rtorrent-color and Ubuntu 13.04

For my main laptop, the PC I use day in and day out, I run ArchLinux. Over time the load became more than I wanted on the laptop. It could easily handle it but I decided to purchase a desktop. On the desktop I can now run rtorrent and irssi with minimal downtime(Use screen). The distro I chose for the desktop was Ubuntu 13.04 with Gnome. I wanted something I hardly ever had to update, why I chose Gnome I’ll never know as it doesn’t have a screen plugged into 95% of the time.

Anyways to make a long story short I mainly use Arch and have grown accustom to rtorrent with color which is readily available in the AUR. Sadly I could not find it for Ubuntu For sometime now I’ve used rtorrent without the color patch on the Ubuntu machine but every time I looked at it I became more and more annoyed. All the white text, I could not easily distinguish what as active or not. I could not find a ‘How to’ or PPA to install it, so I decided finally to do it myself and figured I’d post about it. So here we go….

Firstly get the need build tools

sudo apt-get install subversion build-essential libtool automake openssl libsigc++-2.0-dev libncurses5-dev libcurl4-openssl-dev

Then get libtorrent

wget http://libtorrent.rakshasa.no/downloads/libtorrent-0.13.3.tar.gz
tar xvfz libtorrent-0.13.3.tar.gz
cd libtorrent-0.13.3
./configure
make
sudo make install

Now that you have libtorrent we can move on to the good stuff. Being an Arch user I basically stole the package build and used it to my favor.

wget http://libtorrent.rakshasa.no/downloads/rtorrent-0.9.3.tar.gz
tar xvfz rtorrent-0.9.3.tar.gz
wget https://aur.archlinux.org/packages/rt/rtorrent-color/rtorrent-color.tar.gz
tar xvfz rtorrent-color.tar.gz
mv rtorrent-color/rtorrent-0.9.3_canvas_color.patch rtorrent-0.9.3
cd rtorrent-0.9.3
patch -uNp1 -i rtorrent-0.9.3_canvas_color.patch
./configure
make
sudo make install

Now run

sudo ldconfig

Should update your libraries and you’ll be well upon your way. All you have to do is configure your .rtorrentrc to support color. Which is simple enough, Add the following to the end of your .rtorrentrc

done_fg_color=2
#done_bg_color=3
active_fg_color=1
#active_bg_color=5
3

Securing PhpMyAdmin and using ssh tunneling for access

Now that I am hosting my own site I needed to to setup php and mysql, no better option than PhpMyAdmin right? You could simply restrict the PhpMyAdmin directory with basic auth but I was wanted to try something else. I wanted to restrict access to a singular IP address but have access where ever I might be.

So I decided on using my home’s IP and using ssh to tunnel in when need be. To do this I found Firefox to be a better tool for the job over Chrome. YMMV.

Start off with restricting the IP address. I use Lighttpd, so things are a bit different but I am sure you can find the Apache way of doing this with some GoogleFu.

On this server I am running Debian, on another distro files may be elsewhere. Open up /etc/lighttpd/lighttpd.conf with you favorite text editor and add this to your lighttpd.conf

$HTTP["remoteip"] == "Your IP" {
      alias.url += (
               "/phpmyadmin" => '/usr/share/phpmyadmin",
      )
}

Where “Your IP” is add just that and restart the lighttpd service. So now we can access the PhpMyAdmin whenever connected to to that IP. Now as long as you have a box at that IP with an ssh connection you can reach your PhpMyAdmin. For that you can use tunneling.

ssh -D 'port number' user@host.com

Run the above command and leave that terminal open. From there all that is needed is to configure FireFox to use the tunnel you just created. From the toolbar select Edit => Preferences => Network. In the Connections settings chose ‘Settings’.

Fill it out like this but chose the port you selected.(In my case it was ’999′)

2013-06-06-220813_493x485_scrot

That’s it. If you have a better way please let me know. I am always willing to read about the errors of my ways.

New host, using WordPress. First post.

I recently switched from Octopress to WordPress and one of my main concerns was the use of code tages. While Octopress uses code tags by default and handles them very well unfortunately WordPress does not.

Thankfully I found this post. You can get the plugin from here Not only does it allow code tags but it can also handle syntax highlighting.

Sample bash-

#!/bin/bash
echo Hello World!

Sample Java-

class Hello World {
    public static void main(String[] args) {
        System.out.print("Hello World!");
    }
}

So a simple plugin install resolved my one main concern. I wasn’t ever an Octopress pro but it did have it benefits.