ssh-copy-id

ssh-copy-id is a great little bash script.  Basically, you run:

ssh-copy-id myuser@someserver.com

And ssh-copy-id will copy your public key into the authorized_keys file of your user on that remote system.  From now on when you ssh to that system, you won’t need to enter a password.

The only problem is, the site that used to host the ssh-copy-id script has gone down.  I can’t find it anywhere any more.  So… I’m going to put it up here!  Enjoy!

To install ssh-copy-id on Linux or Mac:

sudo wget http://blog.christopherpitzer.com/wp-content/uploads/ssh-copy-id -O /usr/bin/ssh-copy-id
sudo chmod +x /usr/bin/ssh-copy-id

That’s it.  Have fun.  Here are the docs if you’d like some more reading.

Timebook – command line time tracking

What is Timebook?

Timebook is a command line utility that tracks your time without costing you any of it.

Preface

There are a few time tracking tools out there. I’ve used SlimTimer in the past, but having an extra window open is a pain, especially a browser window. As much as I love Firefox, I don’t want my paycheck to count on it not crashing.

So, I usually end up keeping a big Google Docs spreadsheet. I have different pages for different clients and columns for date, task, clock in time, clock out time, etc. It’s not a bad system, but it means clocking in takes me 30 seconds. Too much overhead.

So I was talking to Trevor about two weeks ago, and mentioned my frustration. “I wish there was a way I could track time by just entering “timer start ‘client’ ‘task-description’ on the command line.” He shot me a link to a python script he’s been using for a few years that does just that (though the syntax is a little different)! And ever since, we’ve been refining it and adding features. I find it incredibly useful – take a look!

Using Timebook

First, let’s take a look at the Timebook commands. Note that the base for timebook is “t” and you can use 1 letter shortcuts for every one of the timebook commands. So in the examples below, I’m going to use “t s” instead of “t switch”, etc.

$ t --help
Usage: t [OPTIONS] COMMAND [ARGS...]
 
where COMMAND is one of:
    alter - alter the description of the active period
    backend - open an the backend´s interactive shell
    display - display the current timesheet
    format - export a sheet to csv format
    in - start the timer for the current timesheet
    kill - delete a timesheet
    list - show the available timesheets
    now - show the status of the current timesheet
    out - stop the timer for the current timesheet
    running - show all running timesheets
    switch - switch to a new timesheet

Timebook will start you off on a timesheet called “default”. You’ll probably want to have different timesheets for different groups of tasks; say, different clients. Let’s say you have one for your client Acme. Switch to the Acme timesheet like this (it will be created as you start using it).

$ t s Acme

Now let’s say you’re going to spend an hour tightening widgets. Punch in like this.

$ t i tightening widgets

Pretty easy! Let’s say you’ve been working for a while and you wanted to be reminded what task you were on and how long you’d been on it. Try this command.

$ t
Acme: 0:40:48 (tightening widgets)

Clock out like this.

$ t o

Now let’s start a new task, and display our timesheet so far.

$ t i running errands
$ t d
Timesheet Acme:
Day            Start      End        Duration   Notes
Mar 19, 2009   14:47:59 - 16:30:28   1:42:29    tightening widgets
               16:30:33 -            0:00:03    running errands
                                     1:42:32    
Total                                1:42:32

Play around with some of the other commands. You can list your timesheets, display which ones are active, export your timesheet (even given a particular date range) as a csv (hopefully soon an excel doc).

Lots of fun stuff to play with. And it’s definitely the lightest weight timekeeping app I know of.

Installing Timebook

Linux

$ sudo apt-get install mercurial # if you don't already have mercurial
$ hg clone http://hg@bitbucket.org/trevor/timebook/
$ cd timebook 
$ sudo python setup.py install

Windows
coming soon
OS X
First get mercurial. Here’s one option: http://mercurial.berkwood.com/

$ hg clone http://hg@bitbucket.org/trevor/timebook/
$ cd timebook 
$ sudo python setup.py install

turn off trackpad taps while typing

So I have this Macbook I’m running Ubuntu 8.10 on.  I have taps turned on as a way to click on things because that’s my general preference… but it can get me in trouble.  The thing about Macbooks is that they have huge trackpads.  It’s pretty easy to touch the trackpad while you’re typing, which will cause you to jump around mid-sentence.  Annoying.

Wouldn’t it be nice if we could disable touchpad taps while typing?

Here we go… from the terminal, try out this command:

syndaemon -dti 1

That will turn off tapping on the keypad for 1 second each time you press a key on the keyboard. What do those flags mean?

-d    Start the process as a daemon (in the background)

-t    Only disable tapping, not mouse movements.

-i #  how many seconds to disable tapping after the last keypress.

So, play with it and figure out your preferred settings.  1 second?  2 seconds?  When you are happy with how you have it set up, go to System -> Preferences -> Sessions (in Ubuntu) and add the command so it will run every time you start your computer.

Ubuntu’s crappie fonts

If you develop websites on Ubuntu, you may have noticed the horrible fonts it uses.  You want Times New Roman?  It gives you some quasi Courier-New mutant.  Microsoft’s Truetype fonts, though free, are not open source, so Ubuntu cannot offer them as part of its default package.

You can, however, install them yourself.

sudo apt-get install msttcorefonts

That’s it!  Reboot your browser and you will now see fonts (at least the common ones) the way the rest of the world does.