Skip to content

Instantly share code, notes, and snippets.

View oogali's full-sized avatar

Omachonu Ogali oogali

  • Ordinary Stack
  • Princeton, NJ
  • 00:13 (UTC -04:00)
View GitHub Profile
@oogali
oogali / install.sh
Created July 20, 2016 12:52
Install cryptography on OS X via pip w/openssl via homebrew
CFLAGS="-I/usr/local/opt/openssl/include" \
LDFLAGS="-L/usr/local/opt/openssl/lib" \
pip install cryptography
#!/bin/sh
docker ps -a | awk '/Exited/ { print $1 }' | xargs -n 1 docker rm
docker images | awk '/<none>/ { print $3 }' | xargs -n 1 docker rmi
@oogali
oogali / .bash_profile
Created May 31, 2016 19:53
OS X + System Python + virtualenv + Jupyter
function frameworkpython {
if [[ ! -z "$VIRTUAL_ENV" ]]; then
PYTHONHOME=$VIRTUAL_ENV /usr/bin/python "$@"
else
/usr/bin/python "$@"
fi
}
function jupyter {
jcmd=$1
# x86_64
#
CONFIG_64BIT=y
# CONFIG_X86_32 is not set
CONFIG_X86_64=y
CONFIG_X86=y
CONFIG_OUTPUT_FORMAT="elf64-x86-64"
CONFIG_ARCH_DEFCONFIG="arch/x86/configs/x86_64_defconfig"
CONFIG_GENERIC_CMOS_UPDATE=y
CONFIG_CLOCKSOURCE_WATCHDOG=y
@oogali
oogali / follow-me.sh
Created April 14, 2016 01:11
Running services in your dev environment
brew install daemontools
sudo mkdir /service /var/service
sudo chown $USER /service /var/service
cat <<EOF> ~/Library/LaunchAgents/homebrew.mxcl.daemontools.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>KeepAlive</key>
17:16 < itai> KARACHI (Staff Report) - A hand grenade exploded inside courtroom in Karachi's Anti-Terrorism Court (ATC) after a judge asked a police constable if he knew how
grenades worked.
17:16 < itai> The constable, instead of explaining his expertise in weapons and grenade handling to the judge, opted to demonstrate practically by promptly pulling out the pin from
the grenade.
17:17 < itai> This resulted in a loud explosion, injuring five including the judge, the constable and a court clerk.
17:17 < Herk> lol
17:17 < itai> i would say that demonstration was...highly effective
17:36 < gleam> he did a bang-up job
17:41 < itai> you could say his testimony had quite an impact
17:43 < gleam> it was a bombshell
@oogali
oogali / c_rehash
Created December 27, 2015 17:23
c_rehash hack for FreeBSD
#!/bin/sh
if [ $# -ne 1 ]; then
echo "${0} <directory of PEMs>"
exit 1
fi
certdir=${1}
if [ -z "${certdir}" ]; then
echo "Must specify path to directory of PEMs"
@oogali
oogali / etc-nginx-conf.d-observium.conf
Created September 10, 2015 15:42
Observium Nginx configuration
server {
listen 80;
server_name observium.yourdomain.com;
access_log /var/log/nginx/observium-access_log combined;
error_log /var/log/nginx/observium-error_log warn;
root /opt/observium/html;
client_max_body_size 10m;
client_body_buffer_size 8K;
$ ~/cidrdns -q 4.68.3.0/24
4.68.3.4: lo-0.err1-old.losangeles1.level3.net
4.68.3.5: lo-0.err2-old.losangeles1.level3.net
4.68.3.27: lo-0.bbr1.denver1.level3.net
4.68.3.28: lo-0.bbr2.denver1.level3.net
4.68.3.29: lo-0.car1.losangeles1.level3.net
4.68.3.30: lo-0.car2.losangeles1.level3.net
4.68.3.31: lo-0.car1.chicago1.level3.net
4.68.3.32: lo-0.car2.chicago1.level3.net
4.68.3.33: lo-0.car1.boston1.level3.net
@oogali
oogali / consumer.py
Created April 12, 2015 00:37
A test in sending HipChat messages using the v2 API and RabbitMQ
#!/usr/bin/env python
import sys
import json
import pika
import requests
def queue_callback(channel, method, properties, body):
msg = json.loads(body)