Posts

Showing posts from 2021

Uninstall all Azure PowerShell Modules

Image
With Azure PowerShell modules changing all the time and the recent introduction of the   PowerShell modules being renamed from AzureRm to Az , you may want to totally uninstall all modules and reinstall to make sure you are using the latest and greatest modules. To do so, the following scripit will go through and cleanup all the Azure(RM)(AD) modules.  Simply open up PowerShell as an Administrator and execute the following PowerShell workflow/commands: workflow Uninstall-AzureModules {     $Modules = @() $Modules += (Get-Module -ListAvailable Azure*).Name    $Modules += (Get-Module -ListAvailable Az.*).Name     Foreach -parallel ($Module in ($Modules | Get-Unique))     {         if($Modules)          {                Write-Output ("Uninstalling: $Module")              Uninstall-Module $Module -Force          }          else          {                Write-Output ("Uninstalling: Module '$Module' is null or empty")          }     } } Uninstall-AzureM

Compress Payload in NodeJS

Image
Compress Payload (response) in NodeJS Compression  in  Node.js  and  Express.js  decreases the amount of downloadable data from a website or app. By using this compression, we can  improve the performance of our Node.js applications  as our  payload size is dramatically reduced above 70% . Compression  generally refers to code that has been modified using a data compression algorithm. Unlike  minification  that ends up providing perfectly valid code, compressed code must be unzipped before use. There are many text compression algorithms, but there are only  3 supported   algorithms for compression  (and  decompression ) of  HTTP requests: Deflate  ( deflate ): Not commonly used. Gzip  ( gzip ): The most widely used compression format for server and client interactions. It is based on the  Deflate  algorithm and is compatible with all current browsers. Brotli  ( br ): A newer compression algorithm that aims to further improve compression ratios, which can result in even faster page load

Simple NodeJs App with MQTT

Image
What is MQTT? MQTT is a lightweight, publish-subscribe network protocol that transports messages between devices. The protocol usually runs over TCP/IP, however, any network protocol that provides ordered, lossless, bi-directional connections can support MQTT. MQTT is used for  data exchange between constrained devices and server applications . It keeps bandwidth requirements to an absolute minimum, handles unreliable networks, requires little implementation effort for developers, and is, therefore, ideal for machine-to-machine (M2M) communication. Node JS Application using MQTT Create a publish file. (pub.js) const mqtt = require ( 'mqtt' ); const client = mqtt . connect ( 'mqtt://broker.hivemq.com' ); client . on ( 'connect' , function (){     setInterval (() => {         const random = Math . random () * 50 ;         console . log ( random )         if ( random > 26 ){             client . publish ( 'ATM01' , 'ATM 01 temperature is &

Hardware assisted virtualization and data execution protection must be enabled in the BIOS

Image
This post is about fixing the error, Hardware assisted virtualization and data execution protection must be enabled in the BIOS which displayed by Docker while running Windows 10. Today while running Docker, it throws an error like this. After few searches, I found the solution for this problem. Enable Hyper V - You can do this by running the following command as administrator. -  dism.exe /Online /Enable-Feature:Microsoft-Hyper-V /All Enable Hypervisor with following command -  bcdedit /set hypervisorlaunchtype auto . You should run either one of the above commands. And you need to restart the system to apply the changes. If the problem persist probably Hyper-V on your system is corrupted, so Open in Control Panel > [Programs] > [Windows Features] and completely uncheck all Hyper-V related components. Restart the system. Enable Hyper-V again. Restart. If you see Hyper-V Hypervisor is disabled. This mean that Virtualization support is disabled in the firmware. To enable Virtualiz