Sometimes, you wanna try some risky things such as playing with Network on your Raspberry through SSH. If you lose the connection, and you are not next to the Raspberry, you lose it for good. Sad but true :(
A timer to restart Raspberry just in case shit happens while playing dumb through ssh:
sudo nano /home/pi/sshcheck.sh
for (( c=$1; c>1; c-- ))
echo -n "Reboot in $c minute(s)... "
echo "Reboot in 1 minute(s)..."
for (( c=59; c>0; c-- ))
echo -e "\e[101mReboot in $c second(s)... (CTRL+C to cancel rebooting)\e[49m"
echo -e "\e[101mReboot in $c second(s)...\e[49m"
echo -e "\e[101mREBOOT!!!\e[49m"
This needs to be started in a screen. If not, you lose the SSH link, and the timer script is stopped (meaning no restart of Raspberry...).
Here are some screen tips.
- Start a screen :
Then start your script within the screen :
$ bash /home/pi/sshcheck.sh number_of_minutes
Once timer is in place, you can detach the screen by doing CTRL + a, then d
- To resume your screen session use the following command :
$ screen -dr
- In case you have multiple screen sessions running on you machine you will need to append the screen session ID after the
r switch. To find the session ID list the current running screen sessions with:
$ screen -ls
There is a screen on:
14704.pts-1.raspberrypi (21/12/18 15:15:26) (Attached)
1 Socket in /run/screen/S-pi.
screen -r 10835
sudo apt-get install openjdk-8-jre
Download the Subsonic .deb package and install it:
sudo dpkg -i subsonic-x.x.deb
Change user (i have set pi instead of root) :
sudo nano /etc/default/subsonic
For troubleshooting interesting files are here: /var/subsonic
It was interesting because it allowed me to understand why Subsonic web interface was OK but impossible to play a file :
[2018-01-14 10:59:44,539] INFO TranscodeInputStream - Starting transcoder: /var/subsonic/transcode/ffmpeg -i /home/pi/Music/Paul Kalkbrenner - Berlin Calling/07_Paul_Kalkbrenner_-_Torted_Original Mix.mp3 -map 0:0 -b:a 128k -v 0 -f mp3 -
[2018-01-14 10:59:44,551] INFO InputStreamReaderThread - (/var/subsonic/transcode/ffmpeg) /var/subsonic/transcode/ffmpeg: 1: /var/subsonic/transcode/ffmpeg: Syntax error: "(" unexpected
It was a problem linked with ffmpeg. I think the problem comes from the fact that ffmpeg given in deb is made for ubuntu/debian but probably not ARM processor. THis is why I install ffmpeg from repository and then linked Subsonic folder to this ffmpeg freshly installed:
sudo apt-get install ffmpeg
sudo rm /var/subsonic/transcode/ffmpeg
sudo ln -s /usr/bin/ffmpeg /var/subsonic/transcode/ffmpeg
sudo service subsonic restart
Configure Subsonic using web interface and admin account.
It worked! I could play my music from Astana, Kazakhstan while it was actually stocked in my Raspberry in Paris!
In my opinion it works quiet nice! Not laggy I mean.
sudo apt-get install samba
Edit configuration file:
sudo nano /etc/samba/smb.conf
# The specific set of interfaces / networks to bind to
# This can be either the interface name or an IP address/netmask;
# interface names are normally preferred
interfaces = 127.0.0.0/8 wlan0
bind interfaces only = yes
comment = Samba sharing on Raspberry Pi
path = /home/pi/Downloads
writable = yes
guest ok = yes
guest only = yes
create mode = 0777
directory mode = 0777
share modes = yes
Let everyone read and write on /home/pi/Downloads:
sudo chmod -R 777 /home/pi/Downloads
$ sudo systemctl stop smbd
$ sudo systemctl start smbd
It should be visible in windows Networks.
sudo apt-get install ddclient
Configure for for two different service with two different website to check IP adress:
sudo nano /etc/ddclient.conf
use=web, web=checkip.dyndns.com/, web-skip='Current IP Address: '
## FreeDNS (freedns.afraid.org)
To run ddclient as a daemon, set run_daemon to 'true' in /etc/default/ddclient.
Once it is configured as daemon, restart it:
sudo /etc/init.d/ddclient restart
To debug :
sudo ddclient -daemon=0 -debug -verbose -noquiet (-force)
I only want to have some process owned by specific users to use the VPN. This means two route table, or more.
Create a new table "42" for marked packet:
sudo ip rule add fwmark 42 table 42
List all route table:
ip rule list
0: from all lookup local
32765: from all fwmark 0x2a lookup 42
32766: from all lookup main
32767: from all lookup default
Delete table 42:
sudo ip rule del fwmark 42 table 42
Show "main" table route:
ip route show table main
default via 192.168.1.1 dev wlan0 src 192.168.1.200 metric 303
10.13.0.81 dev tun0 proto kernel scope link src 10.13.0.82
192.168.1.0/24 dev wlan0 proto kernel scope link src 192.168.1.200 metric 303
Add a default route in table 42:
sudo ip route add 0.0.0.0/1 via 10.13.0.29 dev tun0 table 42
Delete the default route in table 42:
sudo ip route del 0.0.0.0/1 via 10.13.0.29 dev tun0 table 42
You can delete all routes of a specific table:
sudo ip route flush table 42
Copy all route from table main to table 42:
ip route show table main | while read LINE; do sudo ip route add $LINE table 42; done
sudo apt-get install transmission-daemon
Start and stop transmission daemon:
sudo /etc/init.d/transmission-daemon start
sudo /etc/init.d/transmission-daemon stop
Edit configuration of transmission (stop transmission first):
sudo nano /etc/transmission-daemon/settings.json
Check your transmission's IP:
To avoid permission issues:
sudo adduser pi debian-transmission
sudo adduser debian-transmission pi
sudo chmod -R 777 /home/pi/Downloads/torrents
sudo chmod -R 777 /home/pi/Downloads/torrents/.incomplete
Transmission How To
Know your IP address:
sudo apt-get install openvpn
Know your route before OpenVPN is connected:
Copy all necessary conf files in:
Start openvpn from command line to test if tun0 mounts:
sudo openvpn --config /etc/openvpn/server.conf
To connect to VPN at startup, put conf file in /etc/openvpn. Example: openvpn will connect at startup to VPN1 and VPN2:
Start raspberry on SSD instead of microSD Card
Raspberry Pi 3B+ MicroSD / SSD Speed Benchmarks
Raspberry Pi Cheap SSD Upgrade Guide
- Virtual Keyboard:
- sudo apt-get install matchbox-keyboard
- sudo apt-get install florence at-spi2-core [link]
- Configure remote access for SSH and VNC: sudo raspi-config
- Change pi password: sudo raspi-config
- "Install" SFTP server: actually already done when activating SSH
Display basic stuff
$ while true; do uptime; vcgencmd get_throttled; vcgencmd measure_temp; vcgencmd measure_clock arm; free -h; echo '-----'; sleep 10; done
total used free shared buff/cache available
Mem: 731Mi 297Mi 118Mi 27Mi 316Mi 345Mi
Swap: 2.0Gi 346Mi 1.6Gi
$ sudo nano /boot/cmdline.txt
You have to add this at the end of the line :
Example, from this...
console=serial0,115200 console=tty1 root=PARTUUID=fe481079-02 rootfstype=ext4 fsck.repair=yes rootwait quiet splash plymouth.ignore-serial-consoles
... to this :
console=serial0,115200 console=tty1 root=PARTUUID=fe481079-02 rootfstype=ext4 fsck.repair=yes rootwait quiet splash plymouth.ignore-serial-consoles ipv6.disable=1
And then, reboot the pi and verify with ifconfig command.
How to set headless VNC resolution
Problem illustration I had with following Raspberry Pi OS:
$ cat /etc/os-release
PRETTY_NAME="Raspbian GNU/Linux 11 (bullseye)"
$ sudo nano /boot/config.txt
I had to edit following line (added in bold):
# Enable DRM VC4 V3D driver
Source 1 2
How to set up Optware on WRT3500L with firmware Tomato Firmware 1.28.0000 MIPSR2-138 K26 USB miniVPN by shibby.
How to install Transmission BitTorrent client on external drive plug on USB of WNR3500L.
First, you should have a partition in ext2/ext3 in order to be able to install Optware on it (you cannot install optware directly on you router memory neither on FAT and NTFS partitions).
In administration interface of your router, go to section "USB and NAS >> USB Support". Make sure ext2/ext3 File Systems Support is checked.
I plugged in my router one HDD of 250GB. 249GB formatted in NTSF. 1GB formatted in ext3 called <harddisk label> where I will install different packages such as Transmission.
1. make sure mounted usb harddisk is detected.
ls /tmp/mnt/<harddisk> should be present
mount -o bind /tmp/mnt/<harddisk>/opt /opt
6. install your optware,
7. update optware,
ipkg update and
8. install transmission,
ipkg install transmission
9. you can list all packages available with
Then, go enable BitTorrent in router adminitration, section "USB and NAS >> BitTorrent Client".
Once it's started you can monitor Transmission via http :
Et voila !
French ISP provides free website hosting.To enjoy this service, you must be in France to connect to FTP server ftpperso.free.fr.
If you are not in France, find a proxy located in France :
Then in FileZilla, go to Edit >> Settings >> Connection >> FTP >> Generic proxy. Then configure. You might need to test different proxy...
Besides that :
- create specific ".htaccess" file to activate PHP5.
- create folder "sessions" in root folder to be able to use sessions.