SaltyCrane: wmiihttps://www.saltycrane.com/blog/2009-12-22T01:00:05-08:00Wmii Python script to monitor remote machines
2009-12-22T01:00:05-08:00https://www.saltycrane.com/blog/2009/12/wmii-python-script-monitor-remote-machines/<object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/jSes6lJdj5Y&hl=en_US&fs=1&rel=0&color1=0x3a3a3a&color2=0x999999"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/jSes6lJdj5Y&hl=en_US&fs=1&rel=0&color1=0x3a3a3a&color2=0x999999" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object>
<p>I like to monitor our web servers by ssh'ing into the remote machine and watching
"top", tailing log files, etc. Normally, I open a terminal, ssh into the
remote machine, run the monitoring command (e.g. "top"), then repeat for the rest
of the remote machines. Then I adjust the window sizes so I can see everything
at once.</p>
<p>My window manager, <a href="http://wmii.suckless.org/">wmii</a>, is great for
tiling a bunch of windows at once. It is also scriptable with Python, so I wrote a
Python script to create my web server monitoring view. Below is my script. I also put a
<a href="http://www.youtube.com/watch?v=jSes6lJdj5Y">video on YouTube</a>.
</p>
<pre class="python">#!/usr/bin/env python
import os
import time
NGINX_MONITOR_CMD = "tail --follow=name /var/log/nginx/cache.log | grep --color -E '(HIT|MISS|EXPIRED|STALE|UPDATING|\*\*\*)'"
APACHE_MONITOR_CMD = "top"
MYSQL_MONITOR_CMD = "mysqladmin extended -i10 -r | grep -i 'questions\|aborted_clients\|opened_tables\|slow_queries\|threads_created' "
CMDS_COL1 = ['urxvt -title "Nginx 1" -e ssh -t us-ng1 "%s" &' % NGINX_MONITOR_CMD,
'urxvt -title "Nginx 2" -e ssh -t us-ng2 "%s" &' % NGINX_MONITOR_CMD,
]
CMDS_COL2 = ['urxvt -title "Apache 1" -e ssh -t us-med1 "%s" &' % APACHE_MONITOR_CMD,
'urxvt -title "Apache 2" -e ssh -t us-med2 "%s" &' % APACHE_MONITOR_CMD,
'urxvt -title "Apache 3" -e ssh -t us-med3 "%s" &' % APACHE_MONITOR_CMD,
]
CMDS_COL3 = ['urxvt -title "MySQL 1" -e ssh -t us-my1 "%s" &' % MYSQL_MONITOR_CMD,
'urxvt -title "MySQL 2" -e ssh -t us-my2 "%s" &' % MYSQL_MONITOR_CMD,
]
COLUMNS = [CMDS_COL1, CMDS_COL2, CMDS_COL3]
def create_windows():
for i, col in enumerate(COLUMNS):
cindex = str(i+1)
for cmd in col:
os.system(cmd)
time.sleep(1)
os.system('wmiir xwrite /tag/sel/ctl send sel %s' % cindex)
os.system('wmiir xwrite /tag/sel/ctl colmode %s default-max' % cindex)
os.system('wmii.py 45.5 31.5 23')
if __name__ == '__main__':
create_windows()</pre>
<p><em>Note 1:</em> The script above uses another
<a href="http://www.saltycrane.com/blog/2009/04/scripting-wmii-column-widths-python/">
script I wrote previously, <code>wmii.py</code>,</a> to set the column widths.
</p>
<p><em>Note 2:</em> The remote server addresses are specified by the nicknames
<em>us-ng1</em>, <em>us-ng2</em>, <em>us-med1</em>, etc. configured in my
<code>~/.ssh/config</code> file as described
<a href="http://www.saltycrane.com/blog/2008/11/creating-remote-server-nicknames-sshconfig/">here</a>.
</p>
<p><em>Note 3 (on using ssh and top):</em> I first tried doing <code>ssh host top</code>,
but this gave me a <em><code>TERM environment variable not set.</code></em> error.
I then tried <code>ssh host "export TERM=rxvt-unicode; top"</code>, but this gave me
a <em><code>top: failed tty get</code></em> error. The solution that worked for me was
to use the <em><code>-t</code></em> option with <code>ssh</code>. E.g.
<code>ssh -t host top</code>. This is what I used in the script above.
</p>
<p><em>Note 4 (added 2010-03-05):</em> I used "tail --follow=name" instead of "tail -f"
so that tail will follow the log file even after it has been rotated. For more
information, see the
<a href="http://manpages.debian.net/cgi-bin/man.cgi?query=tail&apropos=0&sektion=0&manpath=Debian+5.0+lenny&format=html&locale=en">man
page for tail</a>.</p>
<p><em>Note 5 (added 2010-03-05):</em> To prevent your ssh session from timing out,
add the following 2 lines to your <code>~/.ssh/config</code> file
(<a href="http://ocaoimh.ie/how-to-fix-ssh-timeout-problems/">via</a>):</p>
<pre>Host *
ServerAliveInterval 60</pre>
Install wmii snapshot 20090703 on Ubuntu Jaunty
2009-07-13T09:30:34-07:00https://www.saltycrane.com/blog/2009/07/install-wmii-snapshot-20090703-ubuntu-jaunty/<p>On Friday I installed the latest snapshot of <a href="http://wmii.suckless.org/">wmii</a>,
the lightweight, tiling, dynamic, scriptable, keyboard navigatable window manager.
(See my <a href="/blog/tag/wmii/">wmii tag</a> for more posts about wmii.)
Wmii orangizes windows into columns.
Traditionally there has been three modes for each
column: default, stack, and max. "Default" shows all windows in a column.
"Stack" shows
only one window at a time with the title bars of the other windows showing.
"Max" shows only one window without any other titlebars. I usually use two columns
each in stack mode. To navigate windows, I use Mod4+j/k to move among windows in a
column and Mod4+h/l to move between columns. This has worked well for me, but sometimes
I wanted to display two windows in a column while keeping the rest of the windows hidden.
Thankfully, the latest snapshot of wmii now includes a new mode which solves my problem.
It is a hybrid of the "default" and "stack" modes. It is called "defalut-max" and it
allows for multiple stacks of windows per column. There is also a "default+max" mode
which is like a hybrid of the old "default" and "max" modes. Additionally these modes
now apply to the floating layer as well.
</p>
<p>Another really cool thing about the latest wmii snapshot is that it now includes
a Python library to interface with the wmii filesystem and a wmiirc written in
Python. This should make it a lot easier to script wmii. This is exciting stuff.
Thanks to Kris Maglione and the wmii contributors.
</p>
<p>Here are my notes for installing wmii snapshot 20090703
on Ubuntu 9.04 Jaunty.
</p>
<h4>Install prerequisites</h4>
<ul>
<li>
<pre>$ sudo apt-get install build-essential xorg-dev</pre>
<pre>$ sudo apt-get install dwm-tools</pre>
</li>
<li>This is so it can find the freetype headers.
<pre>$ sudo ln -s /usr/include/freetype2/freetype /usr/include/freetype</pre>
</li>
</ul>
<h4>Install wmii</h4>
<ul>
<li>Download wmii+ixp-snap20090703.tgz from the
<a href="http://www.suckless.org/wmii/">wmii homepage</a>
and save it to <code>~/incoming</code>.
</li>
<li>Unpack
<pre>$ cd ~/incoming
$ tar -zxvf wmii+ixp-snap20090703.tgz</pre>
</li>
<li>make config
<pre>$ cd ~/incoming/wmii+ixp-snap20090703
$ make config</pre>
Accept all defaults except set <code>PREFIX=/home/eliot/lib/wmii_20090703</code>
<br><br>
</li>
<li>make & make install
<pre>$ make
$ make install</pre>
</li>
<li>Create links in my <code>~/bin</code> directory:
<pre>$ cd ~/bin
$ ln -s ~/lib/wmii_20090703/bin/* .</pre>
</li>
</ul>
<h4>Use the fun Python wmiirc</h4>
<ul>
<li>Copy the Python files to <code>~/.wmii-hg</code>. This includes the <code>pygmi</code> directory, the <code>pyxp</code> directory, and the two wmiirc files.
<pre>$ cp -r ~/incoming/wmii+ixp-snap20090703/alternative_wmiircs/python/* ~/.wmii-hg/</pre>
</li>
<li>Edit <code>~/.wmii-hg/wmiirc.py</code> as desired.</li>
</ul>
<h4>Run wmii</h4>
<ul>
<li>Create <code>~/.xsession</code>:
<pre>xmodmap ~/.Xmodmap
gnome-screensaver&
gnome-power-manager&
nm-applet --sm-disable&
urxvt&
until wmii; do
true
done</pre>
</li>
<li>Log out of the current window manager and then select X client script
as the session and log in.</li>
</ul>
<h4>Install <code>slock</code> screen locker</h4>
<ul>
<li>Download from <a href="http://tools.suckless.org/slock">http://tools.suckless.org/slock</a></li>
<li>
<pre class="console">$ tar zxvf slock-0.9.tar.gz
$ cd slock-0.9
$ sudo make clean install </pre>
</li>
<li>Running slock:
Simply invoke the 'slock' command. To get out of it, enter your password.
</li>
</li>
</ul>
<h4>Freetype header error</h4>
<p>The first time around, I got the following error:</p>
<pre style="overflow: scroll; height: 80px;">In file included from /usr/include/X11/Xft/Xft.h:39,
from ../include/x11.h:9,
from cmd/wmii9menu.c:49:
/usr/include/ft2build.h:56:38: error: freetype/config/ftheader.h: No such file or directory
In file included from ../include/x11.h:9,
from cmd/wmii9menu.c:49:
/usr/include/X11/Xft/Xft.h:40:10: error: #include expects "FILENAME" or <FILENAME>
In file included from ../include/x11.h:9,
from cmd/wmii9menu.c:49:
/usr/include/X11/Xft/Xft.h:60: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_XftFTlibrary’
/usr/include/X11/Xft/Xft.h:94: error: expected specifier-qualifier-list before ‘FT_UInt’
/usr/include/X11/Xft/Xft.h:101: error: expected specifier-qualifier-list before ‘FT_UInt’
/usr/include/X11/Xft/Xft.h:198: error: expected ‘;’, ‘,’ or ‘)’ before ‘*’ token
/usr/include/X11/Xft/Xft.h:303: error: expected ‘;’, ‘,’ or ‘)’ before ‘*’ token
/usr/include/X11/Xft/Xft.h:362: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘XftLockFace’
/usr/include/X11/Xft/Xft.h:401: error: expected ‘;’, ‘,’ or ‘)’ before ‘*’ token
/usr/include/X11/Xft/Xft.h:407: error: expected ‘;’, ‘,’ or ‘)’ before ‘*’ token
/usr/include/X11/Xft/Xft.h:416: error: expected declaration specifiers or ‘...’ before ‘FT_UInt’
/usr/include/X11/Xft/Xft.h:417: error: expected declaration specifiers or ‘...’ before ‘FT_UInt’
/usr/include/X11/Xft/Xft.h:426: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘XftCharIndex’
/usr/include/X11/Xft/Xft.h:459: error: expected ‘;’, ‘,’ or ‘)’ before ‘*’ token
make[1]: *** [wmii9menu.o] Error 1
make: *** [dall] Error 2</pre>
<p>Per <a href="http://qtopia.net/modules/newbb_plus/archive.php?forum=8&topic_id=43:">this
discussion</a>, I solved the problem by creating a symbolic link:</p>
<pre>$ sudo ln -s /usr/include/freetype2/freetype /usr/include/freetype</pre>
Scripting wmii column widths with Python
2009-04-12T23:05:12-07:00https://www.saltycrane.com/blog/2009/04/scripting-wmii-column-widths-python/<p>I mentioned in my previous post on
<a href="http://www.saltycrane.com/blog/2009/03/using-wmii-gnome/">
using wmii with Gnome</a> that I had written a script for resizing
the column widths in
<a href="http://wmii.suckless.org/">wmii</a>. This is the followup post.
Note, I am using the 20080520 snapshot of wmii. This doesn't work with wmii
3.6 (as Marco commented below).
</p>
<p>To incrementally change window sizes, I use the following in my
<code>~/.wmii-3.5/wmiirc</code> file:</p>
<pre> Key $MODKEY-y
# shrink horizontally
wmiir xwrite /tag/sel/ctl grow sel sel right -10
wmiir xwrite /tag/sel/ctl grow sel sel left -10
Key $MODKEY-u
# grow horizontally
wmiir xwrite /tag/sel/ctl grow sel sel right 10
wmiir xwrite /tag/sel/ctl grow sel sel left 10
Key $MODKEY-i
# shrink vertically
wmiir xwrite /tag/sel/ctl grow sel sel down -10
wmiir xwrite /tag/sel/ctl grow sel sel up -10
Key $MODKEY-o
# grow vertically
wmiir xwrite /tag/sel/ctl grow sel sel down 10
wmiir xwrite /tag/sel/ctl grow sel sel up 10
Key $MODKEY-Shift-y
# shrink horizontally
wmiir xwrite /tag/sel/ctl grow sel sel right -2
wmiir xwrite /tag/sel/ctl grow sel sel left -2
Key $MODKEY-Shift-u
# grow horizontally
wmiir xwrite /tag/sel/ctl grow sel sel right 2
wmiir xwrite /tag/sel/ctl grow sel sel left 2
Key $MODKEY-Shift-i
# shrink vertically
wmiir xwrite /tag/sel/ctl grow sel sel down -2
wmiir xwrite /tag/sel/ctl grow sel sel up -2
Key $MODKEY-Shift-o
# grow vertically
wmiir xwrite /tag/sel/ctl grow sel sel down 2
wmiir xwrite /tag/sel/ctl grow sel sel up 2</pre>
<p>In addition to incrementally changing column widths, I wanted to
be able to switch to predetermined column width ratios with a keyboard
shortcut. For example, I wanted to be able to set the column widths
at a 20/80 ratio, a 40/60 ratio, a 50/50 ratio, a 60/40 ratio, and so on.
So I hacked a Python script to do this. <del>It is pretty ugly because
I first grow the window by a set amount, measure the change in size,
then grow it again to the correct width. If anyone knows of a better
way to do this, please let me know.</del> I'm posting my solution here
in case anyone else wanted to do the same thing and got stuck.
<del><em>(Note, this script only works with two columns)</em></del>
<p><em>UPDATE 2009-12-21: I just learned from the
<a href="http://wmii.googlecode.com/hg/doc/wmii.pdf">new wmii documentation</a>
that I can specify a grow amount in pixels by suffixing it with "px".
This means I no longer have to perform the ugly, extra grow-then-measure
step in my script. I'm not sure if this is a newly added change or if it
is just newly documented. I am now using wmii 3.9b1. I have updated the
script below to use the new method. Also, the script now works with more
than two columns. I kept the old method for reference.</em></p>
</p>
<pre class="python">#!/usr/bin/env python
import os
import re
import sys
class Wmii:
"""
wmiir xwrite /tag/sel/ctl grow col row side increment
col: column number of the window to grow
row: row number of the window to grow
side: the side to grow. one of left, right, up, or down
increment: the number of pixels to grow. use a positive number to grow larger
and a negative number to grow smaller
"""
def set_column_widths(self, width_list):
"""Use the 'grow' command to set the column widths to those specified.
Widths are specified in percentages.
"""
total_width_perc = sum([float(width) for width in width_list])
for i, width_perc in enumerate(width_list[:-1]):
self.read_current_col_widths()
total_width_px = float(sum(self.curr_colwidths))
new_width_px = float(width_perc) / total_width_perc * total_width_px
grow_amount_px = int(round(new_width_px - self.curr_colwidths[i]))
self.xwrite("/tag/sel/ctl grow %d 1 right %dpx" % (i+1, grow_amount_px))
def read_current_col_widths(self):
"""'wmiir read /tag/sel/index' and set the attribute, self.curr_colwidths.
self.curr_colwidths is a list of the width (ints) (in pixels) of each
column in the view.
"""
lines = self.read("/tag/sel/index")
self.curr_colwidths = []
for line in lines:
match = re.search(r"# [^~]+ \d+ (\d+)", line)
if match:
self.curr_colwidths.append(int(match.group(1)))
print self.curr_colwidths
def xwrite(self, path_and_value):
"""Use the xwrite form."""
cmd = "wmiir xwrite %s" % path_and_value
print cmd
os.system(cmd)
def read(self, path):
"""Return a list of the lines returned by "wmii read path" """
return os.popen4("wmiir read " + path)[1].readlines()
if __name__ == "__main__":
w = Wmii()
w.set_column_widths(sys.argv[1:])</pre>
<b>Old method (for reference):</b>
<pre class="python" style="overflow: auto; height: 100px">#!/usr/bin/env python
import os
import re
import sys
class Wmii:
"""
wmiir xwrite /tag/sel/ctl grow col row side increment
col: column number of the window to grow
row: row number of the window to grow
side: the side to grow. one of left, right, up, or down
increment: the number of pixels to grow. use a positive number to grow larger
and a negative number to grow smaller
"""
def __init__(self):
pass
def set_column_widths(self, width0, width1):
"""Use the 'grow' command to set the column widths to those specified.
Widths are specified in percentages.
Currently only works with 2 columns.
"""
self.determine_pixels_per_grow_horiz()
new_width0 = sum(self.curr_colwidths) * (float(width0) /
(float(width0)+float(width1)))
grow_amount = int(round((new_width0-self.curr_colwidths[0]) /
self.pixels_per_grow_increment))
self.xwrite("/tag/sel/ctl grow 1 1 right %d" % grow_amount)
def determine_pixels_per_grow_horiz(self):
"""Try growing by an increment of 1 and record the number of pixels changed.
"""
self.read_current_col_widths()
prev_colwidth0 = self.curr_colwidths[0]
self.xwrite("/tag/sel/ctl grow 1 1 right 1")
self.read_current_col_widths()
self.pixels_per_grow_increment = self.curr_colwidths[0] - prev_colwidth0
def read_current_col_widths(self):
"""'wmiir read /tag/sel/index' and set the attribute, self.curr_colwidths.
self.curr_colwidths is a list of the width (ints) (in pixels) of each
column in the view.
"""
lines = self.read("/tag/sel/index")
self.curr_colwidths = []
for line in lines:
match = re.search(r"# [^~]+ \d+ (\d+)", line)
if match:
self.curr_colwidths.append(int(match.group(1)))
print self.curr_colwidths
def read_current_column_number(self):
"""'wmiir read /tag/sel/ctl' and set the attribute, self.curr_col."""
lines = self.read("/tag/sel/ctl")
self.curr_col = re.split(" ", lines[1])[1]
print "curr_col = %s" % self.curr_col
def xwrite(self, path_and_value):
"""Use the xwrite form."""
cmd = "wmiir xwrite %s" % path_and_value
print cmd
os.system(cmd)
def read(self, path):
"""Return a list of the lines returned by "wmii read path" """
return os.popen4("wmiir read " + path)[1].readlines()
if __name__ == "__main__":
w = Wmii()
w.set_column_widths(sys.argv[1], sys.argv[2])</pre>
<p>I named the script <code>wmii.py</code>, made it executable,
and put it on my path. Then I modified my <code>wmiirc</code>:</p>
<pre> Key $MODKEY-q
wmii.py 20 80
Key $MODKEY-w
wmii.py 40 60
Key $MODKEY-e
wmii.py 50 50
Key $MODKEY-r
wmii.py 60 40
Key $MODKEY-t
wmii.py 80 20</pre>
<p>Hope that's helpful to someone. Let me know if you've written some cool
python wmii scripts.</p>
Using wmii with Gnome
2009-03-19T11:15:17-07:00https://www.saltycrane.com/blog/2009/03/using-wmii-gnome/<style>
.super {
vertical-align: super;
font-size: 85%;
}
.fn {
font-size: 85%;
}
</style>
<p>
<a href="http://glyph.twistedmatrix.com/2009/01/you-got-your-windowmaker-in-my-peanut.html">
Thanks to Glyph</a>, I can now use
<a href="http://wmii.suckless.org/">wmii</a> as the
<a href="http://en.wikipedia.org/wiki/Window_manager">window manager</a> for
<a href="http://www.gnome.org/">Gnome</a>. I like wmii because it makes good use
of screen real estate, is keyboard-navigatable, is
scriptable<a class="super" name="tt1" href="#ss1">1</a>, and uses
minimal resources<a class="super" name="tt2" href="#ss2">2</a>.
</p>
<p>
It is possible to use
<a href="http://live.gnome.org/GnomePanel">gnome-panel</a> within wmii-- just press
<code><em>MOD+P gnome-panel RET</em></code>. And you can manually fine tune your
<code>.xinitrc</code> or <code>.xsession</code> by adding your required stuff
such as <code>gnome-power-manager</code> and <code>nm-applet</code>. (This is what
I had been doing (and may continue to do depending on how this full on Gnome thing
works out).)
</p>
<p>
If, for some strange reason (e.g.
you want to use an annoying<a class="super" name="tt3" href="#ss3">3</a>
<a href="http://www.adobe.com/products/air/">Adobe Air</a> application), you want
to use the full Gnome desktop with wmii, that is possible also. To do this,
start up Gnome and go to <em>System, Preferences, Sessions</em>. Uncheck
<em>Window Manager</em>, then click <em>Add</em> and fill in the path
to your wmii executable. Glyph also suggests running <code>gconf-editor</code>
and turning off <em>/apps/nautilus/preferences/show_desktop</em>. After logging
out and logging in, you should now have wmii as the window manager for Gnome.
</p>
<p>Note, I've only used this Gnome+wmii configuration about a day, so I'm not sure if
I will keep it or not. I have found
<a href="http://www.tweetdeck.com/">TweetDeck</a> will load up but has some disappearing
act problems. <a href="http://www.twitterlocal.net/">TwitterLocal</a> on the
other hand, seems to run fine.
</p>
<p><em>Update 2010-07-18:</em> I only used the full Gnome+wmii configuration for a couple days before going back to pure wmii. However, I am retrying this configuration with Ubuntu 10.04 Lucid again since I have a more powerful computer now and I need extra non-hacker type stuff to just work without trying to figure out which program provides it... So it looks like Ubuntu 10.04 no longer has the Sessions item in the Preferences menu. I tried using <code>gconf-editor</code> and changin <code>/desktop/gnome/session/required_components/windowmanager</code> from <code>gnome-wm</code> to the path to my wmii executable but that didn't work. If you know how to do it, let me know.
</p>
<hr>
<ol class="fn">
<li>
<a name="ss1"></a>Yes I have written one script for wmii. It allows me to change column widths
using the keyboard instead of the mouse. It's a bit of a hack, but maybe I will
make another post for that sometime. <em>Update 2009-04-12: <a href="/blog/2009/04/scripting-wmii-column-widths-python/">here is that post</a></em> <a href="#tt1">↩</a>
</li>
<li>
<a name"ss2"></a> Of course, using Gnome with wmii negates this advantage. When I bought my Dell
530N with 1GB of RAM, I had planned to purchase more RAM separately because it was
so much cheaper. I suppose I ought to do that sometime. Of course at work, my
computer had only half a gig of RAM and I was running out of memory continually.
<a href="#tt2">↩</a>
</li>
<li>
<a name="ss3"></a> I call Air annoying because it only works in Gnome or KDE (and to add another
alliterative adjective). Otherwise, I don't know much about it.
<a href="#tt3">↩</a>
</li>
</ol>
Install wmii snapshot
2008-07-29T14:24:21-07:00https://www.saltycrane.com/blog/2008/07/install-wmii-snapshot/<p>These are my notes for installing wmii snapshot in my
home directory on Ubuntu 8.04 Hardy.</p>
<ul>
<li>Download the latest snapshot (wmii+ixp-20080520) from the
<a href="http://www.suckless.org/wmii/">wmii homepage</a>
and save it to <code>~/incoming</code>.
</li>
<li>Untar the snapshot.
<pre>$ cd ~/incoming
$ tar -zxvf wmii+ixp-20080520.tgz</pre>
</li>
<li>Install prerequisites:
<pre>$ sudo apt-get install build-essential xorg-dev</pre>
<pre>$ sudo apt-get install dwm-tools</pre>
</li>
<li>Build: (I left the defaults for everything during make config except
for the path. I changed this to a temporary directory, <code>~/tmp/wmii</code>.)
<pre>$ cd ~/incoming/wmii+ixp-20080520
$ make config
$ make
$ make install</pre>
</li>
<li>Move bin, etc, lib, and share to a new wmii directory.
<pre>$ mkdir ~/lib/wmii
$ mv ~/tmp/wmii/* ~/lib/wmii</pre>
</li>
<li>Create links in my <code>~/bin</code> directory:
<pre>$ cd ~/bin
$ ln -s ../lib/wmii/bin/wihack wihack
$ ln -s ../lib/wmii/bin/wmii9rc wmii9rc
$ ln -s ../lib/wmii/bin/wmii9menu wmii9menu
$ ln -s ../lib/wmii/bin/wmii.rc wmii.rc
$ ln -s ../lib/wmii/bin/wmii.sh wmii.sh</pre>
</li>
<li>Create a .xinitrc script:
<pre>xmodmap ~/.Xmodmap
gnome-screensaver&
urxvt&
until wmii; do
true
done</pre>
</li>
<li>And link <code>~/.xsession</code> to it:
<pre>$ ln -s ~/.xinitrc ~/.xsession</pre>
</li>
<li>Log out of the current window manager and then select X client script
as the session and log in.</li>
</ul>
Install coLinux (and Ubuntu Hardy) on Win XP using Slirp to internet and TAP to host behind a corporate firewall/proxy server
2008-04-14T14:43:00-07:00https://www.saltycrane.com/blog/2008/04/install-colinux-and-ubuntu-gutsy-on-win/<p><a href="http://www.colinux.org">coLinux</a> allows you to run a full Linux
distribution, such as Ubuntu Hardy, on top of Windows at near native speeds.
It runs as a single Windows process with its own specially allocated
address space. The guest linux system can run from either a separate
disk partition or from a single file on your Windows filesystem.
</p>
<p>My initial impression of coLinux was so positive, I had planned to name this
post, <em>Goodbye Cygwin, hello coLinux</em>. After 2 months of using
coLinux, I still am using Cygwin a little bit. Despite being slow, (almost
unbearably slow with my company's mandatory Whole Disk Encryption), Cygwin
is good at integrating the GNU tools with Windows. Currently, I am still using
Cygwin to script my Windows-only project version control system and use the
Cygwin version of Mercurial for my personal version control. I'm not sure
if using the Linux version of Mercurial would work on Samba shares. The more
I learn about Linux and the less I depend on Windows applications, the less I
will need Cygwin.
(<em>Update: Mercurial 1.0 works great on Samba shares. The important thing
is to setup the owner of the share to be your user id and not root.
See <a href="#samba">samba config</a> below.</em>)</p>
<span id="fullpost">
</span><p>Besides that, coLinux is great. The best part for me was being able
to run the dynamic, tiling, scriptable, keyboard-driven
window manager, <a href="http://www.suckless.org/wiki/wmii">wmii</a>.
I access Windows files (and network drives) using <a href="http://www.samba.org">
Samba</a>. Shell commands, emacs, ssh are all there and are so fast.
GUI applications such as Firefox, OpenOffice and Gimp are available as well. However,
these are slow with the slirp networking setup. With a TAP connection between
coLinux and the host OS, these apps run well, however, I couldn't get the
TAP connection to work in conjuction with internet access so I settled for slirp
only. If I figure this out, I will update the post.
Here are my install notes.</p>
<p>Update 4/28/2008: I got my private TAP connection to the host working
along with a slirp connection for internet. This makes my X server connections
fast enough to run all my GUI apps like OpenOffice, <strike>evince</strike>
kpdf for pdf
files, and my web browser. See <a href="#networking2">this section</a>
for details.</p>
<br /><strong><a name="toc">Contents</a></strong><br />
<ul>
<li><a href="#install">Install coLinux</a></li>
<li><a href="#config">Configure CoLinux</a></li>
<li><a href="#run">Run CoLinux</a></li>
<li><a href="#networking">Configure networking with slirp only</a></li>
<li><a href="#networking2">Configure networking with slirp and TAP</a></li>
<li><a href="#update">Update your Ubuntu Dapper installation</a></li>
<li><a href="#xterm">Run an Xterm and other apps</a></li>
<li><a href="#expandroot">Expand the root file system image</a></li>
<li><a href="#hardy">Upgrade to Ubuntu Hardy</a></li>
<li><a href="#startup">Disable some startup services</a></li>
<li><a href="#setup">Configure Ubuntu</a></li>
<li><a href="#homefs">Create a home filesystem image</a></li>
<li><a href="#swap">Setup the swap file</a></li>
<li><a href="#samba">Mount Windows filesystem as Samba share</a></li>
<li><a href="#wmii">Set up wmii window manager</a></li>
</ul>
<br /><strong><a href="#toc" name="install">Install coLinux</a></strong><br />
<ol>
<li>Download the coLinux installer and the Ubuntu root file system image
<ul>
<li>Go to <a href="http://sourceforge.net/projects/colinux/files">http://sourceforge.net/projects/colinux/files</a></li>
<li>Under coLinux-stable, 0.7.2-linux-2.6.22, download coLinux-0.7.2.exe
</li>
<li>Under Root FS Images - 2.6.x-based, Ubuntu,
download Ubuntu-6.06.1.ext3.1gb.bz2</li>
</ul>
</li>
<li>Run the coLinux Windows installer
<ul>
<li>Accept defaults except for:</li>
<li>Destination Folder: change to c:\coLinux</li>
<li>You do not need to install WinPCap library.</li>
<li>You will get a warning dialog saying that "TAP-Win32 Adapter V8 (coLinux)"
has not passed Windows Logo testing. Click "Continue Anyway"</li>
</ul>
</li>
</ol>
<br /><strong><a href="#toc" name="config">Configure CoLinux</a></strong><br />
I already had Cygwin running so I did this stuff in a bash shell.
You can use Windows commands as well to do the same thing.
<ol>
<li>Copy <code>Ubuntu-6.06.1.ext3.1bg.bz2</code> to <code>c:\coLinux</code>.
(Keep a copy of this file as a backup to revert your Ubuntu filesystem
if you mess things up.)
</li>
<li>Decompress the Ubuntu file system image. (Note, this could take a minute or more depending on your system.)<br />
<code>$ cd /cygdrive/c/coLinux</code><br />
<code>$ bunzip2 Ubuntu-6.06.1.ext3.1gb.bz2</code>
</li>
<li>Create a swap file<br />
<code>$ dd if=/dev/zero of=swap_device bs=1M count=512</code><br />
<code>$ dd if=/dev/zero of=swap_device.2gb bs=1M count=2K</code><br />
(In Windows, you can use <code>fsutil file createnew swap_device 536870912
</code>)
</li>
<li>Create a configuration file<br />
<code>$ cp example.conf colinux.conf</code><br />
Edit colinux.conf and set the following:<br />
<pre>cobd0="c:\coLinux\Ubuntu-6.06.1.ext3.1gb"
cobd1="c:\coLinux\swap_device"
mem=512
eth0=slirp
eth1=tuntap # only needed for TAP connection</pre>
The following items should already be set by default:<br />
<pre>kernel=vmlinux
root=/dev/cobd0
ro
initrd=initrd.gz</pre>
</li>
</ol>
<br /><strong><a href="#toc" name="run">Run CoLinux</a></strong><br />
<ol>
<li>Open a Windows <code>cmd.exe</code> shell</li>
<li><code>cd c:\colinux</code></li>
<li><code>colinux-daemon.exe -t nt @colinux.conf</code><br />
(the -t nt is optional but makes it easier to copy/paste)</li>
<li>login as "root" with password "root"</li>
<li>Try commands such as <code>ls</code>, <code>pwd</code>, etc.</li>
<li>To exit, use the <code>halt</code> command.</li>
</ol>
<br /><strong><a href="#toc" name="networking">Configure networking with
slirp only</a></strong><br />
<ol>
<li>If you use a http proxy server to get to the internet, do the following
inside the running CoLinux session:<br />
<code>root@ubuntu:~# echo "export http_proxy='http://your-proxy-server.com:yourportnumber'" >> .bash_profile</code><br />
<code>root@ubuntu:~# source .bash_profile</code>
</li>
<li>Otherwise, there is nothing to do. The Ubuntu image already has the
correct /etc/network/interfaces and /etc/resolv.conf files setup.<br /><br />
/etc/network/interfaces should look like this:<br />
<pre># This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface (slirp)
auto eth0
iface eth0 inet static
address 10.0.2.15
broadcast 10.0.2.255
netmask 255.255.255.0
gateway 10.0.2.2
</pre>
</li>
<br />/etc/resolv.conf should look like this:<br />
<pre>nameserver 10.0.2.3</pre>
<li>To test internet access, use something like <code>wget</code> since <code>
ping</code> doesn't work with slirp.<br />
<code>root@ubuntu:~# wget www.google.com</code>
</li>
</ol>
<br /><strong><a href="#toc" name="networking2">Configure networking with
slirp to internet and TAP to host</a></strong><br />
In this configuration, I set up TAP to form a private connection to the
host and slirp to access the internet. If you want to use X applications,
this will make the response much better than with slirp only. I had to
play around with the IP addresses to find one that didn't conflict with
the static IP addresses on our network. I ended up choosing "10.0.3.16"
for the TAP colinux address and "10.0.3.17" for my Windows side.
<ol>
<li>TAP should be installed when you install coLinux</li>
<li>In Windows, go to "Start", "Control Panel", "Network Connections"</li>
<li>Find the "TAP-Win32 Adapter V8 (coLinux)" adapter. For me, it was named
"Local Area Connection 2". Right click on it and select "Properties".</li>
<li>On the "General" tab, scroll down and select "Internet Protocol (TCP/IP)".
Click on "Properties".</li>
<li>Select "Use the following IP address:". Enter in "10.0.3.17" for the
"IP address:" and "255.255.254.0" for the "Subnet mask:". Leave the rest
blank. Click "OK" twice to finish.</li>
<li>in coLinux, edit /etc/network/interfaces to look like the following:
<pre>auto lo
# Loopback interface
iface lo inet loopback
# Network interface for internet access (slirp)
auto eth0
iface eth0 inet static
address 10.0.2.15
broadcast 10.0.2.255
netmask 255.255.255.0
gateway 10.0.2.2
# Network interface for private connection to Host OS (tap-win32)
auto eth1
iface eth1 inet static
address 10.0.3.16
network 10.0.3.0
netmask 255.255.254.0
broadcast 10.0.3.255</pre>
</li>
<li>Make sure your "colinux.conf" file has the following lines:
<pre>eth0=slirp
eth1=tuntap</pre>
</li>
<li>You will need to set your DISPLAY variable to "10.0.3.17:0"<br />
<code>root@ubuntu:~# export DISPLAY=10.0.3.17:0</code>
</li>
</ol>
<br /><strong><a href="#toc" name="update">Update your Ubuntu Dapper installation</a></strong><br />
<ol>
<li><code>root@ubuntu:~# apt-get update</code><br />
You can ignore the following warning:
<pre>W: GPG error: http://security.ubuntu.com dapper-security Release: Could not exec
ute /usr/bin/gpgv to verify signature (is gnupg installed?)
W: GPG error: http://fr.archive.ubuntu.com dapper-updates Release: Could not exe
cute /usr/bin/gpgv to verify signature (is gnupg installed?)
W: GPG error: http://fr.archive.ubuntu.com dapper-backports Release: Could not e
xecute /usr/bin/gpgv to verify signature (is gnupg installed?)
W: GPG error: http://fr.archive.ubuntu.com dapper Release: Could not execute /us
r/bin/gpgv to verify signature (is gnupg installed?)
W: You may want to run apt-get update to correct these problems</pre>
</li>
<li><code>root@ubuntu:~# apt-get upgrade</code><br />
Answer yes to prompts.</li>
<li>That was easy.</li>
</ol>
<br /><strong><a href="#toc" name="xterm">Run an Xterm and other apps</a></strong><br />
<p><em>Warning, getting the X Window System working properly was one of the most
frustrating parts of the setup for me. The behavior seemed to be even
non-deterministic. This is what worked for me. You may need to consult other
sources to get it working for you. I am starting to read </em><em>X Power Tools</em>
to learn more about the X Window System and will update this section if I learn
anything new. I used Cygwin's X server because I already had Cygwin installed.
Another option is <a href="http://www.freedesktop.org/wiki/Xming">Xming</a>.</p>
<p>Update 5/6/2008: After switching to the Slirp+TAP networking configuration,
I've been getting errors when trying to start my X clients:
<pre style="height: 40px; overflow:auto">$ xeyes
No protocol specified
Error: Can't open display: 10.0.3.17:0
$ xterm
No protocol specified
xterm Xt error: Can't open display: 10.0.3.17:0
$ urxvt
No protocol specified
urxvt: can't open display 10.0.3.17:0, aborting.</pre>
To resolve this, I have been starting up a Cygwin bash shell, and running the
<code>xhost +</code> command to disable access control. This worked, but it
was annoying to do this all the time. I discovered that there is a <code>-ac</code>
command line option to <code>Xwin</code> which will do the same thing.
I've updated my batch file below to reflect this. Here is a list of all the
<code>Xwin</code> command line options:
<pre style="height: 50px; overflow:auto">use: X [:<display>] [option]
-a # mouse acceleration (pixels)
-ac disable access control restrictions
-audit int set audit trail level
-auth file select authorization file
bc enable bug compatibility
-br create root window with black background
+bs enable any backing store support
-bs disable any backing store support
-c turns off key-click
c # key-click volume (0-100)
-cc int default color visual class
-co file color database file
-core generate core dump on fatal error
-dpi int screen resolution in dots per inch
-deferglyphs [none|all|16] defer loading of [no|all|16-bit] glyphs
-f # bell base (0-100)
-fc string cursor font
-fn string default font name
-fp string default font path
-help prints message with these options
-I ignore all remaining arguments
-ld int limit data space to N Kb
-lf int limit number of open files to N
-ls int limit stack space to N Kb
-logo enable logo in screen saver
nologo disable logo in screen saver
-nolisten string don't listen on protocol
-noreset don't reset after last client exists
-reset reset after last client exists
-p # screen-saver pattern duration (minutes)
-pn accept failure to listen on all ports
-nopn reject failure to listen on all ports
-r turns off auto-repeat
r turns on auto-repeat
-render [default|mono|gray|color] set render color alloc policy
-s # screen-saver timeout (minutes)
-sp file security policy file
-su disable any save under support
-t # mouse threshold (pixels)
-terminate terminate at server reset
-to # connection time out
-tst disable testing extensions
ttyxx server started from init on /dev/ttyxx
v video blanking for screen-saver
-v screen-saver without video blanking
-wm WhenMapped default backing-store
-x string loads named extension at init time
-maxbigreqsize set maximal bigrequest size
+extension name Enable extension
-extension name Disable extension
-query host-name contact named host for XDMCP
-broadcast broadcast for XDMCP
-indirect host-name contact named host for indirect XDMCP
-port port-num UDP port number to send messages to
-from local-address specify the local address to connect from
-once Terminate server after one session
-class display-class specify display class to send in manage
-cookie xdm-auth-bits specify the magic cookie for XDMCP
-displayID display-id manufacturer display ID for request
The X Keyboard Extension adds the following arguments:
-kb disable the X Keyboard Extension
+kb enable the X Keyboard Extension
[+-]accessx [ timeout [ timeout_mask [ feedback [ options_mask] ] ] ]
enable/disable accessx key sequences
-ar1 set XKB autorepeat delay
-ar2 set XKB autorepeat interval
-noloadxkb don't load XKB keymap description
-xkbdb file that contains default XKB keymaps
-xkbmap XKB keyboard description to load on startup
-depth bits_per_pixel
Specify an optional bitdepth to use in fullscreen mode
with a DirectDraw engine.
-emulate3buttons [timeout]
Emulate 3 button mouse with an optional timeout in
milliseconds.
-engine engine_type_id
Override the server's automatically selected engine type:
1 - Shadow GDI
2 - Shadow DirectDraw
4 - Shadow DirectDraw4 Non-Locking
-fullscreen
Run the server in fullscreen mode.
-refresh rate_in_Hz
Specify an optional refresh rate to use in fullscreen mode
with a DirectDraw engine.
-screen scr_num [width height [x y] | [[WxH[+X+Y]][@m]] ]
Enable screen scr_num and optionally specify a width and
height and initial position for that screen. Additionally
a monitor number can be specified to start the server on,
at which point, all coordinates become relative to that
monitor (Not for Windows NT4 and 95). Examples:
-screen 0 800x600+100+100@2 ; 2nd monitor offset 100,100 size 800x600
-screen 0 1024x768@3 ; 3rd monitor size 1024x768
-screen 0 @1 ; on 1st monitor using its full resolution (the default)
-lesspointer
Hide the windows mouse pointer when it is over an inactive
Cygwin/X window. This prevents ghost cursors appearing where
the Windows cursor is drawn overtop of the X cursor
-nodecoration
Do not draw a window border, title bar, etc. Windowed
mode only.
-mwextwm
Run the server in multi-window external window manager mode.
-internalwm
Run the internal window manager.
-rootless
Run the server in rootless mode.
-multiwindow
Run the server in multi-window mode.
-multiplemonitors
EXPERIMENTAL: Use the entire virtual screen if multiple
monitors are present.
-clipboard
Run the clipboard integration module.
Do not use at the same time as 'xwinclip'.
-nounicodeclipboard
Do not use Unicode clipboard even if NT-based platform.
-scrollbars
In windowed mode, allow screens bigger than the Windows desktop.
Moreover, if the window has decorations, one can now resize
it.
-[no]trayicon
Do not create a tray icon. Default is to create one
icon per screen. You can globally disable tray icons with
-notrayicon, then enable it for specific screens with
-trayicon for those screens.
-clipupdates num_boxes
Use a clipping region to constrain shadow update blits to
the updated region when num_boxes, or more, are in the
updated region. Currently supported only by `-engine 1'.
-[no]unixkill
Ctrl+Alt+Backspace exits the X Server.
-[no]winkill
Alt+F4 exits the X Server.
-xkbrules XKBRules
Equivalent to XKBRules in XF86Config files.
-xkbmodel XKBModel
Equivalent to XKBModel in XF86Config files.
-xkblayout XKBLayout
Equivalent to XKBLayout in XF86Config files.
For example: -xkblayout de
-xkbvariant XKBVariant
Equivalent to XKBVariant in XF86Config files.
For example: -xkbvariant nodeadkeys
-xkboptions XKBOptions
Equivalent to XKBOptions in XF86Config files.
-logfile filename
Write logmessages to <filename> instead of /tmp/Xwin.log.
-logverbose verbosity
Set the verbosity of logmessages. [NOTE: Only a few messages
respect the settings yet]
0 - only print fatal error.
1 - print additional configuration information.
2 - print additional runtime information [default].
3 - print debugging and tracing information.
-[no]keyhook
Grab special windows key combinations like Alt-Tab or the Menu key.
These keys are discarded by default.
-swcursor
Disable the usage of the windows cursor and use the X11 software cursor instead</filename></display></pre>
You can view this list by typing <code>Xwin --help</code> in a Cygwin bash
shell.
Also, in the process, I tried the Xming X server. However, I couldn't get it
to work with wmii, so I decided to stick with Cygwin's X server.</p>
<ol>
<li>Edit your startxwin.bat file (located in "C:\cygwin\usr\X11R6\bin")
so that it starts X in rootless mode, with clipboard support, disables
access control, and doesn't run anything else.
Run the new bat file.<br />
<pre>@echo off
SET DISPLAY=127.0.0.1:0.0
SET CYGWIN_ROOT=\cygwin
SET RUN=%CYGWIN_ROOT%\bin\run -p /usr/X11R6/bin
SET PATH=.;%CYGWIN_ROOT%\bin;%CYGWIN_ROOT%\usr\X11R6\bin;%PATH%
SET XAPPLRESDIR=/usr/X11R6/lib/X11/app-defaults
SET XCMSDB=/usr/X11R6/lib/X11/Xcms.txt
SET XKEYSYMDB=/usr/X11R6/lib/X11/XKeysymDB
SET XNLSPATH=/usr/X11R6/lib/X11/locale
if not exist %CYGWIN_ROOT%\tmp\.X11-unix\X0 goto CLEANUP-FINISH
attrib -s %CYGWIN_ROOT%\tmp\.X11-unix\X0
del %CYGWIN_ROOT%\tmp\.X11-unix\X0
:CLEANUP-FINISH
if exist %CYGWIN_ROOT%\tmp\.X11-unix rmdir %CYGWIN_ROOT%\tmp\.X11-unix
%RUN% XWin -clipboard -silent-dup-error -rootless -ac</pre>
</li>
<li>If you are using Slirp-only networking:
<ul>
<li>Obtain your Windows host IP address by opening a cmd.exe shell and
running <code>ipconfig</code>
</li>
<li>In coLinux, set your DISPLAY variable to this IP address:<br />
<code>root@ubuntu:~# export DISPLAY=xxx.xxx.xxx.xxx:0.0</code><br />
where <code>xxx.xxx.xxx.xxx</code> is your IP address. Don't forget
the <code>:0.0</code> at the end.<br />
</li>
</ul>
</li>
<li>If you are using TAP plus Slirp configuration described above,
set your DISPLAY variable to "10.0.3.17:0"<br />
<code>root@ubuntu:~# export DISPLAY=10.0.3.17:0</code>
</li>
<li><code>root@ubuntu:~# apt-get install xterm</code><br />
Answer yes to prompts.
</li>
<li><code>root@ubuntu:~# xterm&</code><br />
Xterm comes up!
</li>
<li>You can now install and run other high level apps like firefox or emacs</li>
</ol>
<br /><strong><a href="#toc" name="expandroot">Expand the root file system image</a></strong><br />
You will need to expand the size your root filesystem image to
hold the larger Ubuntu installation. I expanded it to 4GB for Xubuntu Hardy
and am currently using about 87% of that. You might want to expand it to 5GB
or more especially if you will be installing a lot of apps. See
<a href="http://colinux.wikia.com/wiki/ExpandingRoot">
http://colinux.wikia.com/wiki/ExpandingRoot</a> for more information.
Note, Google's calculator function
can be useful for calculating block sizes. (e.g. entering in <code>4GB / 16KB</code>
into the Google search box returns: <em>(4 gigabytes) / (16 kilobytes) = 262 144</em>)
<ol>
<li>If you have coLinux running, shut it down, with <code>halt</code></li>
<li>In a Cygwin bash shell, make a copy of your current image.<br />
<code>$ cp Ubuntu-6.06.1.ext3.1gb Ubuntu-6.06.1.ext3.4gb</code><br />
This may take a while.
</li>
<li>Expand the new file:<br />
<code>$ dd bs=16384 if=/dev/zero of=Ubuntu-6.06.1.ext3.4gb seek=65536 count=262144</code><br /><br />
bs=16384 sets the blocksize to 16KB<br />
seek=65536 skips the first 65536 blocks (1GB/16KB = 65536)<br />
count=262144 adds 262144 blocks to the image (4GB/16KB = 262144)<br /><br />
This may take a while also. It should display the following when complete:
<pre>262144+0 records in
262144+0 records out
4294967296 bytes (4.3 GB) copied, 154.362 s, 27.8 MB/s</pre>
</li>
<li>Change your colinux.conf file to use the new file system image:<br />
<pre>cobd0="c:\coLinux\Ubuntu-6.06.1.ext3.4gb"</pre>
</li>
<li>Switch back to the cmd.exe console, and start coLinux again<br />
</li>
<li><code>root@ubuntu:~# apt-get install ext2resize</code></li>
<li><code>root@ubuntu:~# ext2online /dev/cobd0</code></li>
<li>Look at your available space:<br />
<code>root@ubuntu:~# df</code>
<pre>Filesystem 1K-blocks Used Available Use% Mounted on
/dev/cobd0 4128448 411148 3507624 11% /
varrun 128096 36 128060 1% /var/run
varlock 128096 0 128096 0% /var/lock
devshm 128096 0 128096 0% /dev/shm</pre>
</li>
<li>Note, you may want to make a backup copy of your new expanded root file
system image at this point in case things get hosed up later on. Be sure
to <code>halt</code> coLinux first. Note, this will take even longer than
the 1gb filesystem copy.
</li>
</ol>
<br /><strong><a href="#toc" name="hardy">Upgrade to Ubuntu Hardy</a></strong><br />
Update 4/28/2008: When I first installed coLinux, Ubuntu Gutsy was the latest
release. Because there was no direct upgrade path from Ubuntu 6.06 Dapper to
Ubuntu 7.10 Gutsy, I had to incrementally upgrade from Dapper to Edgy, Edgy to
Feisty, and Feisty to Gutsy. Later, when Hardy came out, I upgraded from
Gutsy to Hardy. If you are upgrading to Dapper to Hardy for the first time,
you can use the incremental method, or the direct method. Ubuntu supports
a direct upgrade from 6.06 Dapper Drake to 8.04 Hardy Heron because both are
Long Term Support (LTS) releases. See the
<a href="https://help.ubuntu.com/community/HardyUpgrades">Ubuntu upgrade
documentation</a> for more information. Note, I did not test the direct
upgrade method.
<ol>
<li>In coLinux:<br />
<code>root@ubuntu:~# apt-get update</code></li>
<li><code>root@ubuntu:~# apt-get install ubuntu-minimal</code></li>
<li><code>root@ubuntu:~# apt-get install ubuntu-standard</code></li>
<li><code>root@ubuntu:~# apt-get install xubuntu-desktop</code></li>
<li>Edit your sources.list file and change "dapper" to "edgy"<br />
<code>root@ubuntu:~# nano /etc/apt/sources.list</code><br />
</li>
<li><code>root@ubuntu:~# apt-get update</code></li>
<li><code>root@ubuntu:~# apt-get upgrade</code></li>
<li><code>root@ubuntu:~# apt-get dist-upgrade</code></li>
<li>Change "edgy" to "feisty" in /etc/apt/sources.list and repeat steps 6-8.</li>
<li>Change "feisty" to "gutsy" in /etc/apt/sources.list and repeat steps 6-8.</li>
<li>Change "gutsy" to "hardy" in /etc/apt/sources.list and repeat steps 6-8.</li>
<li>Remove unneeded packages:<br />
<code>root@ubuntu:~# apt-get autoremove</code>
</li>
</ol>
<br /><strong><a href="#toc" name="startup">Disable some startup services</a></strong><br />
This is optional but may give you fewer warnings. In coLinux, go to the
/etc/rc2.d directory and follow the instructions in the README file for disabling
services. Here are some suggested services to disable:
<ul>
<li>acpid, acpi-support, apmd: used for power management</li>
<li>bluetooth: used for bluetooth</li>
<li>hotkey-setup: used to configure laptop hotkeys</li>
<li>pcmciautils: tools for PCMCIA cards (PC cards)</li>
<li>powernowd: controls CPU speed and voltage using the sysfs interface</li>
<li>vbesave: used to save the video card state</li>
</ul>
<br /><strong><a href="#toc" name="setup">Configure Ubuntu</a></strong><br />
<ol>
<li>Don't start gdm (the display manager which starts the X server)<br />
<code>root@ubuntu:~# mv /etc/rc2.d/S13gdm /etc/rc2.d/K87gdm</code></li>
<li>Set the timezone<br />
Start your Cygwin X server if it is not already running.<br />
<code>root@ubuntu:~# time-admin &</code><br />
Set your timezone.
</li>
<li>Set the root password<br />
<code>root@ubuntu:~# passwd</code>
</li>
<li>Set local machine name:<br />
<code>root@ubuntu:~# nano /etc/hostname</code><br />
<code>root@ubuntu:~# nano /etc/hosts</code><br />
</li>
<li>Create a user account<br />
<code>root@ubuntu:~# adduser sofeng</code><br />
Note, adduser is a higher level command than useradd. adduser will set up
a group and home directory.
</li>
<li>Set permissions on /dev/tty* (Note: not sure if this is needed)<br />
<code>root@ubuntu:~# chgrp tty /dev/tty*</code><br />
Edit /etc/group to have the following line:<br />
<pre>tty:x:5:sofeng</pre>
</li>
<li>Make a pty device<br />
<code>root@ubuntu:~# cd /dev</code><br />
<code>root@ubuntu:~# MAKEDEV pty</code><br />
</li>
<li>Add environment variables to .bash_profile<br />
Use the <code>printenv</code> command to list your environment variables.
</li>
</ol>
<br /><strong><a href="#toc" name="homefs">Create a home filesystem image</a></strong><br />
<ol>
<li>Create a 10GB blank file. In Cygwin,<br />
<pre>$ dd if=/dev/zero of=home-fs-image.10gb bs=1M count=10K</pre>
</li>
<li>Add the following to your c:\coLinux\colinux.conf file:<br />
<pre>cobd2="c:\coLinux\home-fs-image.10gb"</pre>
</li>
<li>Restart coLinux, then do the following:<br />
Create an ext2 file system on the new disk image<br />
<pre>root@ubuntu:~# mke2fs -F /dev/cobd2</pre>
Turn this into an ext3 filesystem<br />
<pre>root@ubuntu:~# tune2fs -i 0 -j /dev/cobd4</pre>
</li>
<li>Mount the new filesystem to /home<br />
<pre>root@ubuntu:~# mv /home /home_backup
root@ubuntu:~# mkdir /home
root@ubuntu:~# mount /dev/cobd2 /home</pre>
Check it worked:<br />
<pre>root@ubuntu:~# df</pre>
</li>
<li>To mount the filesystem automatically at startup, add the following line
to your /etc/fstab:<br />
<pre>/dev/cobd2 /home ext3 defaults 0 0</pre>
</li>
</ol>
<br /><strong><a href="#toc" name="swap">Setup the swap file</a></strong><br />
<ol>
<li>Add the following to /etc/fstab:<br />
<pre>/dev/cobd1 swap swap defaults 0 0</pre>
</li>
<li>Initialize the swap partition<br />
<pre>root@ubuntu:~# sudo mkswap /dev/cobd1</pre>
</li>
<li>make use of swap now, without rebooting system:<br />
<pre>root@ubuntu:~# swapon -a</pre>
</li>
<li>Check that swap total is non-zero:<br />
<pre>root@ubuntu:~# free</pre>
</li>
</ol>
<br /><strong><a href="#toc" name="samba">Mount Windows filesystem as Samba share</a></strong>
<ol>
<li>Setup Windows networking:<br />
<ul>
<li>In Windows Explorer, right click on your C: drive and select "Properties"</li>
<li>Click on the "Sharing" tab</li>
<li>Select "Share this folder". Set the "Share name:" to "E$". Setup "Permissions" as
necessary.</li>
</ul>
</li>
<li>create the location for your samba share:<br />
<code>$ sudo mkdir -p /mnt/cdrive</code>
</li>
<li>add the following to /etc/fstab:<br />
<pre>//yourcomputer.example.com/E$ /mnt/cdrive smbfs auto,user,rw,dir_mode=0777,file_mode=0777,uid=sofeng,gid=sofeng,credentials=/etc/smb-credentials 0 0</pre>
<code>/mnt/cdrive</code> is the mount point<br />
<code>smbfs</code> means it is a samba filesystem type<br />
<code>auto</code> means it will be mounted at startup<br />
<code>user</code> means any user can mount it<br />
<code>rw</code> means it will be readable and writable<br />
<code>file_mode=0777</code> specifies that files will be readable, writable, and executable by everyone (this replaces the deprecated fmask)<br />
<code>dir_mode=0777</code> specifies that directories will be readable, writable, and executable by everyone (this replaces the deprecated dmask)<br />
<code>uid=sofeng</code> means the owner is sofeng<br />
<code>gid=sofeng</code> means the group is sofeng<br />
<code>credentials=/etc/smb-credentials</code> specifies the file that contains the user name and password<br />
</li>
<li>create /etc/smb-credentials<br />
<pre>username=yourdomain\yourusername
password=yourpassword</pre>
<code>$ sudo chmod 600 /etc/smb-credentails</code>
</li>
<li>Mount the drive:<br />
<code>$ sudo mount /mnt/cdrive</code>
</li>
</ol>
<br /><strong><a href="#toc" name="wmii">Set up wmii window manager</a></strong><br />
<ol>
<li>Install wmii window manager<br />
<code>apt-get install wmii</code>
</li>
<li>I use emacs so the following steps are used to change the mod key.</li>
<li>Download <a href="http://webpages.charter.net/krumsick/">KeyTweak</a> for
Windows and remap your "Left Windows" key to "Context Menu".</li>
<li>Use xmodmap to setup the "Menu" key to be "mod4". For my keyboard, my
<code>~/.Xmodmap</code> file looks like this:<br />
<pre>clear mod4
keycode 115 =
keycode 127 =
keycode 117 = Super_L
add mod4 = Super_L</pre>
Then run xmodmap in one of your startup scripts (.xinitrc, .bash_profile, etc.)<br />
<pre>xmodmap ~/.Xmodmap</pre>
</li>
</ol>
My software tools list
2007-08-10T13:32:00-07:00https://www.saltycrane.com/blog/2007/08/current-configuration/<style type="text/css">
td {
vertical-align: top;
}
</style>
<p>Inspired by Mark Pilgrim's
<a href="http://web.archive.org/web/20101214224709/http://diveintomark.org/archives/2006/06/26/essentials-2006">
2006 Essentials list</a>,
below is a list of my current software tools. If you notice a lot of
"I switched from ..." statements, keep in mind that I am a
<a href="http://undefined.com/ia/2006/10/10/the-fourteen-types-of-programmers-type-2-those-that-like-shiny-things/">
programmer who likes shiny things</a>.
</p>
<h4 id="other-lists">Other lists</h4>
<ul>
<li><a href="http://web.archive.org/web/20101214234142/http://diveintomark.org/archives/2008/10/28/essentials-2008">
Mark Pilgrim's Essentials, 2008 edition</a>
</li>
<li><a href="http://web.archive.org/web/20081226033542/http://adam.gomaa.us/blog/essentials-cop-out/">
Adam Gomaa's Essentials (2008)</a>
</li>
<li>Here is a <a href="http://mark.pilgrim.usesthis.com/">2010 update
for Mark Pilgrim</a>. After 2 and a half years, I still have several items
in common: <a href="#operating-system">Ubuntu</a> running <a href="#terminal">rxvt-unicode</a>
and <a href="#editor">Emacs 23</a>, the <a href="#keyboard">Unicomp keyboard</a>,
an <a href="#mobile-phone">Android phone</a>, <a href="#email">Gmail</a>,
Google Reader, Google Docs, and Pandora.
</li>
<li><a href="http://salvatore.sanfilippo.usesthis.com/">Salvatore Sanfilippo on usesthis.com (2011)</a></li>
<li><a href="http://aaron.boodman.usesthis.com/">Aaron Boodman on usesthis.com (2011)</a></li>
</ul>
<h4 id="contents">Contents</h4>
<table>
<tr>
<td>
<ul>
<li><a href="#operating-system">Operating System</a>: Ubuntu</li>
<li><a href="#window-manager">Window Manager</a>: Qtile</li>
<li><a href="#editor">Editor</a>: Emacs</li>
<li><a href="#terminal">Terminal</a>: urxvt + screen</li>
<li><a href="#vcs">Version Control System</a>: Git</li>
<li><a href="#high-high-level-language">"High-high-level" Language</a>: Python</li>
<li><a href="#web-framework">Web Framework</a>: Django/Flask</li>
</ul>
</td>
<td>
<ul>
<li><a href="#web-browser">Web Browser</a>: Firefox</li>
<li><a href="#email">Email</a>: Gmail</li>
<li><a href="#graphical-diff">Graphical Diff</a>: KDiff3</li>
<li><a href="#keyboard">Keyboard</a>: Leopold Tenkeyless (MX Browns)</li>
<li><a href="#office-chair">Office Chair</a>: Undecided</li>
<li><a href="#mobile-phone">Mobile Phone</a>: Motorola Droid 4</li>
</ul>
</td>
</tr>
</table>
<h4 id="my-list">My software tools list</h4>
<table style="font-size:100%">
<tr>
<td ><b>Category</b></td>
<td ><b>Currently using</b></td>
<td ><b>Comments</b></td>
</tr>
<tr>
<td id="operating-system" ><p>Operating System</p>
<a href="#operating-system" title="Section permalink" class="sectionlink">¶</a></td>
<td ><p><a href="http://www.ubuntu.com">Ubuntu</a> 14.04 Trusty Tahr</p>
</td>
<td >
<p>My first
Ubuntu install was in 2007 (dual-boot) and I got my first Windows-free machine
in 2008. I have used Cygwin
and coLinux when on Windows. Cygwin integrates better with Windows applications,
but coLinux is super fast and allows you to run a full Linux distro on top of
Windows. Windows does have some advantages, but overall I prefer Linux.</p>
<p><em>Update 2008-09</em>: Switching jobs means I can now use Linux at work.
I'm now using Linux about 90% of the time. My wife still uses Windows Vista on our laptop.</p>
<p>I don't have enough experience
with OSX to draw any authoritative conclusions, though I think
<a href="http://en.wikipedia.org/wiki/Mark_Pilgrim">Mark Pilgrim</a>
has <a href="http://diveintomark.org/archives/2006/06/02/when-the-bough-breaks">
biased me against Apple</a>. Also, I think Linux's
<a href="http://c2.com/cgi/wiki?FreeAsInBeer">free as in beer</a> (and somewhat
related free as in speech) characteristics
vs. Mac's expensive (and somewhat related proprietary) characteristics
resonate with the cheap engineer in me.</p>
<p>Additional Linux vs. Mac commentary:</p>
<ul>
<li>
<a href="http://en.wikipedia.org/wiki/Jamie_Zawinski">JWZ</a> 2000:
<a href="http://www.jwz.org/doc/linux.html">Unix/linux sucks less, but it still sucks.</a>
</li>
<li>
JWZ <a href="http://jwz.livejournal.com/494040.html">2005</a>,
<a href="http://jwz.livejournal.com/780264.html">2007</a>: Linux sucks more.
</li>
<li>
<a href="http://en.wikipedia.org/wiki/Paul_Graham">Paul Graham</a> 2005:
<a href="http://www.paulgraham.com/mac.html">Return of the Mac.</a>
</li>
<li>
Mark Pilgrim 2006: <a href="http://diveintomark.org/archives/2006/05/30/bye-apple">
Bye, Apple</a>
</li>
<li>
<a href="http://en.wikipedia.org/wiki/Cory_Doctorow">Cory Doctorow</a> 2006:
<a href="http://www.boingboing.net/2006/06/29/mark-pilgrims-list-o.html">
Me too</a>.
</li>
<li>
<a href="http://en.wikipedia.org/wiki/Tim_Bray">Tim Bray</a> 2006:
<a href="http://www.tbray.org/ongoing/When/200x/2006/06/15/Switch-From-Mac">Me too</a>,
<a href="http://www.tbray.org/ongoing/When/200x/2006/08/16/Back-to-the-Mac">Back to the Mac</a>
</li>
<li>
Steve Yegge 2008:
<a href="http://steve-yegge.blogspot.com/2008/04/settling-osx-focus-follows-mouse-debate.html">
Switching to OSX for the fonts</a>
</li>
<li>
Of course, <a href="http://en.wikipedia.org/wiki/Linus_Torvalds">Linus Torvalds</a>
<a href="http://www.smh.com.au/news/technology/q-and-a-with-linus-torvalds/2008/02/05/1202090403120.html?page=2">
"prefers" Linux</a> (2008)
</li>
<li><a href="http://en.wikipedia.org/wiki/Donald_Knuth">Donald Knuth</a>,
author of <em>The Art of Computer Programming</em>,
<a href="http://www.informit.com/articles/printerfriendly.aspx?p=1193856">
uses Ubuntu Linux for work, and Macs for play</a> (2008).
</li>
<li>Salvatore Sanfilippo (author of <a href="http://code.google.com/p/redis/">Redis</a>)
chooses to use
a Mac so he can <em>"focus on what <he's> doing without spending hours trying to
fix unrelated desktop stuff"</em> but says Linux is
<a href="http://antirez.com/post/linux-better-for-coding.html">
<em>"still better for coding"</em></a> (2009).
</li>
<li>Ted Dziuba: <a href="http://harmful.cat-v.org/software/operating-systems/osx/osx-unsuitable-web-development">
<em>MacOS X is an Unsuitable Platform for Web Development</em>
</a> (2011)</li>
<li>Bozhidar Batsov: <a href="http://batsov.com/Linux/Windows/Rant/2011/06/11/linux-desktop-experience-killing-linux-on-the-desktop.html">
<em>The Linux desktop experience is killing Linux on the desktop</em>
</a> (2011)</li>
</ul>
<p>History: 1987: <a href="http://en.wikipedia.org/wiki/Apple_IIGS">Apple GS/OS</a>,
1994: <a href="http://en.wikipedia.org/wiki/Windows_3.1x">Windows 3.1</a>,
2000: <a href="http://en.wikipedia.org/wiki/Windows_98">Windows 98</a>,
2001: <a href="http://en.wikipedia.org/wiki/Windows_XP">Windows XP</a>,
2007: <a href="http://en.wikipedia.org/wiki/Windows_Vista">Windows Vista</a>,
2007: <a href="http://en.wikipedia.org/wiki/Ubuntu_%28operating_system%29">Ubuntu</a>
</p>
</td>
</tr>
<tr>
<td id="window-manager"><p>Window Manager</p>
<a href="#window-manager" title="Section permalink" class="sectionlink">¶</a></td>
<td ><p><a href="http://www.qtile.org/">Qtile</a></p></td>
<td >
<p>The WM written in Python,
<a href="http://panela.blog-city.com/fun_of_tiling_window_managers.htm">
recommended by Matt Harrison</a>.
</p>
<p>Previously, wmii: dynamic, tiling, scriptable window manager that doesn't
require a mouse. It sucks less.</p>
<p>I switched from <a href="http://www.nongnu.org/ratpoison/">ratpoison</a>
at the same time I started using coLinux because running native Linux
allowed me to use any Linux window manager as well.</p>
<p>Recently, some have switched from wmii to
<a href="http://xmonad.org/">xmonad</a>, the new
<a href="http://www.haskell.org/">Haskell</a> tiling window manager.
It has some nice features over wmii, including dual head support, but after
a brief excursion, I slightly prefer wmii's way of doing things.</p>
<p>If you're a hard core Lisper,
<a href="http://www.nongnu.org/stumpwm/">stumpwm</a> is the window manager
for you. It has a <a href="http://en.wikipedia.org/wiki/REPL">REPL</a>. This one
seems a little too hard core for me, especially since I don't know Lisp.</p>
<p>History: 2007: ratpoison, 2007: wmii, 2012: Qtile</p>
</td>
</tr>
<tr>
<td id="editor"><p>Editor/IDE</p>
<a href="#editor" title="Section permalink" class="sectionlink">¶</a></td>
<td><p><a href="http://www.gnu.org/software/emacs">GNU Emacs</a> 24.3</p></td>
<td >
<p>Switched from Eclipse in 2007. It was a slow transition, but
I think Emacs is worth the investment.</p>
<p><b>On Emacs vs. Vim:</b> I really like that Vim can be used easily on remote
machines. Currently, I use TRAMP for remote file editing. It is very cool,
but it is slow, and I sometimes fall back on nano (*gasp*) for a quick
config file edit when I am logged into a remote terminal. I also suspect
that the dual modes of Vim are more efficient than Emacs-- I'm just not
smart enough to get used to it. Maybe someday I will switch to
<a href="http://www.gnu.org/software/emacs/manual/html_node/viper/index.html#Top">Viper
mode</a>. Why Emacs over Vim? I choose Emacs because it is more powerful
and closer to an IDE. Emacs Lisp allows you to do whatever you want.
</p>
<p><b>On Emacs vs. Eclipse:</b> I found Eclipse was too slow and heavy, used too
much screen real estate, and was too difficult to customize. Scripting
Eclipse required writing extensions in Java whereas Emacs can be extended
in elegant Lisp. I think Eclipse (and other IDE's) are better for code
exploration and they probably have features that I'm not aware of since
I don't use them. I figure, though, that with enough Emacs Lisp, Emacs
can do anything those IDEs can do. If you really want those features,
it's a question of if you want to spend the time achieving perfection
in Emacs or getting real work done in another IDE. I choose perfection. ;)
</p>
<p>Additional commentary:</p>
<ul>
<li><a href="http://blog.ianbicking.org/the-vs-emacs.html">
THE vs. Emacs</a>, Ian Bicking (2005)</li>
<li><a href="http://steve.yegge.googlepages.com/effective-emacs">
Effective Emacs</a>, Steve Yegge (2005)</li>
<li><a href="http://blog.ianbicking.org/other-editors.html">
Other Editors?</a>, Ian Bicking (2005)</li>
<li><a href="http://glyph.twistedmatrix.com/2008/04/structured-python-editor.html">
Structured Python Editor</a>, Glyph Lefkowitz (2008)</li>
<li><a href="http://chalain.livejournal.com/74234.html">
Editor Wars: Revenge of the... oh, whatever.</a>, Chalain (2008)</li>
<li><a href="http://metajack.im/2008/09/05/what-you-can-learn-from-emacs/">
What You Can Learn From Emacs</a>, Jack Moffitt (2008)</li>
<li><a href="http://glyph.twistedmatrix.com/2008/12/emacs-test.html">
The Emacs Test</a>, Glyph Lefkowitz (2008)</li>
<li><a href="http://www.redreddesign.com/blog/emacs-extensions-i-cant-live-without/">
emacs extensions i can’t live without</a> (2009)</li>
</ul>
<p>Screencasts:</p>
<ul>
<li><a href="http://platypope.org/yada/emacs-demo/">I need a cool European accent</a></li>
<li><a href="http://www.vimeo.com/1013263">What You Can Learn From ido.el</a></li>
<li><a href="http://www.youtube.com/watch?v=76Ygeg9miao#t=01m47s">YASnippet demo</a></li>
</ul>
<p>Install method:
<del><a href="http://www.saltycrane.com/blog/2008/10/installing-emacs-23-cvs-ubuntu-hardy/">
from source</a></del>
<code>sudo apt-get install emacs</code>
</p>
<p>Useful packages:</p>
<ul>
<li><a href="http://www.gnu.org/software/tramp/">
Tramp</a>: transparent remote file access</li>
<li><a href="http://www.emacswiki.org/emacs/InteractivelyDoThings">
ido</a>: Buffer switching and more</li>
<li><a href="http://orgmode.org/">Org-Mode</a>: note taking, task lists</li>
<li><a href="http://github.com/yoshiki/yaml-mode">yaml-mode</a>: for yaml</li>
<li><a href="http://jblevins.org/projects/markdown-mode/">markdown-mode</a>: for markdown</li>
<li><a href="http://code.google.com/p/yasnippet/">YASnippet</a>:
Textmate-inspired templating. Great for making HTML less tedious.</li>
<li><a href="https://github.com/nonsequitur/smex">smex: IDO for M-x</a></li>
<li><a href="https://github.com/magnars/multiple-cursors.el">multiple-cursors</a>: this is really fun *and* useful.</li>
<li><a href="http://web-mode.org/">web-mode</a>: for HTML/CSS/Javascript</li>
</ul>
<p>My emacs config on github: <a href="http://github.com/saltycrane/emacs">http://github.com/saltycrane/emacs</a></p>
<p>History: 2001: Emacs/NEdit/UltraEdit, 2006: Eclipse, 2007: Emacs</p>
</td>
</tr>
<tr>
<td id="terminal"><p>Terminal</p>
<a href="#terminal" title="Section permalink" class="sectionlink">¶</a></td>
<td><p><a href="http://software.schmorp.de/pkg/rxvt-unicode.html">urxvt</a></p>
9.19
+ <br><a href="http://www.gnu.org/software/screen/">screen</a></td>
<td>
<p>urxvt supports xft (anti-aliased) fonts, real transparency (not that
I actually use transparency with Qtile), and fading (which I do use with Qtile)
and it is much faster and lighter than gnome-terminal or konsole. screen allows me to switch
terminal sessions without ugly tabs, attach to remote sessions, search through
the scrollback buffer, and more. <em>Update:</em> urxvt also has embedded perl.</p>
<p>Install method:
<del><a href="/blog/2009/11/how-make-urxvt-look-gnome-terminal/">from source</a></del>
<code>sudo apt-get install rxvt-unicode</code>
</p>
</td>
</tr>
<tr>
<td id="vcs"><p>Version Control System</p>
<a href="#vcs" title="Section permalink" class="sectionlink">¶</a></td>
<td>
<p><a href="http://git-scm.com/">Git</a></p>
</td>
<td>
<p>Switched from Subversion to Mercurial in June 2007. The merging in Mercurial
is very nice and can be done without thinking. I do miss Subversion/Subclipse's
revision history viewer, file compare, and ability to isolate files apart from
changesets. <em>Update 2010-04-05:</em> See <a href="#c8633">my comment
below</a>.
</p>
<p><em>Update 2011-05:</em> Switched my personal repos to Git. Use Git almost
exclusively now.
</p>
<p>Additional commentary:</p>
<ul>
<li><a href="http://jonchu.posterous.com/16445171">
DVCS: Why I chose Mercurial over Git</a> (2010)</li>
<li><a href="http://blog.extracheese.org/2010/05/why-i-switched-to-git-from-mercurial.html">
Why I Switched to Git From Mercurial</a> (2010)</li>
</ul>
<p>Install method: <code>sudo apt-get install mercurial</code></p>
<p>History: 2001: SCCS, 2003: Other, 2007: Subversion, 2007: Mercurial,
2010: Mercurial/Git, 2011: Git</p>
</td>
</tr>
<tr>
<td id="high-level-language"><p>"High-level" Language</p>
<a href="#high-level-language" title="Section permalink" class="sectionlink">¶</a></td>
<td><p>None</p></td>
<td>
<p>Previously, I used C. Now I use don't use any statically-typed languague. Wouldn't mind learning <del>C++</del> Go. Although,
Linus <a href="http://thread.gmane.org/gmane.comp.version-control.git/57643/focus=57918">
doesn't like it.</a></p>
</td>
</tr>
<tr>
<td id="high-high-level-language" ><p>"High-high-level" Language</p>
<a href="#high-high-level-language" title="Section permalink" class="sectionlink">¶</a></td>
<td ><p><a href="http://www.python.org/">Python</a> 2.7</p></td>
<td >
<p>My love for Python is strong. I switched from Perl in 2005
and have no regrets. Object-oriented, easy to read (no more
<a href="http://en.wikipedia.org/wiki/There_is_more_than_one_way_to_do_it">
TIMTOWTDI</a>), and smart people use it. I also want to learn Javascript 2
becuase it is the
<a href="http://steve-yegge.blogspot.com/2007/02/next-big-language.html">
"Next Big Language"</a> and Lisp because it is the
<a href="http://www.paulgraham.com/avg.html">"most powerful language"</a>.</p>
<p><b>On Python vs. Ruby:</b> from what I've read, I characterize Ruby as the
more expressive language more similar to Perl (than Python is) and Python
as the more regimented language. Since I like regimented, I like Python.</p>
<p><b>On Python vs. Lisp:</b> I've concluded that I lack the intelligence to
harness enough of Lisp's power to counteract its non-practicality (e.g.
lack of libraries).</p>
<p>Additional commentary:</p>
<ul>
<li><a href="http://en.wikipedia.org/wiki/Paul_Graham">Paul Graham</a>:
<a href="http://www.paulgraham.com/icad.html">Python is
getting closer to Lisp</a> (2002)</li>
<li>Paul Prescod: <a href="http://www.prescod.net/python/IsPythonLisp.html">
no it isn't</a></li>
<li>Paraphrase of <a href="http://www.swiss.ai.mit.edu/~gjs/">
Gerald Jay Sussman</a> (one of the creators of Scheme):
<a href="http://blog.snowtide.com/2009/03/24/why-mit-now-uses-python-instead-of-scheme-for-its-undergraduate-cs-program">
Why MIT now uses python instead of scheme for its undergraduate CS program</a>
(2009)</li>
</ul>
<p>Install method: preinstalled on Ubuntu</p>
<p>History: 2001: <a href="http://www.perl.org/">Perl</a>,
2005: <a href="http://www.python.org/">Python</a>
</p>
</td>
</tr>
<tr>
<td id="web-framework" ><p>Web Framework</p>
<a href="#web-framework" title="Section permalink" class="sectionlink">¶</a></td>
<td >
<p>
<a href="http://www.djangoproject.com/">Django</a> /
<a href="http://flask.pocoo.org/">Flask</a>
</p>
</td>
<td >
<p><em>2014-10:</em>I now use Flask at work. Previously, I used Django. I think I like SQLAlchemy and Jinja2 better than Django. Django has a lot more built in and is put together better. Flask's thread locals are convenient and messy. Probably <a href="http://www.pylonsproject.org/">Pyramid</a> is the best but no one uses it.</p>
<p>Here are some links:</p>
<ul>
<li><a href="http://www.ianbicking.org/">Ian Bicking</a>:
<a href="http://blog.ianbicking.org/theres-so-much-more-than-rails.html">
There's so much more than Rails</a> (2005)</li>
<li><a href="http://blog.ianbicking.org/2008/01/12/what-php-deployment-gets-right/">
What PHP deployment gets right</a> (2008)</li>
<li><a href="http://www.feedmagnet.com/blog/django-vs-rails/">
Django vs. Rails</a> (2009)</li>
</ul>
<p>Install method: <code>pip install Django</code> / <code>pip install Flask</code></p>
</td>
</tr>
<tr>
<td id="web-browser"><p>Web Browser</p>
<a href="#web-browser" title="Section permalink" class="sectionlink">¶</a></td>
<td><p>Firefox</p></td>
<td >
<p>Not to be confused with <a href="http://www.konqueror.org">
Konqueror</a>, Conkeror is an emacs-like, keyboard driven, scriptable,
Mozilla-based web browser. I've used it almost full
time since January 2008. It is still considered alpha stage software
so there are a number of bugs. However, it is still pretty sweet. I use
Firefox as a backup (and IE Tab for Launchcast and Netflix on Windows).</p>
<p>Unfortunately, one of the annoying things in Firefox 2 is present in
Conkeror as well-- memory leaks. Based on
<a href="http://kb.mozillazine.org/Memory_Leak">this Mozilla article</a>
and some brief personal experience, Firefox 3 has made fixes in this area.
It would be nice if Conkeror could benefit from the Firefox 3 fixes.</p>
<p><em>Update 2010-05-04:</em> Conkeror is really awesome, but I had some memory/cpu issues with it
a while ago and haven't put in the work to merge my custom keybindings
with the latest Conkeror code. Also waiting to see if there will be
an Emacs version of <a href="http://vimium.github.com/">Vimium</a>
(since, after all <a href="http://vimperator.org/">vimperator</a>
followed conkeror).
</p>
<p>I'm currently using a combination of Google Chrome and Firefox.
Chrome is faster, especially for Javascript-intensive sites, but I really
<a href="http://superuser.com/questions/91334/alternative-to-arrow-keys-in-google-chrome-location-bar">
<em>hate</em> the Google Chrome Omnibar</a>. If you have a solution
or workaround, please post an answer. Firefox also has some Add-ons
that Chrome doesn't.
</td>
</tr>
<tr>
<td id="email" ><p>Email</p>
<a href="#email" title="Section permalink" class="sectionlink">¶</a></td>
<td ><p>Gmail</p></td>
<td >
<p><em>Update 2010-05-04:</em>
Gmail. It's slow but it has a lot of features and it's in
my web browser and it's easy and it works and I don't really like using
email that much anyways. Oh, and, big plus, syncing works almost perfect
with my Android phone. (Actual full switch to Gmail was around December 2008.)
</p>
</td>
</tr>
<tr>
<td id="graphical-diff" ><p>Graphical diff/merge</p>
<a href="#graphical-diff" title="Section permalink" class="sectionlink">¶</a></td>
<td ><p><a href="http://kdiff3.sourceforge.net/">KDiff3</a></p></td>
<td >
<p>I started using KDiff a while ago on Windows and have
always liked it. I'm thinking, though, since I'm an Emacs person, I ought to
use <a href="http://www.gnu.org/software/emacs/manual/html_mono/ediff.html">
Ediff</a>.</p>
<p>Install method: <code>sudo apt-get install kdiff3</code></p>
</td>
</tr>
<tr>
<td id="keyboard"><p>Keyboard</p>
<a href="#keyboard" title="Section permalink" class="sectionlink">¶</a></td>
<td>
<p><a href="http://pckeyboards.stores.yahoo.net//en104wh.html">
Unicomp Endurapro</a> /
<a href="http://elitekeyboards.com/products.php?sub=leopold,tenkeyless&pid=fc200rtab">
Leopold Tenkeyless w/ Cherry MX Browns
</a></p>
</td>
<td>
<p>I realize a keyboard is hardware and not software, but it is
hardware that can evoke strong opinions, so I made an exception.
</p>
<p>One problem with hardware is I can't try out all the different types
and choose the one I like the best as I can with software. So
my selection is based on reviews not on actual experience. And,
after buying the Endurapro, I found I actually did not like the
integrated mouse stick, so I should have bought a Customizer 104/105
and saved $30.</p>
<p><em>Update 2011-05:</em> Got the Leopold tenkeyless for work.
Tenkeyless is a must for quicker mouse access.
And I actually like the lighter touch of the
Cherry MX Browns versus the Unicomp's buckling springs. I like it
so much I want to replace my Unicomp at home with another Leopold.
</p>
<p><em>Update:</em> Got a second Leopold for home to replace my Unicomp.</p>
<p>Additional commentary:</p>
<ul>
<li><a href="http://www.jwz.org/gruntle/wrists.html">
my wrists and welcome to them.</a>, JWZ (1999)</li>
<li><a href="http://www.dansdata.com/deck.htm">
Deck keyboard</a>, Dan (2005)</li>
<li><a href="http://bc.tech.coop/blog/060131.html">
Surviving Emacs - Part 4</a>, Bill Clementson (2006)</li>
<li><a href="http://glyf.livejournal.com/55780.html">
Keyboard Fight</a>, Glyph Lefkowitz (2006)</li>
<li><a href="http://diveintomark.org/archives/2006/05/30/bye-apple">
Bye, Apple</a>, Mark Pilgrim (2006)</li>
<li><a href="http://glyph.twistedmatrix.com/2009/01/meandering-review-of-logitech.html">
A Meandering Review of the Logitech Illuminated Keyboard</a>,
Glyph Lefkowitz (2009)</li>
</ul>
<p>History: 2009: Unicomp Endurapro, 2011: Leopold Tenkeyless (MX Browns)</p>
</td>
</tr>
<tr>
<td id="office-chair"><p>Office Chair</p>
<a href="#office-chair" title="Section permalink" class="sectionlink">¶</a></td>
<td><p>Undecided</p></td>
<td><p>Herman Miller Aeron or Steelcase Leap</p>
</td>
</tr>
<tr>
<td id="mobile-phone"><p>Mobile Phone</p>
<a href="#mobile-phone" title="Section permalink" class="sectionlink">¶</a></td>
<td><p><a href="http://www.motorola.com/Consumers/US-EN/Consumer-Product-and-Services/Mobile-Phones/Motorola-DROID-US-EN">Motorola Droid 4</a></p></td>
<td>
<p>After almost 10 years (and 3 generations) of the Palm Treo, I got the
Motorola Droid.</p>
<p>The Droid is pretty awesome, but I don't like switching
to landscape mode to use the keyboard-- especially when toolbars and headers
take up half the screen. I think Palm and Blackberry got this form factor Right.
Just as I prefer the keyboard over the mouse on my PC, I want to use the keyboard
and D-pad over the touchscreen on my phone.
<em>Update 2010-05-04:</em> The keyboard is mediocre and use of the D-pad
center button sucks. My Palm Treo 650 D-pad worked much better.
</p>
<p>My reasons for choosing an
<a href="http://en.wikipedia.org/wiki/Android_%28operating_system%29">Android</a>
phone are: I <em>need</em> a physical keyboard.
I <em>want</em> to hack on my phone. I <em>think</em> Android has more potential than Palm's
<a href="http://en.wikipedia.org/wiki/WebOS">webOS</a>
or <a href="http://en.wikipedia.org/wiki/Maemo">Maemo</a>.</p>
<p>Useful apps:</p>
<ul>
<li><a href="http://code.google.com/p/connectbot/">Connectbot</a>
Secure shell (SSH) client for the Android platform. Use this all the time. Awesome.</li>
<li><a href="http://www.android.com/market/#app=listen">Listen</a>
Listen from Google Labs brings podcast search, subscribe, download and stream to your Android-powered device.</li>
<li><a href="http://mytracks.appspot.com/">My Tracks</a>
Record GPS tracks. Monitor your performance. Share your outdoor activities with friends.
Really enjoy this one. Love tracking my romping.
</li>
</ul>
<p><em>2010-05-04 Updates:</em></p>
<ul>
<li><a href="http://www.google.com/mobile/voice/">Google Voice</a>: Free text messages
and better voicemail. Another useful app. Makes voicemail suck a lot less.</li>
<li><a href="http://levelupstudio.com/foxyring">FoxyRing</a>: automatically
control the ringer volume based on ambient noise level. I was doubtful about this one,
but it actually works well for me.</li>
<li><a href="http://www.flixster.com/mobile/apps/android">Flixter (Movies)</a>:
Useful for checking movie showtimes.
</li>
<li><a href="http://www.youversion.com/mobile/android">Bible (YouVersion)</a>:
This version is pretty good. I miss my <a href="http://www.plkr.org/">Plucker</a>
created Bible on my Palm though. I wish there was something like Plucker for
Android.
</li>
<li>DroidLight: use the LED camera flash as a flashlight. Simple and useful.
Works much better than using the screen as a flashlight.
</li>
<li><a href="http://www.google.com/mobile/navigation/">Google Navigation</a>: I
don't need my Garmin anymore. (Each has advantages and disadvantages, but I
have found it to be a capable replacement.)</li>
<li>Just want to mention that the Calendar sucks. It is great that I can sync
with my Google calendar, but I really hate the Android Calendar UI.</li>
</ul>
<p>Additional Commentary/Links:</p>
<ul>
<li><a href="http://randomfoo.net/2009/06/15/thoughts-on-the-palm-pre-g2-and-iphone-3g">
Thoughts on the Palm Pre, G2, and iPhone 3G</a> Leonard Lin (2009 June)</li>
<li><a href="http://jwz.livejournal.com/1055120.html">
JWZ gets a Palm Pre</a> (2009 June)</li>
<li><a href="http://jwz.livejournal.com/1055369.html">
Emacs on Android</a> (2009 June)</li>
<li><a href="http://daringfireball.net/2009/08/the_android_opportunity">
The Android Opportunity</a>, John Gruber (2009 August)</li>
<li><a href="http://jwz.livejournal.com/1108212.html">
Dear Palm, it's just not working out</a>, JWZ (2009 October)</li>
</ul>
<p>History: 2002: <a href="http://en.wikipedia.org/wiki/Treo_180">Handspring Treo 180</a>,
2003: <a href="http://en.wikipedia.org/wiki/Treo_600">Handspring Treo 600</a>,
2005: <a href="http://en.wikipedia.org/wiki/Treo_650">Palm Treo 650</a>,
2009: <a href="http://en.wikipedia.org/wiki/Motorola_Droid">Motorola Droid</a>
2011: <a href="http://en.wikipedia.org/wiki/Droid_4">Motorola Droid 4</a>
</p>
</td>
</tr>
</table>