Using Automator to make your life with Transmission easier

I have two computers: a Macbook with Snow Leopard, that sometimes I carry with me, and a computer at home with an Atom processor and running Linux that is my media server and downloader. If I need to download something that will take too much time, I put this second computer to download: it has a good connection and it’s always online.

It has Transmission running with its great web interface activated. If I need to download some torrent file, I open its web interface and upload the .torrent file. Good, but… it could be easier.

If you download torrent files very often, the easiest way is to use the watch-dir feature from Transmission: every torrent that you put at some directory is automatically downloaded by Transmission. So, all I needed to do was copying the torrent files from my Macbook to my home server, using SFTP.

To configure your Transmission watch-dir, you must stop the Transmission service (I’m running the transmission-daemon version) and edit the settings.json file, inserting the following settings:

"watch-dir": "/home/mediaserver/transmission/watch",
"watch-dir-enabled": true

Remember: you must stop Transmission service, edit the file and start it again!

It works, but… It can be even easier, I thought. And I remembered of Automator, a good piece of software that comes with Snow Leopard, and that I knew but never used before.

The idea was: every time a new .torrent file is written at my laptop’s download directory, it should be copied to my home server.

So I opened Automator and created a new Folder Action:

At the top of the new workflow, I selected my Downloads folder:

 The next step in our flow is to create a script to copy our files via SSH to the computer that’s running Transmission. Use Utilities -> Run Shell Script to make it:

Now add the following content as the script’s source code. To make it work automatically, I allow my SSH server to receive connections using keys, not passwords. Don’t forget to change the scp’s destination to your computer’s host and directory:

for f in "$@"
do
	ext=`basename "$f" | awk -F "." '{ print $NF }'`
	if [ "$ext" == "torrent" ]; then
		scp "$f" root@myhostname.asdf.com:/home/transmission/watch
	fi
done

That’s it! Save your workflow and test it. Now, every time you click at a torrent file and download it, Transmission will download it automatically.

Cool tools to avoid suffering with Windows

After two years working only with Linux and Mac OS, I received a new task that requires using Windows for two months (only two months, happily). It’s hard to get back to this bugful, unstable and confusing world: I do believe Linux and Mac OS are easier to use than Windows, that big world of icons that lead to icons that lead to icons that lead to nowhere, but I’m doing my best.

I tried to find a set of useful and free (as in “free beer” and/or as in “free speech”) tools to make my work easier. They are:

Classic Shell Setup

I don’t know why Microsoft removed the toolbar from Windows Explorer since Windows Vista, but this application tries to put it back there. It also allows you to get some customisation of Start Menu, and get a simple, fast and useful menu like the Windows 9x/ME/2000 times.

Notepad++

I like gedit and kate, and the native alternative for Windows is Notepad++: a good editor for plain text files, like source code.

Pidgin

With support for MSN/Live/whatever network, Google Talk, ICQ, etc. Pidgin is one of the best chat clients. I’d rather use it than the fancy MSN Live Messenger.

Winamp

Why use iTunes or the suffering Windows Media Player if you can use Winamp? It has a clean interface, a good way to organise library (although it’s a little bit iTunesy) and a simple playlist, everything in the same screen. I really love the good and old Winamp.

VLC

Winamp can play some videos, but I think VLC is a better tool for this job. Besides, it has a great support for a huge range  of video formats and features for users with any needs and all experience levels.

Firefox 4.0 pre-beta released

Lifehacker shown a screenshot of the new Firefox 4.0 pre-beta for Windows. Here it is (Mozilla names Firefox beta versions “Minefield”):

Nice, isn’t it? So, I downloaded the new beta for Linux, and it looks like the screenshot below. I had to set the tabs to be on top; Windows version brings this for default (at least the one that I installed using Wine).

Firefox 4.0 pre-beta on Linux

Compare. The screenshot below is Firefox 3.6.4.

Firefox 3.6.4 on Linux

It’s a little far from the mockups of Firefox for Linux at Mozilla’s site. I hope I can see it soon. :)

Windows 95: someone still loves you

Or at least uses you.

I use StatPress to get statistics of the last readers of this blog. One of the informations I have access to are the operating systems that the last visitors were using. And how surprising it was to discover that I still have a visitor that was using Windows 95:

I really hope this person is using some extension to change his/her browser’s user agent header or just woke up from a sleep of 10 years or more.

How to fix ugly fonts in Qt-based applications

I was using Qt Creator and tried to change the editor’s font to Monaco, 9. But hey, Monaco is not that ugly:

Monaco before fix

So I googled a way to fix for this problem, and found the fix at Arch Linux forums. You’ll need to create a file called .fonts.conf in your home directory with this content:

<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
   <match target="font" >
      <edit mode="assign" name="rgba" >
         <const>rgb</const>
      </edit>
   </match>
   <match target="font" >
      <edit mode="assign" name="hinting" >
         <bool>true</bool>
      </edit>
   </match>
   <match target="font" >
      <edit mode="assign" name="hintstyle" >
         <const>hintslight</const>
      </edit>
   </match>
   <match target="font" >
      <edit mode="assign" name="antialias" >
         <bool>true</bool>
      </edit>
   </match>
</fontconfig>

I closed Qt Creator and reopened it. The result was this:

Monaco after fix