jeudi 22 décembre 2016

Ajouter un "download manager" à votre raspberry

... Pour télécharger des fichiers directement depuis un lien ...

iso, torrent, metaliens, etc...

Installation

sudo apt-get install aria2
sudo mkdir /home/pi/.aria2
sudo nano /home/pi/.aria2/aria2.conf 
 
Copier ceci dedans: 
dir=/media/key/complete
file-allocation=falloc
continue
log-level=error
max-connection-per-server=4
summary-interval=120
daemon=true
enable-rpc=true
rpc-listen-port=6800
rpc-listen-all=true
max-concurrent-downloads=2
#save-session=/home/pi/.aria2/aria.txt
#input-file=/home/pi/.aria2/aria.txt
#log=/home/pi/.aria2/aria.log
disable-ipv6=true
disk-cache=25M
timeout=600
retry-wait=30
max-tries=50

Exemples d'utilisation:

Directement: 
aria2c http://example.org/mylinux.iso
aria2c http://a/f.iso ftp://b/f.iso
   
Une liste de downloads:
aria2c -ifiles.txt -j2
 
Un torrent:
aria2c --follow-torrent=mem "http://host/file.torrent"
aria2c --max-upload-limit=40K file.torrent

Uniquement une partie du torrent: 
aria2c --select-file=1-4,8 file.torrent
 
Limiter la bande passante à l'émission:
aria2c --max-upload-limit=100K file.torrent
 
etc... 
 
Toutes infos ici:
https://aria2.github.io/manual/en/html/aria2c.html#example
 

mercredi 21 décembre 2016

Transfer the system from SD to HDD !

... to preserve your SD card ...



1- Prepare your HDD by adding a new partition
       Use gparted live CD or something else (your linux PC) ...
       Create a second ext3 partition with a size at least equal to the size of the system partition on SD card (sda2 for me, sda1 containing data )

Or directly, ie. usb key contains 2 partitions sda1 and sda2 that will be deleted :

$ sudo su
$ umount /dev/sda1
$ umount /dev/sda2
$ fdisk /dev/sda
p
d /dev/sda1
d /dev/sda2
w
q

$ mkfs.ext4 /dev/sda2 -L untitled 

2- Copy the SD file system to the hard drive
       Loggon raspberry and type:
       $ sudo dd if=/dev/mmcblk0p2 of=/dev/sda2 bs=512

3- Cleanup old mounted points ans mount sda1
       $ rm -R /mnt/*
       $ mkdir /mnt/sda
       $ mount /dev/sda2 /mnt/sda

3- Modify the fstab on the hdd as follow:
       /dev/mmcblk0p1 /boot vfat defaults,ro 0 2
   #/dev/mmcblk0p2 / ext4 defaults,noatime 0 1
   /dev/sda2 / ext4 defaults,noatime 0 1

4- Change the boot command lines (on the SD):
       $ cd boot
   $ sudo nano cmdline.txt

        And change root=/dev/mmcblk0p2 by root=/dev/sda2

5- Reboot raspberry !
   $ sudo reboot