lecturing and git-bisect

I was recently asked to give a lecture for the PRELUDE series at McGill. Here was my abstract:

I don’t like computers, and neither should you.

We spend too much time figuring out how to talk to them, instead of having them figure out how to understand us.

There’s a big discontinuity between what software is providing, and the killer features we want!

We’re not completely lost though. There are a lot of good tools and methodologies available!

Until the feature gap closes, let me introduce you to some of these tools, and show you how I use the computer.

I spoke about a variety of topics with the intention of filling in everyone’s knowledge about the useful tools available to users and developers. I included a section about git-bisect and have posted the script in the examples section of the bash-tutor tarball. It is now available for you to download and share.

I hope everyone enjoyed the lecture, and I always appreciate feedback!

scary cool bash scripting inside a Makefile

Makefiles are both scary and wonderful. When both these adjectives are involved, it often makes for interesting hacking. This is likely the reason I use bash.

In any case, I digress, back to real work. I use Makefiles as a general purpose tool to launch any of a number of shell scripts which I use to maintain my code, and instead of actually having external shell scripts, I just build any necessary bash right into the Makefile.

One benefit of all this is that when you type “Make <target>”, the <target> can actually autocomplete which makes your shell experience that much more friendly.

In any case, let me show you the code in question. Please note the double $$ for shell execution and for variable referencing. The calls to rsync and sort make me pleased.

rsync -avz --include=*$(EXT) --exclude='*' --delete dist/ $(WWW)
# empty the file
echo -n '' > $(METADATA)
cd $(WWW);
for i in *$(EXT); do
b=$$(basename $$i $(EXT));
V=$$(echo -n $$(basename "`echo -n "$$b" | rev`"
"`echo -n "$(NAME)-" | rev`") | rev);
echo $(NAME) $$V $$i >> $(METADATA);
sort -V -k 2 -o $(METADATA) $(METADATA) # sort by version key

The full Makefile can be found inside of the bash-tutor tarball.

getting gedit to work like magic

i use gnu/linux. it’s probably no secret. what is more of a secret, is that i secretly (well actually not so secretly) love using gedit for editing text. i still use vim, echo (gnu bash) and emacs (but only for org-mode).

vim is really, really great. but for day to day full-screen coding, i love working in gedit. i only have one [1] longstanding gripe, and today i believe that it is solved. here is the magic combination which appeases my troubled spirit:

  • gedit smart spaces plugin [2]
  • gedit autotab plugin [3]
  • gedit modelines plugin [4]

install these, restart gedit, enable them, and happy coding!
while it will be much friendlier to use spaces for indentation, i still recommend using tabs, i mean, that’s what the 0x09 was invented for!

[1] actually i wish that everyone would just use eight-space-tabs for all their coding needs, but i realize there are some problems with this, and so i reluctantly am glad that modelines and the above magic exist.

[2] http://git.gnome.org/browse/gedit-plugins/tree/plugins/smartspaces

[3] http://code.google.com/p/gedit-autotab/

[4] http://library.gnome.org/users/gedit/stable/gedit-modelines-plugin.html.en

n900 features that should be added

i decided i’d compile a short list of features / functionality which should be added to the new nokia N900 to make it totally pro. it’s pretty good as it is, despite it not working with the bell networks. i’ve attempted to order this list in order of importance (more or less).

  • all the closed source bits must become free software under a GPL or AGPL license.
  • it should support a fully encrypted file system. if i lose my phone, i shouldn’t worry that all my data or contacts get stolen!
  • addresses that are stored in contacts should integrate with maps program. (currently they only display)
  • the stock maps tool should integrate nicely with the rest of the phone. currently it’s a bit of a sore thumb. confusing too. also it’s green.
  • screen/interfaces should support multi touch.
  • user should be able to choose username instead of default “user”
  • hostname should match bluetooth name, etc… on device, one name.
  • it should support the “usb on the go” host functionality. i’d like to be able to plug in a usb key and be able to copy files to and from it.
  • better battery, if even only an upgrade to the 1500mAh version.
  • once plugged in via usb, it would be nice to be able to unmount as usb device while retaining the charging functionality. currently, when you click on the notification area thing, usb mass storage mode is connected, but there is no software way to disconnect. (that i know of) this is important because you can’t access the files through your phone when mounted.
  • user should be able to specify which accounts notify you of new messages and which don’t. same for which do periodic updates and when.
  • default shell should be bash, not busybox, and it should include usual software like “man”.
  • should include stock ir remote control software, that has a large database of hardware including radios, air conditioners and weird tvs. irreco needs some serious work.
  • people sometimes click on contacts to view data eg a phone number or address to use on a different phone or otherwise. it should be easy to zoom into to read.
  • my gps should just work. (it doesn’t seem to at the moment for some reason)
  • since i change my wireless WEP keys often, and always forget them, the phones wireless manager should integrate nicely with aircrack-ng to easily help me recover my lost WEP key.
  • it could be a little thinner. it’s a bit of a brick as it stands. i could overlook this problem if it did everything above.
  • battery life indicator could benefit from having a countdown timer (sure it would change based on usage, but it would give users an approximate idea)
  • the cameras should be able to function as a usb camera for the computer when the device is plugged in. (over bluetooth could be nice too)

unfortunately i haven’t mentioned this phones positive features– many before me have– there are many! overall it’s a nice package and i look forward to seeing improvements to the above.