Skip to content

Instantly share code, notes, and snippets.

View osiloke's full-sized avatar
🎯
Focusing

Osi Emoekpere osiloke

🎯
Focusing
View GitHub Profile
## Configure eth0
#
# vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
NM_CONTROLLED="yes"
ONBOOT=yes
HWADDR=A4:BA:DB:37:F1:04
TYPE=Ethernet
BOOTPROTO=static
// Copyright (C) 2013 Polychrom Pty Ltd
//
// This program is licensed under the 3-clause "Modified" BSD license,
// see LICENSE file for full definition.
package com.polychrom.examples;
import java.util.concurrent.ExecutorService;
import android.app.Activity;
@osiloke
osiloke / gDNS.py
Created August 22, 2013 18:42 — forked from waawal/gDNS.py
# dns server using dnslib and gevent
# based on https://bitbucket.org/paulc/dnslib/src/80d85555aae4/src/server/gevent_server.py
# set the key as
# set IP:name ip_addr
# set TXT:name txtfield
# fallback on gevent's dns resolver
# gleicon 2011
import gevent
# 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
class AdImageX(Widget, Ad):
source = None # StringProperty()
texture = None
allow_stretch = BooleanProperty(True)
keep_ratio = BooleanProperty(False)
def __init__(self, **kwargs):
super(AdImageX, self).__init__(**kwargs)
self.opacity = 0
@osiloke
osiloke / image_roller.py
Created August 1, 2014 18:59
This highlights a memory leak i encountered in kivy
import os
import sys
from kivy.core.window import Window
from kivy.graphics.context_instructions import Color
from kivy.uix.floatlayout import FloatLayout
from kivy.lang import Builder
from kivy import Logger
import gc
from kivy.app import App
@osiloke
osiloke / transitions.cpp
Created August 5, 2014 07:27
Trying to figure out why i can't do something
#include "testApp.h"
#define STRINGIFY(A) "#define QUALITY 32 \n uniform float progress; \n uniform vec2 resolution; \n uniform float time; \n uniform sampler2DRect first; \n uniform sampler2DRect second; \n" #A
float width, height;
//--------------------------------------------------------------
void testApp::setup(){
string shaderProgram = STRINGIFY(
void main (void){
vec2 pos = gl_FragCoord.xy;
vec4 src = texture2DRect(second, pos);
@osiloke
osiloke / Bitcask fail to start
Created November 15, 2014 07:30
/var/log/riak/error.log
2014-11-15 07:48:24.038 [error] <0.150.0> Supervisor riak_core_sup had child riak_core_vnode_manager started with riak_core_vnode_manager:start_link() at <0.183.0> exit with reason {{function_clause,[{riak_kv_vnode,terminate,[{bad_return_value,{stop,{init_keydir_scan_key_files,too_many_iterations}}},undefined],[{file,"src/riak_kv_vnode.erl"},{line,1029}]},{riak_core_vnode,terminate,3,[{file,"src/riak_core_vnode.erl"},{line,901}]},{gen_fsm,terminate,7,[{file,"gen_fsm.erl"},{line,597}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,239}]}]},{gen_fsm,sync_send_event,[<0.662.0>,wait_for_init,infinity]}} in context child_terminated
2014-11-15 07:48:24.039 [error] <0.507.0> CRASH REPORT Process proxy_riak_kv_vnode_776422744832042175295707567380525354192214163456 with 0 neighbours exited with reason: {{{function_clause,[{riak_kv_vnode,terminate,[{bad_return_value,{stop,{init_keydir_scan_key_files,too_many_iterations}}},undefined],[{file,"src/riak_kv_vnode.erl"},{line,1029}]},{riak_core_vnode,terminate,3,[