Skip to content

Instantly share code, notes, and snippets.

Omachonu Ogali oogali

Block or report user

Report or block oogali

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@oogali
oogali / re-debug.txt
Created Feb 16, 2019
Example of Python regular expression compiler debugging
View re-debug.txt
>>> 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 Apr 9, 2018
kong + kong dashboard docker-compose
View docker-compose.yml
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 Jan 1, 2018
pip install docker-compose
View warning.txt
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 Dec 16, 2017
Just waiting on Terraform AWS provider to support inter-region VPC peering...
View aws-us-east-peering.tf
# 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 Oct 13, 2017
Snippet to insert into .bash_profile for reliable local Jupyter execution (assumes you have Jupyter installed)
View .bash_profile
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 Jun 17, 2017
network layers
View layers.dot
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 Nov 8, 2016
Python + OS X bash_profile...
View 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 Oct 20, 2016
Super simple ASCII spinner
View spinner.rb
#!/usr/bin/env ruby
segments = %w( / - \\ | )
20.times do
segments.each do |segment|
print segment
sleep 0.1
print "\r"
end
View Makefile
dep:
npm install --only=dev
watch: dep
webpack-dev-server --progress --colors --watch
.PHONY: watch
@oogali
oogali / hipchat-oxr.py
Created Jul 26, 2016
exchange rate hipchat bot
View hipchat-oxr.py
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')
You can’t perform that action at this time.