Raam Dev » thoughts essays journal notes contact about subscribe rss

Posts Tagged: HOWTO

Convert any Website into a PDF!

HTML to PDF Converter is a service that allows you to provide the URL of any website and promptly get a PDF version of the website in return. This is incredibly useful. I’ve always wanted a way to backup sites that contain really useful information for fear that they may disappear. It’s dangerous to always rely on a site being just a Google-search away.

Installing rTorrent on OS X Leopard (10.5) using Fink

I’ve been using Transmission as a BitTorrent client on my MacBook Pro for a while now, but after setting up rTorrent on my Linux server earlier today and seeing how awesome it was, I just had to install it on my laptop as well. I absolutely love text-based applications!

The easiest way to install rTorrent is by using Fink or MacPorts. (Both of these tools allow you to download software that has been ported from Unix/Linux to Mac OS X.) I’ll use Fink since I’m a fan of Debian Linux and Fink uses the Debian dpkg and apt-get package management tools.

Apparently there is no Fink binary available yet for OS X Leopard (10.5), so it must be compiled from source. These directions (which also contain instructions for setting up rTorrent on earlier versions of OS X) helped explain the overall process presented here. Since you’ll need to compile from source, you will need to have Xcode installed (a set of development tools from Apple).

The basic steps for setting up Fink are as follows:

  1. Download the latest Fink source
  2. Open up a terminal (Applications -> Utilities -> Terminal.app) and run the following commands
  3. $ cd /path/to/download/directory
  4. $ tar xvzf fink-x.xx.x.tar.gz
  5. $ cd fink-x.xx.x
  6. $ ./bootstrap
  7. You will now be presented with several questions. Answer using the defaults (press Enter) for everything except the question about whether you want to enable the unstable tree; you must answer Yes to this question (see here if you accidentally missed this step).
  8. When the script finishes, run /sw/bin/pathsetup.sh
  9. For good measure, run apt-get update

Great! Now that Fink is installed, installing rTorrent is really easy:

$ fink install rtorrent

You might be notified that a bunch of extra packages need to be installed (there were 46 needed on my system!) so just choose Yes. After the packages have been downloaded and compiled (this might take a while) rTorrent should be on your system and ready to use.

Getting Started with rTorrent

rTorrent

You can launch rTorrent by simply running rtorrent in a Terminal, but before you get started you should look over the man page (man rtorrent) and then set up a configuration file (~/.rtorrent.rc). There are only four lines in my configuration file (check the man page to see what these do):

port_range = 26000-26999
directory = ~/downloads/torrents/
session = ~/downloads/torrents/sessions/
encryption = allow_incoming,try_outgoing,enable_retry

If you’re interested in a lot more options, you might want to grab a copy of the sample .rtorrent.rc config file (why this wasn’t included in the package, I don’t know) and place it in your home directory.

The rTorrent User Guide has information about all the stuff on the screen as well as various commands to navigate the interface.

Using the wonderful screen utility, rTorrent becomes even more powerful on remote systems. I leave rTorrent running on my server and whenever I remotely SSH into the box I can then reattach the screen session that rTorrent is running inside of and instantly have access to it!

HOWTO: Take a Screenshot on your iPhone

Taking a screenshot on your iPhone is really useful for documenting stuff or when submitting a bug report to a developer (a picture is worth a thousand words!). I mentioned how to do this in an Aside a few months ago, but I really think it deserves a little more attention. It’s so useful, but also so simple:

Step 1: Press and hold the Home button
Step 2: Press and release the sleep/power button

The screen will flash white for a second and return to normal. Now you can find the screenshot in the Photos section and email, or send it to MobileMe.

How to take an iPhone Screenshot

HOWTO: Remove Google Software Update on Mac OS X

A few days ago I wrote about how evil Google secretly installed software update on my computer. Well, even worse than that, when I choose to continue with the update it gives me this message:

Updates Unsuccessful

So every other day for the past two weeks I have been prompted to update the Google Talk plugin, and every single time I choose OK this same error message pops up. I had planned to leave the software update installed, but since it’s not working and it’s really starting to bug me, I’m removing it.

According to some discussion on Google Groups, the Google Software Update can only be removed by uninstalling any plugins associated with it (Google Earth, Google Talk, etc). Well that’s not fair. I never installed any plugins to begin with! Time to do it the hacky way.

Hidden away on a page labeled “What is Google Software Update?“, Google provides the single command you need to run to uninstall Google Software Update from your entire system:

sudo /Library/Google/GoogleSoftwareUpdate/GoogleSoftwareUpdate.bundle/Contents/Resources/GoogleSoftwareUpdateAgent.app/Contents/Resources/install.py --uninstall

NOTE: Make sure the --uninstall portion of the command actually has two dash characters. It’s possible your browser replaced the two dashes with a single dash character.

If you have something like the Google Gears plugin installed in your browser, you should either uninstall the Gears plugin or use it with caution. The Google Software Update is meant to help keep your Gears plugin (and other plugins) updated with any new security patches. Of course, if the Software Update isn’t working, then it’s really nothing more than an annoying nag screen.

Removing the Update Engine from your Home Directory

Several commenters mentioned the update engine was installed in their home directory. If the update engine was installed on a per-user basis (as opposed to system-wide), then use this command instead:

~/Library/Google/GoogleSoftwareUpdate/GoogleSoftwareUpdate.bundle/Contents/Resources/GoogleSoftwareUpdateAgent.app/Contents/Resources/install.py --uninstall

NOTE: Make sure the --uninstall portion of the command actually has two dash characters. It’s possible your browser replaced the two dashes with a single dash character.

Preventing Google Earth from Reinstalling the Update Engine

A commenter provided this solution for preventing Google Earth from reinstalling the update engine:

Google Earth reinstalls the software updater when it’s launched. To prevent this I created an empty file at ~/Library/Google/GoogleSoftwareUpdate, then transferred ownership to root and made it read-only for normal users:

touch ~/Library/Google/GoogleSoftwareUpdate
sudo chown root ~/Library/Google/GoogleSoftwareUpdate
sudo chmod 644 ~/Library/Google/GoogleSoftwareUpdate

Update: As one commenter mentioned, Google now has a page relevant to this discussion.

Update: It appears that at least some of Google’s software now gives you the option for disabling the installation of the automatic update engine during the setup process. See this blog post for an explanation.

It appears that now you can plug this into your terminal to disable Google Software Updater from checking for updates:

defaults write com.google.Keystone.Agent checkInterval 0

Google Update Uninstaller Tool

Viktor Petersson from Wireload notified me of a tool they put together to make uninstalling the Google Update engine really simple. If you don’t feel comfortable with the command line, download the Google Update Uninstaller.


Using ‘rsync –exclude-from’ to Exclude Files Containing Spaces

A few months ago I wrote a post about escaping filename or directory spaces for rsync. Well that wasn’t the end of rsync giving me problems with spaces.

When I used the --exclude-from rsync option to specify a list of exclusions, I figured using single or double-quotes around files/directories that contain spaces would be enough to escape them. However, after swashing through hundreds and hundreds of lines from rsync’s output, I discovered the excluded directories were still being synced!

When using --exclude-from, files and directories should not contain any single or double quotes, only a backslash:

/afs/*
/automount/*
/Users/raam/Documents/Virtual\ Machines/*

Where in the world is Raam?

Join the Facebook Community

Raam Dev » thoughts essays journal notes contact about subscribe rss

Powered by WordPress and other Open Source Software
Uncopyright by Raam Dev