~/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.
Syncing Kindle titles to your Android device
August 10, 2011
I use my Xoom mainly for reading eBooks, and I really like Amazon’s Kindle app.
Unfortunately, it seems to have no support at all for syncing books that are not bought through Amazon (not surprisingly perhaps). This is a problem for me because I often buy from the Pragmatic Programmers, and I don’t want to copy those .mobi files to my tablet manually (I know that PragProg offers to sync the titles via Whispernet, but that only works for physical Kindle devices).
What I found out recently is that there is a pretty easy fix for this:
- Store your books in some folder in your Dropbox, say “/kindle”
- Install the app FolderSync Lite on your Android device
- Set up your Dropbox account in FolderSync. The interface is not very intuitive so pay attention.
- Set up a “folderpair” in FolderSync, mapping /kindle in your Dropbox to /mnt/sdcard/kindle on your device. Make sure the sync type is “to local folder”.
- Schedule this folderpair to sync as often as you like.
You may be wondering if this conflicts with the books you bought through Amazon – after all, they’re also stored in /mnt/sdcard/kindle. The trick is that FolderSync does not take ownership of this folder, it simply copies files from the remote (Dropbox) folder into it. So I assume that it doesn’t even clean up deleted files, although I haven’t tried.