Rtorrent

From openSUSE

Rtorrent is a ncurses (text based) torrent client supporting to add and remove torrents. Developement of this client is dedicated to performance, the projects homepage says that on a high speed connection seeding is 3 times faster then on 'The Official Client'.


One needs to install libtorrent and rtorrent, both are available in the ... repository of opensuse. Although one can also check the source at the libtorrent and rtorrent webpage. For help on installing 'packages' in general on opensuse linux, goto here.

openSUSE 10.3

You can use 1-Click-Install in openSUSE 10.3 One Click Python Install

Don't worry, it's really simple. As soon as you done it you can return here and continue. The one click install only contains python, not python-ogg and python-vorbis. I am trying to fix this, but for now you will have to install them using the section for opensuse 10.2 :(.

openSUSE 10.2

1. Start YaST

foo-nix@linuxbucket:~> su
password:
linuxbucket:/home/foo-nix # YaST2

2. Choose the "Software Managament" module under "Software".

3. You might need to insert a opensuse cd or dvd, as will be asked.

4. Search for "python", lots of results will show up, one needs the "Python Interpreter". It will be on one of the cd's or the dvd.

5. Searching for python will also find python-ogg and python-vorbis. Install them too. Note that they already might be installed, them make sure not to delete them ;).

6. Make sure you check the box in front of the python packages such that it will be installed and then click accept.

7. As a last step one could rpm -q python,rpm -q python-ogg,rpm -q python-vorbis to check if it is installed.

Installing Edna

Installing edna wont require an rpm, one will download the tar.gz file and extract it somewhere such that the python script can be executed.

Download Edna

Download the edna .tar.gz file from the projects website: Edna Webpage. One will need to click doqnload under quickstart at the right top opn the webpage. Then one click the tar.gz file (i.e. edna-0.6.tar.gz) to download it.

Extract the tar.gz file

Now the file is downloaded, one can extract it. But first it will be copied to /usr/local/share, since this is a standard place to put source files. Then it can be extracted. Notice that I used CTRL+C keycombination to stop the server. Or Ctrl+D to insert an EOF (end of file, usually also closes the console).

foo-nix@linuxbucket:~> su
Password:
linuxbucket:/home/foo-nix # cp Desktop/edna-0.6.tar.gz /usr/local/share/
linuxbucket:/home/hfoo-nix # cd /usr/local/share/
linuxbucket:/usr/local/share # tar -xf edna-0.6.tar.gz
linuxbucket:/usr/local/share # ls
edna-0.6  edna-0.6.tar.gz
linuxbucket:/usr/local/share # cd edna-0.6/
linuxbucket:/usr/local/share/edna-0.6 # python edna.py
WARNING: a source's directory must exist
 skipping: dir1 = /mnt/cdrom = MP3 CDROM
WARNING: a source's directory must exist
 skipping: dir2 = /mp3/all-albums = Jukebox
edna: Ogg Vorbis support disabled, to enable it you will need to install the "pyogg" and the "pyvorbis" modules
edna: serving on port 8080...

Caught ctr-c, taking down the server
Please wait while the remaining streams finish..
linuxbucket:/usr/local/share/edna-0.6 #

At this moment the edna server is runnable. But one could notice the warnings about source directory's. This since there is no specification given to the server where to find the mp3 files. In my case they are in /mnt/doc/med/mzk.

Configure Edna

The configuration of the server can be done in the edna.conf file.

linuxbucket:/usr/local/share/edna-0.6 # kwrite edna.conf

The file below will show up. The parts below are only fragments of the file. The port will be the port the server will be listening to. One can leave this at 8080 or change it as one likes.

#
# edna.conf -- configuration file for edna.py
#

[server]
port = 8080

The next feature which I will discuss is zip. This allows a user to download mp3 zip archives. There is a snake below the grass though. Setting this parameter to high will allow the user to download huge files. This will not only cause bandwidth kill, but also will use lots of memory. Once a user clicks to download that huge music collection of 30GB, 30GB will be store in your RAM memory. This will probably crash your machine and a reboot will be needed. I advise to leave it below 10 (i.e. maximum of 10MB).

# If you want to allow downloading of ZIP archives of directory contents,
# specify the maximum size of an archive in MB.
# Note: the ZIP archive is entirely built in memory before being sent and
#       will cause edna to consume a lot of memory.
zip = 0

Some options so set passwords and to restrict the server to only certain users.

# If you wish to restrict to certain hostnames or IP address, specify them here
#allow = host1, host2, host3/24, 123.123.123.123, 2.2.2.2/11
# If you wish to use password protection, enter user password pairs here
#auth = aUser1:aPass1, aUser2:aPass2


Now one will need to specify in which directories the music for the server is stored. I filled it in for my /mnt/doc/med/mzk case. Notice that one needs to specify a name for the directory two. That is, there are two = marks in a directory specification!

[sources]
#
# List each source directory (top of the tree). The lines should be of the
# form:
#   dirNNN = DIRECTORY = DISPLAY_NAME
#
# WARNING: the DISPLAY-NAME part may *not* have a slash ("/") in it!
# WARNING: each DIRECTORY must exist when edna is started
#
# The NNN part will determine the sort order in the top-level listing.
#
dir1 = /mnt/doc/med/mzk = foo-nix's music

A nice feature to mark files as new.

# Mark all files as new if they are newer than days_new
days_new = 30

Start Edna

Now edna is configured it can be started.

foo-nix@linuxbucket:/usr/local/share/edna-0.6> python edna.py
edna: Ogg Vorbis support disabled, to enable it you will need to install the "pyogg" and the "pyvorbis" modules
edna: serving on port 8080...

Although other things might happen. I summarized them as troubleshooters. Don't worry, if you're the unlucky one having trouble. It is probably a wrongly configured edna.conf file.

Troubleshoot start Edna

You get this:

foo-nix@linuxbucket:/usr/local/share/edna-0.6> python edna.py
edna.py:176: DeprecationWarning: raising a string exception is deprecated
 raise error, 'no sources'
Traceback (most recent call last):
  File "edna.py", line 1167, in <module>
    run_server(fname)
  File "edna.py", line 1075, in run_server
    svr = Server(fname)
  File "edna.py", line 176, in __init__
    raise error, 'no sources'
__main__.error: no sources
foo-nix@linuxbucket:/usr/local/share/edna-0.6>

You might have added a folder in the edna.conf file like this

whtvr = /mnt/doc/med/mzk = foo-nix's music

whtvr Is wrong. It should be of syntax dir<some_number>. Change this line to

dir1 = /mnt/doc/med/mzk = foo-nix's music

Ok, I admid, I also made this mistake.

You might also get this:

foo-nix@linuxbucket:/usr/local/share/edna-0.6> python edna.py
WARNING: a source's display name cannot contain '/'
 skipping: dir3 = /mnt/doc/med/mzk = /mnt/doc/med/mzk
edna: Ogg Vorbis support disabled, to enable it you will need to install the "pyogg" and the "pyvorbis" modules
edna: serving on port 8080...

Notice that one dir was skipped. This was due to bad syntax. This causes the lack of sources, there is none. Therefore the edna server will run, but wont work correctly. It has nothing to stream.

In my case I had to rewrite

dir3 = /mnt/doc/med/mzk

to

dir3 = /mnt/doc/med/mzk = foo-nix's mzk

This error may also occur when no music sources are added. So add some in that case.

Use Edna

Now one has edna running, it should be like

foo-nix@linuxbucket:/usr/local/share/edna-0.6> python edna.py
edna: Ogg Vorbis support disabled, to enable it you will need to install the "pyogg" and the "pyvorbis" modules
edna: serving on port 8080...

Own computer

Now lets check it out. One can type http://localhost:8080/ in a webbrowser and check it out. Wait a little till it has listed all mp3's (If no mp3's show up and the webpage stays white you probably didn't add the mp3 sources right). I got something like this.

This should be a firefox window with edna in it, but the image failed to load.

Computers in local network

Now enjoy? well, this is local, but what about other computers. If it works on your computer, it will probably work on other computers in the same subnet (probably all computers in your home network) too. You will need to type your computers ip instead of localhost. One can get the ip adress by typing ifconfig (server pc is wired) or iwconfig (server pc is wireless) in a console as root. I did so, and found out about my ip (I already knew it before checking though ;) )

foo-nix@linuxbucket:~> su
Password:
linuxbucket:/usr/local/share/edna-0.6 # ifconfig
eth0      Link encap:Ethernet  HWaddr 00:13:D3:A8:D4:6F
          inet addr: >>>>>192.168.2.102<<<<<< Bcast:192.168.2.255  Mask:255.255.255.0
          inet6 addr: xxxx::xxxx:xxxx:xxxx:xxxx/xxxx Scope:xxxx
          UP BROADCAST NOTRAILERS RUNNING MULTICAST  MTU:xxxx  Metric:xxxx
          RX packets:52417 errors:0 dropped:0 overruns:0 frame:0
          TX packets:41977 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:55469149 (52.8 Mb)  TX bytes:8585793 (8.1 Mb)
          Interrupt:18 Base address:0xec00

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:xxxx
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:43052 errors:0 dropped:0 overruns:0 frame:0
          TX packets:43052 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:12690203 (12.1 Mb)  TX bytes:12690203 (12.1 Mb)

linuxbucket:/usr/local/share/edna-0.6 #

The world; internet

As I pointed out, mine is 192.168.2.102. So I will use [http://192.168.2.102:8080/]. iwconfig Works almost the same. If you want to access it from 'the internet' one needs the ip given by the internet service provider (ISP) and need to forward the 8080 port to the 192.168... ip address just found. This is done in the router, taken you have a basic home network configuration.

I take a guess forwarding the port can be done here http://92.168.1.1/. But can't know for sure. When the port forwarding is set right one can access the edna with http://<IP_FROM_ISP>:8080/.

Notice that this will let the world access your music. This can be against copyright laws and may infringe your network security. I don't give any guarantee about that, it's all your own responsibility.

Open in amarok

I take it you already have amarok. To open it, simply click the link to a m3u file. Then firefox will ask whether to save or open. Choose Open With and click the drop down box to choose an other program if amarok is not between them. Then browse to /opt/kde3/bin and choose the amarok file. Then click open and ok. It will open in amarok or will be added to the current playlist of amarok.

External Links

- Edna Homepage; Edna Home Page

I am planning to ad a link to a edna like project of a friend of mine. It improves edna on some points. A major thing is that it searches a lot faster, but uses lots of memory for the data structure. I will first have to ask him for permission to put the link here though.