This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# | |
# Print certificate signatures that can be used with certificate pinning on iOS and Android | |
# | |
# usage: cat cert_bundle.pem | ./print_cert_signatures.py | |
# usage: openssl s_client -connect fqdn:443 -showcerts </dev/null 2>/dev/null | ~/bin/print_cert_signatures.py | |
# | |
# example: | |
# $ openssl s_client -connect www.google.com:443 -showcerts </dev/null 2>/dev/null | ~/bin/print_cert_signatures.py | |
# Certificate 1 of 2: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rchapman@linux:~$ curl icanhazip.com | |
1.2.3.4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
VB=/Applications/VirtualBox.app/Contents/Resources/VirtualBoxVM.app/Contents/MacOS/VBoxManage; for vm in $($VB list vms | awk '{print $1}' | tr -d '"'); do $VB showvminfo $vm 2>&1 | grep 'State:.*running' &>/dev/null || continue; perl -e 'print "=" x 80 . "\n"'; echo $vm; $VB showvminfo $vm 2>&1 | egrep '^(Name|Guest OS|UUID|Config file|Memory size|Number of CPUs):|NIC.*Rule|Name:.*Host path:'; done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* save as test.c, compile with gcc test.c -o test -m64 */ | |
#define _GNU_SOURCE /* See feature_test_macros(7) */ | |
#include <unistd.h> | |
#include <sys/syscall.h> /* For SYS_xxx definitions */ | |
void main() { | |
const char *buf="test\n"; | |
syscall(1, /* sys_write */ | |
1, /* stdout */ | |
buf, /* buf, or string to write to stdout */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mmdd=`date | sed 's|^\(... \)\(... ..\)\( ..:..:.. ... ....\)|\2|'`; hour=`date +%H`; echo; echo -n "Number of hosts sending us nsca results: "; cat /var/log/messages | egrep 'START:.*from=' | sed 's|\(.*from=\)\(.*\..*\..*\..*\)$|\2|g' | sort -u | wc -l; echo " ATTEMPTS/MIN FAILS/MIN"; min=0; while [ $min -lt 61 ]; do min_formatted=`printf "%2.2d" $min`; echo -n "${mmdd} ${hour}:${min_formatted} "; printf "%8.8s" `cat /var/log/messages | grep 'START: nsca pid=' | grep "${mmdd} ${hour}:${min_formatted}:" | wc -l`; printf " %8.8s\n" `cat /var/log/messages | grep 'FAIL: nsca' | grep "${mmdd} ${hour}:${min_formatted}:" | wc -l`;min=$((min+1)); done |