Recently Updated Pages
While loops
Run for period of time #!/bin/bash runtime="5 minute" endtime=$(date -ud "$runtime" +%s) ...
For loops
Compute md5sum for every item in a directory for i in "$(ls)"; do md5sum "${i}"; done | sort Pr...
SSH
Encrypt Key openssl rsa -des3 -in key.pem -out encrypted-key.pem # Enter a passphrase mv encry...
Create sudo user non-interactively
Skip the prompts that come with creating a user typically, and give them sudoers privileges. Repl...
Run function as another user
export -f <function_name> su <user to run function as> -c "bash -c <function_name>"
Run command as another user
USER=centos runuser -l $USER -c 'whoami' Resource: https://devops.stackexchange.com/questions/1...
New Page
Exit-on-error mode Put this at the top of your bash script: set -e. If a command returns a nonze...
Azure Powershell Module Cheatsheet
# Azure Product Azure CLI Example CLI PowerShell Module Example PS 1 Syntax ...
Install latest version of Azure CLI on Mac
brew update && brew install azure-cli Original Article
Install latest version of Azure CLI on Linux
# YOLO curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash Resources: https://docs.microsoft...
Install PowerShell
brew install --cask powershell-preview Run a powershell terminal with: pwsh-preview
Update Powershell
brew update brew upgrade powershell-preview --cask
Uninstall Powershell
brew uninstall --cask powershell sudo rm -rf /usr/local/bin/pwsh-preview /usr/local/microsoft/po...
Install Azure PowerShell module
For the current user: if ($PSVersionTable.PSEdition -eq 'Desktop' -and (Get-Module -Name AzureRM...
Setup the AzureRMAlias module
This will deal with incompatibilities with older scripts that use AzureRM: Enable-AzureRmAlias
List available modules
Get-Module -ListAvailable
Get authenticated in Powershell
Connect-AzAccount %USERNAME
List commands in a module
Get-Command -Module <module name>
List functions in a module
Get-Command -Module <module name> -Type Function
Authenticate via the CLI
Run this command to get authenticated: az login This will result in a web browser opening, or a...