Launchpad PPA’s

So after discovering that my quick and dirty rtorrent fix didn’t actually fix what i needed it to (xmlrpc stuff, specifically), I decided to instead look into setting up a ppa on launchpad to host some of my custom packages. So here is a quick guide on how to do this:

first, some things you will need to install:
sudo apt-get install dput devscripts
of course, you’ll need some of the usual stuff like build-essentials and other common dev packages. dput is used to upload your source packages to your ppa, and devscripts contains some useful debian package scripts, such as debuild which is used to build your package.

now, create a gpg key for your ppa (or use an existing one if you have one)
simply use gpg –gen-key to generate a key (use the defaults, unless you want to get more specific)
if you already have a set of keys on another machine, you can export/import the public and private keys to your other machine. If you get into trouble with not enough entropy (happens when your compile machine is headless and you do everything through ssh), then try installing rng-tools and set your device to /dev/urandom (in /etc/default/rng-tools) then start the service. This will generate entropy for you.

Now setup your own ppa. First you’ll need a launchpad account, then you just need to authenticate yourself and create a new ppa. I won’t detail this process, but you can probably get a good idea from here: http://blog.launchpad.net/ppa/personal-package-archives-for-everyone

Now grab your source package as well as its build dependencies:
sudo apt-get build-dep PACKAGE
apt-get source PACKAGE

note that you don’t need to sudo when getting package sources. If you are upgrading the package using the latest version, things can get a little wonky because ubuntu packages are usually customized with patches, and these patches often don’t work with bleeding edge source. None the less you can give it a shot, simply grab the source for your package (not through apt, but from svn, git, http, etc…) and then copy the debian directory from the ubuntu source directory to your newer source directory. You will need to modify the changelog and create a new entry for your package (with an updated version). Alternatively, you can use dch to do this. Once you have your source set up, you have to build the source package. I recommend building the binary first, but this is not necessary, it just helps to for testing installation of the package and other things. to build the source package:
debuild -S -sa
this will generate a source package in the parent directory. Once this finishes, you can upload it to you ppa.

to upload your package to your ppa, just run:
dput PPA PACKAGE_source.changes
PPA will be something like ppa:USER_NAME/PPA_NAME
the changes file will have been created as a part of the source package creation.
this will ask you to enter your gpg password, and then upload the files to the launchpad servers. In a few minutes your package will be built and you’ll get a notice saying it was successful or not.

Caveats! They exist! some things i have found which are slightly annoying are the following:
you cannot re-upload (re-build) a package. This is useful if you have a dependency issue, the only fix is to increment the version and re-upload (please correct me if there is a better solution).
deleting packages is not very clear what happens, a deleted package still exists for quite some time on the server. There appears to be no notice of a package being purged, it just randomly stops existing.

p.s. updated rtorrent ppa will come soon, if you really want to get it now, you can use this package source:
deb http://ppa.launchpad.net/patricksissons/pjs/ubuntu karmic main
this is my development ppa, so it may contain things you don’t actually want to install.

Upgrade rtorrent in karmic 9.10

here is a quick and easy way to upgrade to the latest rtorrent on karmic. Basically we just snag it from lucid.

There are two basic methods to do this, the easiest is debatable between the two. Personally, i just tried method one, but i’m sure method two would work just as well.

Method 1:

  1. head to http://packages.ubuntu.com/lucid/rtorrent
  2. download the deb for your architecture
  3. download the deb for each of the following dependent packages:
    1. libssl
    2. librtorrent
    3. libxmlrpc
    4. libxmlrpc-core
  4. install each of the packages by running sudo dpkg -i *.deb

Method 2:

update your apt sources to lucid, do an apt update and then install rtorrent.  This should get the lucid packages and dependents.  Just remember to revert your changes to the apt source.

Like i said, i did method one, mostly because i was curious which packages i would need to backport to get rtorrent upgraded to version 0.8.6.  If you are curious why one might do this, it is because there are significant changes made to libtorrent and rtorrent, and this is an easy way to get access to them.

There may be some remaining issues to deal with regarding libxmlrpc, this is something i will look into once i have had a chance to work with this new version of rtorrent.

Making Google Chrome Work With a SOCKS5 proxy (i.e. putty ssh tunnel)

I really like chrome, but something that is an absolute must is a SOCKS5 proxy.  This is due to my ultra restrictive corporate firewall, i need to tunnel http content through an ssh tunnel.  And ssh creates a SOCKS5 proxy when you use the -D option.  Chrome seems like it assumes that your proxy is SOCKS4.x and just fails on the ssh tunnel proxy.  But there is hope, i found a way to work around this and it isn’t even complicated!

Just a quick note, i actually use a plugin from chrome called Switchy! which helps me quickly switch to and from the ssh tunnel proxy.  It is certainly no foxyproxy, but it works well enough that i can use it to solve most proxy related problems.

Now, the secret to this solution is to use Proxy Auto Configuration scripts.  These scripts allow you to specify which version of SOCKS to use for your proxy.  So all you need to do is create a file somewhere on your computer (say called pac-ssh-tunnel.pac) and then add the following to it:

function FindProxyForURL(url, host)
{
   return "SOCKS5 localhost:8080";
}

Now, take note that i am creating the ssh tunnel proxy using the following command:

ssh -N -g -D 8080 username@remote_server

Just FYI, “-N” means don’t execute any commands on the server (i.e. strictly a tunnel connection only).  And “-g” allows the remote host to connect to locally forwarded ports (which i must admit, most people will never need this, but handy if you do complex tunneling of data).   Finally, “-D 8080″ means dynamically forward the proxy data through local port 8080.

So once you have your SSH SOCKS5 tunnel up and running, set chrome to use your proxy automatic configuration script that you created (either through chrome’s options, or through Switchy! if you prefer).  Now you can proxy traffic over your ssh tunnel.

One final note, PAC files are basically javascript files (with a few built-in functions).  You can actually create some complicated PAC files that do all your complex proxy selection for you (basically a lot of regular expression matching).  So if you get adventurous, you can just add all your proxy selection logic to that one function (or break it into multiple functions) and then you won’t even need to change your proxy around ever!

Happy surfing!

« Previous PageNext Page »