Skip to content

Instantly share code, notes, and snippets.


Garth Humphreys garthhumphreys

View GitHub Profile
garthhumphreys /
Last active Nov 18, 2020
Installing Homebrew Tap - Pen Test Tools - Dirb
$ brew tap sidaf/pentest
View NSLog-format-specifiers.txt
%@ Object
%d, %i signed int
%u unsigned int
%f float/double
%x, %X hexadecimal int
%o octal int
%zu size_t
%p pointer
%e float/double (in scientific notation)
View install_brew_pentest_dirb
$ brew install sidaf/pentest/dirb
garthhumphreys / wav-mp3
Created Dec 26, 2019 — forked from championofblocks/wav-mp3
Command line bash to convert all wav to mp3
View wav-mp3
for i in *.wav; do lame -b 320 -h "${i}" "${i%.wav}.mp3"; done


alias urldecode='python -c "import sys, urllib as ul; \ print ul.unquote_plus(sys.argv[1])"'

alias urlencode='python -c "import sys, urllib as ul; \ print ul.quote_plus(sys.argv[1])"'

Emmet-vim -

  • html:5_
  • <c-y>, (Ctrly,)
garthhumphreys /
Created Mar 5, 2018
Fab maintenance-mode script
# One for renaming the toggle file from 'maintenance-mode-off' to 'maintenance-mode-on', this will turn on the maintenance mode the next time someone refreshes the page or clicks on a link
def mm_on():
with cd('~/path/to/where/your/toggle/file/is/located/on/the/server'):
run('mv maintenance-mode-off maintenance-mode-on')
# And this command turns the maintenance mode off, again by renaming the "toggle file".
def mm_off():
with cd('~/path/to/where/your/toggle/file/is/located/on/the/server'):
run('mv maintenance-mode-on maintenance-mode-off')
View gist:8fe0308ed12cca1816a4ba3fb88da255
RewriteEngine On
# If this file (toggle file) exsists then put the site into maintenance mode
RewriteCond /path/to/where/your/toggle/file/is/located/on/the/server -f
# If coming from approved ip address, then don't put it into maintenance mode,
# here I'm using HTTP:x-forwarded-for in place of REMOTE_ADDR this is because some users (or your yourself) might
# arrive to the site via a proxy server, so it's more accurate to use HTTP:x-forwarded-for to get the real ip address,
# Also please note that the ip address below has '\' in them because HTTP:x-forwarded-for returns or stores the ip address as a comma delimited list
RewriteCond %{HTTP:x-forwarded-for} !^127\.127\.127\.127$

###IAB1 Arts & Entertainment IAB1-1 Books & Literature
IAB1-2 Celebrity Fan/Gossip
IAB1-3 Fine Art
IAB1-4 Humor
IAB1-5 Movies
IAB1-6 Music
IAB1-7 Television

###IAB2 Automotive

View gist:17d6a1809b6f57be6b5a
You'll need to install npm, nodejs and phantomjs
$ apt-get install nodejs nodejs-dev npm phantomjs
$ pip install selenium-python
garthhumphreys /
Created Oct 31, 2012
Print to screen a random country
#!/usr/bin/python -tt
import random
def main():
This script randomly prints to screen a soverign country from a list of 206 countries
You can’t perform that action at this time.