- 1 Preliminaries
- 2 Hardware
- 3 Software
- 4 Communicating and working across machines
- 5 Email -- Reading and writing
- 6 Browsing the Web, Web search, etc.
- 7 Version control, archives, DVCS/DRCS, etc
- 8 Locating content and information
- 9 Writing documentation
- 10 Creating this Web site
- 11 Suggestions for MS Windows users
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.
- 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) | (ethernet) | +------ 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.
- 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/
- 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).
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.
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:
#!/bin/bash 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:
#!/bin/bash sudo umount /crow-a1
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/.
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 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.
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).
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
I'm constantly using one search engine or another, most frequently:
- Dogpile -- http://www.dogpile.com/
- Duckduckgo -- https://duckduckgo.com/
- IxQuick -- https://ixquick.com/
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.
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.
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".