I love Django management commands.
For dpaste.com I’ve written several management commands for things that I don’t need a web UI for, like:
expire - delete expired pastes (invoked by cron) expunge - manage TOS violations like spam stats - useful metrics on the current corpus of pastes, and on user activity In running the site I also use management commands from my django-blocklist app, for tasks like deleting expired entries (via cron) or generating reports.
A step-by-step guide from real life
Go to darktable.org/install. Skim page. Download some tarball. Scratch head over .tar.xz format. brew install xz xz --decompress darktable-1.4.2.tar.xz cd darktable-1.4.2 ./build.sh --prefix /opt/darktable --buildtype Release Fail. brew install cmake brew install glib brew install gtk Fix weird permissions error inside existing libpng install. brew install gtk again brew install webp brew install lensfun build.sh again… fail, needs rsvg2 No available formula for rsvg2 No available formula for rsvg Give up on build.
Recently I switched my work environment from OS X to Ubuntu (a post on that project is in the works).
For years I’ve been using the standard Apple Keychain app, which has several points in its favor: it’s included with the OS, it integrates well with a lot of applications, and is not trying to “freemium” me into a paid tier. However, it’s OS X only, which meant I had to find something new.
In the shell, emacs is my editor of choice. However, it has one default behavior that has gotten in the way more often than it has helped – automatic generation of backup files in the same directory as the original.
Emacs is great for making quick edits to files on the web server. But I don’t want or need all those *~ files sitting around. The material is all in version control, so I can already revert to any point in history.
When I created dpaste, I tried to make it both a simple browser-based tool and a simple RESTful API. With very little work you could write a script that created a new paste item with a single POST.
Over the life of the site a few people have discovered and played with that “secret” API. I’ve now made it a bit more official. The new API has its own URL (versioned, even!
This has been going around – give people a peek at what commands you run most often. I ran this on my server, where I spend most of my shell time:
> history|awk '{a[$2]++} END{for(i in a){printf "%5d\t%s\n",a[i],i}}'|sort -rn|head
103 hg
81 cd
67 ll
29 ./manage.py
23 ab
21 re-ap
17 hgup
14 svn
13 cat
12 ls
Notes:
Mercurial has pushed my use of Subversion way down. I can’t remember what I was benchmarking with ab, but I’m sure it’s faster now!
An opinionated minority of advanced computer users are rebelling against the WIMP (windows, icons, menus, pointers) model of HCI. They are developing and promoting alternative interfaces (typically desiigned to work with unix-based systems) that embody their opinions.
I haven’t used any of these yet, but here are the ones I keep encountering references to:
Ion Ratpoison Orion StumpWM Most if not all of these credit the terminal-only GNU Screen (a program I do use) with inspiration.