Skip to content

Instantly share code, notes, and snippets.

View btbytes's full-sized avatar

Pradeep Gowda btbytes

View GitHub Profile
@btbytes
btbytes / couchdb_install.txt
Created December 17, 2010 05:16
couchdb install
If this is your first install, automatically load on login with:
cp /usr/local/Cellar/couchdb/1.0.1/Library/LaunchDaemons/org.apache.couchdb.plist ~/Library/LaunchAgents
launchctl load -w ~/Library/LaunchAgents/org.apache.couchdb.plist
If this is an upgrade and you already have the org.apache.couchdb.plist loaded:
launchctl unload -w ~/Library/LaunchAgents/org.apache.couchdb.plist
cp /usr/local/Cellar/couchdb/1.0.1/Library/LaunchDaemons/org.apache.couchdb.plist ~/Library/LaunchAgents
launchctl load -w ~/Library/LaunchAgents/org.apache.couchdb.plist
Or start manually with:
@btbytes
btbytes / couchdb.markdown
Created December 22, 2010 14:35
Couchdb experiments
curl -X PUT http://127.0.0.1:5984/testdb/apple -H "Content-Type: application/json" -d {}

To view the output of a view:

http://localhost:5984/testdb/_design/people/_view/all

where:

testdb - database

@btbytes
btbytes / python_sleep_using_select.py
Created December 28, 2010 20:26
Python sleep using select
import select
select.select([],[],[],3)
@btbytes
btbytes / install_luacurl.mkd
Created January 4, 2011 04:51
Installing luacurl

Installing luacurl

Download the source from luaforge

Linux

LUA_CFLAGS="-I/usr/include/curl" LUA_LIBS="-L/usr/lib -lm -llua" make

brew install redis ==> Downloading http://redis.googlecode.com/files/redis-2.0.4.tar.gz ######################################################################## 100.0% ==> make -C . ==> Caveats If this is your first install, automatically load on login with: cp /usr/local/Cellar/redis/2.0.4/io.redis.redis-server.plist ~/Library/LaunchAgents launchctl load -w ~/Library/LaunchAgents/io.redis.redis-server.plist

If this is an upgrade and you already have the io.redis.redis-server.plist loaded:

@btbytes
btbytes / mokoservices.py
Created January 5, 2011 15:40
python subprocess example
#!/usr/bin/env python
#FROM : http://www.paultt.org/downloads/openmoko/mokoservices.py
# example table.py
import pygtk
pygtk.require('2.0')
import gtk
import subprocess
import time
import gobject
@btbytes
btbytes / haserl_installation.markdown
Created January 7, 2011 18:39
Installing Haserl with Lua development
$ wget -c http://iweb.dl.sourceforge.net/project/haserl/haserl-devel/0.9.27/haserl-0.9.27.tar.gz
$ tar -zxvf haserl-0.9.27.tar.gz
$ cd haserl-0.9.27
$ ./configure --enable-luashell --with-lua=/usr/bin --with-lua-headers=/usr/include/lua5.1
$ make 

thttpd

Download and make thttpd.

@btbytes
btbytes / siri_words.markdown
Created January 9, 2011 15:42
Siri Words

My 13 month old daughter Siri speaks these words, in three languages :

  • kn = Kannada (Pradeep's Mother tongue)
  • ko = Konkani (Nayan's Mother tongue)
  • en = English
  • ba = Baby talk

2011-01-09

# Full credit to: http://jeffmiller.github.com/2011/01/10/ssh-host-color
#!/bin/bash
#
# ssh into a machine and automatically set the background
# color of Mac OS X Terminal depending on the hostname.
#
# Installation:
# 1. Save this script to /some/bin/ssh-host-color
# 2. chmod 755 /some/bin/ssh-host-color
{"session_id":"ffbd6be88a97b58dde655d779b389173","start_time":"Wed, 12 Jan 2011 19:01:55 GMT","end_time":"Wed, 12 Jan 2011 19:02:21 GMT","start_last_seq":0,"end_last_seq":4094,"recorded_seq":0,"missing_checked":0,"missing_found":912,"docs_read":912,"docs_written":912,"doc_write_failures":0}
{"session_id":"58cf12e5d73fcf0452c6ca2909ec2c53","start_time":"Wed, 12 Jan 2011 18:58:23 GMT","end_time":"Wed, 12 Jan 2011 18:59:05 GMT","start_last_seq":0,"end_last_seq":3182,"recorded_seq":0,"missing_checked":0,"missing_found":3182,"docs_read":3182,"docs_written":3182,"doc_write_failures":0}