Skip to content

Instantly share code, notes, and snippets.

View garthhumphreys's full-sized avatar
🎯
Focusing

Garth Humphreys garthhumphreys

🎯
Focusing
View GitHub Profile
@garthhumphreys
garthhumphreys / install_brew_pentest_dirb
Created February 28, 2018 19:56
Installing Homebrew Dirb
$ brew install sidaf/pentest/dirb
@garthhumphreys
garthhumphreys / gist:8fe0308ed12cca1816a4ba3fb88da255
Created March 5, 2018 19:08 — forked from anonymous/gist:c3066c657c453c09a48deb1ed8b5d12f
.htacess/httpd.conf maintenance mode changes
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$
@garthhumphreys
garthhumphreys / fab.py
Created March 5, 2018 19:11
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')
@garthhumphreys
garthhumphreys / vim-commands.md
Last active September 16, 2019 20:54
My vim commands

Alias

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])"'

  • html:5_
  • , (Ctrly,)
@garthhumphreys
garthhumphreys / wav-mp3
Created December 26, 2019 04:48 — forked from championofblocks/wav-mp3
Command line bash to convert all wav to mp3
for i in *.wav; do lame -b 320 -h "${i}" "${i%.wav}.mp3"; done

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@garthhumphreys
garthhumphreys / install-codeql.sh
Created June 9, 2023 16:53 — forked from crashGoBoom/install-codeql.sh
Install codeql for MacOS (BigSur)
#!/bin/bash
# Check for latest release: https://github.com/github/codeql-cli-binaries/releases
_version='v2.4.1'
_arch='osx'
_zip_url="https://github.com/github/codeql-cli-binaries/releases/download/${_version}/codeql-${_arch}64.zip"
_dir='codeql-home'
_cores=2
pushd "${HOME}" || exit