Skip to content

Instantly share code, notes, and snippets.

View oogali's full-sized avatar

Omachonu Ogali oogali

  • Ordinary Stack
  • Princeton, NJ
  • 18:47 (UTC -04:00)
View GitHub Profile
@oogali
oogali / re-debug.txt
Created February 16, 2019 12:08
Example of Python regular expression compiler debugging
>>> re.compile(r'(jump|off)\s+the\s+ramp', re.DEBUG)
subpattern 1
branch
literal 106
literal 117
literal 109
literal 112
or
literal 111
literal 102
@oogali
oogali / docker-compose.yml
Created April 9, 2018 11:56
kong + kong dashboard docker-compose
version: '3'
services:
kong:
image: kong:0.12-alpine
environment:
KONG_DATABASE: postgres
KONG_PG_HOST: db
KONG_PROXY_ACCESS_LOG: /dev/stdout
KONG_ADMIN_ACCESS_LOG: /dev/stdout
@oogali
oogali / warning.txt
Created January 1, 2018 11:58
pip install docker-compose
WARNING: Dependency conflict: an older version of the 'docker-py' package may be polluting the namespace. If you're experiencing crashes, run the following command to remedy the issue:
pip uninstall docker-py; pip uninstall docker; pip install docker
@oogali
oogali / aws-us-east-peering.tf
Last active December 16, 2017 17:46
Just waiting on Terraform AWS provider to support inter-region VPC peering...
# Pending apply... needs https://github.com/terraform-providers/terraform-provider-aws/issues/2484
#
resource "aws_vpc_peering_connection" "north-virginia-to-ohio" {
provider = "aws.us-east-1"
vpc_id = "${module.us-north-virginia.vpc_id}"
peer_region = "us-east-2"
peer_vpc_id = "${module.us-ohio.vpc_id}"
accepter {
allow_remote_vpc_dns_resolution = true
@oogali
oogali / .bash_profile
Created October 13, 2017 20:46
Snippet to insert into .bash_profile for reliable local Jupyter execution (assumes you have Jupyter installed)
function frameworkpython {
if [[ ! -z "$VIRTUAL_ENV" ]]; then
PYTHONHOME=$VIRTUAL_ENV /usr/bin/python "$@"
else
/usr/bin/python "$@"
fi
}
function jupyter {
jcmd=$1
@oogali
oogali / layers.dot
Created June 17, 2017 02:57
network layers
digraph layers {
size = "8, 8"
splines = true
ranksep = 1.5
node [shape = "plaintext"]
transit -> transit_vrrp -> lb -> lb_floating -> dmz -> internal
node [shape = "rect"]
{rank = "same"; transit br1 br2; }
@oogali
oogali / bash_profile
Created November 8, 2016 11:05
Python + OS X bash_profile...
if [ -d "${HOME}/Library/Python/2.7" ]; then
export PATH="${PATH}:${HOME}/Library/Python/2.7/bin"
fi
function frameworkpython {
if [[ ! -z "$VIRTUAL_ENV" ]]; then
PYTHONHOME=$VIRTUAL_ENV /usr/bin/python "$@"
else
/usr/bin/python "$@"
fi
@oogali
oogali / spinner.rb
Created October 20, 2016 12:46
Super simple ASCII spinner
#!/usr/bin/env ruby
segments = %w( / - \\ | )
20.times do
segments.each do |segment|
print segment
sleep 0.1
print "\r"
end
dep:
npm install --only=dev
watch: dep
webpack-dev-server --progress --colors --watch
.PHONY: watch
@oogali
oogali / hipchat-oxr.py
Created July 26, 2016 19:57
exchange rate hipchat bot
import json
import requests
def lambda_handler(event, context):
message_id = event.get('message_id')
if not message_id:
return None
ccypair = event.get('ccypair')