Skip to content

Instantly share code, notes, and snippets.

View osiloke's full-sized avatar
🎯
Focusing

Osi Emoekpere osiloke

🎯
Focusing
View GitHub Profile
# encoding: utf-8
"""
A python logging Handler that use ZeroMQ (ØMQ).
+------+ +------+ +-------+
| app1 | | app2 | | app X |
+------+ +------+ +-------+
| PUSH | PUSH | PUSH
| | |
import zmq
def main():
try:
context = zmq.Context(1)
frontend = context.socket(zmq.SUB)
frontend.bind('tcp://*:5559')
frontend.setsockopt(zmq.SUBSCRIBE, '')
@osiloke
osiloke / curl.md
Created February 14, 2014 09:18 — forked from btoone/curl.md

Introduction

An introduction to curl using GitHub's API

The Basics

Makes a basic GET request to the specifed URI

curl https://api.github.com/users/caspyin
@osiloke
osiloke / extractors.py
Created August 12, 2011 14:27 — forked from davepeck/extractors.py
A scrapy link extractor that uses BeautifulSoup
import re
from scrapy.link import Link
from urlparse import urljoin
from BeautifulSoup import BeautifulSoup
class SoupLinkExtractor(object):
def __init__(self, *args, **kwargs):
super(SoupLinkExtractor, self).__init__()
allow_re = kwargs.get('allow', None)
@osiloke
osiloke / transfer-network-config
Created September 30, 2011 15:18 — forked from makuk66/transfer-network-config
Notes about using point-to-point links for routing IP addresses in virtual machines
Some experiments, which worked but were eventually not used.
See http://www.greenhills.co.uk/2011/06/10/lxc.html
Now, the next big milestone is to get networking working.
In the config, we told lxc-create to use br0 as the link,
and inside the container we have eth0:
root@thunder:/# brctl show br0
bridge name bridge id STP enabled interfaces
br0 8000.962e6bb72480 no vethP70LNx
@osiloke
osiloke / lxc.rb
Created October 3, 2011 20:23 — forked from niklas/lxc.rb
Setup an lxc-container (chef recipe)
package 'debootstrap'
package 'apt-cacher-ng'
package 'inotify-tools'
include_recipe 'lxc::manage'
include_recipe 'lxc::network_bridge'
include_recipe 'lxc::dns'
host = node[:container]
@osiloke
osiloke / native.scroll.html
Created October 22, 2012 17:25 — forked from mattsahr/native.scroll.html
IOS Webkit - native internal scroll - a fix for the document page-top-bounce
<!DOCTYPE html>
<html>
<!-- NOTES
Demo - uses IOS native scroll available in IOS5, but sidestep the document-bounce behavior. Tested on iPad 1, using IOS 5.1.
This approach uses a set of 3 nested divs.
OuterDiv -- fixed height, width, overflow-scrolling: touch;
MiddleDiv -- fixed height width, overflow-scrolling: touch; fits inside OuterDiv
InnerDiv -- fixed height width, bigger than MiddleDiv, so it kicks in the overflow behavior
#
# Cookbook Name:: s3_backups
# Recipe:: default
# Author:: Todd Zusman (toddzusman.com)
#
execute "apt-get update" do
action :nothing
end
# DO NOT RESPOND TO REQUESTS OTHER THAN yourdomain.com
server {
listen 80 default;
server_name _;
return 444;
}
# FILE UPLOADS
server {
listen 80;
require 'formula'
class LibdnetPython <Formula
depends_on 'libdnet'
url 'http://libdnet.googlecode.com/files/libdnet-1.12.tgz'
homepage 'http://code.google.com/p/libdnet/'
sha1 '71302be302e84fc19b559e811951b5d600d976f8'
def install
ENV["CFLAGS"] = "-O3 -w -pipe"