# Making Yourself Comfortable With Git in the Terminal

If you’re cloning or forking Tracks from GitHub, you might be interested in some changes you can make to your .bashrc to make using git a bit more comfortable. Henrik over at The Pug Automatic posted this tip for putting both your current branch name on the command line, and also indicating whether you have any uncommitted changes in the branch. If your branch has uncommitted changes, it prints an asterisk after the branch name. This is incredibly helpful for seeing at a glance what state you are in, without having to issue the commands ‘git branch’ or ‘git status’. If you flit about between branches a lot, having the branch name at the command prompt can save you from a great deal of trouble.

You can grab Henrik’s code here, or use mine below. I just foraged around among the forks and the comments on this related post to get a version combining the best bits of them all, then I substituted in my existing command prompt. Enjoy!

# Morphexchange - Tracks as a Hosted Service

If you’d like to have a globally-accessible installation of Tracks, which you could access from any computer on the internet, but you either don’t have a web server, web host, or don’t want the hassle of installing it yourself, you could try Morph eXchange. The Morph Application Platform allows you to run certain Ruby on Rails applications as services. They have some services which require a paid subscription, but their Tracks service is free to use. All you need to do is go to the homepage, signup for an account, then under subscriptions you will see Tracks listed. Click subscribe, and you can launch Tracks and enter your data.

# Linking Actions and Yojimbo Items

If, like me, you have the snippet manager Yojimbo, you might be interested in a way to link actions to Yojimbo items. I often use this if I want to make extensive notes on an action, or if I want to update those notes frequently. It’s also handy if you want to keep login details close at hand for an action, but you don’t want to store passwords in plain text in Tracks.

It’s very easy. In Yojimbo, select the item you want to link, then go to Edit > Copy Item Link. Then switch to Tracks and click the edit button for the action you’re interested in. Paste the link you copied into the notes box, wrapped as a Textile link, like so (note that I’ve added spaces around the colon so that it renders properly on the page):


"Yojimbo item" : x-yojimbo-item://A8A40A39-blah-blah



When you update the action and open the notes field, you’ll find a clickable link that will open your Yojimbo item. It’s the kind of thing that’s crying out for an Applescript or a Quicksilver script to automate it, but it’s easy enough to do manually.

# All-in-one Installation for Windows

For those of you on Windows who have been struggling with getting Tracks installed, Jim Strupp has kindly packaged up an installation of Tracks which uses Uniform Server. Everything you need (except Ruby) is included, and it’s a simple double click on a batch file to start Tracks running. Give it a go! And many thanks to Jim for creating and hosting the package.

Updated 29-09-2006: Fixed the link to the installation.

# Mongrel and Windows

mk sent me the following tip for people wanting to running Tracks on Windows using Mongrel as the webserver, rather than WEBrick, Apache or lighttpd:

Installing mongrel (this would work for Linux and MacOS X users too):


sudo gem install mongrel
cd tracks_directory
mongrel_rails start -d



Running the service:


mongrel_rails_service install -n tracks -r c:\path\to\tracks -p 4000 -e production
mongrel_rails_service start -n tracks



Now hit the port and poof, it works (or should). The application will stop if you use:


mongrel_rails_service stop -n tracks



Off course, you can control service at services in the control panel. I have it set to start on boot, and that’s it. Read more about Mongrel or more about Mongrel on Windows.

# Installing Tracks Using Locomotive

Jacken has a great and very simple tutorial for installing Tracks using Locomotive for those of you on MacOS X. It’s a great (nearly) one-click install. Thanks, Jacken!

# Emailing Upcoming Actions to Yourself

Luke Melia came up with an absolute gem of a tip on the tracks-discuss mailing list. If you enter the following command in your crontab on the server which runs your copy of Tracks 1.04, it will email you a list of the upcoming actions which are due within the next 7 days every day at 6 am (the command should be on one line, without the backslashes):


0 6 * * * /usr/local/bin/curl -0 http://[tracks_url]/feed/text/[username]/[your_token]?due=6 | /usr/bin/mail -E -s 'Tracks actions due in the next 7 days' youremail@yourdomain.com



It’s easiest if you copy and paste the URL of the text feed from your feeds page. Of course you can choose any feed you like — why not email a list of next actions in a particular project to a group of colleagues who are working on the project?

# A Better Startup Item for Mac OS X Tiger

Jeroen van der Ham has been hard at work improving the method for starting Tracks when you login on Mac OS X Tiger, and has produced a .plist file which works on its own, without the need for a separate shell script file.

You can download the single .plist file here. Edit the file to put the full path to Tracks on your system under the ‘WorkingDirectory’ item, and also edit the port number if you want to run Tracks on a port other than 3000. Then save the file in ~/Library/LaunchAgents, making the LaunchAgents directory if it doesn’t yet exist. That’s all there is to it! When you next login, Tracks will start automatically. If you want to start Tracks manually, use the following command in Terminal:





The same command with ‘unload’ substituted for ‘load’ stops Tracks. Thanks to Jeroen for some very neat work!

# Starting Tracks at Login With Mac OS X Tiger

Several people have asked me if there’s a way to start up Tracks on your own machine when it boots or when you login. The answer if you’re using Mac OS X Tiger is yes — there’s an easy way.

NOTE: There’s now a better way to do this, which only involves one file.

Tiger comes with a new system for starting, stopping and monitoring processes called launchd. I found the discussions on MacOSXHints and Mac Geekery very useful when I was putting this together, and both are well worth reading if you want to find out more about the capabilities for launchd. However, I thought I’d save you a bit of hassle by putting the files together myself.

• Download the files here and unzip the package. You’ll find two files inside: com.rousette.tracks.plist and start_tracks.
• You need to edit both (using a text editor) and replace ‘YOURUSERNAME’ with your real user name. Unless your actual user name is ‘YOURUSERNAME’ — some people have a funny sense of humour. You might also want to change the port in start_tracks from the default 3030 if you have another app running on that port.
• Put the start_tracks file in ~/Library/Scripts/Applications/launchd, making the folders if necessary.
• Make sure start_tracks is executable by issuing this command in the Terminal:


cd ~/Library/Scripts/Applications/launchd
chmod +x start_tracks


• Put the file com.rousette.tracks.plist in ~/Library/LaunchAgents, again, making the folders if necessary.

When you next log in, the WEBrick server should start automatically. If you want to start it manually now, run:





or





to unload it. It seems that unloading the script doesn’t actually stop the server, so if you want to stop it, you’ll have to find the process ID and use that to kill it:


ps ax | grep -i "ruby script/server" | grep -v grep | awk '{print \$1}'



then note the number you get back (let’s say it’s 1283)


kill 1283



This method starts the server at user login, and doesn’t restart the server if it crashes or is stopped for some other reason. If you want to start the server when the computer boots, put the plist file in the root level Library folder (i.e. /Library/LaunchAgents), and put the start_tracks file in somewhere like /usr/local/bin. If you want the server to re-launch automatically when it gets killed, take a look at the manpage for launchd.plist. I think that it would probably work if you replace the RunAtLoad parameter with OnDemand, which should be set to false — but I haven’t tested that.

This method has started up WEBrick, but you could easily adapt it by replacing the command starting WEBrick in start_tracks with one starting lighttpd.