Skip to content

Instantly share code, notes, and snippets.

View azet's full-sized avatar
🔐
hacking audio devices, diving caves, breaking codes

Aaron Zauner azet

🔐
hacking audio devices, diving caves, breaking codes
View GitHub Profile
@azet
azet / tls_server.sh
Last active August 29, 2015 14:00
cli tls debugging server (state, debug of tls handshake and extensions, data and much more)
openssl s_server -state -debug -msg -tlsextdebug \
-accept ${port} -cipher ${suite} \
-serverpref -cert cert.pem \
-key key.pem
@azet
azet / proper_bash.md
Last active August 29, 2015 14:02
hitchhikers guide to writing useful and modern bash scripts
@azet
azet / tls_server_boilerplate.py
Last active August 29, 2015 14:04
Python 3 TLS Server boilerplate
#!/usr/bin/env python3
import sys, socket, ssl
def main():
try:
PORT = int(sys.argv[1])
context = ssl.SSLContext(ssl.PROTOCOL_TLSv1_2)
context.load_cert_chain(certfile="x509/server.crt",
keyfile="x509/server.key")
@azet
azet / ss.md
Last active August 29, 2015 14:04
selfsigned CA / server cert. cheat sheet (people regularly ask me for this)

create your own CA and server certificate

Note that the common name of the server certificate has to match your hostname!

magic oneliner:

openssl req -new -x509 -keyout privkey.pem -out cacert.pem -days 1095 -nodes -newkey rsa:<keysize> -sha256

old:

@azet
azet / gnupg_setup
Last active August 29, 2015 14:06
my 'hardened' gnupg configuration
moved to: https://github.com/azet/dotfiles
@azet
azet / .conkyrc
Last active August 29, 2015 14:07
.conkyrc
moved to: https://github.com/azet/dotfiles
@azet
azet / vmware.patch
Created October 13, 2014 12:32
Foreman (1.6.1) VMWare provider fix for German localization in vSphere (foreman/app/models/compute_resources/foreman/model/vmware.rb)
--- vmware_orig.rb 2014-10-13 14:31:53.200587637 +0200
+++ vmware.rb 2014-10-13 14:22:15.177351876 +0200
@@ -345,10 +345,10 @@
# because it has no children.
def clone_vm args
args = parse_args args
- path_replace = %r{/Datacenters/#{datacenter}/vm(/|)}
+ path_replace = %r{/Datencenter/#{datacenter}/vm(/|)}
interfaces = client.list_vm_interfaces(args[:image_id])
@azet
azet / gist:6c5da818cd74bdfc239f
Created October 13, 2014 15:48
centos6{5..9} mirror hack
[root@mirror cron.hourly]# pwd
/etc/cron.hourly
[root@mirror cron.hourly]# cat mirror_centos6
#!/usr/bin/env bash
[[ $(pgrep rsync) ]] && exit 0
cd /net/gmi.oeaw.ac.at/software/mirror/centos/
./mirror.sh &>> rsync_mirror.log
@azet
azet / trigger_security_updates.sh
Created October 13, 2014 17:09
check installed yum packages for CVEs (needs yum-changelog plugin)
#!/usr/bin/env bash
echo "running yum-security-check.pl"
perl /usr/local/share/gmi/yum-security-check.pl
updateinfo=$(cat /tmp/sec_updates_info | grep '/usr/bin/yum')
if [[ $updateinfo == *yum* ]]; then
echo "triggering security updates"
updatecmd="${updateinfo} -y"
exec $updatecmd
#!/usr/bin/env bash
set -e
if [ ! -f debian/changelog ]; then
echo "E: debian/changelog not found, aborting." >&2
exit 1
fi
if [ "$1" == "--help" ] || [ "$1" == "-h" ]; then
echo "This is a simple wrapper script; all arguments are passed on to git dch."
echo "Use git dch --help for help."