Skip to content

Instantly share code, notes, and snippets.

View amrynsky's full-sized avatar

Alex Mrynsky amrynsky

  • Palo Alto Networks
  • CA, USA
View GitHub Profile
@amrynsky
amrynsky / sshuttle.sh
Created August 14, 2018 19:38 — forked from Davor111/sshuttle.sh
How to use sshuttle with .key, .csr or .pem files for authentication
#It's not directly mentioned in the documentation on how to do this, so here you go. This command will tunnel everything including DNS:
sshuttle --dns -vr user@yourserver.com 0/0 --ssh-cmd 'ssh -i /your/key/path.pem'
@amrynsky
amrynsky / brew_symlink_error_sierra.md
Created August 14, 2018 19:28 — forked from dalegaspi/brew_symlink_error_sierra.md
Homebrew Symlink errors in Mac OSX High Sierra
@amrynsky
amrynsky / run.tpl
Created February 12, 2018 23:24 — forked from efrecon/run.tpl
`docker inspect` template to regenerate the `docker run` command that created a container
docker run \
--name={{.Name}} \
{{range $e := .Config.Env}}--env="{{$e}}" \
{{end}}{{range $p, $conf := .NetworkSettings.Ports}}-p {{(index $conf 0).HostIp}}:{{(index $conf 0).HostPort}}:{{$p}} \
{{end}}{{range $v := .HostConfig.VolumesFrom}}--volumes-from="{{.}}" \
{{end}}{{range $v := .HostConfig.Binds}}--volume="{{.}}" \
{{end}}{{range $l, $v := .Config.Labels}}--label "{{$l}}"="{{$v}}" \
{{end}}{{range $v := .HostConfig.CapAdd}}--cap-add {{.}} \
{{end}}{{range $v := .HostConfig.CapDrop}}--cap-drop {{.}} \
{{end}}{{range $d := .HostConfig.Devices}}--device={{(index $d).PathOnHost}}:{{(index $d).PathInContainer}}:{{(index $d).CgroupPermissions}} \
@amrynsky
amrynsky / awscli_functions.sh
Created February 8, 2016 14:38 — forked from cbsmith/awscli_functions.sh
A handy collection of bash functions to make the aws cli a bit more usable
# Usage: . awscli_functions.sh
# Suggested: add to ~/.bashrc
# This code lazily uses your default profile && region.
# It wouldn't take much to add some logic for using ${PROFILE} and/or ${REGION} as some kind of override.
# Lots more functions would be helpful, but I've been playing with ec2 & vpcs a lot lately, so...
clusters()
{
local __resultvar=$1
local __clusters=$(aws ecs list-clusters | jq -r '.clusterArns[]')