πŸ‘¨β€πŸ’» about me home CV/Resume πŸ–ŠοΈ Contact Github LinkedIn I’m a Haskeller πŸ“ Blog Freedom, privacy, tutorials… πŸ† Best of panda upp Haskell abp pp hCalc bl todo pwd TPG Nextcloud Git BitTorrent

πŸ“° Friday 2. April 2021: upp is a panda companion. It’s is a Lua-scriptable lightweight text preprocessor.
πŸ†• since December 2020: Playing with the actor model in an embedded multicore context. C imperative components become C stream pure functions with no side effect ➑️ C low level programming with high level pure functional programming properties πŸ†
πŸ“° Saturday 30. January 2021: Playing with Pandoc Lua filters in Lua. panda is a lightweight alternative to abp providing a consistent set of Pandoc filters (text substitution, file inclusion, diagragrams, scripts, …).
πŸ†• Sunday 24. May 2020: Working at EasyMile for more than 4 years. Critical real-time software in C, simulation and monitoring in Haskell ➑️ perfect combo! It’s efficient and funny ;-)
🚌 And we are recruiting! Contact if you are interested in Haskell or embedded softwares (or both).

Torrent box on Raspberry Pi

Christophe Delord

Goal

The decentralized bittorrent protocol helps reducing the load of servers. Downloading OS updates from torrent servers thanks to a Raspberry Pi is interesting since your main PC does not need to run while downloading files.

Prerequisites

Raspberry Pi installation

I already have a Raspberry Pi hosting Nextcloud. The same device can be used to install rtorrent.

Solution 1: rtorrent

rtorrent installation

More information here:

  1. Connect to the Raspberry Pi

    ssh pi@cloud
  2. Install rtorrent

    sudo apt install rtorrent
  3. Configure rtorrent

    curl -Ls "https://raw.githubusercontent.com/wiki/rakshasa/rtorrent/CONFIG-Template.md" \
    | sed -ne "/^######/,/^### END/p" \
    | sed -re "s:/home/USERNAME:$HOME:" >~/.rtorrent.rc
    mkdir -p ~/rtorrent/

rtorrent usage

  1. Start rtorrent

    ssh -t pi@cloud -C "tmux attach -t rtorrent || tmux new-session -s rtorrent rtorrent"
  2. Add a new torrent

    On your PC:

    sudo mkdir -p /mnt/torrents
    sudo chown $USER:$USER /mnt/torrents
    sshfs pi@cloud:/home/pi/rtorrent/ /mnt/torrents

    Now you can download new .torrent files to /mnt/torrents/watch:

Solution 2: qbittorrent

qbittorrent installation

  1. Connect to the Raspberry Pi

    ssh pi@cloud
  2. Install qbittorrent

    sudo apt install qbittorrent-nox
  3. Configure qbittorrent

    On your PC, start qbittorrent:

    ssh -t pi@cloud -C "tmux attach -t qbittorrent || tmux new-session -s qbittorrent qbittorrent-nox"

    and connect to http://cloud:8080. The default login/password is admin/adminadmin. It must obviously be changed.

    Additionnaly to the default configuration, I would suggest the following changes:

qbittorrent usage

  1. Start qbittorrent

    On your PC:

    ssh -t pi@cloud -C "tmux attach -t qbittorrent || tmux new-session -s qbittorrent qbittorrent-nox"
  2. Add a new torrent

    On your PC:

    sudo mkdir -p /mnt/downloads
    sudo chown $USER:$USER /mnt/downloads
    sshfs pi@cloud:/home/pi/Downloads/ /mnt/downloads

    Now you can download new .torrent files to /mnt/downloads. You can monitor qbittorrent here: http://cloud:8080. When downloads finish, the files are available in /mnt/downloads.