Skip to main content

Recently Updated Pages

While loops

Bash - Cheatsheet

Run for period of time #!/bin/bash runtime="5 minute" endtime=$(date -ud "$runtime" +%s) ...

Updated 1 year ago by Ryan

For loops

Bash - Cheatsheet

Compute md5sum for every item in a directory for i in "$(ls)"; do md5sum "${i}"; done | sort Pr...

Updated 1 year ago by Ryan

SSH

Bash - Cheatsheet

Encrypt Key openssl rsa -des3 -in key.pem -out encrypted-key.pem # Enter a passphrase mv encry...

Updated 1 year ago by Ryan

Create sudo user non-interactively

Bash - Cheatsheet

Skip the prompts that come with creating a user typically, and give them sudoers privileges. Repl...

Updated 1 year ago by Ryan

Run function as another user

Bash - Cheatsheet

export -f <function_name> su <user to run function as> -c "bash -c <function_name>"  

Updated 1 year ago by Ryan

Run command as another user

Bash - Cheatsheet

USER=centos runuser -l $USER -c 'whoami' Resource: https://devops.stackexchange.com/questions/1...

Updated 1 year ago by Ryan

New Page

Bash - Cheatsheet Unsorted

Exit-on-error mode Put this at the top of your bash script: set -e. If a command returns a nonze...

Updated 1 year ago by Ryan

Azure Powershell Module Cheatsheet

Azure - Cheatsheet

# Azure Product Azure CLI Example CLI PowerShell Module Example PS 1 Syntax ...

Updated 1 year ago by Ryan

Install latest version of Azure CLI on Mac

Azure - Cheatsheet Powershell Installation and Modules

brew update && brew install azure-cli Original Article

Updated 1 year ago by Ryan

Install latest version of Azure CLI on Linux

Azure - Cheatsheet Powershell Installation and Modules

# YOLO curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash Resources: https://docs.microsoft...

Updated 1 year ago by Ryan

Install PowerShell

Azure - Cheatsheet Powershell Installation and Modules

brew install --cask powershell-preview Run a powershell terminal with: pwsh-preview

Updated 1 year ago by Ryan

Update Powershell

Azure - Cheatsheet Powershell Installation and Modules

brew update brew upgrade powershell-preview --cask  

Updated 1 year ago by Ryan

Uninstall Powershell

Azure - Cheatsheet Powershell Installation and Modules

brew uninstall --cask powershell sudo rm -rf /usr/local/bin/pwsh-preview /usr/local/microsoft/po...

Updated 1 year ago by Ryan

Install Azure PowerShell module

Azure - Cheatsheet Powershell Installation and Modules

For the current user: if ($PSVersionTable.PSEdition -eq 'Desktop' -and (Get-Module -Name AzureRM...

Updated 1 year ago by Ryan

Setup the AzureRMAlias module

Azure - Cheatsheet Powershell Installation and Modules

This will deal with incompatibilities with older scripts that use AzureRM: Enable-AzureRmAlias

Updated 1 year ago by Ryan

List available modules

Azure - Cheatsheet Powershell Installation and Modules

Get-Module -ListAvailable  

Updated 1 year ago by Ryan

Get authenticated in Powershell

Azure - Cheatsheet Powershell Installation and Modules

Connect-AzAccount %USERNAME  

Updated 1 year ago by Ryan

List commands in a module

Azure - Cheatsheet Powershell Installation and Modules

Get-Command -Module <module name>  

Updated 1 year ago by Ryan

List functions in a module

Azure - Cheatsheet Powershell Installation and Modules

Get-Command -Module <module name> -Type Function  

Updated 1 year ago by Ryan

Authenticate via the CLI

Azure - Cheatsheet Powershell Installation and Modules

Run this command to get authenticated: az login This will result in a web browser opening, or a...

Updated 1 year ago by Ryan