Skip to content

Instantly share code, notes, and snippets.

View bretthoerner's full-sized avatar

Brett Hoerner bretthoerner

View GitHub Profile
$ sudo apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages have been kept back:
libohai-ruby libohai-ruby1.8 linux-ec2 linux-image-ec2 linux-image-virtual linux-virtual
The following packages will be upgraded:
apache2 apache2-mpm-worker apache2-prefork-dev apache2-utils apache2.2-bin apache2.2-common apt apt-transport-https apt-utils base-files consolekit cpp-4.4 cron
g++-4.4 gcc-4.4 gcc-4.4-base grub-common grub-pc initscripts libc-bin libc-dev-bin libc6 libc6-dev libck-connector0 libgcc1 libgomp1 libmysqlclient-dev
libmysqlclient16 libpam-ck-connector libpng12-0 libstdc++6 libstdc++6-4.4-dev linux-libc-dev mysql-common ohai openssl procps python-boto python-httplib2
ii libohai-ruby 0.6.12-1 Library to collect data about your operating
ii libohai-ruby1.8 0.6.12-1 Ruby 1.8 library to collect data about your
ii ohai 0.6.12-2 Detects data about your operating system and
$ dpkg -l | grep ipadd
# nothing
[Thu, 22 Mar 2012 21:12:58 +0000] DEBUG: Loading plugin network
[Thu, 22 Mar 2012 21:12:58 +0000] DEBUG: Plugin network threw exception #<LoadError: no such file to load -- ipaddress> /usr/lib/ruby/1.8/ohai/plugins/network.rb:19:in `require'
import java.io.IOException;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.File;
import java.net.URI;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.io.IOUtils;
require 'riak'
# Create a client interface
# client = Riak::Client.new
# Create a client interface that uses Excon
# client = Riak::Client.new(:http_backend => :Excon)
# Create a client that uses Protocol Buffers
client = Riak::Client.new(:protocol => "pbc")
@bretthoerner
bretthoerner / ipdb.py
Created August 4, 2011 18:21
ipdb for IPython 0.11
import sys
from IPython.core.debugger import Pdb
from IPython.core import ipapi
def set_trace():
ip = ipapi.get()
def_colors = ip.colors
Pdb(def_colors).set_trace(sys._getframe().f_back)
@bretthoerner
bretthoerner / gist:1125778
Created August 4, 2011 17:58
Riak (Python?) sibling question
import riak
import random
r = riak.RiakClient()
b = r.bucket("test")
# allow_mult
b.set_allow_multiples(True)
# new obj per run
@bretthoerner
bretthoerner / gist:1117011
Created July 31, 2011 17:47
Guile 2.0.2 compilation error on OS X 10.7 Lion
$ make
make all-recursive
Making all in lib
GEN alloca.h
GEN arg-nonnull.h
GEN c++defs.h
GEN warn-on-use.h
GEN arpa/inet.h
GEN byteswap.h
GEN fcntl.h
@bretthoerner
bretthoerner / client
Created July 27, 2011 19:25
Scribe configuration
port=1464
<store>
category=default
type=buffer
max_write_interval=1 # process messages at least once per second
<primary>
type=network
from scribe import scribe
from thrift.transport import TTransport, TSocket
from thrift.protocol import TBinaryProtocol
category='event'
message='data goes here'
log_entry = scribe.LogEntry(category, message)
socket = TSocket.TSocket(host='localhost', port=1464)