Vous êtes sur la page 1sur 12

Please before you start commenting about breaking the law etc etc notice that there are

many freeware programs out there which you can download and share freely.
I never download and share movies, music etc.
Thank you

lm noL a Llnux experL so l spenL some Llme Lrylng Lo seLup a LorrenL cllenL wlLh my
Raspberry Pi. So I know how difficult it is and how much you have to search to set it up
properly. This is the way I did it and it runs smoothly.
First of all these are the things you need to start your project
1. Your Raspberry Pi
2. A USB HUB with power
3. A USB hard disk

The connections we must do are as shown
You need a keyboard to start which you can connect to the HUB
Now we have to go to our windows computer to format our USB Disk and prepare the SD
Card.
l prefer Lo formaL my Puu Lo exL4 flle sysLem. lLs fasLer and more sLable. lor LhaL l use Lhe
free Mini tool Partition Wizard. You can get it from here
http://download.cnet.com/MiniTool-Partition-Wizard-Home-Edition/3000-2094_4-
10962200.html
To prepare the SD Card. To do that you need a program called Win32DiskImager and you
can download it for free from
http://sourceforge.net/projects/win32diskimager/files/latest/download
Extract the exe an install it.
Then we have to download the Raspberry Pi distribution. I use the latest distribution from
ls offlclal slLe. http://www.raspberrypi.org/downloads The image I use is the

2013-05-25-wheezy-raspbian
Extract the image file and start Win32DiskImager

Select your downloaded image, you SDCard device and press Write. Wait until the image is
ready.
Now we are ready to start.


Put the SDCard to your Pi and put the power cable in. In this step toy need to have at list a
keyboard connected to your HUB or your Pi and a monlLor Lo see whaLs happenlng. I use a
Video cable and I connect it to my monitor

lf you canL connecL lL Lo your monitor you can move to your TV and plug the cable there so
you donL have Lo mess everyLhlng around. ln Lhls sLage you donL need Lhe Pu8 and Lhe
disk.
Now you are ready to start. First of all you have to setup your device to run the raspbian.
ln Lhe lnlLlal screen donL forgeL Lo enable P. Also as you will use the Pi for torrenting you
donL need Lhe Cul envlronmenL so choose Lo logln lnLo Lhe console.
Finish all the proper adjustments and press finish.
Your device will restart and you have to log in. The defaults are
USER:pi PASSWORD:raspberry
If you have changed your password use the new password.
You are now logged in. Write down the address of your device so you can connect to it later.
It is something like 192.168.1.24
Key in
sudo shutdown h now
and wait for the device to shut down. At this point you can remove the keyboard and the
monitor and connect the HDD and the HUB as above. Start the Pi and leave it there.
You can go now to your computer.
1o connecL Lo your pls console you need an P program. l use puLLy whlch you can
download from http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html
Run putty and write the address of your pi (in my case it is 192.168.1.24)

Log in the Pi using pi as user and your password

I have renamed my device as mypi the default name is raspberrypi

And now it is time to start. What I usually do is that I shutdown the pi and put the SD card
back into the computer. I start Win32DiskImager and save my work to an image file (you can
give to it any name) so if (better is when) I make a mistake I will not lose all my work.

If you press read the program copies the SD Card to an image file which you can write back
laLer lf necessary. (donL forgeL Lo puL .lmg aL Lhe end).
We are back logged in the pi.
##TIP## If you dont like typing you can copy the text from windows and paste it to putty
with a right click
First of all we need to update raspbian
sudo apt-get update
Wait until the update is finished.
The next thing is to get rid of all the unnecessary GUI content
sudo apt-get purge libx11-6 libgtk-3-common xkb-data lxde-icon-theme raspberrypi-
artwork penguinspuzzle
[TIP] If you make a typing mistake you can press the UP ARROW and edit your command
sudo apt-get autoremove
AL Lhls polnL sysLem lf very llghL. lf you havenL saved your work l Lhlnk lLs Llme Lo do lL now.
Next we must make our pi to have all times the same network address (static). For this we
must use a text editor names nano to edit the file /etc/network/interfaces.
sudo nano /etc/network/interfaces

We replace all the content of the file
auto eth0
iface eth0 inet static
address 192.168.1.24
netmask 255.255.255.0
gateway 192.168.1.1
We do this when we are plugged into a wired network and we donL use a wlreless one, else
we leave wla0 in place.
To write the content of the file to the SD we press Control-O [^O] and then ENTER. To exit
nano [^X] (control and X simultaneously).
In the address toy can put at the fourth number any number between 2 and 255 but I prefer
to use the address it was automatically assigned.
The gateway is usually 192.168.1.1. In my case it is 192.168.1.2 because of the router I use.
In some cases might be 192.168.0.1 because the network address of the DHCP server
(usually the router).
The gateway address is the address of your router which is connected to the internet.
If you change the address you better restart the pi.
If you want to have access from the internet, you should get an address from http://www.no-
ip.org or any other provider. You'll also need to forward your external IP to your Pi's IP
address on your LAN. It depends on your router. Usually there's NAT, or Virtual server or Port
forward. Use port 80.
lf you havenL change Lhe password of Lhe l you can do lL now

sudo passwd

Now lLs Llme Lo see our parLlLlon Lable.
cat /proc/partitions

Our disk is sda1.
We need to instruct Pi to mount our Disk at the same position
sudo mkdir /media/USBDisk

Before we can mount the drives, we need to create a directory to mount the drives to.
sudo mount -t auto /dev/sda1 /media/USBDisk
*Note that in LINUX words are case sensitive. USBDisk is not the same
as usbdisk

sudo mkdir /media/USBDisk/shares
sudo mkdir /media/USBDisk/shares/downloading
sudo mkdir /media/USBDisk/shares/completed


sudo nano /etc/fstab

We add the /dev/sda1 line and save it
nCW lLs Llme Lo lnsLall Lhe LorrenL cllenL. 1here are qulLe a few l have used transmission
and deluge. I prefer transmission because I can easily control it from my android phone and
my work computer. Later we will show toy how to install deluge

sudo apt-get install transmission-daemon

LeLs conflgure Lhe permlsslons now
sudo usermod -a -G debian-transmission pi
sudo chgrp debian-transmission /media/USBDisk/shares/downloading
sudo chgrp debian-transmission /media/ USBDisk/shares/completed
sudo chmod 770 /media/USBDisk/shares/downloading
sudo chmod 777 /media/ USBDisk/shares/completed
1he permlsslons leL us browse read and wrlLe Lo Lhe compleLed dlrecLory buL we canL
browse the downloading one. If you want you can change the 770 to 777 to have full control
on it.
Reload the transmission
sudo service transmission-daemon reload

Edit transmission settings.json file
sudo nano /etc/transmission-daemon/settings.json

The content of the file is here. Marked are the lines we must edit
{
"alt-speed-down": 50,
"alt-speed-enabled": false,
"alt-speed-time-begin": 540,
"alt-speed-time-day": 127,
"alt-speed-time-enabled": false,
"alt-speed-time-end": 1020,
"alt-speed-up": 50,
"bind-address-ipv4": "0.0.0.0",
"bind-address-ipv6": "::",
"blocklist-enabled": false,
"blocklist-url": "http://www.example.com/blocklist",
"cache-size-mb": 4,
"dht-enabled": false,
"download-dir": "/media/data/complete",
"download-limit": 100,
"download-limit-enabled": 0,
"download-queue-enabled": true,
"download-queue-size": 5,
"encryption": 1,
"idle-seeding-limit": 30,
"idle-seeding-limit-enabled": false,
"incomplete-dir": "/media/data/incomplete",
"incomplete-dir-enabled": true,
"lpd-enabled": false,
"max-peers-global": 200,
"message-level": 2,
"peer-congestion-algorithm": "",
"peer-limit-global": 91,
"peer-limit-per-torrent": 150,
"peer-port": 51413,
"peer-port-random-high": 65535,
"peer-port-random-low": 49152,
"peer-port-random-on-start": false,
"peer-socket-tos": "default",
"pex-enabled": false,
"port-forwarding-enabled": true,
"preallocation": 1,
"prefetch-enabled": 1,
"queue-stalled-enabled": true,
"queue-stalled-minutes": 30,
"ratio-limit": 2,
"ratio-limit-enabled": false,
"rename-partial-files": true,
"rpc-authentication-required": true,
"rpc-bind-address": "0.0.0.0",
"rpc-enabled": true,
"rpc-password": "{2dc2c41724aab07ccc301e97f56360cb35f8ba1fGVVrdHDX",
"rpc-port": 9091,
"rpc-url": "/transmission/",
"rpc-username": "transmission",
"rpc-whitelist": "*.*.*.*",
"rpc-whitelist-enabled": false,
"scrape-paused-torrents-enabled": true,
"script-torrent-done-enabled": false,
"script-torrent-done-filename": "",
"seed-queue-enabled": false,
"seed-queue-size": 10,
"speed-limit-down": 250,
"speed-limit-down-enabled": true,
"speed-limit-up": 0,
"speed-limit-up-enabled": true,
"start-added-torrents": true,
"trash-original-torrent-files": false,
"umask": 18,
"upload-limit": 100,
"upload-limit-enabled": 0,
"upload-slots-per-torrent": 14,
"utp-enabled": true
}


"download-dir": "/media/data/complete",
Becomes
"download-dir": "/media/USBDisk/shares/completed",

"incomplete-dir": "/media/data/incomplete",
"incomplete-dir": "/media/USBDisk/shares/downloading",

"rpc-username": "transmission",
"rpc-username": "myname",


I changed the username because its easier to remember. You are not obliged to do
that if you dont want to.

Cross your fingers and open your browser


And now lLs time to install SAMBA

sudo apt-get install samba samba-common-bin

Open the configuration file
sudo nano /etc/samba/smb.conf


At the end of the file add the following lines
[Torrentbox]
comment = Public Shares
path = /media/USBDisk/shares/completed
writeable = Yes
only guest = Yes
create mask = 0777
directory mask = 0777
browseable = Yes
public = yes

Restart SAMBA
sudo service samba restart

THATS IT
YOU CAN NOW ACCESS YOUR FILES FROM WINDOWS EXPLORER

If you want to access transmission from your android phone you can install Remote
Transmission
Hope I helped

NOTE. I face no problems with transmissions stability but other users do, Efstathis Iosifidis
made the following changes and he found that they work OK.
Edit /boot/cmdline.txt and add smsc95xx.turbo_mode=N" Lo lL.
Edit /etc/sysctl.conf and change vm.min_free_kbytes =16384 (from 8M8 Lo 16M8).

If you want to have access to your files from outside you have to install an ftp server. This is
how we can do it.
Install the ftp program
sudo apt-get install vsftpd

Uncomment (that means delete the # before) the following lines
local_enable=YES
write_enable=YES

Restart the service and you are done
sudo service vsftpd restart

Dont forget to sae your ork

Vous aimerez peut-être aussi