EC2 cloud management front ends

July 11th, 2008

There is a wealth of resources available now through Amazon Web Services. One of which is the EC2 compute cloud. But EC2 is really just a bunch of virtual machines with finite resources. To enable these to act as a render farm, performing asyncronous jobs, there needs to be some kind of management front end. Here’s what I’ve found so far.

Scalr has nice process documents, a screencast and come flow charts. Main problem is it’s written in object oriented PHP. Suprisingly, this decision didn’t influence the developers enough to use some kind of ORM, and I’m seeing SQL in functions as high level as RunInstance. I’m going to write off Scalr for now. I wish them the best.

On the level of further abstraction, Morph is a company who’s attempting to completely abstract Ruby on Rails and offer a set of management interfaces for a complete production deployment scenario. Unfortunately this makes details like dependency management and base OS choice impossible, as well as making version conflict resolution complicated within a community (Ruby on Rails) that is currently not well coordinated, to put it nicely.

So…survey says…NOTHING. I’m off to generate some Rails scaffolding. Of course it will be open source. I’m actually sort of excited.

Wheel Building

July 3rd, 2008

For the record, it is possible to use a 32 hole hub laced to a 36 hole rim. It is by no means recommended, though it will be a wheel and it will roll. The secret lies in skipping 1 hole for every 8 on the trailing spokes and lining up the leading spokes normally, so they are one hole away from the trailing on the same side of the flange. I followed this pattern and was still able to use Sheldon Brown’s wheel building page as an accurate reference, despite the mismatch.

Debian Lenny Thinkpad config without Gnome - part 2

June 8th, 2008

The next step in my thinkpad drama is hardware monitoring. It’s a laptop, right? I found a way to get battery state, battery charge, system load, CPU tempurature and date/time. DWM is clever with it’s “toolbar” in that it takes a text string via stdin and shoves it into the top right status bar. So how do I get all of this hardware info into a nicely formated single line of text? Here’s how.

Download and compile the tp-smapi kernel modules.

Install this script, taken from minimalblue.com


#!/bin/sh

battery() {
case `cat /sys/bus/platform/devices/smapi/BAT0/state` in
idle)
charge_type="="
time_left="==="
;;
charging)
charge_type="+"
time_left=`cat /sys/bus/platform/devices/smapi/BAT0/remaining_charging_time`
;;
discharging)
charge_type="-"
time_left=`cat /sys/bus/platform/devices/smapi/BAT0/remaining_running_time`
;;
*)
charge_type="?"
time_left="???"
;;
esac
echo "${charge_type}${time_left}"
}
temp() {
awk '{ print $2 }' /proc/acpi/thermal_zone/THM0/temperature
}
load() {
cut -d' ' -f1 /proc/loadavg
}

echo "temp: `temp`C | sys: `load` | bat: `battery` | `date`"

Now you have to launch DWM with this script as an argument to DWM. This is my .xinitrc, as I’m starting my session through startx.


while true; do
$HOME/.dwm/status
sleep 1
done | dwm

That’ll give you a nice status display at the top.

Next up…capturing the thinkpad keys for suspend and brightness, as well as any other arbitrary command you’d like to call.

Debian Lenny on a Thinkpad X61 without Gnome

June 8th, 2008

OMG. Epic drama. I love my new Thinkpad X61. I’m spending an inordinate amount of time configuring it to my tastes. The screen is small and it’s got a small battery, so I set out to find a nice desktop environment that’s light, functional, customizable, CPU efficient and doesn’t get in my way. I settled on DWM.

I’m coming from OS X and Quicksilver. I never liked the OS X window manager so DWM is a real treat. But Quicksilver is pretty awesome and hard to reproduce. I found dmenu. It works in exactly the same way as I use Quicksilver. It doesn’t require any extra configuration. I binded it to the same key combo as Quicksilver, Ctrl + Space. This requires reconfiguring DWM. I also made some other changes to the config file.

DWM is configured by modifying a C header file and recompiling. Here’s mine:

/* See LICENSE file for copyright and license details. */

/* appearance */
#define BORDERPX 2
#define FONT "-*-terminus-medium-r-normal-*-14-*-*-*-*-*-*-*"
#define NORMBORDERCOLOR "#cccccc"
#define NORMBGCOLOR "#cccccc"
#define NORMFGCOLOR "#000000"
#define SELBORDERCOLOR "#AA3333"
#define SELBGCOLOR "#0066ff"
#define SELFGCOLOR "#ffffff"

/* tagging */
const char tags[][MAXTAGLEN] = { "com", "cal", "kvm", "aux" };

Rule rules[] = {
/* class instance title tags ref isfloating */
{ NULL, NULL, "Pidgin", tags[0], True },
{ "Gimp", NULL, NULL, NULL, True },
};

/* geometries, s{x,y,w,h} and bh are already initualized here */
/* func name bx by bw wx wy ww wh mx my mw mh tx ty tw th mox moy mow moh */
#define MFACT 0.55 /* master width factor [0.1 .. 0.9] */
DEFGEOM(single, 0, 0, sw, 0, bh, sw, sh-bh, wx, wy, mfact*sw, wh, mx+mw, wy, ww-mw, wh, wx, wy, ww, wh)

Geom geoms[] = {
/* symbol function */
{ "[]", single }, /* first entry is default */
};

/* layout(s) */
#define RESIZEHINTS True /* False - respect size hints in tiled resizals */
#define SNAP 16 /* snap pixel */

Layout layouts[] = {
/* symbol function isfloating */
{ "[]=", tilev, False }, /* first entry is default */
{ "[]|", tileh, False },
{ "><>“, floating, True },
{ “[M]”, monocle, True },
};

/* key definitions */
#define MODKEY Mod1Mask
Key keys[] = {
/* modifier key function argument */
{ ControlMask, XK_space, spawn,
“exec dmenu_run -fn ‘”FONT”‘ -nb ‘”NORMBGCOLOR”‘ -nf ‘”NORMFGCOLOR”‘ -sb ‘”SELBGCOLOR”‘ -sf ‘”SELFGCOLOR”‘” },
{ MODKEY|ShiftMask, XK_Return, spawn, “exec uxterm” },
{ MODKEY, XK_j, focusnext, NULL },
{ MODKEY, XK_k, focusprev, NULL },
{ MODKEY, XK_r, reapply, NULL },
{ MODKEY, XK_h, setmfact, “-0.05″ },
{ MODKEY, XK_l, setmfact, “+0.05″ },
{ MODKEY, XK_Return, zoom, NULL },
{ MODKEY, XK_Tab, viewprevtag, NULL },
{ MODKEY|ShiftMask, XK_c, killclient, NULL },
{ MODKEY, XK_space, setlayout, NULL },
{ MODKEY|ShiftMask, XK_space, togglefloating, NULL },
{ MODKEY|ControlMask, XK_space, setgeom, NULL },
{ MODKEY, XK_0, view, NULL },
{ MODKEY, XK_1, view, tags[0] },
{ MODKEY, XK_2, view, tags[1] },
{ MODKEY, XK_3, view, tags[2] },
{ MODKEY, XK_4, view, tags[3] },
{ MODKEY, XK_5, view, tags[4] },
{ MODKEY, XK_6, view, tags[5] },
{ MODKEY, XK_7, view, tags[6] },
{ MODKEY, XK_8, view, tags[7] },
{ MODKEY, XK_9, view, tags[8] },
{ MODKEY|ControlMask, XK_1, toggleview, tags[0] },
{ MODKEY|ControlMask, XK_2, toggleview, tags[1] },
{ MODKEY|ControlMask, XK_3, toggleview, tags[2] },
{ MODKEY|ControlMask, XK_4, toggleview, tags[3] },
{ MODKEY|ControlMask, XK_5, toggleview, tags[4] },
{ MODKEY|ControlMask, XK_6, toggleview, tags[5] },
{ MODKEY|ControlMask, XK_7, toggleview, tags[6] },
{ MODKEY|ControlMask, XK_8, toggleview, tags[7] },
{ MODKEY|ControlMask, XK_9, toggleview, tags[8] },
{ MODKEY|ShiftMask, XK_0, tag, NULL },
{ MODKEY|ShiftMask, XK_1, tag, tags[0] },
{ MODKEY|ShiftMask, XK_2, tag, tags[1] },
{ MODKEY|ShiftMask, XK_3, tag, tags[2] },
{ MODKEY|ShiftMask, XK_4, tag, tags[3] },
{ MODKEY|ShiftMask, XK_5, tag, tags[4] },
{ MODKEY|ShiftMask, XK_6, tag, tags[5] },
{ MODKEY|ShiftMask, XK_7, tag, tags[6] },
{ MODKEY|ShiftMask, XK_8, tag, tags[7] },
{ MODKEY|ShiftMask, XK_9, tag, tags[8] },
{ MODKEY|ControlMask|ShiftMask, XK_1, toggletag, tags[0] },
{ MODKEY|ControlMask|ShiftMask, XK_2, toggletag, tags[1] },
{ MODKEY|ControlMask|ShiftMask, XK_3, toggletag, tags[2] },
{ MODKEY|ControlMask|ShiftMask, XK_4, toggletag, tags[3] },
{ MODKEY|ControlMask|ShiftMask, XK_5, toggletag, tags[4] },
{ MODKEY|ControlMask|ShiftMask, XK_6, toggletag, tags[5] },
{ MODKEY|ControlMask|ShiftMask, XK_7, toggletag, tags[6] },
{ MODKEY|ControlMask|ShiftMask, XK_8, toggletag, tags[7] },
{ MODKEY|ControlMask|ShiftMask, XK_9, toggletag, tags[8] },
{ MODKEY|ShiftMask, XK_q, quit, NULL },
};

Next up…fun with menus!