Skip to content

Instantly share code, notes, and snippets.

View Code0x58's full-sized avatar

Oliver Bristow Code0x58

View GitHub Profile
@Code0x58
Code0x58 / git-tree
Last active January 24, 2019 21:31
bash script to use tree and exclude any files/directories git is ignoring
#!/bin/bash
set -e
_=<<DOC
You can pass options to tree, but it's a bit bodgy, so you'll have to use -- before adding any directories if you pass any options.
If this script is available on your \$PATH then you can do \`git tree\` in repositories.
DOC
options=()
directories=()
@Code0x58
Code0x58 / kubectl proxy.md
Last active June 1, 2017 20:27
Start kubectl and tunnel in a single line

This is a one liner to connect to a machine and start kubectl proxy, and start a tunnel:

ssh -L 8001:127.0.0.1:8001 -tt $machine "bash -O huponexit -c 'kubectl proxy'"

This will kill kubectl proxy when the SSH process is terminated.