Rpi Softwares

= Dynamic DNS =

The objective is to access Raspberry Pi from Internet using Dynamic DNS service. Most of the ISPs in India (& other third world countries) provide Dynamic IP address due to shortage of IP addresses.

Using this tutorial you will be able to access your device(or any other Linux machine) through Internet. You will have a registered unique sub-domain name which will be pointing to the current IP address assigned to the device.


 * Requirements:
 * Raspberry Pi(or any other Linux machine; for windows machine you need to download a different client)
 * ISP which provides Dynamic IP address.
 * DDClient,inadyn, etc or any other free Dynamic DNS Client.
 * Need to register at FreeDNS (free)


 * Note:
 * If you ISP provides a static IP, then you can directly access device using IP address or can use any DNS service(e.g: FreeDNS) for mapping IP to domain name. there is no need of installing client in Raspberry Pi.
 * If your ISP provides a private IP address (e.g. 10.103.85.131), then following this tutorial will not help.


 * Configuration:

http://freedns.afraid.org/dynamic/update.php?[xxxxxxxxxxxxxxxxxxxxxx] sudo apt-get install ddclient sudo nano /etc/ddclient.conf
 * Log on to SignUp page and register for a new unique sub-domain name (e.g: network.info.tm).
 * Open Dynamic DNS page. Copy the large alpha-numeric key in "Direct URL" link. e.g:
 * Install & Configure DDClient

daemon=3600 use=if, if=eth0                       ##comment out this line & use below line if Interface is not having Public IP directly assigned #use=web, web=checkip.dyndns.com/, web-skip='IP Address' server=freedns.afraid.org protocol=freedns login=xxxxxxxx password=xxxxxxxx xxxxxxxx.com                             ##replace with your domain name

sudo service ddclient restart

= WiringPi =

Source

Installation: git clone git://git.drogon.net/wiringPi cd wiringPi git pull origin ./build

Verify: gpio -v gpio readall

= Tonido =

Installation:

sudo mkdir /usr/local/tonido cd /usr/local/tonido sudo wget http://patch.codelathe.com/tonido/live/installer/armv6l-rpi/tonido.tar.gz sudo tar-zxvf tonido.tar.gz ./tonido.sh start

Audio Playback for FLAC, M4A etc:

cd /usr/local/tonido sudo apt-get install ffmpeg sudo ln -s /usr/bin/ffmpeg ffmpeg.exe sudo ln -s /usr/bin/ffmpeg ffmpegv.exe

Auto Start at Bootup:

sudo wget --output-document=tonido http://www.tonido.com/support/download/attachments/9109990/tonido?version=2&modificationDate=1412274854000&api=v2 sudo cp tonido /etc/init.d/ sudo chmod +x /etc/init.d/tonido sudo update-rc.d tonido defaults

= Transmission =

Please follow Automount USB Drive for mounting USB during bootup else Transmission will give error for temp files not found.

Installation: sudo apt-get install transmission-daemon sudo /etc/init.d/transmission-daemon stop sudo nano /etc/transmission-daemon/settings.json

Change “rpc-authentication-required” to false

"rpc-password": "password", "rpc-username": "username", "rpc-whitelist-enabled": false, "download-dir": "/mnt/USBDrive", "download-queue-size": 5, "incomplete-dir": "/mnt/USBDrive", "incomplete-dir-enabled": true, "seed-queue-size": 10, "watch-dir": "/mnt/USBDrive", "watch-dir-enabled": true, "umask": 2,

sudo nano /etc/init.d/transmission-daemon Change the USER=transmission-daemon to USER=root sudo service transmission-daemon reload

Transmission will be available at following link now: http://192.168.1.6:9091/transmission/web/

OSMC
sudo systemctl stop transmission sudo nano /home/osmc/.config/transmission-daemon/settings.json sudo systemctl start transmission

= Deluge =

Source: [howtogeek.com]

Installation: sudo apt-get install deluged sudo apt-get install python-mako sudo apt-get install deluge-web

Run deluge-web once deluge-web sudo pkill deluge-web

Auto Start at boot up: sudo nano /etc/rc.local

sudo -u pi /usr/bin/python /usr/bin/deluged sudo -u pi /usr/bin/python /usr/bin/deluge-web
 * 1) Start Deluge on boot:

Now reboot the Pi & open the WebUI to see if everything is running fine: http:/192.168.1.6:8112

Upgrade to Deluge 2.x
Add the following line to your apt sources: sudo nano /etc/apt/sources.list deb http://ppa.launchpad.net/deluge-team/stable/ubuntu/ xenial main

Update the Cache sudo apt update

Import the correct public key: gpg --keyserver hkps://keyserver.ubuntu.com --recv-keys C5E6A5ED249AD24C

Add the imported key to apt keys: gpg --export 8EED8FB4A8E6DA6DFDF0192BC5E6A5ED249AD24C | sudo apt-key add -

Upgrade Deluge: sudo apt update sudo apt upgrade

= Amuled = Installation: sudo apt-get install amule-daemon

Copy the md5 of the password: echo -n "password" | md5sum

Run amuled once amuled

Edit the Config file: nano ~/.aMule/amule.conf

TempDir=/media/aman32/Temp IncomingDir=/media/aman32/Incoming

AcceptExternalConnections=1 ECPassword = md5 value of On Password ECPort = 4712

Below [WebServer]: Enabled=1 Password= md5 value of On Password Port=4711

Create Addresses file: nano addresses.dat http://www.emule.com/server.met

Auto Start: sudo nano /etc/default/amule-daemon AMULED_USER = "pi"

Reboot: sudo reboot

Events/Scripts
Source: wiki.amule.org

nano .aMule/amule.conf
 * Edit the below file:

[UserEvents] [UserEvents/DownloadCompleted] CoreEnabled=1 CoreCommand=/home/pi/scripts/telegram_bot.py "%DLACTIVETIME" "%NAME" "%FILE"

nano /home/pi/scripts/telegram_bot.py
 * Create the script file:

Amule Remote in Ubuntu 20.04
Source: ubuntuforums.org

sudo apt install -y libboost-system1.67.0 libcrypto++6 libwxbase3.0-0v5 libgeoip1 libupnp13 wget http://archive.ubuntu.com/ubuntu/pool/universe/a/amule/amule-utils-gui_2.3.2-6_amd64.deb sudo dpkg -i amule-utils-gui_2.3.2-6_amd64.deb

Auto Mount USB Drive
sudo systemctl disable amule-daemon
 * To prevent the Boot failure due to missing/corrupt USB Drive, Remove the entry from FSTAB.
 * Disable auto start for Amule Daemon:

sudo nano /etc/rc.local
 * Edit the rc.local file:

sudo mount /dev/sda1 /media/aman32 sudo service amule-daemon start
 * Add below lines before "exit 0":

= FTP Server =

sudo apt-get install vsftpd sudo nano /etc/vsftpd.conf

uncomment the following options: local_enable=YES write_enable=YES

In case of errors replace the contents of conf file with below contents:

listen=YES local_enable=YES write_enable=YES local_umask=022 dirmessage_enable=YES use_localtime=YES xferlog_enable=YES secure_chroot_dir=/var/run/vsftpd/empty pam_service_name=vsftpd rsa_cert_file=/etc/ssl/private/vsftpd.pem max_per_ip=0                                //By default connection limit is set to 50, you can remove this limitation by setting it to 0

Restart the Service sudo service vsftpd restart

Now you should be able to login with any local user credentails.

Use Filezille to upload files & verify: tail /var/log/vsftpd.log

= TFTP Server =

sudo apt-get install tftpd-hpa

tftpd-hpa look for ipv6 and wont start without it. Add -4 or –ipv4 between the quotes on the TFTP_OPTIONS line in the file

sudo nano /etc/default/tftpd-hpa

TFTP_USERNAME=”tftp” TFTP_DIRECTORY=”/srv/tftp” TFTP_ADDRESS=”0.0.0.0:69″ TFTP_OPTIONS=”–secure”

sudo chmod -R 777 /srv/tftp sudo service tftpd-hpa restart sudo service –status-all

= JDownloader =

Source: steven-england.info


 * If you are in a SSH connection, change into a desktop session based terminal before starting JDownloader.
 * JDownloader needs features of an active LXDE environment, it won’t work as a headless service.

mkdir ~/jdownloader2 cd jdownloader2

wget http://installer.jdownloader.org/JDownloader.jar java -jar /home/pi/jdownloader2/JDownloader.jar

nano /home/pi/jdownloader2/startjd2.sh
 * Create startup script

java -jar /home/pi/jdownloader2/JDownloader.jar
 * 1) !/bin/sh

Make it executable: chmod 755 /home/pi/jdownloader2/startjd2.sh

nano ~/.config/lxsession/LXDE-pi/autostart Paste this line into the file: @/home/pi/jdownloader2/startjd2.sh
 * Autostart

sudo apt-get install lxshortcut                     ## Install lxshortcut if it is not already installed by default lxshortcut -o /home/pi/Desktop/JDownloader.desktop
 * If you want a desktop icon:

nano JDownloader.desktop Add below line to the file: Categories=Utility Move the file to applications folder: cp JDownloader.desktop ~/.local/share/applications/
 * To create a Menu item:

= Tor =

Install Tor: sudo apt-get install tor

Edit torrc file: sudo nano /etc/tor/torrc SocksPort 9050 SocksPort 192.168.1.35:9050 SocksPolicy accept 127.0.0.1/32 SocksPolicy accept 192.168.1.0/24 SocksPolicy reject * Log notice file /var/log/tor/notices.log RunAsDaemon 1

Create log file: sudo touch /var/log/tor/notices.log sudo chmod 666 /var/log/tor/notices.log

Enable Autostart: sudo update-rc.d tor enable

Reboot & Verify Installation netstat -an | grep 9050 ps -aux | grep tor

You will have two services running as Tor: tor.service                                        # dummy service appears to the user as active but in exited status. tor@default.service                                # most reliable service to check if Tor is running
 * Service:

Therefore check the Tor Service using below command: sudo systemctl status tor@default.service

Jdownloader with Tor Proxy
Goto Connection Manager, add a proxy for: Socks5 Proxy -> 127.0.0.1 -> 9050 -> Whitelist -> rapidshare.*(domain names)

= Node-Red =

Source: nodered.org

Upgrading existing installation: bash <(curl -sL https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered)

Start the application: node-red-start

Access the Web-UI: http://192.168.1.20:1880

Install Dashboard npm i node-red-dashboard

= Pyload =

Install Dependancies: sudo apt-get update sudo apt-get install python-support python-crypto python-pycurl tesseract-ocr tesseract-ocr-eng python-imaging python-qt4 -y

Download Package wget https://github.com/pyload/pyload/releases/download/0.4.20/pyload-cli_0.4.20_all.deb

Install Package: sudo dpkg -i pyload-cli_0.4.20_all.deb sudo apt --fix-broken install

For downloading from storage sites with click-n-load install Rhino javascript engine: sudo apt-get install rhino -y

Add/Edit user pyLoadCore -u

Initial Config pyLoadCore -s

Test process: sudo pyLoadCore

Start process: /etc/init.d/pyload start

Enable Autostart: sudo update-rc.d pyload defaults

Access the GUI: http://192.168.1.20:8000

2nd Method
Source: github.com

Add Sources: sudo nano /etc/apt/sources.list deb http://mirrordirector.raspbian.org/raspbian/ jessie main contrib non-free rpi deb-src http://archive.raspbian.org/raspbian/ jessie main contrib non-free rpi

Update our package list and install the dependencies: sudo apt-get update sudo apt-get -y install git liblept4 python python-crypto python-pycurl python-imaging tesseract-ocr zip unzip python-openssl libmozjs-24-bin sudo apt-get -y build-dep rar unrar-nonfree sudo apt-get source -b unrar-nonfree sudo dpkg -i unrar_*_armhf.deb sudo rm -rf unrar-*

cd /usr/bin ln -s js24 js

Download the current version of pyLoad and install that: cd /opt sudo git clone -b stable https://github.com/pyload/pyload.git cd pyload sudo ./pyLoadCore.py

Start pyload at every reboot: sudo nano /etc/systemd/system/pyload.service

[Unit] Description=Python Downloader After=network.target

[Service] User=pyload ExecStart=/usr/bin/python /opt/pyload/pyLoadCore.py

[Install] WantedBy=multi-user.target

Activate this rule with systemd: sudo systemctl enable pyload.service

Check the status of the service: sudo systemctl status pyload

= Resilio Sync =

Source: resilio.com

Download the ARM Package from below URL: https://www.resilio.com/individuals/ https://download-cdn.resilio.com/stable/linux-arm/resilio-sync_arm.tar.gz

Extract the Binary file, make it executable & test: ./rslsync --webui.listen 0.0.0.0:8888

Enable autostart on reboot: sudo nano /etc/rc.local

Add below before "exit 0": /home/pi/rslsync --webui.listen 0.0.0.0:8888

Reboot sudo reboot

= DC ++ =

AirDCPP on Rpi Zero W (Armv6)
Auto starting in Rpi as normal user: sudo -i -u pi /home/pi/airdcpp/airdcppd $> /home/pi/airdcpp/event.log &

Compile Using Docker
Source: blog.kitware.com airdcpp-web.github.io

Clone the Repository: git clone https://github.com/airdcpp-web/airdcpp-webclient.git cd airdcpp-webclient

Install Docker, Pull Image and start the Container: sudo apt install docker docker.io sudo docker pull thewtex/cross-compiler-linux-armv6 sudo docker run --rm -it -v /home/aman/airdcpp-webclient:/usr/src/airdc:rw thewtex/cross-compiler-linux-armv6 bash

Update the Container: apt update apt upgrade

Install Tools: apt install gcc g++ git cmake python pkg-config git npm

Install libraries: apt install pkg-config libbz2-dev zlib1g-dev libssl-dev libstdc++6 libminiupnpc-dev libnatpmp-dev libtbb-dev libmaxminddb-dev libboost1.58-dev libboost-regex1.58 libboost-thread1.58 libboost-system1.58 libleveldb-dev libwebsocketpp-dev

Compile the binary: cmake. make -j1              # j1 for 1 CPU core in Rpi ZeroW

Compile: cmake -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} -DBUILD_EXAMPLES=OFF -G Ninja.

GCC 4.9 not getting detected error: vi CMakeLists.txt set (GNUCXX_MINIMUM_VERSION "4.9") to set (GNUCXX_MINIMUM_VERSION "4.8")

Install BZIP2 Lib: apt install libbz2-dev

Install MindmaxDB Lib wget http://ftp.de.debian.org/debian/pool/main/libm/libmaxminddb/libmaxminddb-dev_1.3.2 wget http://ftp.de.debian.org/debian/pool/main/libm/libmaxminddb/libmaxminddb0_1.3.2-1_amd64.deb dpkg -i libmaxminddb0_1.3.2-1_amd64.deb dpkg -i libmaxminddb-dev_1.3.2-1_amd64.deb

Compile using Buildroot
Source: github.com

Install NPM: sudo apt install npm

Install Dependencies: sudo apt install libncurses-dev unzip pcregrep cmake python

Check for the latest patch of Buildroot to get the latest fixes and security updates: https://buildroot.org/download.html

Download Buildroot: mkdir buildroot cd buildroot/ wget https://buildroot.org/downloads/buildroot-2020.05.1.tar.bz2 tar jxvf buildroot-2020.05.1.tar.bz2 mv -f buildroot-2020.05.1 armhf

Now you should have the below directory: /home/aman/buildroot/armhf

Download Airdccpp Source in home directory: cd ~ && git clone https://github.com/airdcpp-web/airdcpp-webclient.git

The source code should be in below directory: /home/aman/airdcpp-webclient/

Compile the Buildroot: /home/aman/airdcpp-webclient/buildroot/setup-buildroot.sh /home/aman/buildroot/armhf/ cd buildroot/armhf/ make nconfig

Now edit the configuration based on you needs (mainly the Target options sections). For Raspberry Pi Zero W:    Target Architecture            --->    ARM (Little Endian]     Target Architecture Variant    --->    arm1176jzf-s Press F6 -> Save Press F9 -> Exit

make -j4

Create the build directory: cd /home/aman/ && mkdir build

Compile the Airdcpp Source Code: SKIP_EXISTING=1 BUILD_THREADS=4 BRANCH=master /home/aman/airdcpp-webclient/buildroot/build-portable.sh /home/aman/buildroot/ /home/aman/build armhf

EiskaltDC++
sudo apt-get install eiskaltdcpp eiskaltdcpp-daemon mkdir /home/pi/.config/eiskaltdc++/Logs touch /home/pi/.config/eiskaltdc++/Logs/daemon.log eiskaltdcpp-daemon -L 0.0.0.0 -d
 * Install Daemon:

cd ~ git clone https://github.com/eiskaltdcpp/eiskaltdcpp-web sudo mv eiskaltdcpp-web /usr/share/ cd /usr/share/eiskaltdcpp-web/
 * Install Simple WebUI:

sudo nano config.js "host" : "192.168.0.132",    # IP address of remote computer where eiskaltdcpp-daemon is launched

Install Apache Server sudo apt install apache2 cd /etc/apache2/conf-enabled/ cd sites-enabled/ nano 000-default.conf

Listen 80  DocumentRoot /usr/share/eiskaltdcpp-web/ 

sudo systemctl restart apache2

Test the WebUI: http://192.168.0.35/


 * Icecult WebUI:

Run the daemon once and kill it: eiskaltdcpp-daemon

Edit the Config File: nano ~/.config/eiskaltdc++/DCPlusPlus.xml

Edit Favorites file for auto connect: nano ~/.config/eiskaltdc++/Favorites.xml

Download the Icecult Files: git clone https://github.com/kraiz/icecult.git

Install Nginx Server: sudo apt install nginx

To serve the webinterface and proxy the jsonrpc interface and replace sudo nano /etc/nginx/site-enabled/default

With below config: server { root /home/pi/icecult/app; location /rpc { rewrite /rpc/(.*) /$1 break; proxy_http_version 1.1; proxy_pass http://127.0.0.1:3121; } }

Restart the Rpi: sudo reboot

Test the WebUI: http://192.168.0.35/

PtokaX
Download and extract the Source: wget http://www.ptokax.org/files/0.5.2.2-nix-src.tgz

Packages to install: sudo apt install make g++ zlib1g-dev libtinyxml-dev liblua5.3-dev

Optional package for SQLite database support sudo apt install libsqlite3-dev

To compile PtokaX with SQLite database for Lua 5.3: make -f makefile-sqlite

= Emulate Rpi with Docker =

Source: github.com

Install Docker: sudo apt install docker docker.io

Run the container: sudo docker run -it lukechilds/dockerpi

Boot a local Raspbian image: sudo docker run -it -v /home/aman/filesystem.img:/sdcard/filesystem.img lukechilds/dockerpi

Download a much slimmer VM only Docker container that doesn't contain the Raspbian filesystem image: sudo docker run -it -v /home/aman/filesystem.img:/sdcard/filesystem.img lukechilds/dockerpi:vm

Also add storage: sudo docker run -it -v /home/aman/filesystem.img:/sdcard/filesystem.img -v /tmp:/sdcard2 lukechilds/dockerpi:vm

= Plex Media Server on OSMC =

Source: pimylifeup.com
 * Installation

Update: sudo apt-get update sudo apt-get upgrade

Install Dependencies: sudo apt-get install apt-transport-https

Add Repository: curl https://downloads.plex.tv/plex-keys/PlexSign.key | sudo apt-key add - echo deb https://downloads.plex.tv/repo/deb public main | sudo tee /etc/apt/sources.list.d/plexmediaserver.list

Install Plex: sudo apt-get update sudo apt install plexmediaserver

Access Plex: https://192.168.1.20:32400/web/

sudo apt-get update sudo apt-get install plexmediaserver
 * Upgrade

= ScratchGPIO =

Source simplesi.net

Install: wget https://git.io/vMS6T -O isgh8.sh sudo bash isgh8.sh pi

= PiHole =


 * Configure static Ip address for the Raspberry pi.
 * Use this IP address as DNS server in the Router.

curl -sSL https://install.pi-hole.net | bash sudo reboot
 * Install:

pihole -a -p
 * Change password:

pihole -up
 * Upgrade:

Youtube Blocklist
https://github.com/kboghdady/youTube_ads_4_pi-hole

= NextCloud =

Source: techrepublic.com askubuntu.com flexion.org

Install Snapd: sudo apt update sudo apt install snapd sudo reboot

After this, install the core snap in order to get the latest snapd: sudo snap install core

Install Nextcloud sudo snap install nextcloud

= Selenium =

Source stackexchange.com

Installation: pip3 install selenium

Chrome driver sudo apt install chromium-chromedriver

OR

sudo dpkg -i chromium-chromedriver_65.0.3325.181-0ubuntu0.14.04.1_armhf.deb sudo apt install -f sudo apt install xvfb pip3 install PyVirtualDisplay pip3 install xvfbwrapper