SaltyCrane: cygwinhttps://www.saltycrane.com/blog/2008-05-12T09:59:00-07:00/usr/bin/python: bad interpreter: Permission denied error
2008-05-12T09:59:00-07:00https://www.saltycrane.com/blog/2008/05/usrbinpython-bad-interpreter-permission/<p>
I have a Python script,
myscript.py with a <code>#!/usr/bin/python</code>
<a href="http://en.wikipedia.org/wiki/Shebang_(Unix)">shebang</a>* at the top
and tried to execute it on Ubuntu Linux using
<code>./myscript.py</code>. I got the following error message:
</p>
<pre>bash: ./myscript.py: /usr/bin/python: bad interpreter: Permission denied </pre>
<p>
Here are things to check:
</p>
<ul>
<li>The file should be executable (use <code>chmod +x myscript.py</code>)</li>
<li>The file shoud have Unix line endings</li>
<li>The file shouldn't be on a fat32 or ntfs filesystem. Apparently, bash can't handle scripts that are
stored on fat32 or ntfs</li>
<li>The shebang line must be less than 128 characters (on Linux)</li>
</ul>
<p>
<em>UPDATE 2015-09-23:</em> 7 years later, I ran into this error again on our Jenkins server...
A shebang line that is <strong>too long</strong> will also cause this error.
On Linux, the maximum length is 128 characters. See:
<ul>
<li><a href="https://github.com/pypa/pip/issues/1773">https://github.com/pypa/pip/issues/1773</a></li>
<li><a href="https://github.com/pypa/virtualenv/issues/596">https://github.com/pypa/virtualenv/issues/596</a></li>
<li><a href="http://superuser.com/questions/634555/shebang-line-length-limitation">http://superuser.com/questions/634555/shebang-line-length-limitation</a></li>
<li><a href="http://www.in-ulm.de/~mascheck/various/shebang/#length">http://www.in-ulm.de/~mascheck/various/shebang/#length</a></li>
</ul>
</p>
<hr>
<p>* <code>#!/usr/bin/env python</code> would be the more portable shebang.</p>
How to paste in Cygwin bash using CTRL-V
2008-05-01T18:32:00-07:00https://www.saltycrane.com/blog/2008/05/how-to-paste-in-cygwin-bash-using-ctrl/<p>I come from a Windows background where Cut/Copy/Paste are almost always CTRL+X/C/V
respectively. I like this consistency, so adjusting to Cygwin's (or other *nix
environments') use of SHIFT+INSERT or the middle mouse button for pasting in
terminals is a little annoying. After a bit of googling, I found a mailing
list thread that solved my problem.</p>
<p>This method uses a modification to <a href="http://en.wikipedia.org/wiki/Readline">
readline</a>'s ~/.inputrc configuration file, so it should work in rxvt, xterm,
or even the default cmd.exe shell. Here is what to do:</p>
Add the following line to your ~/.bashrc:
<pre>stty lnext ^q stop undef start undef</pre>
And add the following line to your ~/.inputrc:
<pre>"\C-v": paste-from-clipboard</pre>
<p>These modifications will unmap <code>stty</code>'s <code>lnext</code> (literal next-character) and
<code>readline</code>'s
<code>quoted-insert</code> settings which are normally mapped to CTRL-V.
For more details, see <a href="http://www.cygwin.com/ml/cygwin/2005-08/msg00190.html">
this cygwin mailing list thread</a>.</p>
<p>Note, this appears to be a Cygwin-specific solution. Linux users could use custom key
bindings in <code>gnome-terminal</code> or <code>konsole</code>, or translation tables
with <code>xterm</code>.</p>
<br />Useful commands for reference:<br />
<code>$ bind -p</code><br />
<code>$ stty -a</code><br />
How to install Mercurial 1.0 on Cygwin
2008-04-17T14:49:00-07:00https://www.saltycrane.com/blog/2008/04/how-to-install-mercurial-10-on-cygwin/
<p>Mercurial 1.0 has been released and I just posted,
<a href="http://www.saltycrane.com/blog/2008/04/how-to-install-mercurial-10-on-ubuntu/">
How to install Mercurial 1.0 on Ubuntu Gutsy (or Hardy)</a>. Here are
instructions for installing Mercurial 1.0 on Cygwin.</p>
<b>Install Mercurial 1.0</b>
<ol>
<li>Install Python Easy Install<br />
<pre>$ cd /tmp
$ wget http://peak.telecommunity.com/dist/ez_setup.py
$ python ez_setup.py</pre>
</li>
<li>Install Mercurial 1.0<br />
<pre>$ easy_install -U mercurial</pre>
</li>
<li>Trying <code>hg version</code>, gives me a
<code>ImportError: Permission denied</code> error.
<a href="http://www.velocityreviews.com/forums/t484678-python-eggs-on-cygwin.html">
Apparently</a>, there is a Eggs/Cygwin problem. To fix it, make the
dll files executable:<br />
<pre>$ chmod +x /usr/lib/python2.5/site-packages/mercurial-1.0-py2.5-cygwin-1.5.25-i686.egg/mercurial/*.dll</pre>
</li>
</ol>
Try <code>hg version</code> again:
<pre>Mercurial Distributed SCM (version 1.0)
Copyright (C) 2005-2008 Matt Mackall <mpm> and others
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.</mpm></pre>
<br /><b>Install hgk extension</b><br />
I'm not sure how to get <code>hg view</code> working in Cygwin. If anyone knows,
please let me know.
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>
Unaswered Questions
2008-01-25T15:32:00-08:00https://www.saltycrane.com/blog/2008/01/unaswered-questions/<div class="Section1"> <p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size: 10.0pt;font-family:Arial;color:navy">If you know the answer, please leave a comment.</span></font></p> <p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size: 10.0pt;font-family:Arial;color:navy"> </span></font></p> <p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size: 10.0pt;font-family:Arial;color:navy">1. How do I unpack a tarball to a specific directory?</span></font></p> <p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size: 10.0pt;font-family:Arial;color:navy">I know I can uncompress a tar file in the current working directory with tar –xvf mytarfile.tar. Can I upack it to another directory instead?</span></font></p> <p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size: 10.0pt;font-family:Arial;color:navy"> </span></font></p> <p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size: 10.0pt;font-family:Arial;color:navy"> </span></font></p> </div>
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>
Cygwin tips / howto's
2008-01-16T17:28:00-08:00https://www.saltycrane.com/blog/2008/01/cygwin-tips-howtos/
<br /><strong>cygwin tips / howto's</strong><br />
<ul><li><a href="http://www.saltycrane.com/blog/2008/04/how-to-install-mercurial-10-on-cygwin/">How to install Mercurial 1.0 on Cygwin</a> <em style="font-size:70%">(posted 4/17/2008)</em></li>
<li><a href="http://www.saltycrane.com/blog/2008/04/install-colinux-and-ubuntu-gutsy-on-win/">Install coLinux (and Ubuntu Gutsy) on Win XP using Slirp behind a corporate firewall/proxy server</a> <em style="font-size:70%">(posted 4/14/2008)</em></li>
<li><a href="http://www.saltycrane.com/blog/2008/02/how-to-get-summary-of-disk-usage-with/">How to get a summary of disk usage with du</a> <em style="font-size:70%">(posted 2/02/2008)</em></li>
<li><a href="http://www.saltycrane.com/blog/2008/01/how-to-scroll-in-gnu-screen/">How to scroll in GNU Screen</a> <em style="font-size:70%">(posted 1/24/2008)</em></li>
<li><a href="http://www.saltycrane.com/blog/2007/12/how-to-use-grep-and-find-to-search/">How to use grep and find to search specific files</a> <em style="font-size:70%">(posted 12/14/2007)</em></li>
<li><a href="http://www.saltycrane.com/blog/2007/11/cygwin-install-tips/">Cygwin install tips using cyg-apt</a> <em style="font-size:70%">(posted 11/16/2007)</em></li>
<li><a href="http://www.saltycrane.com/blog/2007/09/how-to-get-anti-aliased-fonts-for/">How to get anti-aliased fonts for Cygwin with urxvt</a> <em style="font-size:70%">(posted 9/25/2007)</em></li>
<li><a href="http://www.saltycrane.com/blog/2007/09/cygwin-x-ratposoin-screen-rxvt-setup/">Cygwin, X, ratposoin, screen, rxvt setup</a> <em style="font-size:70%">(posted 9/04/2007)</em></li>
<li><a href="http://www.saltycrane.com/blog/2007/08/backing-up-with-rsync/">backing up with rsync</a> <em style="font-size:70%">(posted 8/31/2007)</em></li>
<li><a href="http://www.saltycrane.com/blog/2007/07/ratpoison-with-cygwin-works/">How to install ratpoison with Cygwin</a> <em style="font-size:70%">(posted 7/16/2007)</em></li>
<li><a href="http://www.saltycrane.com/blog/2007/07/screenrc-and-xdefaults-for-rxvt/">.screenrc and .Xdefaults (for rxvt)</a> <em style="font-size:70%">(posted 7/12/2007)</em></li>
<li><a href="http://www.saltycrane.com/blog/2007/07/rxvt-gnu-screen-and-bash/">rxvt, GNU screen and bash</a> <em style="font-size:70%">(posted 7/12/2007)</em></li></ul>
How to use grep and find to search specific files
2007-12-14T18:04:00-08:00https://www.saltycrane.com/blog/2007/12/how-to-use-grep-and-find-to-search/<p>I often use <code>grep</code> to search through the text of my
files for search terms such as a variable or function name. For
example, since <code>xrange</code>
is <a href="http://www.artima.com/weblogs/viewpost.jsp?thread=208549">being
removed</a> from Python 3000, I'd like to search for all the
occurrences of <em>xrange</em>. Here is how to search all my Python
files in the current directory:</p>
<pre>$ grep --color "xrange" *.py</pre>
<p>Which outputs something like:</p>
<pre>dol2lol.py: for i in <span style="color:red">xrange</span>(len(dol[keylist[0]])):
dol2lol.py: for i in <span style="color:red">xrange</span>(len(dol[keylist[0]]))]
lol2lod.py:# for i in <span style="color:red">xrange</span>(len(locols[0])):
lol2lod.py:# for j in <span style="color:red">xrange</span>(len(keylist)):
lol2lod.py: return [dict([(keylist[j], locols[j][i]) for j in <span style="color:red">xrange</span>(len(keylist))])
lol2lod.py: for i in <span style="color:red">xrange</span>(len(locols[0]))]
table_modelview.py: for row in <span style="color:red">xrange</span>(nrows):</pre>
<p>The above command only works for the current directory. If I want
to recurse into subdirectories, I can use:</p>
<pre>$ grep -r --color "xrange" .</pre>
<p>However, this command often produces too many results because I
cannot specify which files to search. To gain better control over
which files are searched, I can use <code>grep</code> in combination
with the <code>find</code> command. Here is an example which recurses into
subdirectories and searches all my Python files
for <em>xrange</em>. (I know it's hard to imagine
when <em>xrange</em> would be inside anything other than a Python
file, but hey, it's just an example.</p>
<pre>$ find . -name '*.py' -exec grep --color 'xrange' {} +</pre>
<p><a href="http://www.oreillynet.com/cs/user/view/cs_msg/18273">Usually</a>,
using <code>find</code> with <code>-exec</code> is very
slow and <code>xargs</code> is used to gain performance. However,
thanks to the tip from <a href="http://www.in-ulm.de/~mascheck/various/find/#xargs">Some
notes about find</a>, I used the <em>+</em> expression at the end of
the commandline which avoids the <code>fork/exec</code> overhead,
without using <code>xargs</code>.</p>
<p>As a final example, here is how I search for the
text <em>#define</em> in all files in my current directory,
excluding my backup files (*~, *.orig, *.bak). In this example, I
don't want to recurse into directories, so I
set <code>-maxdepth</code>
to <code>1</code>. Note, <a href="http://www.in-ulm.de/~mascheck/various/find/#limit">Some
notes about find</a> has some other options about limiting the depth
portably, but this option worked for me. Note, this is similar to the
command I use as my Emacs grep.</p>
<pre>find . -maxdepth 1 ! -regex '.*~$' ! -regex '.*\.orig$' \
! -regex '.*\.bak$' -exec grep --color "#define" {} +</pre>
<br>
<b>Using grep to exclude a pattern</b><br>
<p>If you want to find all the lines that DO NOT match a particular pattern, use the <code>-v</code> (or <code>--invert-match</code>) option to invert the match and select non-matching lines.</p>
Cygwin install tips using cyg-apt
2007-11-16T17:23:00-08:00https://www.saltycrane.com/blog/2007/11/cygwin-install-tips/
<p>I recently got a new computer at work and needed to reinstall Cygwin. Here is my install procedure using the very nice <code>cyg-apt</code> script. It's like Debian's <code>apt-get</code> for Cygwin! Note, this install process assumes that I have all my init files backed up and can copy them over to my new machine.</p>
<ol><li>Run the Cygwin <a href="http://www.cygwin.com/setup.exe">setup</a> program and install the default packages plus <code>wget</code> and <code>python</code>.</li>
<li>Set the Windows user environment variable <code>HOME</code> to <code>c:\home\sofeng</code>. Note, I tried it with forward slashes, but then it doesn't work in my Windows batch file.</li>
<li>Start the Cygwin bash shell</li>
<li>Change the cygdrive prefix:<br />
<kbd>mount -s --change-cygdrive-prefix /</kbd><br />
If you don't have admin privileges:<br />
<kbd>mount -u --change-cygdrive-prefix /</kbd></li>
<li>Copy over my init files and startup scripts:<br />
<ul>
<li><strong>~/bin/startxwin.bat</strong><br />
This is the Windows batch file that I use to start my Cygwin/X environment. It does the following:
<ul>
<li>Adds <code>~/bin</code> to my <code>PATH</code></li>
<li><code>cd</code>s to my <code>HOME</code> directory</li>
<li>Starts the <code>ratpoison</code> window manager with a <code>urxvt</code> terminal running <code>screen</code></li>
</ul>
</li>
<li><strong>~/.Xdefaults</strong><br />
Sets the colors, font, and scrolling behavior for <code>urxvt</code>.
</li>
<li><strong>~/.bashrc</strong><br />
<ul>
<li>Sets the <code>PS1</code> (prompt), <code>EDITOR</code>, <code>http_proxy</code>, and other environment variables.</li>
<li>Sets a lot of aliases</li>
<li>Sets bash filename completion to be case insensitive</li>
</ul>
</li>
<li>~/.cyg-apt<br /></li>
<li>~/.emacs<br /></li>
<li>~/.emacs.d<br /></li>
<li>~/.inputrc<br /></li>
<li>~/.screenrc<br /></li>
<li>/etc/ssmtp/ssmtp.conf</li>
<li>/var/cron/tabs/sofeng</li>
</ul>
</li>
<li>Install <code>cyg-apt</code>
<pre>$ wget http://www.lilypond.org/~janneke/software/cyg-apt
$ chmod a+xr cyg-apt
$ mv cyg-apt ~/bin</pre></li>
<li>Install good stuff (note, if you don't already have <code>~/.cyg-apt</code>, you will need to run <code>cyg-apt setup</code> first):<br />
<table>
<tr><td width="270"><kbd>$ cyg-apt install rsync</kbd></td><td> Best backup utility</td></tr>
<tr><td><kbd>$ cyg-apt install screen</kbd></td><td> Terminal multiplexer</td></tr>
<tr><td><kbd>$ cyg-apt install xorg-x11-base</kbd></td><td> X Windows</td></tr>
<tr><td><kbd>$ cyg-apt install rxvt-unicode-X</kbd></td><td> Better Xterm</td></tr>
<tr><td><kbd>$ cyg-apt install diffutils</kbd></td><td> diff</td></tr>
<tr><td><kbd>$ cyg-apt install gcc-core</kbd></td><td> GCC C complier</td></tr>
<tr><td><kbd>$ cyg-apt install make</kbd></td><td> GNU make</td></tr>
<tr><td><kbd>$ cyg-apt install xorg-x11-devel</kbd></td><td> X header and library files for compiling <code>ratpoison</code> or other programs</td></tr>
<tr><td><kbd>$ cyg-apt install readline</kbd></td><td> used for <code>ratpoison</code></td></tr>
<tr><td><kbd>$ cyg-apt install cron</kbd></td><td> so I can schedule my backups and <code>updatedb</code></td></tr>
<tr><td><kbd>$ cyg-apt install ssmtp</kbd></td><td> Sendmail replacement so cron can email me</td></tr>
<tr><td><kbd>$ cyg-apt install emacs</kbd></td><td> Terminal version of emacs for quick editing jobs from the shell</td></tr>
</table>
</li>
</ol>
<h4>Other notes:</h4>
<ul>
<li>I thought that I needed to add <code>c:/cygwin/bin</code> to my Windows path in order to use <code>grep</code> in Emacs Windows. However, I later found out that this step is not needed. It is generally bad practice to add <code>c:/cygwin/bin</code> to the Windows path. Instead, I added the required code in my .emacs file. See <a href="http://cygwin.com/faq/faq-nochunks.html#faq.using.ntemacs">http://cygwin.com/faq/faq-nochunks.html#faq.using.ntemacs</a> for more information.</li>
<li>I used to keep my http proxy server information in <code>~/.wgetrc</code>, but now I store it in the <code>http_proxy</code> environment variable. (Note, it is lowercase and not uppercase. I don't know why this is.)</li>
</ul>
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>
Eclipse 3.3 cannot open a file from the command line
2007-07-19T17:14:00-07:00https://www.saltycrane.com/blog/2007/07/eclipse-33-cannot-open-file-from/
<div><font face="Arial" color="#000080" size="2"><span class="563360000-20072007">I want to type "<font face="Courier New" color="#000000"><strong>eclipse myfile</strong></font>" from the command line and have eclipse open <font face="Courier New" color="#000000"><strong>myfile</strong></font>. As of version 3.3, Eclipse can't do this. See <a href="http://dev.eclipse.org/newslists/news.eclipse.platform/msg59476.html">this post</a> on the eclipse mailing list and <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=60289">bug report 60289</a>. </span></font></div> <div><font face="Arial" color="#000080" size="2"><span class="563360000-20072007"></span></font> </div> <div><font face="Arial" color="#000080" size="2"><span class="563360000-20072007">I like Eclipse a lot, but am considering using emacs. It would be nice if there were a fast, keyboard driven editor/IDE with *functional* graphical decorations. Graphical icons are useful, but it shouldn't mean that the application is slow and requires a mouse.</span></font></div> <div><font face="Arial" color="#000080" size="2"><span class="563360000-20072007"></span></font> </div> <div><font face="Arial" color="#000080" size="2"><span class="563360000-20072007">sidenote: ratpoison with Cgywin/X, screen, rxvt, and bash are working great.<br /><br />
UPDATE 7/23/07: <a href="http://villane.blogspot.com/2007/06/padclipse-text-editor.html">Padclipse</a> is a lightweight editor based on Eclipse that allows you to open a file from the command line. You can add plug-ins to Padclipse like Eclipse, however, I could not get all of the Eclipse functionality to work.</span></font></div>
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>
.screenrc and .Xdefaults (for rxvt)
2007-07-12T17:48:00-07:00https://www.saltycrane.com/blog/2007/07/screenrc-and-xdefaults-for-rxvt/
<div><font face="Arial" color="#000080" size="2"><span class="978004200-13072007">Use SHIFT+PGUP and SHIFT+PGDOWN to scroll in rxvt. Here are my .Xdefaults and .screenrc config files. A lot of the .screenrc stuff is from <a href="http://diveintomark.org/">Mark Pilgrim</a>. I don't use his "nowplaying" script, but the caption seems to still work.</span></font></div> <div><font face="Arial" color="#000080" size="2"><span class="978004200-13072007"></span></font> </div> <div><font face="Courier New" size="2"><span class="978004200-13072007">! ~/.Xdefaults<br />Rxvt*background: #000033<br />Rxvt*foreground: #ffffcc<br />Rxvt*font: 14<br />Rxvt*geometry: 80x40<br />Rxvt*jumpScroll: True<br />Rxvt*scrollBar: False<br />Rxvt*scrollTtyOutput: False<br />Rxvt*scrollTtyKeypress: True</span></font></div> <div><font face="Courier New" size="2"><span class="978004200-13072007"></span></font> </div> <div><font face="Courier New" size="2"><span class="978004200-13072007"># ~/.screenrc</span></font></div> <div><font face="Courier New" size="2"><span class="978004200-13072007">shell $SHELL</span></font></div> <div><font face="Arial" color="#000080" size="2"></font> </div> <div><font face="Courier New" size="2"><span class="978004200-13072007"># scrollback<br />defscrollback 5000</span></font></div> <div> </div> <div><font face="Courier New" size="2"><span class="978004200-13072007"># Window numbering starts at 1<br />bind c screen 1<br />bind 0 select 10<br />screen 1</span></font></div> <div> </div> <div><font face="Courier New" size="2"><span class="978004200-13072007"># Set the caption on the bottom line:<br /># window-list <nowplaying> <mm/dd/yy> <HH:MM>am/pm<br /># from <a href="http://diveintomark.org/public/2007/03/screenrc">http://diveintomark.org/public/2007/03/screenrc</a><br />caption always "%{= kw}%-w%{= BW}%n %t%{-}%+w %-= %1` %m/%d/%y %C:%s%a"</span></font></div> <div> </div> <div><font face="Courier New" size="2"><span class="978004200-13072007"># use backtick for prefix key instead of Ctrl-A<br />escape ``</span></font></div> <div> </div> <div><font face="Courier New" size="2"><span class="978004200-13072007"># use regular audible bell<br />vbell off</span></font></div> <div> </div> <div><font face="Courier New" size="2"><span class="978004200-13072007"># skip intro<br />startup_message off</span></font></div> <div> </div> <div><font face="Courier New" size="2"><span class="978004200-13072007"># detach on disconnect<br />autodetach on</span></font></div>
rxvt, GNU screen and bash
2007-07-12T12:53:00-07:00https://www.saltycrane.com/blog/2007/07/rxvt-gnu-screen-and-bash/
<div><font face="Arial" color="#000080" size="2"><span class="588035618-12072007">rxvt is a <a href="http://blasphemousbits.wordpress.com/2007/02/12/rxvt-solves-many-cygwin-woes/">better alternative</a> to the default Cygwin cmd.exe setup. </span></font><font face="Arial" color="#000080" size="2"><span class="588035618-12072007"><a href="http://www.gnu.org/software/screen/">GNU screen</a> is a full-screen window manager that, among other things, allows you to quickly switch between shell sessions. I had some trouble figuring out how to use them together along with bash, so here are my notes on how I did it.</span></font></div> <div><font face="Arial" color="#000080" size="2"></font> </div> <div><span class="588035618-12072007"><font face="Arial" color="#000080" size="2">In your Cygwin Windows shortcut put:</font></span></div> <blockquote dir="ltr" style="MARGIN-RIGHT: 0px"> <div><span class="588035618-12072007"><font face="Arial" color="#000080" size="2">Target: <font face="Courier New">C:\cygwin\bin\rxvt.exe -e bash --login -i</font></font></span></div> <div><span class="588035618-12072007"><font face="Arial" color="#000080" size="2">Start in: <font face="Courier New">c:\cygwin\bin</font></font></span></div></blockquote> <div dir="ltr"><span class="588035618-12072007"><span class="588035618-12072007"><font face="Arial" color="#000080" size="2">At the end of your ~/.bash_profile, put the following line:</font></span></span></div> <blockquote dir="ltr" style="MARGIN-RIGHT: 0px"> <div dir="ltr"><span class="588035618-12072007"><span class="588035618-12072007"><font face="Courier New" color="#000080" size="2">screen bash</font></span></span></div></blockquote> <div dir="ltr"><span class="588035618-12072007"><span class="588035618-12072007"><font face="Arial" color="#000080" size="2">Also, in your ~/.screenrc file (if you have one), make sure your shell command does not have a dash "-" in front. The dash in front will make screen treat the shell as a login shell, executing your "screen" command in your .bash_profile recursively. (see <a href="http://www.zsh.org/mla/users/2004/msg00523.html">this thread</a> on the zsh mailing list).</font></span></span></div> <div dir="ltr"><span class="588035618-12072007"><span class="588035618-12072007"><font face="Arial" color="#000080" size="2"></font></span></span> </div> <div dir="ltr"><span class="588035618-12072007"><span class="588035618-12072007"><font face="Arial" color="#000080" size="2">As a side note, I'm also trying out <a href="http://samba.anu.edu.au/rsync/">rsync</a>. After only a small amout of use, I tend to agree with others that it rocks.</font></span></span></div>