Martin Ström
my-domain.se

TwitterFax

The TwitterFax is a small project done together with Konst & Teknik. It will watch a given Twitter username for mentions and then print it, together with any twitpics or yimg images attached to it.

The code is pretty simple and uses the Twitter gem for communicating with Twitter and Prawn to genereate the PDF’s. I’ve set it up to run every 15 minute using a Cron job.

Check out the full source code. You’ll need to change what typeface to use or get LucidFaxEFRom.ttf from somewhere else.

So go ahead and mention @konst_teknik to try it out!


Google Email Uploader

For different reasons I have many different Google accounts and wanted to merge them all into one Google Apps for Domain account. I also wanted to upload email from the past years to that account.

I’ve tried before to move a lot of messages between Google/Gmail accounts by just dragging the messages from one IMAP account into another (using a regular IMAP client such as Thunderbird or Mail), but it never works for a lot of messages. Then I found out about the Google Email Uploader tool, and gave it a try.

My first attempt was to use the Mac version of Google’s Email Uploader and just upload all messages I had downloaded in my local OS X Mail setup. The upload was supposed to take around 18 hours and I tried twice but both times, the uploader seemed to get stuck on some message(s).

I downloaded the source for the app and tried to figure out if I could patch the app to make the work easier. But instead of digging through all code, I thought I should give the Windows version a try instead. It has been around for a longer time and therefore probably a bit more reliable.

So I set up Thunderbird in my Windows installation (running VMware Fusion), and downloaded all messages from my IMAP server, and then uploaded them using Google Email Uploader for Windows. Everything went smooth and took about 20 hours.

For the next batch I imported the messsages into Thunderbird for Mac and then used the uploader tool for Mac. This time it worked great (but was fewer messages).

So, lesson learned: Try to import the messages into Thunderbird if the uploader get stuck when uploading from Mail.app. If that doesn’t work, try the Windows version.


Push notifications for Things Touch (iPhone/iOS) using Prowl

While waiting for Things Touch to officially support push notifications I hacked my own solution based on Prowl and my own Ruby library for Things, things-rb.

Installation

  1. I’ve setup Dropbox to share my Things database betweeen my laptop and a computer at home which is always online.

  2. Buy and install Prowl on your iOS device.

  3. On the home computer/server, install things-rb:

    $ (sudo) gem update --system # if you're on an older RubyGems version
    $ (sudo) gem install things-rb

  4. ..and the prowl gem to talk to the Prowl API

    $ (sudo) gem install prowl

  5. Save this file somewhere (like ~/bin/prowl_things.rb)

  6. Setup a cronjob to run the script as often as you’d like. Mine runs every weekday at 8:45 am.

    45 8 * * 1-5 /usr/bin/ruby /Users/me/bin/prowl_things.rb


Nicer public Dropbox URLs

I use Dropbox but wanted nicer URLs for the links I sometimes send to the files in my Public folder. Each user has a folder on dropbox.com which is publicly shared, like this http://dl.dropbox.com/u/12345/ so I just set up a new sub domain (mine is dropbox.my-domain.se) and let Apache redirect all requests to that domain to my Dropbox folder instead:

<VirtualHost *:80><br />
  ServerName  dropbox.my-domain.se<br />
  RewriteEngine on<br />
  RewriteRule ^(.*)$ http://dl.dropbox.com/u/27215$1 [R,L]<br />
</VirtualHost>

Download torrent files from Twitter DMs

Here’s a simple ruby script to download torrent files in Safari sent to you/an account as URLs in Twitter direct messages.

It could be used on your home server to download torrent files you send to it from something like your iPad.

I’ve set it up to run every fifth minute (using cron) to check for new files, but can of course be adjusted to something that works for you.

Also, make sure to point Safari’s download folder (in Safari’s preferences) to the same folder as you have Transmission automatically watch for .torrent files so the download actually starts.


A better Mail-to-Things-ToDo script

Until now I’ve been creating todos in Things from Mail messages in OS X using the quick entry built into Things and the “autofill” feature. But I didn’t like that it, by default, created the todos in Things’ Inbox and that I had to manually select text in the mail message to get it as notes (which is important when using Things on your iPhone/iPad when the link back to the mail message doesn’t work).

Instead here’s an AppleScript which will take the selected message(s) and automatically create one task for each email in the “Next” focus in Things. It will then archive the mail messages and show a Growl notification. The todos in Things will get tagged with the “Reply” tag (which in my setup is a subtag of “Email”).

The script is a modified version of the one found here. I also put the script in an Automator action like described in the article so you can assign a shortcut key to it without including third party software.


Open Selected Folder or File in TextMate from Finder

QuickSilver

Before upgrading to Snow Leopard I had a QuickSilver trigger (???M) to open the currently selected file(s) or folder(s) in TextMate. It was setup as a QuickSilver trigger using the Proxy Object “Finder Selection”. Too bad it doesn’t work for me in the later QuickSilver versions and/or Snow Leopard.

I missed this trigger so I made a 10.6 Service to accomplish the same task:

Automator

  1. Run Automator and select “Service” from the template chooser.
  2. Select “Files and Folders” from “Finder”
  3. Find the “Open Finder Items” action from the left pane and select TextMate as the application.
  4. Save the service in ~/Library/Services. I called mine “Open With TextMate”

Keyboard Preferences

To run the service from the keyboard, run “System Preferences” and select “Keyboard”, then select “Services” in the left menu and locate the “Open With TextMate” service on the right side. Add a keyboard shortcut (I choose the same as I’m used to, ???M).