1   Preliminaries

There are several reasons for this post: (1) to offer suggestions and guidance and hints to those who think their work might gain from using similar tools and environment; and (2) to make those tools, that environment, and the way I work more clear to myself, so that I might learn new techniques and get ideas on how to improve my own style of work.

2   Hardware

I use:

  • Three desktop machines running Ubuntu GNU/Linux.
  • Two Raspberry Pi singe board computers running Raspian Linux. One of those Raspberry machines is connected to a TV set via HDMI.
  • One laptop machine running Ubuntu GNU/Linux.

All these machines are connected on my LAN (local area network). The three desktop machines connect wired via Ethernet cables. The two Raspberry Pi machines use a wireless connection.

I have three wireless routers: (1) 2WIRE550 is the DSL modem and wireless router. (2) dd-wrt-blueberry is a wireless router on which I've installed DD-WRT, the Linux based router firmware. This router is connected through Ethernet cable to the DSL modem. My wired GNU/Linux desktop machines (presently, magpie, crow, and quail) are connected to this router (dd-wrt-blueberry) through Ethernet cables. Two Raspberry Pi machines (bluebird and rook) and a GNU/Linux laptop (scrubjay) connect via wireless. (3) dd-wrt-tomato is a wireless router, also with DD-WRT installed, that sits in the middle of our house and acts as a repeater so that we have a stronger signal at the end of the house farthest from dd-wrt-blueberry.

Our LAN in ascii art:

The external world
2WIRE550 (DSL modem)
   +------ dd-wrt-blueberry --- (wireless) --- dd-wrt-tomato
              /     \                               |
        (Ethernet)  (wireless)                   (wireless)
            /         \                             |
     magpie         bluejay (R Pi)               scrubjay (laptop)
     quail          rook (R Pi)                  Roku/TV
     crow                                        Android smart phone

The machines that connect with a wireless connection (the Raspberry Pi machines, the laptop computer running GNU/Linux, an Android smart phone, and a Roku device) connect to either dd-wrt-blueberry or dd-wrt-tomato, usually to whichever is closest.

3   Software

  • terminator -- http://gnometerminator.blogspot.com/. An especially powerful terminal emulator that supports tabs, windows within tabs, and panes within windows. One especially useful feature is the ability to create and save a configuration or layout describing tabs, windows, and a command to be started in each window, then to start up terminator with that layout. I've also used xfce4-terminal (http://goodies.xfce.org/projects/applications/terminal), LXTerminal (http://www.lxde.org), and Gnome terminal (https://en.wikipedia.org/wiki/GNOME_Terminal) -- I'm happy with those, too.
  • byobu and tmux -- https://launchpad.net/byobu and http://tmux.github.io/. byobu is a wrapper, key bindings, and convenience functions wrapped around tmux or, the older screen. It enables me to create multiple sessions through a single ssh connection to a remote machine. I use a bash script to create multiple sessions, each open with a bash command prompt with a specific current directory.
  • vim -- http://www.vim.org/. Currently, my favorite text editor is vim. Every few years, I get bored and switch to a different programmers text editor. I've used joe, jed, emacs, geany, and even jedit. But, I haven't switched for a good while now, perhaps because vim is confusing and complex enough so that it keeps me interested.
  • bash -- https://www.gnu.org/software/bash/
  • ssh
  • Python -- http://www.python.org. Python compiled from source for both Python 2 and Python 3. I also use the Anaconda distribution of Python.
  • Erlang -- http://www.erlang.org. On several machines, I compile Erlang from source; on the others, I install it via aptitude (aptitude is a replacement for apt-get).

4   Communicating and working across machines

4.1   The command line (shell) and ssh

The first thing to understand is that I do most of my work in a terminal emulator at the bash command prompt or in some text mode application started from that prompt. Typical examples are Vim, IPython, the Erlang shell, etc.

Most commonly I work by using one machine (most often a Raspberry Pi) as a terminal to connect via ssh to other machines, and then work at the bash prompt on one of those "remote" machines. I use the terminator terminal emulator to open multiple tabs each containing multiple windows. Within each window I use byobu and tmux to create and work in multiple sessions on each of those machines (all but one of which is "remote", but sit in the same room).

Here is a typical screen shot: typical desktop layout.

4.2   Transferring files

Between machines that are both on my local network, I mount a file system using NSF and then copy files to and from a directory in that local file system. I have a bash script to mount that file system:

sudo mount -t nfs -v crow:/home/dkuhlman/a1 /crow-a1

Where crow is that name of the machine with the shared file system. Note that from some machines (in particular those that use a wireless connection, the shared machine must be addressed as crow.local.

And, to unmount it, the script is:

sudo umount /crow-a1

Between one of my local machines and a machine not on my local network, I use lftp (http://lftp.yar.ru/), or I use curl (https://curl.haxx.se/).

5   Email -- Reading and writing

Here, too, I use ssh. I connect to my account at davekuhlman.org via ssh, then read and write email in the mutt mail client. For information on mutt, see: http://www.mutt.org/.

6   Browsing the Web, Web search, etc.

Because a text mode browser is usually faster, I frequently use links2 (see http://links.twibright.com/), which can be installed via aptitude (or apt-get), if you prefer).

On GNU/Linux, I prefer Opera (http://www.opera.com/), and also Firefox (https://www.mozilla.org/en-US/about/).

On the Raspberry Pi, for graphical mode Web browsers, I've tried Epiphany (which seems to be the default on Raspian) and Midori. But Firefox seems to give me the best performance, although on Raspian it is called Iceweasel and can be installed with aptitude.

7   Version control, archives, DVCS/DRCS, etc

I'm a big fan of and believer in DVCS (distributed version control system). OK, so almost everybody else is, too. I use each of git, mercurial, and bazaar. My choice among those three depends to some extent on where out on the Web I want to store revisions: for Github, I use git; for Bitbucket, I use mercurial; and for Launchpad, I use bazaar. For stuff that is strictly local, I use bazaar.

For local and quick backups, I use any of zip/unzip or tar with one of the compression tools (tar command line options "-J/--xz" for xz, "-j" for bzip2, and "-z/--gzip" for gzip).

8   Locating content and information

8.1   Locating files and content on a local machine

I use locate or grep or find combined with grep.

locate -- When I really have no idea where I stored that stuff, I use:

locate "some keywords"

I'm pretty sure that the locate database is kept up-to-date automatically. But, you might have to update it manually by running:

$ sudo updatedb.mlocate

When I believe that what I'm looking for is in a subdirectory of a known directory, then I use find plus xargs plus grep:

$ find * -iname 'somefilepat*' | xargs grep "some text pattern"

I have a bash alias for find:

$ alias ff
alias ff='find * -iname'

Which enables me to shorten that to:

$ ff 'somefilepat*' | xargs grep "some text pattern"

When I'm sure that the file I'm looking for is in a specific (current) directory, plain old grep is usually enough. But, I really should get more familiar with vimgrep.

I often pipe the results of grep into vim:

$ ff 'file_pat*' | xargs grep "text pat" | vim -R -

And, then (in vim) I can use Ctrl-w g f to open some file of interest.

The following bash alias enables me to shorten that a bit also:

$ alias vv
alias vv='vim -R -'
$ ff 'file_pat*' | xargs grep "text pat" | vv

8.2   Finding stuff on the Internet

I'm constantly using one search engine or another, most frequently:

And of course, Wikipedia (https://en.wikipedia.org/) and Stackoverflow (http://stackoverflow.com/).

9   Writing documentation

I use Docutils/reStructuredText (http://docutils.sourceforge.net/) most of the time, asciidoc (http://asciidoc.org/) sometimes, and markdown (http://daringfireball.net/projects/markdown/) once in a while.

10   Creating this Web site

This is a static Web site generated with Pelican (http://getpelican.com/), which enables me to write Blog articles (like this one) and to create content with one of the light-weight markup languages (reST, Asciidoc, or Markdown). Most of the content is written in reST (reStructuredText) and converted to HTML with Docutils.

11   Suggestions for MS Windows users

If you are required to use MS Windows as your work platform, and you would like to work in the style described above, then you might consider the following:

  • Cygwin (https://www.cygwin.com/) -- Cygwin gives you the bash shell and command line; Cygwin enables you to enstall and use many GNU/Linux tools and OpenSource applications.
  • Console2 (https://sourceforge.net/projects/console/) -- Console2 is an advanced terminal emulator for MS Windows. It gives you tabbed multiple sessions and profiles for creating and initializing new tabs/sessions. There is also ConsoleZ (https://github.com/cbucher/console) which is possibly more up-to-date, although when I was using Console2, several years ago, it worked great.
  • The doskey utility gives you something that is a bit like bash aliases.
  • There are several utilities that will help you redefine keys on your keyboard and enable you to define keyboard macros. Search the Web for something like "MS Windows keyboard macros".