I hereby claim:
- I am srhopkins on github.
- I am srhopkins (https://keybase.io/srhopkins) on keybase.
- I have a public key ASCUPKAbmZp5I9bf6KNDLPZmuGstq95hgEnVW9J8V0grdAo
To claim this, I am signing this object:
# Roll your own check_user, pretty_login, logout, and Root functions accordingly. | |
_cp_config={'/':{'tools.sessions.on':True, | |
'tools.sessions.storage_type':'file', | |
'tools.sessions.storage_path':'./', | |
'tools.sessions.timeout':60, | |
'tools.session_auth.on':True, | |
'tools.session_auth.login_screen':pretty_login, | |
'tools.session_auth.check_username_and_password':check_user, | |
} |
# I often need a simple method to determine prime numbers. Returns True or False. | |
is_prime = lambda num: all((num % i > 0 for i in xrange(2,num))) |
wget --no-cookies \ | |
--no-check-certificate \ | |
--header "Cookie: oraclelicense=accept-securebackup-cookie" \ | |
"http://download.oracle.com/otn-pub/java/jdk/7u72-b14/jdk-7u72-linux-x64.rpm" \ | |
-O jdk.rpm |
# /etc/hosts would have something like this | |
# 127.0.0.2 a.firewalled-app.tld | |
# On Mac you need to `sudo ifconfig lo0 alias 127.0.0.3 up` | |
# Then run a command/script like this. | |
ssh -L 127.0.0.2:80:a.firewalled-app.tld:80 \ | |
-L 127.0.0.2:443:a.firewalled-app.tld:443 \ | |
[email protected] |
# /etc/sudoers on target may require "Defaults:username !requiretty" e.g. RHEL/CentOS <= 5 | |
#set -x | |
[ -n "${2}" ] && TCPDUMP_FILTER="${2}" || TCPDUMP_FILTER="not port 22" | |
ssh ${1} sudo /usr/sbin/tcpdump -U -s0 -w - "${TCPDUMP_FILTER}" \ | |
| wireshark -k -i - |
#!/usr/bin/env bash | |
USER=${1} | |
REPO=${2} | |
curl -u "${USER}" https://api.github.com/user/repos -d '{"name":"'${REPO}'"}' |
def dig_numbers(table, row=0, index=0): | |
checks = [] | |
for n in (index, index+1): | |
try: | |
checks.append(table[row][n] + dig_numbers(table, row=row+1, index=n)) | |
except: | |
checks.append(0) | |
return max(checks) | |
#!/bin/bash | |
# This allows use of govim container with relative paths | |
# e.g. | |
# vim ../this.file | |
# vim ~/.bashrc | |
function govim(){ | |
RDIR=`pwd | awk -F/ '{print "/"$2}'` | |
docker run -it --rm -v ${RDIR}:${RDIR} -w `pwd` srhopkins/govim vim "$@" | |
} |
I hereby claim:
To claim this, I am signing this object:
~ kubectl get secrets --namespace=int # check secrets for namespace | |
NAME TYPE DATA AGE | |
default-token-skzsj kubernetes.io/service-account-token 3 6d | |
example-app-int kubernetes.io/tls 2 6d | |
~ export TOKEN=`kubectl get secret default-token-skzsj --namespace=int -o jsonpath={.data.token} | base64 -D` # `-D` for mac `-d` for linux | |
~ docker run --rm lachlanevenson/k8s-kubectl:v1.9.2 --namespace=int --server=https://api.example.com --token=${TOKEN} --insecure-skip-tls-verify=true get pods | |
NAME READY STATUS RESTARTS AGE | |
example-app-5866987b76-n2phz 1/1 Running 0 5d | |
example-app-5866987b76-tqtw2 1/1 Running 0 5d |