Skip to content

Instantly share code, notes, and snippets.

View oogali's full-sized avatar

Omachonu Ogali oogali

  • Ordinary Stack
  • Princeton, NJ
  • 15:35 (UTC -04:00)
View GitHub Profile
@oogali
oogali / send-invite.c
Created May 31, 2013 15:22
Testing SIP INVITEs -- I think I used this to prank Vonage users w/ATA-186s back in the day
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <md5.h>
@oogali
oogali / mediatest.c
Created May 31, 2013 15:19
Something I dug out of my home directory. I guess I was doing some sort of SIP testing...
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>
#include <ortp/ortp.h>
@oogali
oogali / oo-json-test.c
Created May 31, 2013 05:52
Working with JSON in C
#include <stdio.h>
#include <json/json.h>
int main(int argc, char **argv) {
json_object *o, *url;
MC_SET_DEBUG(1);
o = json_tokener_parse("{\"url\":\"http://i.minus.com/i52DkrwgNalFF.gif\",\"created\":1346426580}");
#!/usr/bin/env bash
git clone git://github.com/sstephenson/rbenv.git ~/.rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile
echo 'eval "$(rbenv init -)"' >> ~/.bash_profile
exec $SHELL -l
git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
@oogali
oogali / mcast-data-test.rb
Last active December 16, 2015 21:59
Test multicast reception via Ruby
#!/usr/bin/env ruby
# - @oogali
require 'rubygems'
require 'socket'
require 'ipaddr'
require 'getoptlong'
MAX_RUNTIME_DURATION = 30 # seconds
@oogali
oogali / ruby-mcast-join.rb
Created April 7, 2013 17:31
Joining a multicast group with Ruby
#!/usr/bin/env ruby
require 'rubygems'
require 'socket'
require 'ipaddr'
MCAST_GROUP = {
:addr => '224.5.6.7',
:port => 12345,
:bindaddr => '192.168.1.2'
@oogali
oogali / bot.rb
Created March 22, 2013 14:08
First actual attempt at a IRC bot template
#!/usr/bin/env ruby
require 'rubygems'
require 'eventmachine'
class DammitSocket < EM::Connection
def initialize(dammit)
@dammit = dammit
@buffer = ''
@oogali
oogali / Gemfile-puma.diff
Created March 15, 2013 15:46
Switching from Thin to Puma...
diff --git a/Gemfile b/Gemfile
index ae735c6..0c19644 100644
--- a/Gemfile
+++ b/Gemfile
@@ -2,10 +2,11 @@ source :rubygems
gem 'SystemTimer', :platforms => :ruby_18
gem 'eventmachine'
gem 'thin'
+gem 'puma', :git => 'git://github.com/puma/puma.git'
gem 'hiredis'
@oogali
oogali / ssh-agent.sh
Created March 9, 2013 07:36
SSH agent snippet for your .bash_profile -- stop launching ssh-agent every time you log in.
# append this to your .bash_profile
start_agent() { eval `ssh-agent` >/dev/null; echo "${SSH_AGENT_PID}:${SSH_AUTH_SOCK}" > "${HOME}/.ssh/agent"; }
use_existing_agent() { export SSH_AGENT_PID=`head -1 ${HOME}/.ssh/agent | awk -F ':' '{ print $1 }'`; export SSH_AUTH_SOCK=`head -1 ${HOME}/.ssh/agent | awk -F ':' '{ print $2 }'`; }
if [ ! -f "${HOME}/.ssh/agent" ]; then
start_agent
else
use_existing_agent
if [ -z "${SSH_AUTH_SOCK}" ] || [ ! -S "${SSH_AUTH_SOCK}" ]; then
start_agent
grammar MozillaCKA
rule document
( comment / newline / cvsid / beginning / root / certificates / trusts )*
end
# LOL!
rule cvsid
'CVS_ID' text newline
end