Skip to content

Instantly share code, notes, and snippets.

@maxwellb
maxwellb / .bashrc
Created Oct 29, 2019
bashrc snippet - ssh-agent.service
View .bashrc
# User mode service for ssh-agent -- set the environment variables
SSH_AGENT_PID=$(systemctl --user show ssh-agent.service | grep ^MainPID= | cut -d= -f2)
if [ "0" = "${SSH_AGENT_PID}" ]; then
systemctl --user restart ssh-agent.service
SSH_AGENT_PID=$(systemctl --user show ssh-agent.service | grep ^MainPID= | cut -d= -f2)
fi
export SSH_AGENT_PID
export SSH_AUTH_SOCK="/run/user/$(id -u)/openssh_agent"
@maxwellb
maxwellb / code-insiders.desktop
Last active Oct 16, 2019
Visual Studio Code - Insiders -- Download and Update scripts for Debian
View code-insiders.desktop
# Copyright (c) 2019 Maxwell Bloch, MIT license
[Desktop Entry]
Type=Application
Name=Code - Insiders
Version=1.1
GenericName=IDE
Icon=code-insiders
Exec=/usr/bin/code-insiders %F
Terminal=false
StartupWMClass=Code - Insiders
@maxwellb
maxwellb / 0 Python venv wrapper.md
Last active Aug 29, 2019
Universal Python venv wrapper
View 0 Python venv wrapper.md
$ ln -s /opt/work/my-env/../../../usr/local/bin/within-venv.sh /opt/within-my-venv && ln -s /opt/within-my-venv /usr/local/bin/mytool
$ mytool     # runs in /opt/work/my-venv
@maxwellb
maxwellb / 0 powershell docker wrapper.md
Last active Aug 29, 2019
PowerShell docker wrapper to a Hyper-V VM
View 0 powershell docker wrapper.md
PS C:\tmp> invoke-vmssh -command "uname -a" -username $env:defaultVmUser -vmname $env:defaultVmName
Linux debianvm 4.19.0-5-amd64 #1 SMP Debian 4.19.37-5+deb10u2 (2019-08-08) x86_64 GNU/Linux
PS C:\tmp> docker info | grep Server
Server Version: 18.09.1
PS C:\tmp>
@maxwellb
maxwellb / 0 az-cli wrapper.md
Last active Aug 29, 2019
docker az-cli wrapper for .bashrc
View 0 az-cli wrapper.md
$ mkdir -p ~/.local/var/az-cli-client42
$ az client42 login
$ az client42 resource list