This file contains hidden or 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 | |
| extend serviceEndpointCount= array_length(properties.virtualNetworkRules) | |
| extend vnetFilterOn=tobool(properties.isVirtualNetworkFilterEnabled) | |
| extend ipRangeFilter=tostring(properties.ipRangeFilter) | |
| project id, name, serviceEndpointCount,vnetFilterOn, ipRangeFilter, resourceGroup, subscriptionId, type | |
| where type == "microsoft.documentdb/databaseaccounts" and (vnetFilterOn == false or serviceEndpointCount == 0 or ipRangeFilter <> "") |
This file contains hidden or 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
# Omar McIver | |
# September 16th 2021 | |
# Subject: Open Management Infrastructure Remote Code Execution Vulnerability (CVE-2021-38647) | |
# Ref: https://msrc.microsoft.com/update-guide/en-US/vulnerability/CVE-2021-38647 | |
####################### | |
# This script will visit each of your Linux VMs and use a run-command to cat the omiserver.conf file and then grep for "port=" | |
# This will return you the httpport=XXX and httpsport=XXX settings. If these are non-Zero then you need to get your OMI agent patched to secure against the vulnerability. | |
####################### |
This file contains hidden or 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
#Find the name of your disk: | |
df -Th | |
#Unmount the disk (in this example it's "sdc1") | |
sudo umount /dev/sdc1 | |
#Call the interactive 'parted' command | |
sudo parted /dev/sdc | |
#1. Type "print" and note the size of the disk | |
#2. Type "resizepart" |
This file contains hidden or 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
# Usage copydisk.sh <newdiskdev> <olddiskmountpoint> <temporary mountpoint> | |
# e.g. copydisk.sh /dev/sdc /datadisk /tmpdatadisk | |
echo New disk attached is at $1 | |
echo Existing disk mount point is at $2 | |
echo Temporary mount point for data copy is at $3 | |
## Add partition table | |
parted $1 mklabel gpt | |
## Create partition ext4 100% of the available space | |
parted $1 mkpart primary ext4 0% 100% |
This file contains hidden or 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
Simulate System Loads | |
https://bash-prompt.net/guides/create-system-load/ | |
Sysadmins often need to discover how the performance of an application is affected when the system is under certain types of load. This means that an artificial load must be re-created. It is, of course, possible to install dedicated tools to do this but this option isn’t always desirable or possible. | |
Every Linux distribution comes with all the tools needed to create load. They are not as configurable as dedicated tools but they will always be present and you already know how to use them. | |
CPU | |
The following command will generate a CPU load by compressing a stream of random data and then sending it to /dev/null: |
This file contains hidden or 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
# Set variables | |
$subscriptionId="" #Set to your subscription id where the VM is created | |
$resourceGroup = "" #Resouce group of the VM | |
$vmName = "" #VM Name | |
$location = "westeurope" #VM Location | |
$zone = "2" #1 2 or 3 | |
#Login to the Azure |
This file contains hidden or 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
$ SUBSCRIPTION_ID=$(az account show --query id -o tsv) | |
$ az rest \ | |
--url "https://management.azure.com/subscriptions/$SUBSCRIPTION_ID/resourcegroups?api-version=2020-06-01 | | |
jq ".value | .[] | .name" -r | |
OR | |
$ curl -sL \ |
This file contains hidden or 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
#az login | |
$subs = az account list | ConvertFrom-Json | |
$allServers = @() | |
foreach($sub in $subs){ | |
Write-Output $sub.Name | |
az account set -s $sub.Id | |
$subServers = az resource list --resource-type 'Microsoft.Sql/servers' | ConvertFrom-Json | |
foreach($server in $subServers){ | |
$allServers += $server | |
} |
This file contains hidden or 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
apt update | |
apt install python3-pip | |
python -m pip install --upgrade pip | |
pip install azure-cli |
This file contains hidden or 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
Ensure SDK installed: | |
wget https://dot.net/v1/dotnet-install.sh -O dotnet-install.sh | |
sudo chmod +x ./dotnet-install.sh | |
./dotnet-install.sh --version latest | |
https://learn.microsoft.com/en-us/dotnet/core/diagnostics/dotnet-trace | |
dotnet tool install --global dotnet-trace | |
Manual download linux: wget https://aka.ms/dotnet-trace/linux-x64 |
OlderNewer