Skip to content

Instantly share code, notes, and snippets.

Git aliases that I have found to be indispensable

Add to ~/.gitconfig wherever you use Git.

[alias]
    co = checkout
    st = status
    br = branch
 lg = log --oneline --topo-order --graph --pretty=graph

Testing the updates branch of the D7 upstream

Create a new multi-dev named updates. Then open a terminal and checkout it out.

cd site-name
git checkout updates
@clayball
clayball / gist:b366dcd7efa4aa70a254b6815e43cf2f
Created January 3, 2018 17:39
ZAP spider, save full output
Export (download) output full results from Spider
=================================================
Open your browser and point it at the address ZAP is listening on, default is localhost:8080
On that page click the link which says "Local API"
On the next page click the "spider link"
On the next page click the "fullResults" link
@clayball
clayball / gist:91e0cc7ac4f951a992305b2fa67d31ec
Last active January 1, 2018 04:15
Undo the last commit that was pushed to origin
Undo the last commit that was pushed to origin
I tend to use this in conjunction with creating a new branch, GOTO 30
WARNING: git reset --hard WILL DELETE YOUR WORKING DIRECTORY CHANGES.
Be sure to stash any local changes you want to keep before running these commands
$ git reset --hard HEAD~1
HEAD~1 means the commit before head.
@clayball
clayball / rot.py
Last active December 19, 2017 17:53
#!/usr/bin/env python3
# rot(num), 1-26
import sys
num = int(sys.argv[1])
decode_string = sys.argv[2]
def rot_alpha(n):
#!/usr/bin/env python
import sys
# @_clayball
# A quick helper script for encoding and decoding hex.
# Use positional arguments
try:
action = sys.argv[1]
@clayball
clayball / firp-caesar-client.py
Created September 14, 2017 15:15
FirpBurp with Caesar
import socket
def read_caesar(r):
key = 'abcdefghijklmnopqrstuvwxyz'
result = ''
for l in r:
try:
i = (key.index(l) - 3) % 26
result += key[i]
except ValueError:
@clayball
clayball / burp-client.py
Last active September 14, 2017 14:41
FirpBurp, revisiting the annoying neighbor
import socket
HOST, PORT = "localhost", 1337
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
for i in range(1, 101):
sock.sendto(str(i) + "\n", (HOST, PORT))
response = sock.recv(1024)
print '[*] Sent: ' + str(i) + ', Response: ' + str(response) + '\n'
@clayball
clayball / gist:6464921
Created September 6, 2013 14:53
Doing a little Gist test here.. A colorful Bash shell. (add to or source from .bash_profile)
# .bash_color
# For those people who want to add a little color to their life in Linux
# We also update the Linux prompt, PS1.
#
# Text colors.. no background color. Feel free to experiment!
#
# For more information:
#
# Bash colors:
# http://tldp.org/LDP/abs/html/colorizing.html