Quick script that I can drop in to set up kubectl completion and aliases etc
wget -q -O - https://gist.githubusercontent.com/stuartleeks/29e58601de67f270f27ee240d7b0a5e3/raw/setup.sh | bash
wcode() { cmd.exe /C code ''$(wslpath -w $1)''; } | |
wcode-insiders() { cmd.exe /C code-insiders ''$(wslpath -w $1)''; } |
# usage: `devcontainer <partial container name or mount path>` | |
#function devcontainer(){ docker exec -it $(docker ps -q | xargs docker inspect --format "{{.ID}} {{.Name}} {{range .Mounts}}{{.Source}}|{{end}}" | grep $1 | awk '{print $1}') bash; } | |
# replaced by https://github.com/stuartleeks/devcontainer-cli/ |
// profile for azbrowse (including navigating to subscription - hint: update the subscription id) | |
{ | |
"acrylicOpacity": 0.5, | |
"closeOnExit": true, | |
"colorScheme": "Ubuntu-sl", | |
"commandline": "C:\\Windows\\System32\\bash.exe -c \"azbrowse navigate /subscriptions/00000000-0000-0000-0000-000000000000\"", | |
"cursorColor": "#FFFFFF", | |
"cursorShape": "bar", | |
"fontFace": "Fira Code", | |
"fontSize": 14, |
{ | |
"globals" : | |
{ | |
"alwaysShowTabs" : true, | |
"defaultProfile" : "{c6eaf9f4-32a7-5fdc-b5cf-066e8a4b1e40}", | |
"initialCols" : 120, | |
"initialRows" : 30, | |
"keybindings" : | |
[ | |
{ |
package main | |
import ( | |
"context" | |
"encoding/json" | |
"fmt" | |
"github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-04-01/storage" | |
"github.com/Azure/go-autorest/autorest/azure/auth" | |
) |
#!/bin/bash | |
blue="\e[1;34m" | |
green="\e[1;32m" | |
no_colour="\e[1;0m" | |
PROD=$(kubectl get service api-trip-svc-prod --output=jsonpath={.spec.selector.slot}) | |
echo -e "ProdColour: ${!PROD}$PROD$no_colour" | |
echo |
<# | |
This is an update of the original script to work with the Az PowerShell module: https://docs.microsoft.com/en-us/powershell/azure/install-az-ps?view=azps-1.0.0 | |
Use this script to retrieve the resources that were deployed with a pid-[GUID] tag | |
Select-AzSubscription before running the script - it must be run within the subscription context of the deployment | |
The GUID and resourceGroup name of the deployment are required params | |
#> | |
Param( | |
[GUID][Parameter(Mandatory=$true)]$guid, | |
[string][Parameter(Mandatory=$true)]$resourceGroupName |
[group-kill {{rg}}] | |
command = group delete -g {{rg}} --yes --no-wait | |
[get-subscription-id] | |
command = account show --query id -o tsv | |
#subscriptionId=$(az get-subscription-id) | |
[deployment-operation-summary {{rg}} {{name}}] | |
command = group deployment operation list -g {{rg}} -n {{name}} --query "[].{operationId:operationId, state:properties.provisioningState, resourceType: properties.targetResource.resourceType, resourceName:properties.targetResource.resourceName}" |