This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Check privileges | |
if [[ "$(id -u)" -ne 0 ]] | |
then echo Please run this script as root or using sudo! | |
exit | |
fi | |
# Print current version | |
export PATH="${PATH}:/usr/local/go/bin" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Removes old revisions of snaps | |
# CLOSE ALL SNAPS BEFORE RUNNING THIS | |
set -eu | |
snap list --all | awk '/disabled/{print $1, $3}' | | |
while read snapname revision; do | |
snap remove "$snapname" --revision="$revision" | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Define ranges | |
$NetworkRanges = @( | |
'10.11.0.0/24' | |
'10.11.1.0/24' | |
'10.11.12.0/24' | |
'10.11.24.0/24' | |
'10.11.2.0/24' | |
) | |
# Bad - does not sort according to address spaces, only alphanumerical :( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Add this to your .bash_rc / .zshrc | |
# Alias for vim-style exit in Bash/Zsh | |
alias :q=exit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resources | |
| where type == "microsoft.network/networksecuritygroups" | |
| extend securityRules = properties.securityRules | |
| mv-expand securityRules | |
| where securityRules.properties.destinationApplicationSecurityGroups != '' or securityRules.properties.sourceApplicationSecurityGroups != '' | |
| mv-expand srcAsgs = securityRules.properties.sourceApplicationSecurityGroups | |
| mv-expand dstAsgs = securityRules.properties.destinationApplicationSecurityGroups | |
| extend srcAsgNames = split(srcAsgs.id, "/")[-1] | |
| extend dstAsgNames = split(dstAsgs.id, "/")[-1] | |
| mv-expand subnet = properties.subnets |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
targetScope = 'managementGroup' | |
param name string | |
param displayName string = name | |
param parentName string = '' | |
param workspaceResourceId string = '' | |
resource managementGroup 'Microsoft.Management/managementGroups@2021-04-01' = { | |
name: name | |
scope: tenant() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#requires -modules @{ ModuleName="Az.Resources"; ModuleVersion="5.0.0" } | |
[CmdletBinding()] | |
param( | |
[Parameter(HelpMessage = 'Will output credentials if withing this number of days, use 0 to report only expired and valid as of today')] | |
$ExpiresInDays = 90 | |
) | |
Write-Host 'Gathering necessary information...' | |
$applications = Get-AzADApplication |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Get-Module -Name az.* -ListAvailable | | |
Where-Object -Property Name -ne ‘Az.’ | | |
ForEach-Object { | |
$currentVersion = [Version] $_.Version | |
$newVersion = [Version] (Find-Module -Name $_.Name).Version | |
if ($newVersion -gt $currentVersion) { | |
Write-Host -Object "Updating $_ Module from $currentVersion to $newVersion" | |
Update-Module -Name $_.Name -RequiredVersion $newVersion -Force | |
Uninstall-Module -Name $_.Name -RequiredVersion $currentVersion -Force | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#MaxHotkeysPerInterval 500 | |
^WheelDown::return | |
^WheelUp::return |
NewerOlder