Skip to content

Instantly share code, notes, and snippets.

View ab's full-sized avatar

Andy Brody ab

View GitHub Profile
@ab
ab / GPL.md
Created September 19, 2011 22:41 — forked from jnrbsn/GPL.md
A Markdown-formatted GPL for your GitHub projects.

GNU GENERAL PUBLIC LICENSE

Version 3, 29 June 2007

Copyright © 2007 Free Software Foundation, Inc. <http://fsf.org/>

Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.

@ab
ab / testserver.rb
Created October 13, 2011 01:54
A simple test eventmachine server
#!/usr/bin/env ruby
require 'rubygems'
require 'eventmachine'
class Server < EM::Connection
def post_init
puts "Someone connected"
send_data "Hello!\n"
end
@ab
ab / level01-date
Created March 19, 2012 21:05
Exploit code for the 2012 Stripe CTF Challenge https://stripe.com/blog/capture-the-flag
#!/bin/sh
cat /home/level02/.password
@ab
ab / logger-colors.rb
Created July 23, 2012 01:53 — forked from janlelis/logger-colors.rb
logger-colors
# Colorizes the output of the standard library logger, depending on the logger level:
# To adjust the colors, look at Logger::Colors::SCHEMA and Logger::Colors::constants
class ColoredLogger < Logger
module Colors
VERSION = '1.0.1'
NOTHING = '0;0'
BLACK = '0;30'
RED = '0;31'
GREEN = '0;32'
@ab
ab / gist:3521125
Created August 30, 2012 00:45
Changing user passwords inside a disk image
$ sudo kpartx -v -a stripe-ctf-server-ubuntu-10.04-lucid-amd64-20120427-0108.img
add map loop0p1 (253:7): 0 8386560 linear /dev/loop0 2048
$ mkdir /tmp/mnt
$ sudo mount /dev/mapper/loop0p1 /tmp/mnt
$ sudo chroot /tmp/mnt
# getent passwd
root:x:0:0:root:/root:/bin/bash
daemon:x:1:1:daemon:/usr/sbin:/bin/sh
bin:x:2:2:bin:/bin:/bin/sh
sys:x:3:3:sys:/dev:/bin/sh
@ab
ab / Makefile
Last active February 12, 2018 10:23 — forked from dakatsuka/Makefile
A Makefile for managing an OpenSSL CA.
# must be absolute path
CATOP = $(PWD)/ca
# see https://gist.github.com/4570053 for sample ca.conf
CACONF = $(CATOP)/../ca.conf
OPENSSL = openssl
DAYS = -days 3652
CADAYS = -days 3652
REQ = $(OPENSSL) req -config $(CACONF)
CA = $(OPENSSL) ca -config $(CACONF)
@ab
ab / openssl-ca.conf
Last active December 11, 2015 07:58
# This configuration file governs how OpenSSL should operate for this CA.
[ ca ]
default_ca = CA_myca
[ CA_myca ]
dir = ./ca
certs = $dir/certs
crl_dir = $dir/crl
database = $dir/index.txt
#!/bin/sh
set -eux
first_next_month="$(date -d "+1 month - $(date +%d) days + 1 day" +%A)"
/usr/sbin/sendmail -t <<END
From: Me <me@example.com>
To: Alice <alice@example.com>, Bob <bob@example.com>
Bcc: Me <me@example.com>
Subject: Reminder: rent is due $first_next_month EOM
@ab
ab / generate-ca-bundle
Last active January 31, 2016 18:59
Generate a normalized SSL CA bundle
#!/usr/bin/env ruby
require 'openssl'
require 'optparse'
require 'set'
class CaBundle
class ParseError < StandardError; end
DefaultCAFile = '/etc/ssl/certs/ca-certificates.crt'
VERSION = '0.2.1'
@ab
ab / keybase.md
Created April 16, 2014 04:45
Keybase proof

Keybase proof

I hereby claim:

  • I am ab on github.
  • I am agb (https://keybase.io/agb) on keybase.
  • I have a public key whose fingerprint is 67B4 E575 99FC 7217 0C8C FAEE C709 0B1A 5F57 CDC5

To claim this, I am signing this object: