Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env bash
####DOMAIN NAME FUNCTIONS###################################
extract_domain_names ()
{
lynx -dump -listonly -nonumbers "$1" |
awk -F '/+' 'NF > 1 {print $2}' |
sort -u
}
@tjt263
tjt263 / randymarsh.sh
Created January 11, 2018 00:33
Quick script to generate a list of random IP addresses via nmap.
#!/usr/bin/env bash
dir="/tmp/$0"
mkdir -p "$dir"
nmap -n -sL -iR "$1" |
sed '1,2d;$d' |
awk '{print$5}' |
sort -t. -k1,1n -k2,2n -k3,3n -k4,4n |
tee "$dir/$(date +%s)"
@tjt263
tjt263 / shuttercount.sh
Created December 30, 2017 07:22
Script for macOS & Canon EOS 650D. Prints the shutter count of the most recent image imported to the Photos.app library.
#!/usr/bin/env bash
lastimport()
{
find ~/Pictures/Photos\ Library.photoslibrary/Masters -type f -exec
stat -f "%m%t%Sm %N" {} + |
sort -rn |
head -1 |
cut -d\ -f5-
}
perl -lpe 's/\\x20/ /g;s/\\([."+*()])/$1/g;s/(?:\\r)*\\n/\n/g'
__expand_tilde_by_ref ()
{
if [[ ${!1} == \~* ]]; then
if [[ ${!1} == */* ]]; then
eval $1="${!1/%\/*}"/'${!1#*/}';
else
eval $1="${!1}";
fi;
fi
}
__expand_tilde_by_ref ()
{
if [[ ${!1} == \~* ]]; then
if [[ ${!1} == */* ]]; then
eval $1="${!1/%\/*}"/'${!1#*/}';
else
eval $1="${!1}";
fi;
fi
}
__expand_tilde_by_ref ()
{
if [[ ${!1} == \~* ]]; then
if [[ ${!1} == */* ]]; then
eval $1="${!1/%\/*}"/'${!1#*/}';
else
eval $1="${!1}";
fi;
fi
}
__expand_tilde_by_ref ()
{
if [[ ${!1} == \~* ]]; then
if [[ ${!1} == */* ]]; then
eval $1="${!1/%\/*}"/'${!1#*/}';
else
eval $1="${!1}";
fi;
fi
}
__expand_tilde_by_ref ()
{
if [[ ${!1} == \~* ]]; then
if [[ ${!1} == */* ]]; then
eval $1="${!1/%\/*}"/'${!1#*/}';
else
eval $1="${!1}";
fi;
fi
}
#!/usr/bin/env python2.7
from scapy.all import *
def callback(packet):
print packet.show()
sniff(prn=callback)