Skip to content

Instantly share code, notes, and snippets.

View t3chn0m4g3's full-sized avatar
🖖

Marco Ochse t3chn0m4g3

🖖
View GitHub Profile
@t3chn0m4g3
t3chn0m4g3 / keybase.md
Created September 20, 2017 08:32
keybase.md

Keybase proof

I hereby claim:

  • I am t3chn0m4g3 on github.
  • I am t3chn0m4g3 (https://keybase.io/t3chn0m4g3) on keybase.
  • I have a public key ASBRvVNEDcKT5Ha2BFDYnCPxSiB5dDUpMs5SdMQR7MK_Owo

To claim this, I am signing this object:

#!/bin/bash
## Get my external IP
timeout=2 # seconds to wait for a reply before trying next server
verbose=1 # prints which server was used to STDERR
dnslist=(
"dig +short myip.opendns.com @resolver1.opendns.com"
"dig +short myip.opendns.com @resolver2.opendns.com"
@t3chn0m4g3
t3chn0m4g3 / docker
Created August 12, 2016 23:38
useful docker commands
#docker stats with names instead of container IDs
docker stats $(docker ps --format {{.Names}})
@t3chn0m4g3
t3chn0m4g3 / prompt.sh
Created August 12, 2016 20:26
myPROMPTS
#!/bin/bash
myROOTPROMPT='PS1="\[\033[38;5;8m\][\[$(tput sgr0)\]\[\033[38;5;1m\]\u\[$(tput sgr0)\]\[\033[38;5;6m\]@\[$(tput sgr0)\]\[\033[38;5;4m\]\h\[$(tput sgr0)\]\[\033[38;5;6m\]:\[$(tput sgr0)\]\[\033[38;5;5m\]\w\[$(tput sgr0)\]\[\033[38;5;8m\]]\[$(tput sgr0)\]\[\033[38;5;1m\]\\$\[$(tput sgr0)\]\[\033[38;5;15m\] \[$(tput sgr0)\]"'
myUSERPROMPT='PS1="\[\033[38;5;8m\][\[$(tput sgr0)\]\[\033[38;5;2m\]\u\[$(tput sgr0)\]\[\033[38;5;6m\]@\[$(tput sgr0)\]\[\033[38;5;4m\]\h\[$(tput sgr0)\]\[\033[38;5;6m\]:\[$(tput sgr0)\]\[\033[38;5;5m\]\w\[$(tput sgr0)\]\[\033[38;5;8m\]]\[$(tput sgr0)\]\[\033[38;5;2m\]\\$\[$(tput sgr0)\]\[\033[38;5;15m\] \[$(tput sgr0)\]"'
tee -a /root/.bashrc << EOF
$myROOTPROMPT
EOF
tee -a /home/$1/.bashrc << EOF
$myUSERPROMPT
EOF
@t3chn0m4g3
t3chn0m4g3 / namegen.sh
Last active August 22, 2016 15:07
namegen
#!/bin/bash
fuRANDOMWORD () {
local myWORDFILE=/usr/share/dict/words
local myLINES=$(cat $myWORDFILE | wc -l)
local myRANDOM=$((RANDOM % $myLINES))
local myNUM=$((myRANDOM * myRANDOM % $myLINES + 1))
echo -n $(sed -n "$myNUM p" $myWORDFILE | tr -d \' | tr A-Z a-z)
}
myHOST=$(curl -s www.nsanamegenerator.com | html2text | tr A-Z a-z | awk '{print $1}')