SaltyCrane: softwaretoolshttps://www.saltycrane.com/blog/2017-07-30T18:56:10-07:00How to map Caps Lock to Escape when tapped and Control when held on Mac OS Sierra
2017-07-30T18:56:10-07:00https://www.saltycrane.com/blog/2017/07/how-map-caps-lock-escape-when-tapped-and-control-when-held-mac-os-sierra/<p>
Escape and Control are useful keys when
<a href="/blog/2015/12/switching-emacs-vim-actually-spacemacs/">using Vim</a>
so it's nice to map them to a more convenient key like Caps Lock.
I had been using Karabiner to do this, but Karabiner doesn't work on Mac OS Sierra.
Fortunately
<em>
<a href="https://github.com/tekezo/Karabiner-Elements">
Karabiner-Elements</a>
provides a subset of the features planned for the next generation Karabiner
</em>
including remapping Caps Lock to Escape when tapped and Control when held down.
The solution below is from
<a href="https://github.com/tekezo/Karabiner-Elements/issues/8#issuecomment-309037790">
@zeekay on issue #8
</a>.
I am using Karabiner-Elements 0.91.12 and macOS Sierra 10.12.4.
</p>
<ul>
<li>Uninstall Seil and Karabiner, if previously installed</li>
<li>Install Karabiner-Elements
<pre class="console">$ brew cask install karabiner-elements </pre>
</li>
<li>
Edit <code>~/.config/karabiner/karabiner.json</code> to be:
<pre>{
"global": {
"check_for_updates_on_startup": true,
"show_in_menu_bar": true,
"show_profile_name_in_menu_bar": false
},
"profiles": [
{
"complex_modifications": {
"parameters": {
"basic.to_if_alone_timeout_milliseconds": 250
},
"rules": [
{
"manipulators": [
{
"description": "Change caps_lock to control when used as modifier, escape when used alone",
"from": {
"key_code": "caps_lock",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "left_control"
}
],
"to_if_alone": [
{
"key_code": "escape",
"modifiers": {
"optional": [
"any"
]
}
}
],
"type": "basic"
}
]
}
]
},
"devices": [],
"fn_function_keys": {
"f1": "display_brightness_decrement",
"f10": "mute",
"f11": "volume_decrement",
"f12": "volume_increment",
"f2": "display_brightness_increment",
"f3": "mission_control",
"f4": "launchpad",
"f5": "illumination_decrement",
"f6": "illumination_increment",
"f7": "rewind",
"f8": "play_or_pause",
"f9": "fastforward"
},
"name": "Default profile",
"selected": true,
"virtual_hid_keyboard": {
"caps_lock_delay_milliseconds": 0,
"keyboard_type": "ansi"
}
}
]
}</pre>
</li>
</ul>
<h4>Alternative</h4>
<p>
<a href="https://gist.github.com/kbussell/9d9f9f10032c5bbdec9dc2d2ce5259c2">
@kbussell created a script
</a>
to do the same using
<a href="http://www.hammerspoon.org/">Hammerspoon</a><sup>1</sup>
instead of Karabiner.
</p>
<hr>
<small>
<ol>
<li>
Hammerspoon is awesome.
</li>
</ol>
</small>
How to make urxvt look like gnome-terminal
2009-11-02T01:09:15-08:00https://www.saltycrane.com/blog/2009/11/how-make-urxvt-look-gnome-terminal/<p>My terminal of choice is
<a href="http://software.schmorp.de/pkg/rxvt-unicode.html">rxvt-unicode</a>
(urxvt) because it is fast and lightweight.
However, I recently opened up gnome-terminal and it was so much prettier than
my urxvt. Here's how I made my urxvt look like gnome-terminal. The last step
involves compiling urxvt from source because the latest source includes a patch
to configure horizontal spacing of letters.
</p>
<h4>Set up colors</h4>
<p>Add the following to your <code>~/.Xdefaults</code> file:</p>
<pre>! to match gnome-terminal "Linux console" scheme
! foreground/background
URxvt*background: #000000
URxvt*foreground: #ffffff
! black
URxvt.color0 : #000000
URxvt.color8 : #555555
! red
URxvt.color1 : #AA0000
URxvt.color9 : #FF5555
! green
URxvt.color2 : #00AA00
URxvt.color10 : #55FF55
! yellow
URxvt.color3 : #AA5500
URxvt.color11 : #FFFF55
! blue
URxvt.color4 : #0000AA
URxvt.color12 : #5555FF
! magenta
URxvt.color5 : #AA00AA
URxvt.color13 : #FF55FF
! cyan
URxvt.color6 : #00AAAA
URxvt.color14 : #55FFFF
! white
URxvt.color7 : #AAAAAA
URxvt.color15 : #FFFFFF
</pre>
<h4>Select font</h4>
<p>Also add the following to your <code>~/.Xdefaults</code> file:</p>
<pre>URxvt*font: xft:Monospace:pixelsize=11
</pre>
<h4>Don't use a bold font</h4>
<p>Also add the following to your <code>~/.Xdefaults</code> file:</p>
<pre>URxvt*boldFont: xft:Monospace:pixelsize=11</pre>
<h4>Fix urxvt font width</h4>
<p>This is the most difficult thing to fix. It requires installing urxvt from
CVS source.</p>
<ul>
<li>Install prerequisites:
<pre>apt-get build-dep rxvt-unicode</pre></li>
<li>Get CVS source code:
<pre>cvs -z3 -d :pserver:anonymous@cvs.schmorp.de/schmorpforge co rxvt-unicode</pre></li>
<li>Configure:
<pre>cd rxvt-unicode
./configure --prefix=/home/eliot/lib/rxvt-unicode-20091102</pre></li>
<li>Make & make install:
<pre>make
make install</pre></li>
<li>Link urxvt executable to your <code>~/bin</code> directory:
<pre>cd ~/bin
ln -s ../lib/rxvt-unicode-20091102/bin/urxvt .</pre>
</li>
<li>Edit <code>~/.Xdefaults</code> once again:
<pre>URxvt*letterSpace: -1</pre>
</li>
</ul>
<h4>Also cool: Open links in Firefox</h4>
<p>Here is another trick (thanks to
<a href="http://ztatlock.blogspot.com/2009/02/configuring-urxvt.html">Zachary Tatlock</a>)
to make clicking on URLs open in your Firefox browser.
Add the following to your <code>~/.Xdefaults</code> (yes there's Perl in
your urxvt!):</p>
<pre>URxvt.perl-ext-common : default,matcher
URxvt.urlLauncher : firefox
URxvt.matcher.button : 1
</pre>
<h4>See also</h4>
<ul>
<li><a href="http://www.mail-archive.com/rxvt-unicode@lists.schmorp.de/msg00554.html">
http://www.mail-archive.com/rxvt-unicode@lists.schmorp.de/msg00554.html</a></li>
</ul>
<h4>Screenshots</h4>
<p>Urxvt (default):</p>
<img alt="ugly urxvt screenshot" src="/site_media/image/blog/urxvt_ugly.png" />
<p>Gnome-terminal:</p>
<img alt="gnome-terminal screenshot" src="/site_media/image/blog/gnome_terminal.png" />
<p>Urxvt (modified):</p>
<img alt="pretty urxvt screenshot" src="/site_media/image/blog/urxvt_pretty.png" />
<p>If you're interested, here is how I printed the terminal colors:</p>
<pre>#!/bin/bash
echo -e "\\e[0mCOLOR_NC (No color)"
echo -e "\\e[1;37mCOLOR_WHITE\\t\\e[0;30mCOLOR_BLACK"
echo -e "\\e[0;34mCOLOR_BLUE\\t\\e[1;34mCOLOR_LIGHT_BLUE"
echo -e "\\e[0;32mCOLOR_GREEN\\t\\e[1;32mCOLOR_LIGHT_GREEN"
echo -e "\\e[0;36mCOLOR_CYAN\\t\\e[1;36mCOLOR_LIGHT_CYAN"
echo -e "\\e[0;31mCOLOR_RED\\t\\e[1;31mCOLOR_LIGHT_RED"
echo -e "\\e[0;35mCOLOR_PURPLE\\t\\e[1;35mCOLOR_LIGHT_PURPLE"
echo -e "\\e[0;33mCOLOR_YELLOW\\t\\e[1;33mCOLOR_LIGHT_YELLOW"
echo -e "\\e[1;30mCOLOR_GRAY\\t\\e[0;37mCOLOR_LIGHT_GRAY"</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>
Creating remote server nicknames with .ssh/config
2008-11-20T15:01:35-08:00https://www.saltycrane.com/blog/2008/11/creating-remote-server-nicknames-sshconfig/<p>Using the <code>~/.ssh/config</code> file is an easy way to give your
remote machines nicknames and reduce the number of keystrokes needed
to login with <code>ssh</code>, <code>rsync</code>,
<code>hg push</code>/<code>pull</code>/<code>clone</code>, access
files via <a href="http://www.gnu.org/software/tramp/">Emacs Tramp</a>
(Transparent Remote (file) Access, Multiple Protocol),
or use any other SSH-based tool. You can also set other ssh options such
as <code>IdentityFile</code>, <code>Port</code>, or <code>CompressionLevel</code>.
For more information and a full list of options, check out the man page for <code>ssh_config</code> or
<a href="http://kimmo.suominen.com/docs/ssh/#config">this article</a>
by Kimmo Suominen.
</p>
<p>Here is part of my <code>~/.ssh/config</code> file. It defines the
nicknames turk, tyran, tuna, and tally for some EC2 servers I've been
working with.</p>
<pre>Host turk
User root
HostName ec2-67-202-21-122.compute-1.amazonaws.com
Host tuna
User root
HostName ec2-75-101-178-62.compute-1.amazonaws.com
Host tyran
User root
HostName ec2-67-202-43-207.compute-1.amazonaws.com
Host tally
User root
HostName ec2-67-202-59-207.compute-1.amazonaws.com</pre>
<p>Now, wherever I would normally have typed
<code>root@ec2-67-202-21-122.compute-1.amazonaws.com</code>,
I can just type <code>turk</code>. Here are some examples.</p>
<h4>SSH login</h4>
<p>Old way:</p>
<pre>ssh root@ec2-67-202-21-122.compute-1.amazonaws.com</pre>
<p>New way:</p>
<pre>ssh turk</pre>
<h4>rsync</h4>
<p>Old way:</p>
<pre>rsync -avz myproject root@ec2-67-202-21-122.compute-1.amazonaws.com:/srv</pre>
<p>New way:</p>
<pre>rsync -avz myproject turk:/srv</pre>
<h4>Mercurial</h4>
<p>Old way:</p>
<pre>hg push ssh://root@ec2-67-202-21-122.compute-1.amazonaws.com//srv/myproject</pre>
<p>New way:</p>
<pre>hg push ssh://turk//srv/myproject</pre>
<h4>Emacs Tramp</h4>
<p>To use your <code>~/.ssh/config</code> with Emacs Tramp, you will need
something like the following in your <code>.emacs</code>:</p>
<pre>(tramp-set-completion-function "ssh"
'((tramp-parse-sconfig "/etc/ssh_config")
(tramp-parse-sconfig "~/.ssh/config")))</pre>
<p>Old way:</p>
<pre>C-x C-f /root@ec2-67-202-21-122.compute-1.amazonaws.com:/srv/myproject/myfile.py</pre>
<p>New way:</p>
<pre>C-x C-f /turk:/srv/myproject/myfile.py</pre>
<h4>scp</h4>
<p>Old way:</p>
<pre>scp etc/.screenrc root@ec2-67-202-21-122.compute-1.amazonaws.com:/root</pre>
<p>New way:</p>
<pre>scp etc/.screenrc turk:/root</pre>
How to monitor an Apache web server using Monit
2008-09-22T20:47:22-07:00https://www.saltycrane.com/blog/2008/09/how-monitor-apache-web-server-using-monit/<p><a href="http://www.tildeslash.com/monit/">Monit</a>
is a tool that can monitor your Apache web server,
MySQL database, or other daemon process. It can restart
the service based on configurable conditions such as
CPU usage, memory usage, number of children, etc. It can log status to a file,
email status, and it has a web interface for monitoring or
restarting the service. Here are the steps I took to install and configure
the Monit tool on Ubuntu Hardy. It merely monitors the
status of my Apache web server and restarts it if it stops. It also
checks if the memory used by Apache is greater than 1 MB and logs
it in /var/log/monit.log.
For more configuration options, see the examples in the default
<code>/etc/monit/monitrc</code> file or the
<a href="http://www.tildeslash.com/monit/doc/manual.php#configuration_examples">
configuration examples in the monit documentation</a>. I also
found <a href="http://www.ubuntugeek.com/monitoring-ubuntu-services-using-monit.html">
Ubuntu Geek's guide</a> to be very helpful.
</p>
<ul>
<li>Install monit<pre>$ sudo apt-get install monit</pre></li>
<li>Edit the config file<pre>$ sudo nano /etc/monit/monitrc</pre>
Insert the following:
<pre># check services every 2 minutes
set daemon 120
# logging
set logfile /var/log/monit.log
# web interface
set httpd port 2812 and
use address localhost # only accept connection from localhost
allow localhost # allow localhost to connect to the server
allow admin:monit # require user ‘admin’ with password ‘monit’
# monitor apache
check process apache2 with pidfile /var/run/apache2.pid
start program = "/etc/init.d/apache2 start"
if totalmem > 1.0 MB for 2 cycles then alert</pre>
</li>
<li>Check the file syntax<pre>$ sudo monit -t</pre></li>
<li>Enable the service<pre>$ sudo nano /etc/default/monit</pre>
Change the following line:
<pre>startup=1</pre>
</li>
<li>Start monit<pre>$ sudo /etc/init.d/monit start</pre></li>
<li>Point your browser at <a href="http://localhost:2812">http://localhost:2812</a>
and log in using the user "admin" and the password "monit".
</li>
<li>Click on "apache2" and you can see information about the Apache process.
</li>
</ul>
Simple cron example
2008-09-15T16:55:19-07:00https://www.saltycrane.com/blog/2008/09/simple-cron-example/<p>Simple cron example (tested on Ubuntu):</p>
<ul>
<li>Edit your (user) crontab file
<pre>$ crontab -e</pre>
This will bring up your editor (nano by default in Ubuntu)
<br><br>
</li>
<li>Enter the following inside. This will append the current date to a log file every minute. The 6 fields of the crontab file are: minute, hour, day of month, month, day of week, command.
<pre>* * * * * /bin/date >> /tmp/cron_output
</pre>
<b>Be sure to put a blank line at the end of the file.</b><br>
<em>(NOTE 1: <code>>></code> only redirects STDOUT to a file. To redirect both STDOUT and
STDERR, use something like <code>/bin/date >> /tmp/cron_output 2>&1</code>)</em><br>
<em>(NOTE 2: If output is not redirected, cron will try to email the output to you.
To do this, a mail transfer agent such as <a href="http://en.wikipedia.org/wiki/Sendmail">sendmail</a>
or <a href="http://en.wikipedia.org/wiki/Postfix_(software)">postfix</a> must be installed.)</em><br>
<em>(NOTE 3 (added 2015-06-24): When I created my cron script in <code>/etc/cron.d</code> with Emacs using
<code>sudo::</code>, cron didn't pick up my script. When I created it with nano, cron picked it up.
It seems the cause is the permissions of the cron script. Emacs created the script with 664 permissions
while nano created the script with 644 permissions. When I changed the permissions to 644, it started
working. I am running Ubuntu 15.04. This <a href="http://askubuntu.com/a/251468/423429">Ask Ubuntu answer</a>
confirms that a 644 permission is problematic because it is considered insecure. See /var/log/syslog
for cron messages. The Ask Ubuntu page has a lot of other good tips:
<a href="http://askubuntu.com/questions/23009/reasons-why-crontab-does-not-work">
Reasons why crontab does not work</a>)
</em><br>
<br>
</li>
<li>Exit the editor. It should output:
<pre>crontab: installing new crontab</pre>
</li>
<li>Check that it is working:
<pre>tail -f /tmp/cron_output</pre>
You should see the date updated every minute on the minute (or close to it):
<pre>Tue Sep 16 23:58:01 PDT 2008
Tue Sep 16 23:59:01 PDT 2008
Wed Sep 17 00:00:01 PDT 2008
Wed Sep 17 00:01:01 PDT 2008
...
</pre>
</li>
</ul>
<p>
See also my post: <a href="/blog/2008/12/postgres-backup-cron/">Postgres backup with cron</a>
</p>
How to set the default directory in Claws Mail
2008-07-31T15:21:43-07:00https://www.saltycrane.com/blog/2008/07/how-set-default-directory-claws-mail/<p>I've decided to use <a href="http://www.claws-mail.org/">Claws Mail</a> because it looked pretty good and mainly because I respect <a href="http://adam.gomaa.us/blog/">Adam Gomaa</a>'s opinion a lot. My first customization is to change the default directory used to store the messages. I couldn't find this in the documentation, but found the solution after Googling. The solution is: edit the path in your <code>~/.claws-mail/folderlist.xml</code> file. Now to figure out how to show new message notifications in my wmii status bar!</p>
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>
Backup on Linux: rsnapshot vs. rdiff-backup (vs. Time Machine)
2008-02-07T13:22:00-08:00https://www.saltycrane.com/blog/2008/02/backup-on-linux-rsnapshot-vs-rdiff/<p>Apple's release of Leopard and the included backup utility,
<a href="http://www.apple.com/macosx/features/timemachine.html">
Time Machine</a>, has generated a lot of talk about backups recently. I will
admit Time Machine is pretty cool and believe that it is a bit more than
a glorified GUI on top of an existing *nix tool as some have claimed.
However, the core functionality is very similar to the command-line tool,
<a href="http://www.rsnapshot.org/">rsnapshot</a>, which is itself
based on a <a href="http://samba.org/rsync/">rsync</a> script by Mike
Rubel. Time Machine added a couple of features and a GUI to make it
easy to use. Since I prefer the command line over GUIs most of the time
anyways, rsnapshot seemed perfect for me.</p>
<p>To be complete, I researched a number of other backup utilities for Linux.
<a href="http://www.dirvish.org/">
Dirvish</a> and <a href="http://code.google.com/p/flyback/">flyback</a>
were out because I prefer the command line and they didn't seem to offer
anything more than rsnapshot. Scripting rsync wouldn't get me anything
more than rsnapshot either, plus it would be more work. In the end,
I eliminated all but rsnapshot and another command line tool called
<a href="http://www.nongnu.org/rdiff-backup/">
rdiff-backup</a>. Rdiff-backup has some advantages over rsnapshot (and Time
Machine) because it stores compressed deltas of each version of a file
instead of a complete copy of the file each time it changes. This is not
a big deal for small files, but for large files that change often, it
makes a significant
difference. However, the big disadvantage of rdiff-backup, for me, was
the inablility to perform different levels of backup, such as hourly,
daily, weekly, monthly, etc. Depending on the needs of the user, this
could negate the space saving advantage by needing to keep a large number
of snapshots.</p>
<p>I ended up choosing rsnapshot over rdiff-backup because of this last
reason. It seems rdiff-backup is closer to a version control tool and
rsnapshot closer to a traditional backup solution. It would be great to
create a hybrid of the two tools to gain
the advantages of each. I started to dig into the source of rdiff-backup
(python source makes me happy), but I didn't want to get too sidetracked
with another project. For now, I am using <a href="http://www.selenic.com/mercurial/">
Mercurial</a> to version control
my <code>/etc</code> and <code>/home/.*</code> config files and rsnapshot
as a broader, general purpose backup tool.</p>
<br /><p>Here is my comparison of rsnapshot and rdiff-backup:</p>
<table>
<tr>
<td valign="top">Similar Features</td>
<td valign="top">
<ul>
<li>both use an rsync-like algorithm to transfer data (rsnapshot
actually uses rsync; rdiff-backup uses the python librsync library)
</li>
<li>both can be used over ssh (though rsnapshot cannot push over ssh without some extra scripting)</li>
<li>both use a simple copy of the source for the current backup</li>
</ul>
</td>
</tr>
<tr>
<td valign="top">Written in</td>
<td valign="top">rsnapshot is written in Perl; rdiff-backup is written in Python and C</td>
</tr>
<tr>
<td valign="top">Size</td>
<td valign="top">rdiff-backup stores previous versions
as compressed deltas to the current version similar to a version
control system. rsnapshot uses actual files and hardlinks to save
space. For small files, storage size is similar. For large files
that change often, such as logfiles, databases, etc., rdiff-backup
requires significantly less space for a given number of versions.</td>
</tr>
<tr>
<td valign="top">Speed</td>
<td valign="top">rdiff-backup is slower than rsnapshot</td>
</tr>
<tr>
<td valign="top">Metadata</td>
<td valign="top">rdiff-backup stores file metadata, such as ownership, permissions, and
dates, separately.</td>
</tr>
<tr>
<td valign="top">Transparency</td>
<td valign="top">For rsnapshot, all versions of the backup are accessible as plain files.
For rdiff-backup, only the current backup is accessible as plain files.
Previous versions are stored as rdiff deltas.</td>
</tr>
<tr>
<td valign="top">Backup levels</td>
<td valign="top">rsnapshot supports multiple levels of backup such as monthly, weekly,
and daily. rdiff-backup can only delete snapshots earlier than a given
date; it cannot delete snapshots in between two dates.</td>
</tr>
<tr>
<td valign="top">Community</td>
<td valign="top">
Based on the number of responses to my post on the mailing lists
(<a href="https://sourceforge.net/p/rsnapshot/mailman/rsnapshot-discuss/thread/592a1f150802041321y61b3a2a3j567f1e62e4cca594%40mail.gmail.com/#msg18526014">rsnapshot: 6</a>,
<a href="http://lists.nongnu.org/archive/html/rdiff-backup-users/2008-02/msg00008.html">
rdiff-backup: 0</a>), rsnapshot has a more active
community.
</td>
</tr>
</table>
<p>Reference: <a href="http://search.safaribooksonline.com/0596102461/I11707__ChapterStart__Chapter_7">
Chapter 7 in <em>Backup & Recovery</em> O'Reilly 2007</a></p>
Conkeror: "Firefox for Emacs users"
2008-01-28T17:31:00-08:00https://www.saltycrane.com/blog/2008/01/firefox-for-emacs-users/<p>I recently discovered
<a href="http://conkeror.mozdev.org/">Conkeror</a> via Bill Clementson's article,
<a href="http://bc.tech.coop/blog/060529.html"><em>Firefox for Emacs users
</em></a>. I must say it is pretty sweet. It's the type
of thing that makes you have to get up and go to the bathroom because it's
so exciting.</p>
<p>So I switched over to Emacs from Eclipse about 4 months ago. Though it has
been slow learning everything in Emacs, I am starting to feel pretty
comfortable now and actually feel uneasy when I'm using another editor.
It is very nice to be able to do everything with the keyboard in Emacs. I
can do all cursor movement, scrolling, and selection very nicely in Emacs.
And all text manipulation commands are immediately accessible from the
keyboard. Pair that with a bash command line running inside GNU screen,
and I can do about 50% of my work without using a mouse. Of the other 50%,
one big chunk is Microsoft Outlook which, as far as I know, I need because
we are using an Exchange server. But the other big chunk is web browsing,
which, up until now, has been very mouse dependent.</p>
<p>Enter Conkeror, the keyboard-driven web browser that "conkers" the web
without a mouse. (I just made that up, btw. I do not know the origin of
the name "Conkeror".) Conkeror is a Mozilla-based browser (e.g. Firefox) with
an Emacs-like skin. Emacs users should feel at right home-- screen-stealing
toolbars and menubars are gone. In their place is the modeline and
mini-buffer. Commands are entered using <code>M-x</code>, switch
buffers using <code>C-x b</code>, incremental search using <code>
C-s</code>, and edit text using Emacs editing conventions. (Being
a relative Emacs newbie, I actually rebound a lot of these to be more
Windows/Firefox friendly. But I expect long time Emacs users would rejoice.)
</p>
<p>In my opinion, the best part about Conkeror is the hyperlink navigation
design. Hitting the <code>f</code> key while browsing highlights all
possible hyperlinks (or focus areas) <em>within the current view</em>.
Limiting the scope of choices to the current view is smart because you
most likely won't want to follow a link that's not in the current view.
To follow a link, there are two options. The first is to type in the link
number which is overlaid in the top left corner of each link. The second
method is to start typing any part of the link text and tab through the
remaining selections. A different color highlight shows which link is
currently selected. The second method is very fast-- however, the first
method is more robust in that it can handle links with no text or a large
number of links with similar text.</p>
<p>Conkeror is currently being actively developed and can be considered to
be alpha stage software so there are issues and bugs. Also the documentation
seems to be pretty sparse. However, to me, it looks like a really great tool
with a potential for much more efficient and comfortable browsing. Kudos
to the authors.</p>
<p>Will I ditch Firefox for Conkeror? That question remains to be answered. I
hope the answer will be yes. I plan to use it for a few days and see if I run
across any deal-breakers. Hopefully, with Conkeror, I can up my mouseless
activity to around 70%.</p>
<p>Below are some notes on using Conkeror. I am using the snapshot XULRunner
version of Conkeror on Windows XP.</p>
<br /><br /><strong>How to set a proxy server</strong><br />
<p>Assuming you have your proxy configured in Firefox already...</p>
<ul><li>Type <code>g about:config</code> and hit ENTER in Conkeror.</li>
<li>Hit ENTER to promise you'll be careful.</li>
<li>Hit TAB to get to the "Filter:" box and type in "proxy".</li>
<li>Go to <code>about:config</code> in Firefox and filter on "proxy".</li>
<li>Make the relevant settings in Conkeror match Firefox. Make sure
you set "network.proxy.type" in addition to the proxy servers. (If you
were wondering, no, I don't know how to set these preferences without
using the mouse.)</li>
</ul>
<br /><br /><strong>Here is my .conkerorrc file:</strong><br />
<p>See also <a href="http://dotfiles.org/.conkerorrc">dotfiles.org</a> for a few more.</p>
<pre>// new bindings
define_key(default_global_keymap, "C-w", "kill-current-buffer");
// rebound from global.js
define_key(default_global_keymap, "h", "find-url");
define_key(default_global_keymap, "f1", default_help_keymap);
define_key(default_global_keymap, "b", "switch-to-buffer");
define_key(default_global_keymap, "C-f", "isearch-forward");
// note, i had to comment out the "C-f" binding in basic-commands.js to make this work
// rebound from isearch.js
define_key(isearch_keymap, "C-f", "isearch-continue-forward");
// rebound from normal.js
define_key(content_buffer_normal_keymap, "back_space", "go-back");
define_key(content_buffer_normal_keymap, "S-back_space", "go-forward");
// rebound from element.js
//define_key(content_buffer_normal_keymap, "k", "bookmark");
// rebound from basic-commands.js
define_key(content_buffer_normal_keymap, "home","beginning-of-line");
define_key(content_buffer_normal_keymap, "end","end-of-line");
define_key(content_buffer_normal_keymap, "C-home","cmd_scrollTop");
define_key(content_buffer_normal_keymap, "C-end","cmd_scrollBottom");
// rebound from text.js
define_key(content_buffer_text_keymap, "home", "cmd_beginLine");
define_key(content_buffer_text_keymap, "end", "cmd_endLine");
define_key(content_buffer_text_keymap, "C-left", "cmd_wordPrevious");
define_key(content_buffer_text_keymap, "C-right", "cmd_wordNext");
define_key(content_buffer_text_keymap, "C-y", "cmd_redo");
define_key(content_buffer_text_keymap, "C-z", "cmd_undo");
define_key(content_buffer_text_keymap, "C-v", "cmd_paste");
define_key(content_buffer_text_keymap, "C-x", "cmd_cut");
define_key(content_buffer_text_keymap, "C-c", "cmd_copy");
// new for textarea.js
define_key(content_buffer_textarea_keymap, "home", "cmd_beginLine");
define_key(content_buffer_textarea_keymap, "end", "cmd_endLine");
define_key(content_buffer_textarea_keymap, "C-left", "cmd_wordPrevious");
define_key(content_buffer_textarea_keymap, "C-right", "cmd_wordNext");
define_key(content_buffer_textarea_keymap, "C-y", "cmd_redo");
define_key(content_buffer_textarea_keymap, "C-z", "cmd_undo");
define_key(content_buffer_textarea_keymap, "C-v", "cmd_paste");
define_key(content_buffer_textarea_keymap, "C-x", "cmd_cut");
define_key(content_buffer_textarea_keymap, "C-c", "cmd_copy");
// rebound for textarea.js
define_key(content_buffer_textarea_keymap, "C-home", "cmd_moveTop");
define_key(content_buffer_textarea_keymap, "C-end", "cmd_moveBottom");
// rebound from zoom.js
define_key(content_buffer_normal_keymap, "C-subtract", "zoom-out-text");
define_key(content_buffer_normal_keymap, "C-add", "zoom-in-text");
// webjumps
add_delicious_webjumps ("saltycrane");
add_webjump("g", "www.google.com/search?q=%s");
add_webjump("d", "del.icio.us/saltycrane/%s");
add_webjump("blank", "about:blank");
add_webjump("reader", "www.google.com/reader");</pre>
<br /><br /><strong>How to search the Conkeror mailing list archive</strong><br />
<p>Don't use the one linked from the Conkeror website. Instead use:
<a href="http://www.nabble.com/MozDev---conkeror-f11304.html">http://www.nabble.com/MozDev---conkeror-f11304.html</a>
</p>
<br /><br /><strong>How to get out of Adobe reader when visiting a pdf file</strong><br />
<p>See <a href="http://www.nabble.com/adobe-reader-tp7373120p7373120.html">
this thread</a> on the MozDev - conkeror mailing list archive.</p>
<br /><br /><strong>How to copy a link</strong><br />
<p>Use the <code>c</code> command.</p>
<br /><br /><strong><code>add_command</code> doesn't work!</strong><br />
<p>Per the ChangeLog, it was renamed to <code>interactive</code>. I still
can't figure out how to use <code>message</code> though.</p>
<br /><br /><strong>How to uninstall XULRunner</strong><br />
<p>Run the command <code>xulrunner --unregister-user</code> and then delete
the xulrunner directory. If you deleted the xulrunner directory without unregistering,
delete the registry items in <code>HKEY_CURRENT_USER\Software\mozilla.org\GRE</code>
on Windows, or the directory <code>~/.gre.d</code> on Linux.</p>
<p><em>Update 2008-09-11</em>: I discovered Conkeror now has external editing
capabilities. I can hit C-i in a text box and it will bring up Emacs. Problems:
I set EDITOR and VISUAL to be emacsclient, however,
when I spawn conkeror from wmii using MOD-p, and hit C-i in conkeror, it starts
a new emacs server instead of connecting to my current one. However, if I just
start conkeror from my terminal command line, it works correctly. Also, I don't
know how to change the major mode of Emacs for editing the text boxes. Otherwise,
good stuff.</p>
How to scroll in GNU Screen
2008-01-24T17:30:00-08:00https://www.saltycrane.com/blog/2008/01/how-to-scroll-in-gnu-screen/<p><a href="http://www.gnu.org/software/screen/">GNU Screen</a> is great.
But, after half a year of using it, I've only now figured out how to
scroll into screen's buffer (courtesy of <a href="http://www.kuro5hin.org/story/2004/3/9/16838/14935">
this tutorial</a>). Normally, I just use SHIFT+PGUP to scroll
up in <a href="http://software.schmorp.de/pkg/rxvt-unicode.html">urxvt</a>'s buffer. However, if I have two regions in screen, this
doesn't work. To scroll in screen's buffer, I need to enter "copy mode".
To do this, type <strong><code>C-a [</code></strong> or
<strong><code>C-a ESC</code></strong>. (The latter option works great for me
because I bound the prefix key to the backtick key instead of <strong>
<code>C-a</code></strong>.) Once in "copy mode", I can scroll using the
arrow keys or PGUP/PGDOWN keys. To exit "copy mode", I press ESC. Scrolling
within screen's buffer instead of urxvt's also prevents me from losing my
place in my scrollback buffer when I switch screen "windows" (terminal
sessions).</p>
<h5 id="useful-commands">Other useful commands</h5>
<ul>
<li><strong><code>C-a S</code></strong> splits into two regions</li>
<li><strong><code>C-a tab</code></strong> switches input focus to the next region</li>
<li><strong><code>C-a X</code></strong> kills the current region</li>
<li><strong><code>C-a :resize <em style="font-weight: normal">numlines</em></code></strong> resizes
the current region to <em style="font-weight: normal">numlines</em> lines.</li>
</ul>
<h5 id="custom-key-bindings">Custom key bindings for scrolling <em style="font-weight: normal">(updated 2009-04-01)</em></h5>
<p>If you don't want to hit <code>C-a ESC PGUP</code> everytime to page up,
you can create keyboard shortcuts. I use CTRL+K to scroll up one line and META+K to
scroll up one page (I know these are kind of weird key combinations). To create these
shortcuts, I put the following in my <code>.screenrc</code>.</p>
<pre>bindkey "^[k" eval "copy" "stuff ^b" # enter copy mode and move up one page
bindkey "^k" eval "copy" "stuff k" # enter copy mode and move up one line
bindkey -m "^[k" stuff ^b # move up one page
bindkey -m "^k" stuff k # move up one line</pre>
<p>Now, when I'm in screen and press <code>M-k</code>, screen enters copy mode and
scrolls up one page. Likewise, <code>C-k</code> enters copy mode and scrolls up one line.
As before, to exit copy mode, hit <code>ESC</code>.</p>
<h5 id="copy-paste">How to copy and paste in screen <em style="font-weight: normal">(added 2010-02-03)</em></h5>
<p>Thanks to this <a href="http://arundelo.livejournal.com/390.html">
GNU Screen cheat-sheet</a>.</p>
<ul>
<li>Enter scrollback mode using <code>C-a [</code> or <code>C-a ESC</code></li>
<li>Press the space bar to begin selecting text.</li>
<li>Move the cursor using h,j,k,l,C-b,C-f or arrow keys/PGUP/PGDOWN</li>
<li>Hit the space bar again to copy the selected text.</li>
<li>Hit <code>ESC</code> to exit scrollback mode.</li>
<li>Press <code>C-a ]</code> to paste.</li>
</ul>
<h5 id="multi-display">How to open 2 terminals connected to the same session (Multi display mode) <em style="font-weight: normal">(updated 2012-04-05)</em></h5>
<p>The -x option can be used to attach multiple terminals to the same screen session. Pretty cool!
Open a terminal and create a screen session named "local"</p>
<pre class="console">$ screen -S local </pre>
<p>Start a second terminal, then attach it to the existing session:</p>
<pre class="console">$ screen -x local </pre>
<h5 id="eliminate-copy-mode-delay">How to eliminate apparent delay when entering copy mode <em style="font-weight: normal">(updated 2012-04-05)</em></h5>
<p>To get rid of the apparent delay when entering copy mode, I set msgminwait to 0 in my ~/.screenrc</p>
<pre>msgminwait 0</pre>
<h5 id="screenrc">My ~/.screenrc on github</h5>
<p>Here is <a href="https://github.com/saltycrane/homedir/blob/master/etc/.screenrc">my ~/.screenrc on github</a>.</p>
<h5 id="see-also">See also</h5>
<p>See also my post, <a href="/blog/2012/10/how-start-long-running-process-screen-and-detach-it/">
How to start a long-running process in screen and detach from it</a>
and some "screen vs. tmux" links in
<a href="http://www.saltycrane.com/blog/2012/10/how-start-long-running-process-screen-and-detach-it/#comments">
the comments</a>.
</p>
How to get anti-aliased fonts for Cygwin with urxvt
2007-09-25T14:15:00-07:00https://www.saltycrane.com/blog/2007/09/how-to-get-anti-aliased-fonts-for/
<a href="http://software.schmorp.de/pkg/rxvt-unicode.html">urxvt</a>, or rxvt-unicode, is a better alternative to rxvt and xterm that supports <a href="http://www.freedesktop.org/wiki/Software/Xft">xft</a> (read anti-aliased) fonts. Here's how to make your terminal pretty:<br /><br />
You need: Cygwin with X, urxvt, and <a href="http://fontconfig.org/wiki/">fontconfig</a> (all available through Cygwin's setup utility)
<ol>
<li>To see the list of available fonts run: <code>$ fc-list</code></li>
<li>Select a font and put it in your ~/.Xdefaults file. e.g.
<pre>URxvt*font: xft:Bitstream Vera Sans Mono:size=12
Urxvt*boldFont: xft:Bitstream Vera Sans Mono:size=12:style=Bold</pre></li>
<li>Run: <code>$ urxvt</code></li>
</ol>
For reference, here is the list of fonts I got:
<pre>Bitstream Charter:style=Bold
Bitstream Charter:style=Bold Italic
Bitstream Charter:style=Italic
Bitstream Charter:style=Regular
Bitstream Vera Sans Mono:style=Bold
Bitstream Vera Sans Mono:style=Bold Oblique
Bitstream Vera Sans Mono:style=Oblique
Bitstream Vera Sans Mono:style=Roman
Bitstream Vera Sans:style=Bold
Bitstream Vera Sans:style=Bold Oblique
Bitstream Vera Sans:style=Oblique
Bitstream Vera Sans:style=Roman
Bitstream Vera Serif:style=Bold
Bitstream Vera Serif:style=Roman
Charter:style=Bold
Charter:style=Bold Italic
Charter:style=Italic
Charter:style=Regular
Clean:style=Regular
ClearlyU Alternate Glyphs:style=Regular
ClearlyU PUA:style=Regular
ClearlyU:style=Regular
Courier 10 Pitch:style=Bold
Courier 10 Pitch:style=Bold Italic
Courier 10 Pitch:style=Italic
Courier 10 Pitch:style=Regular
Courier:style=Bold
Courier:style=Bold Italic
Courier:style=Bold Oblique
Courier:style=Italic
Courier:style=Oblique
Courier:style=Regular
Cursor:style=Regular
Fixed:style=Bold
Fixed:style=Bold SemiCondensed
Fixed:style=ja
Fixed:style=ko
Fixed:style=Oblique
Fixed:style=Oblique SemiCondensed
Fixed:style=Regular
Fixed:style=SemiCondensed
Helvetica:style=Bold
Helvetica:style=Bold Oblique
Helvetica:style=Oblique
Helvetica:style=Regular
Lucida:style=Sans
Lucida:style=Sans Bold
Lucida:style=Sans Bold Italic
Lucida:style=Sans Italic
LucidaBright:style=Italic
LucidaBright:style=Regular
LucidaTypewriter:style=Sans
LucidaTypewriter:style=Sans Bold
Luxi Mono:style=Bold
Luxi Mono:style=Bold Oblique
Luxi Mono:style=Oblique
Luxi Mono:style=Regular
Luxi Sans:style=Bold
Luxi Sans:style=Bold Oblique
Luxi Sans:style=Oblique
Luxi Sans:style=Regular
Luxi Serif:style=Bold
Luxi Serif:style=Bold Oblique
Luxi Serif:style=Oblique
Luxi Serif:style=Regular
New Century Schoolbook:style=Bold
New Century Schoolbook:style=Bold Italic
New Century Schoolbook:style=Italic
New Century Schoolbook:style=Regular
Newspaper:style=Regular
Terminal:style=Bold
Terminal:style=Regular
Times:style=Bold
Times:style=Bold Italic
Times:style=Italic
Times:style=Regular
Utopia:style=Bold
Utopia:style=Bold Italic
Utopia:style=Italic
Utopia:style=Regular</pre>
Cygwin, X, ratposoin, screen, rxvt setup
2007-09-04T17:48:00-07:00https://www.saltycrane.com/blog/2007/09/cygwin-x-ratposoin-screen-rxvt-setup/Here are my configuration files for my current <a href="http://www.cygwin.com/">Cygwin</a>, <a href="http://en.wikipedia.org/wiki/X_Window_System">X</a>, <a href="http://www.nongnu.org/ratpoison/">ratpoison</a>, <a href="http://www.gnu.org/software/screen/">screen</a>, <a href="http://software.schmorp.de/pkg/rxvt-unicode.html">urxvt</a>, <a href="http://www.gnu.org/software/bash/">bash</a> setup.<br />
<br />
<b>General Cygwin and bash</b><br />
<ul><li>I changed filename completion to be case-insensitive since we're on Windows. To do this, see the last line in ~/.bashrc and the last line in ~/.inputrc below.</li>
<li>I changed the "/cygdrive" prefix to just "/". To do this, type this command once: "mount -s --change-cygdrive-prefix /"</li>
<li>I added aliases to use "grep" and "ls" with color. And I added aliases to start various windows applications. See ~/.bashrc.</li>
</ul>
<br /><b>urxvt</b><br />
<ul><li>urxvt (rxvt-unicode) is a better alternative to rxvt and xterm. See the ~.Xdefaults file for my urxvt customizations. I chose an anti-aliased font, removed the scrollbar, changed the background to dark blue and the foreground to light yellow, and set the number of saved lines to 8000. (Note, to scroll, hit SHIFT+PGUP or SHIFT+PGDN).</li>
</ul>
<br /><b>ratpoison and screen</b><br />
<ul><li>GNU Screen is a terminal multiplexer which can be used to manage terminal sessions. Ratpoison is a simple keyboard driven window manager largely modeled after GNU Screen which is used as an alternative to complex window managers such as <a href="http://en.wikipedia.org/wiki/GNOME">Gnome</a> or <a href="http://en.wikipedia.org/wiki/KDE">KDE</a>. Most of the ratpoison and screen configuration is copied from <a href="http://diveintomark.org/archives/2007/03/15/good-easy-2007">Mark Pilgrim</a>. The layering, as I understand it, is: the <strong>Windows XP</strong> OS runs the <strong>Cygwin/X</strong> environment which runs the <strong>ratpoison</strong> window manager which runs the <strong>urxvt</strong> terminal emulator which runs the <strong>screen</strong> terminal multiplexer which runs the <strong>bash</strong> command shell.</li></ul>
<br />
Update 5/2/2008: I learned how to paste in urxvt (actually bash). See my post,
<a href="http://www.saltycrane.com/blog/2008/05/how-to-paste-in-cygwin-bash-using-ctrl/">
How to paste in Cygwin bash using CTRL+V</a>.<br /><br />
<b>startxwin.bat</b> (windows batch 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
if "%OS%" == "Windows_NT" goto OS_NT
echo startxwin.bat - Starting on Windows 95/98/Me
goto STARTUP
:OS_NT
echo startxwin.bat - Starting on Windows NT/2000/XP/2003
:STARTUP
%RUN% XWin -rootless -clipboard -silent-dup-error
%RUN% /usr/local/bin/ratpoison</pre>
<b>~/.ratpoisonrc</b><br />
<pre># initial frame and window setup
hsplit
focusright
exec urxvt -e screen -RD
# use Pause as prefix key instead of Ctrl-T
escape Pause
# use global cursor positioning (not per-frame)
warp off
# set appearance of ratpoison status messages and input line
set bgcolor black
set fgcolor grey95
set font -b&h-lucidatypewriter-bold-r-normal-sans-18-180-75-75-m-110-iso8859-1;
set inputwidth 1247
set bargravity ne
set barpadding 4 4
msgwait 3
# top-level shortcuts (don't require prefix key)
definekey top C-M-Up focusup
definekey top C-M-Down focusdown
definekey top C-M-Left focusleft
definekey top C-M-Right focusright</pre>
<b>~/.Xdefaults</b><br />
<pre>URxvt*background: #000033
URxvt*foreground: #ffffcc
! run "fc-list" for a list of available fonts
URxvt*font: xft:Bitstream Vera Sans Mono:size=12
Urxvt*boldFont: xft:Bitstream Vera Sans Mono:size=12:style=Bold
URxvt*scrollBar: False
URxvt*scrollTtyOutput: False
URxvt*scrollTtyKeypress: True
URxvt*secondaryScroll: True
URxvt*saveLines: 8000</pre>
<b>~/.screenrc</b><br />
<pre>shell /usr/bin/bash
# scrollback
defscrollback 8000
# Window numbering starts at 1
bind c screen 1
bind 0 select 10
screen 1
# Create initial windows
screen -t home 1
screen -t myproj 1
screen -t pydev 1
screen -t docs 1
screen -t misc 1
# Set the caption on the bottom line:
# window-list <nowplaying> <mm>dd</mm>yy> <hh:mm>am/pm
# from http://diveintomark.org/public/2007/03/screenrc
caption always "%{= kw}%-w%{= BW}%n %t%{-}%+w %-= %1` %m/%d/%y %C:%s%a"
# use backtick for prefix key instead of Ctrl-A
escape ``
# use regular audible bell
vbell off
# skip intro
startup_message off
# detach on disconnect
autodetach on</hh:mm></nowplaying></pre>
<b>~/.bashrc</b><br />
<pre># prompt
# see http://www.ibm.com/developerworks/linux/library/l-tip-prompt/
export PS1="\n\e[31;1m\w\n\e[0m\$ "
# cygwin aliases
alias where='type -a'
alias grep='grep --color'
alias ls='ls --color=auto'
alias la='ls -dlAog --time-style="+%Y %m/%d %H:%M" .*; ls -Xlog --time-style="+%Y %m/%d %H:%M"'
alias ll='ls -Xlog --hide "*~" --hide "*.bak" --hide "*.orig" --time-style="+%Y %m/%d %H:%M"'
alias dir='ll'
alias ec='emacsclient -n '
# directory aliases
alias home='cd ~'
alias progfiles='cd /c/Program\ Files'
alias incoming='cd ~/incoming'
# windows aliases
alias firefox='/c/Program\ Files/Mozilla\ Firefox/firefox.exe &'
alias eclipse='/c/Programs/eclipse3.3/eclipse.exe -vmargs -Xms192m -Xmx192m &'
alias serena='/c/Program\ Files/Serena/vm/win32/bin/pvcsvmnt.exe &'
alias kdiff='/c/Program\ Files/KDiff3/kdiff3'
alias explorer='/c/windows/explorer /e /root,'
alias outlook='/c/Program\ Files/Microsoft\ Office/OFFICE11/OUTLOOK.EXE &'
alias taskmgr='/c/windows/system32/taskmgr.exe &'
alias word='/c/Program\ Files/Microsoft\ Office/OFFICE11/WINWORD.EXE '
alias excel='/c/Program\ Files/Microsoft\ Office/OFFICE11/EXCEL.EXE '
alias powerpoint='/c/Program\ Files/Microsoft\ Office/OFFICE11/POWERPNT.EXE '
alias acrobat='/c/Program\ Files/Adobe/Acrobat/Acrobat.exe '
# Get bash filename completion to be case insensitive - there is also a line in .inputrc
shopt -s nocaseglob</pre>
<b>~/.inputrc</b><br />
<pre># the following line is actually
# equivalent to "\C-?": delete-char
"\e[3~": delete-char
# VT
"\e[1~": beginning-of-line
"\e[4~": end-of-line
# kvt
"\e[H": beginning-of-line
"\e[F": end-of-line
# rxvt and konsole (i.e. the KDE-app...)
"\e[7~": beginning-of-line
"\e[8~": end-of-line
# VT220
"\eOH": beginning-of-line
"\eOF": end-of-line
# Get bash filename completion to be case insensitive - see also .bashrc
set completion-ignore-case on</pre>
backing up with rsync
2007-08-31T13:55:00-07:00https://www.saltycrane.com/blog/2007/08/backing-up-with-rsync/<p>
Here is a python script using rsync to backup my Users directory in
Vista to an external hard drive.</p>
<pre class="python">import os
cmd = "rsync -avz --exclude '/AppData/'" + \
"/cygdrive/c/Users/saltycrane" + \
"/cygdrive/f/backup/Users"
os.system(cmd)</pre>
<h4 id="why-not-proprietary-backup">Why not to use the backup program that comes with your external hard drive:</h4>
<blockquote>Do not, whatever you do, feed your valuable data to a program that is going to save it in a file format that can only be read by that program, or by
that kind of computer. Because when the program can’t or the computer can’t,
<em>you’re out of options</em>.
--<a href="">Tim Bray</a>, <a href="http://www.tbray.org/ongoing/When/200x/2006/01/31/Data-Protection#p-5"><em>Protecting Your Data</em></a>
</blockquote>
<h4 id="why-rsync">Why to use rsync:</h4>
<p><kbd>rsync -essh -rtpvz</kbd> rocks.
--<a href="http://diveintomark.org/">Mark Pilgrim</a>,
<a href="http://diveintomark.org/archives/2004/05/01/essentials"><em>Essentials</em></a>
</p>
<h4 id="trailing-slashes">On trailing slashes</h4>
<p>from the rsync man page:
<blockquote> A trailing slash on the source changes this behavior to avoid creating an addi‐
tional directory level at the destination. You can think of a trailing / on a
source as meaning “copy the contents of this directory” as opposed to “copy the
directory by name”, but in both cases the attributes of the containing directory
are transferred to the containing directory on the destination. In other words,
each of the following commands copies the files in the same way, including their
setting of the attributes of /dest/foo:<br>
<br>
rsync -av /src/foo /dest<br>
rsync -av /src/foo/ /dest/foo<br>
</blockquote></p>
<h4 id="rsync-sudo">Use rsync with sudo on the remote host <em>(added 2011-09-07)</em></h4>
<p>Use the <code>--rsync-path</code> option. e.g.</p>
<pre class="console">$ rsync -avz --delete --rsync-path="sudo rsync" /tmp/something myhost:/some/path </pre>
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>
How to install ratpoison with Cygwin
2007-07-16T17:48:00-07:00https://www.saltycrane.com/blog/2007/07/ratpoison-with-cygwin-works/
<p>Running the minimalist ratpoison window manager with Cygwin/X works. You will need to install the following Cygwin packages:
<pre>gcc-core
make
readline
xorg-x11-base
xorg-x11-devel
</pre></p>
Here is how to install:<br />
<ol>
<li>Download <a href="http://www.nongnu.org/ratpoison/">ratpoison</a></li>
<li><pre>$ tar xvfz ratpoison-1.4.2.tar.gz
$ cd ratpoison-1.4.2
$ ./configure
$ make
$ make install</pre></li>
<li>Put the following lines in your startxwin.bat file (and remove the other old %RUN% commands):
<pre>%RUN% XWin -rootless -clipboard -silent-dup-error
%RUN% /usr/local/bin/ratpoison</pre></li>
<li>Run the startxwin.bat file</li>
</ol>
<br />
UPDATE 11/08/2007:<br />
<p>When I installed this the first time, I had no problems. The second time I installed, after getting a new PC, I got the following error message when running <kbd>configure</kbd>:
<pre>configure: error: *** Can't find X11 headers and libs</pre>
I thought the reason was because I forgot to install the <code>xorg-x11-devel</code> package which contains the X11 headers. But even after installing it, I still got the same error. I could not figure out the reason why <kbd>configure</kbd> was not finding the headers and libs. So after searching the GNU autoconf manual, I found a way to specify the X11 headers and libs on the command line.
<pre>./configure --x-includes=/usr/X11R6/include/X11/ --x-libraries=/usr/X11R6/lib/</pre>
This did the trick. I'm not sure why it worked the first time and not the second time. See the <a href="http://www.gnu.org/software/autoconf/manual/autoconf.html">GNU Autoconf manual</a> for more information about the <kbd>configure</kbd> script.</p>
See also <a href="http://www.saltycrane.com/blog/2007/09/cygwin-x-ratposoin-screen-rxvt-setup/">Cygwin, X, ratposoin, screen, rxvt setup</a>