Skip to content

Instantly share code, notes, and snippets.

@benmanns
benmanns / gist:5912126
Last active December 19, 2015 06:29 — forked from mguterl/gist:308216
#!/bin/sh
#
# init.d script for single or multiple unicorn installations. Expects at least one .conf
# file in /etc/unicorn
#
# Modified by [email protected] http://github.com/jaygooby
# based on http://gist.github.com/308216 by http://github.com/mguterl
#
## A sample /etc/unicorn/my_app.conf
##
package main
import (
"log"
"time"
)
func main() {
ch := make(chan int)
go func() {
@benmanns
benmanns / queue-redis.sh
Created September 16, 2013 17:23
A comparison of Python RQ to Ruby Resque's Redis data format.
# RQ
redis 127.0.0.1:6379> TYPE rq:queue:default
list
redis 127.0.0.1:6379> RPOP rq:queue:default
"3662e57b-0188-4b78-982c-6904058242d8"
redis 127.0.0.1:6379> TYPE rq:job:3662e57b-0188-4b78-982c-6904058242d8
hash
redis 127.0.0.1:6379> HGETALL rq:job:3662e57b-0188-4b78-982c-6904058242d8
1) "created_at"
2) "2013-09-16T17:18:16.400954+00:00"
@benmanns
benmanns / echo_runner.rb
Created September 16, 2013 17:56
An example of running goworker workers from the command line rather than Redis.
`go run echo_wrapper.go echo_worker.go TESTING` # => [TESTING]
@benmanns
benmanns / hash-setup.sh
Created October 29, 2013 17:06
This sets up an Amazon cluster GPU instance for hash cracking with oclHashcat (CUDA). You must use the Ubuntu 12.04.x AMI for HVM. The most recent is Ubuntu Server 12.04.3 LTS for HVM Instances - ami-b93264d0.
sudo apt-get update -y && sudo apt-get upgrade -y
wget http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1204/x86_64/cuda-repo-ubuntu1204_5.5-0_amd64.deb
sudo dpkg -i cuda-repo-ubuntu1204_5.5-0_amd64.deb
sudo apt-get update -y && sudo apt-get install -y nvidia-settings nvidia-current-dev nvidia-modprobe cuda
cat >> ~/.profile <<END
export CUDA_HOME=/usr/local/cuda-5.5
export CUDA_ROOT=/usr/local/cuda-5.5
@benmanns
benmanns / traceroute-cdn-optimizely-com.txt
Last active August 29, 2015 14:00
Results from a traceroute to cdn.optimizely.com
> traceroute cdn.optimizely.com
traceroute to e6640.g.akamaiedge.net (23.211.231.25), 64 hops max, 52 byte packets
1 192.168.1.1 (192.168.1.1) 2.211 ms 0.889 ms 1.726 ms
2 74-95-15-238-sfba.hfc.comcastbusiness.net (74.95.15.238) 1.489 ms 1.761 ms 1.754 ms
3 50.161.76.1 (50.161.76.1) 23.504 ms 16.465 ms 15.216 ms
4 te-0-3-0-9-sur04.sanmateo.ca.sfba.comcast.net (68.86.248.5) 12.384 ms 15.238 ms 16.453 ms
5 te-0-1-0-4-ar01.oakland.ca.sfba.comcast.net (69.139.199.70) 15.997 ms
te-0-1-0-2-ar01.oakland.ca.sfba.comcast.net (68.85.154.110) 17.584 ms
te-0-7-0-19-sur03.sanmateo.ca.sfba.comcast.net (68.87.194.153) 17.361 ms

Keybase proof

I hereby claim:

  • I am benmanns on github.
  • I am benmanns (https://keybase.io/benmanns) on keybase.
  • I have a public key whose fingerprint is 49B1 8D7D 251F 2A59 F0C9 F4DF 3D90 6CDA 1E81 84E7

To claim this, I am signing this object:

@benmanns
benmanns / ci-key-recover.py
Created February 21, 2016 12:35 — forked from kivikakk/ci-key-recover.py
recover key from CodeIgniter homegrown crypto
#!/usr/bin/env python3
# CodeIgniter pre-2.2 non-mcrypt Encrypt reverser.
# Finds the key by partially-known plaintext attack.
# Written by Yuki Izumi. Placed in the public domain.
import codecs
import re
import sys
import time
CREATE TABLE widgets (id INT PRIMARY KEY, name VARCHAR);

CREATE TABLE prices (id INT PRIMARY KEY, widget_id INT, price INT);
INSERT INTO widgets VALUES (1, 'foo'), (2, 'bor'), (3, 'baz');
@benmanns
benmanns / characters.json
Last active May 1, 2017 15:00
A list of all the IDN characters
[
"0",
"1",
"2",
"3",
"4",
"5",
"6",
"7",
"8",