April 2012

Bootstrap latest version of Chef Solo on Debian/Ubuntu dists

#!/usr/bin/env bash
echo "deb http://apt.opscode.com/ `lsb_release -cs`-0.10 main" | sudo tee /etc/apt/sources.list.d/opscode.list
mkdir -p /etc/apt/trusted.gpg.d
mkdir -p /etc/apt/trusted.gpg.d
gpg --keyserver keys.gnupg.net --recv-keys 83EF826A
gpg --export packages@opscode.com | sudo tee /etc/apt/trusted.gpg.d/opscode-keyring.gpg > /dev/null
apt-get -y update
apt-get -y install opscode-keyring
apt-get -y upgrade
apt-get -y install chef

Tags: 

MongoDB Quick Start - Replica Sets and Sharding

Scaling out 1 node with Replica Set

If you already have a running mongod instance you first need restart it with --replSet

$ mongod --fork --rest --replSet mySetName --port 27017 --dbpath ~/Projects/db/data/mongo/r0 --logpath ~/Library/Logs/mongod-r0.log

Initialize the node via the mongo client

$ mongo
> rs.initiate()
{
        "info" : "Config now saved locally.  Should come online in about a minute.",
        "ok" : 1
}

This node is our Primary Node where read/write is done initially.

> db.messages.insert({City: "Tokyo"})
> db.messages.find()

Tags: 

tmux and irssi sitting in a tree...

tmux+irssi

tmux.conf

# command prefix to ctrl+space
set -g prefix C-Space

# bindings
unbind-key C-b
bind-key a send-prefix
bind-key C-a last-window
bind s split-window -v
bind v split-window -h
bind-key Tab select-pane -t :.+
bind m command-prompt "split-window -h 'exec man %%'"
bind R source-file ~/.tmux.conf
bind k confirm-before "kill-window"
bind-key -r    M-Up resize-pane -U
bind-key -r  M-Down resize-pane -D
bind-key -r  M-Left resize-pane -L
bind-key -r M-Right resize-pane -R
bind-key -r    C-Up resize-pane -U 5
bind-key -r  C-Down resize-pane -D 5
bind-key -r  C-Left resize-pane -L 5
bind-key -r C-Right resize-pane -R 5

# status bar

Tags: