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
# 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/ |
$env:HOME="" # avoid conflicts with devcontainers across OSes | |
$env:GIT_SSH="C:\Windows\System32\OpenSSH\ssh.exe" # set git to use the OpenSSH install and pick up keys from the SSH Agent (avoiding prompting for passphrases) |
{"lastUpload":"2020-06-24T08:12:00.857Z","extensionVersion":"v3.4.3"} |
# simplify dlv debug etc: `dlv2 debug ./cmd/to/run arg1 arg2 ...` | |
dlv2() { dlv $1 $2 --headless --listen localhost:2345 --api-version 2 -- "${@:3}" ; } |
function Set-Prompt { | |
param ( | |
# Specifies a path to one or more locations. | |
[Parameter(Mandatory=$true, | |
ValueFromPipeline=$true)] | |
[ValidateNotNull()] | |
[string] | |
$PromptText | |
) | |
$Host.UI.RawUI.WindowTitle = $PromptText |
free -h | |
sync | |
echo 3 > /proc/sys/vm/drop_caches | |
free -h |
# | |
# Set up ssh agent forwarding to host | |
# | |
# Include this in .bashrc | |
# Ensure that the ssh-agent service is running on windows | |
# build https://github.com/jstarks/npiperelay and ensure it is in your PATH (or modify the script to specify the qualified path) | |
# Configure ssh forwarding | |
export SSH_AUTH_SOCK=$HOME/.ssh/agent.sock |
wcode() { cmd.exe /C code ''$(wslpath -w $1)''; } | |
wcode-insiders() { cmd.exe /C code-insiders ''$(wslpath -w $1)''; } |
// 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, |