Archive for the ‘ubuntu’ Category

Installing Transmission torrent client as a service in Ubuntu Hardy

Thursday, November 27th, 2008

I have a PC that I use as server running Ubuntu 8.04 Hardy Heron and I wanted to install a command-line torrent client and run it as a service to download & seed stuff with no need of a monitor or X attached to it (because I don’t have any of them :P ). So after trying a few clients I decided to stick to Transmission, Ubuntu’s default torrent client.

To get this working, this is what I did:

1) In order to use it as a service, you have to download transmission-cli package which has the transmission-daemon & transmission-remote bins.

2) Before this, I added a new apt sources to the /etc/sources.list because Ubuntu’s sources has a very out-of-date version. So open /etc/sources.list and add the following lines:

deb http://ppa.launchpad.net/bortis/ubuntu hardy main
deb-src http://ppa.launchpad.net/bortis/ubuntu hardy main

Then update & install.

3) You should now have the client intalled. But to use it as a service / daemon, go to:

http://trac.transmissionbt.com/wiki/HeadlessUsageDebian

http://trac.transmissionbt.com/wiki/HeadlessUsage/General
and follow the instructions.

Remember to set the correct permissions to the TRANSMISSION_HOME & TORRENTFOLDER directories to allow writing & reading to the user you set in USERNAME.

I had some problems with transmission populating the default config file “settings.json”. What I did was to manually create the file and add this default content:

{
    "blocklist-enabled": 0,
    "download-dir": "\/shares\/internal\/PUBLIC\/Torrent\/work",
    "download-limit": 100,
    "download-limit-enabled": 0,
    "encryption": 0,
    "max-peers-global": 200,
    "peer-port": 51413,
    "pex-enabled": 1,
    "port-forwarding-enabled": 1,
    "rpc-access-control-list": "+127.0.0.1",
    "rpc-authentication-required": 0,
    "rpc-password": "",
    "rpc-port": 9091,
    "rpc-username": "",
    "upload-limit": 40,
    "upload-limit-enabled": 1
}

You can find out what options for this config files are available at:

http://trac.transmissionbt.com/wiki/EditConfigFiles

Hope it helps, cheers!

Epiphany Webkit

Saturday, September 6th, 2008

Note: this post was created using Epiphany Web Browser 2.22.3

I am very happy with the new version of Epiphany, Gnome’s web browser. With its brand new WebKit HTML engine, it works fast and fluently.

Right now I am using a PPA version of it since it has not been included in the official Ubuntu repositories. It will be on October 30th, when Ubuntu 8.10 becomes alive!

Install it and try it by yourself. To install it just add the following two lines to your /etc/apt/sources.list:

deb http://ppa.launchpad.net/stemp/ubuntu hardy main #WebKit & Midori
deb http://ppa.launchpad.net/michelinux/ubuntu hardy main #Epiphany-WebKit


Then just run:

sudo apt-get update
sudo apt-get install epiphany-webkit

Source: http://theindexer.wordpress.com/2008/07/04/install-epiphanywebkit-on-hardy-heron/

Archive directory with tar with "exclude" parameter.

Monday, September 1st, 2008

You can archive a directory using tar and exclude files or sub-directories using the “exclude” parameter:

tar cvjf ORIG DEST –exclude=PATTERN

*ORIG: the origin directory. I.E: /home/me

*DEST the destination archive file. I.E: /home/me/Desktop/home.tar.bz2

*PATTERN: file & subdirectories exclusion pattern. I.E: .* (excludes all hidden files)

Note: –exclude has two hyphens

watch-movies: TV-Out & Display manager

Wednesday, June 25th, 2008

Continuing with my need of watching movies on my TV using my notebook and Ubuntu easily, I developed this mini-app in Python to turn on/off the TV output and the LCD display.

watch-movie.tar.gz

I hope you find this useful.

Note: you need python-gtk installed on your Ubuntu box.

Develop J2ME apps in Ubuntu with Eclipse, EclipseME & Sun Java Wireless Toolkit 2.5.2

Tuesday, June 24th, 2008

1-Download Sun’s Java Wireless Toolkit 2.5.2:
http://java.sun.com/products/sjwtoolkit/download.html

2-Install dependencies (found in the previous link):

yo@notebook# sudo apt-get install libxpm-dev libxt-dev libx11-dev libice-dev libsm-dev libc6-dev libstdc++6-dev

3-Install Sun’s Java Wireless Toolkit 2.5.2. Go to the dir were you downloaded the installer:

yo@notebook# chmod +x sun_java_wireless_toolkit-2_5_2-linux.bin
yo@notebook# ./sun_java_wireless_toolkit-2_5_2-linux.bin

You must enter the location of the JVM (I’m using JDK6 and it is located in /usr/lib/jvm/java-6-sun/bin/) and select a destination dir.

4-Install EclipseME plugin using the instructions found in:
a) http://eclipseme.org/docs/installation.html
b) http://eclipseme.org/docs/installEclipseME.html
c) http://eclipseme.org/docs/configuring.html

They work perfectly!

5-Now go develop some cool app for your mobile :-)

Reference: http://www.gonzalomarcote.com/blog/?p=15

ATI M6 LY TV-Out with (X)(K)(U)buntu Gutsy and xrandr.

Saturday, January 12th, 2008

I finally got my tv-out working on Xubuntu, I had already made it work but I re-installed my OS and did not remember what I did, so I had to start from scratch.

Just follow these steps to make it work:

Note:  output, set and off options are precedeed with two hyphens (i.e. – - output). I don’t know why, in this post, it seems like they have just one.

1) Plug your TV output to your TV.

2) Run the following command on a terminal window:

xrandr –output S-video –set load_detection 1

This will scan and detect the TV connection. If you run:

xrandr -q

it will return something like this:

Screen 0: minimum 320 x 200, current 1024 x 768, maximum 1024 x 1024
VGA-0 disconnected (normal left inverted right)
LVDS connected 1024×768+0+0 (normal left inverted right) 0mm x 0mm
1024×768 60.0*+ 60.0
800×600 60.3
640×480 59.9
S-video connected (normal left inverted right)
800×600 59.9 + 60.3

If you look at the last two lines you will see that the TV (named S-video) is “connected”. If you see that you S-video output is “disconnected”, try rebooting your computer leaving the TV cable plugged. After reboot, repeat this step in order to ensure that the TV has been detected.

3) This video card only supports 800×600 for the S-video output and 1024×768 for the monitor. So to avoid resolution problems (this means seeing the entire desktop on your TV), change the resolution to 800×600, before turning the TV output on:

xrandr -s 800×600

4) Now that you have the proper resolution, you can turn the TV output on. Just run the following command:

xrandr –output S-video –auto

You should see your desktop on your TV now!

Here is a list of other useful commands.

Turn off TV output: xrandr –output S-video –off

Turn monitor off (I do this when I see movies): xrandr –output lvds –off

Turn monitor on: xrandr –output lvds –auto

Turn resolution back to 1024×768: xrandr -s 1024×768

Hope this helps!