Posts tagged: UNIX

History lesson

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!
  • re-ap is my alias for restarting Apache (re-po restarts Postfix, re-my restarts MySQL, etc.).
  • hgup is a simple shell script that updates the live instance of my site by fetching from the Mercurial repository in the staging instance. It would make a neat Django custom management command, but not one tied to a particular app.

The anti-desktop movement

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:

Most if not all of these credit the terminal-only GNU Screen (a program I do use) with inspiration. The ideas of Jef Raskin undoubtedly are a factor too.

What is the iPhone running, really?

iphone In case you missed it, Apple has a new product. You can’t, you know, buy it or anything just yet – that’ll be about six months. And $500, please. While you wait you can compare it to the competition.

They claim that it runs OS X. Hm. I can imagine there’s a BSD kernel (running on what processor I don’t know), QuickTime, WebKit… but really, how much of the stuff in the standard OS X architecture diagram is actually going to be in that phone?

Goodbye, SCO

I haven’t been following the SCO case very closely, having only mentioned it once since I started this blog. So I missed this ass-kicking order that came down over the summer from Judge Brooke Wells. It’s long and detailed (GrokLaw speculates that this is to discourage SCO from a tedious appeal), so don’t be afraid to skim for the good parts. For example:

The court finds SCOs arguments unpersuasive. SCOs arguments are akin to SCO telling IBM sorry we are not going to tell you what you did wrong because you already know. SCO received substantial code from IBM pursuant to the courts orders as mentioned supra. Further, SCO brought this action against IBM and under the Federal Rules, and the courts orders, SCO was required to disclose in detail what it feels IBM misappropriated. Given the amount of code that SCO has received in discovery the court finds it inexcusable that SCO is in essence still not placing all the details on the table. Certainly if an individual was stopped and accused of shoplifting after walking out of Neiman Marcus they would expect to be eventually told what they allegedly stole. It would be absurd for an officer to tell the accused that you know what you stole Im not telling. Or, to simply hand the accused individual a catalog of Neiman Marcus entire inventory and say its in there somewhere, you figure it out.

Django development tips

Working on a couple Django projects in tandem has me tuning my approach to using the built-in development server. I thought I’d share some of the techniques I’m using.

Here are the commands I’m going to talk about. If you understand it all from these lines, you’re done!

screen -S projectname
./manage.py runserver |& tee -a logs/devserver.log
^A ^D
tail -f logs/devserver.log
screen -r projectname
screen -list

Using screen

screen -S projectname

The GNU screen command is incredibly useful for all kinds of things, including longish-running processes that need to be checked and tweaked and stopped and started – like your Django development server. (Read more about screen if this is new to you.)