I’ve long found it annoying that the active tab in Google Chrome has almost the same color as the inactive ones.

This can be easily fixed by installing a custom theme such as this one. The active tab in this theme is dark and the inactive ones light. The contrast makes it possible for me to see in my peripheral vision where I am when switching between tabs.

Don’t know why I didn’t think of this before…

I’m running Gitosis on my home Linux server. I like to keep everything under source control, and this setup allows me to have dozens of small projects with very little overhead.

This is really convenient, except every time I start a new project I have to

  • Add it to gitosis-admin, commit and push
  • Set up the initial Git repo for the project
  • Touch, add and commit a README
  • Setup the remote
  • Do the inital push with “-u”

Obviously, this gets pretty tedious, so I automated it with the following script.

#!/bin/bash

PROJECT=$1
THIS_SCRIPT=`readlink $0`
GITOSIS_ADMIN_DIR=${THIS_SCRIPT%/*/*}
GIT_SERVER=chopmo.dk

echo "Project:" $PROJECT
echo "Gitosis admin is at $GITOSIS_ADMIN_DIR"
echo "Adding project to gitosis-admin"
cd $GITOSIS_ADMIN_DIR
sed -i "" "/just-me/,\$s/writable.*/& $PROJECT/" gitosis.conf
git add gitosis.conf
git ci -m "Adding new project $PROJECT"
git push

echo "Setting up local repo"
mkdir $PROJECT
cd $PROJECT
git init
touch README
git add README 
git ci -m "initial commit"
git remote add origin git@$GIT_SERVER:$PROJECT.git
git push -u origin master

echo "Done."

It is stored under “bin” in my gitosis-admin repo and symlinked to ~/bin/new_project (which is why the readlink at the top is important).

The “sed” call appends the new project name to the list of projects which are writable by only me. The just-me,$ addresses are necessary because the structure of my gitosis.conf is:

[gitosis]

[group gitosis-admin]
writable = gitosis-admin
members = ...

[group just-me]
writable = foo bar baz ...

members = ...

So without the limiting addresses, I would append the new project to the writable projects in the gitosis-admin group as well.

My bash skills are pretty weak, so feedback on the script would be very welcome. But this works, and it means that the amount of time from I get an idea for a new project until I can start hacking on it is brought down to just a few seconds.

 

Xoom review

September 1, 2011

For some reason, I have completely neglected to write about my favourite gadget of the year: The Motorola Xoom.

I just love this device. It is perfect for casual browsing, checking email, checking Twitter, Facebook, newssites and all that waste of time. And Amazon has created an excellent tablet-optimized Kindle app, which is probably what I’ve spent the most hours using (until now that I’ve bought a real Kindle – more about that in an upcoming post).

It has more storage space that I’m going to need anytime soon (32GB I think), it has Wifi of course, excellent battery life, nice and responsive screen. In short, the hardware is great and the build quality feels good.

This is the device that Google uses for developing Honeycomb, meaning that it is always up to date and contains no wierd-ware. This is just stock Android 3.x, and everything works together as it should.

App highlights: Kindle, Google Maps, the builtin browser, BeyondPod HD, Gmail, IMDB, the list goes on. We’re really starting to see some great tablet-optimized apps, even if most of them are from Google so far.

BeyondPod really stands out, they have done an excellent job of adapting their phone version (which I like a lot) to the larger screen. It offers a much better blog reading experience than eg. Google Reader in the browser.

Well, it can’t be all good, can it? On to the bad stuff.

Most obvious flaw: The reflective screen. This sucks exactly as much as it does on a laptop and makes it impossible to use the device outside except at night. I ended up buying a screen protector which has solved this problem at the cost of a little screen clarity. But you get used to that, and the screen protector also eliminates ugly fingerprints on the screen. It even makes it possible to use the tablet even if your fingers aren’t completely dry which was a welcome surprise. It is really a bitch to apply it, but well worth the effort.

Second slight drawback: It’s a bit heavy for extended reading sessions. However, you quickly get used to resting it on something.

Conclusion: If you like Android and want a tablet, I highly recommend this device. It’s more geeky than the iPad, but if you’re a geek like me, you’ll appreciate this.

~/bin/remind

August 29, 2011

Here is a very simple helper script I came up with today:

#!/bin/sh
grep $1 ~/.bash_history | uniq

I’m currently using Maven on a client project and I keep forgetting the various invocations of mvn. So this helps remind me.

Example:

[ ~/wb/foo ] $ remind mvn
mvn 
which mvn
mvn -v
mvn -cpu hpi:create
mvn package
mvn --help
mvn -o package
mvn install
mvn -DdownloadSources=true -DdownloadJavadocs=true -DoutputDirectory=target/eclipse-classes eclipse:eclipse
mvn hpi:run

This is handy for those cases where I want an overview of all ways in which I’ve recently used a command.

If I just want to recall a specific command, I use bash’s Ctrl-R and whichever few letters of the command I remember:

ctrl-R ec

This will recall the long second-to-last command in the example above.

 

Rich Hickey has done a pretty amazing job, mostly single-handed, of creating Clojure. Aside from the popularity of the language itself, Clojure seems to have inspired even more people to start talking about functional programming.

However, Rich is going to need funding to continue developing the language next year.

In his own words:

As should be obvious, Clojure is a labor of love on my part. Started
as a self-funded sabbatical project, Clojure has come to occupy me far
more than full-time. However, Clojure does not have institutional or
corporate sponsorship, and was not, and is not, the by-product of
another profitable endeavor. I have borne the costs of developing
Clojure myself, but 2009 is the last year I, or my family, can bear
that.

The above is an exerpt from a long post by Rich on the Clojure Google Group.

On a personal note, I am surprised that Rich explicitly states that people who are just “evaluating Clojure” should not feel obliged to pay anything.

This is a really nice attitude, but also very ineffective. By far most of us use Clojure only for playing around and maybe solving the occasional Project Euler problem. Does that amount to more than just evaluating the language? Most would probably say no, especially when the suggested donation for “real users” is $100/year.

Instead, if all us casual users donate just a little bit, for example $10, it will amount to quite a substantial amount of money. My guess would be a lot more than the $100/year paid by the relatively few commercial users.

So if you want Clojure to stay alive, chip in! $10 is not a lot of money.

Quick tip: Replacing cmd.exe

December 14, 2009

It has been a long while now since I ran Windows on hardware. However, I need to use it for a lot of things at work, so I have several Windows VMs running on ESX hosts and I just RDP to them.

Most of the time, this works really well. I have always been pretty impressed with the RDP protocol (not so much after trying NX, but it’s still decent). However, one huge annoyance is the Command Prompt, cmd.exe. Whenever large amounts of text scroll by (verbose logging, for example), my RDP session simply hangs. There’s nothing I can do to break the output. Ctrl-C can take ages to get though and I usually end up killing the RDP client.

So I recently decided to find an alternative, and that turned out to be pretty easy: Console.

It is by no means perfect, in fact it is pretty rough around the edges. But scrolling works much better than with cmd.exe, and there are a few other improvements as well. For example, it is possible to resize the window without entering numbers in a dialog box :-)

Copying and pasting works a bit differently, so that took a few days of getting used to. But the good thing is that I no longer pause a running process accidentally by selecting a character of text (grr…).

Follow

Get every new post delivered to your Inbox.