Shakira - Chantaje

Written by pmd - - no comments

C#m  X  4  6  6  5  4
G#m  4  6  6  4  4  4
B    X  2  4  4  4  2

ms

[INTRO]
C#m C#m G#m B C#m C#m G#m B

[Verse 1: Maluma]
C#m
Cuando estás bien te alejas de mí
C#m
Te sientes sola y siempre estoy ahí
G#m
Es una guerra de toma y dame
B
Pues dame de eso que tiene' ahí
C#m       
Oye baby, no sea' mala
C#m        
No me deje' con las ganas
G#m           
Se escucha en la calle
Que ya no me quieres
B
Ven y dímelo en la cara...!

[Pre-Chorus: Shakira & Maluma]
C#m
  Pregúntale a quien tú quieras
          C#m
Vida, te juro que eso no es así
G#m
  Yo nunca tuve una mala intención
B             
  Yo nunca quise burlarme de ti
C#m
  Conmigo ves, nunca se sabe
C#m                               
  Un día digo que no, y otro que sí
G#m
  Yo soy masoquista
B
  Con mi cuerpo un egoísta

[Coro: Dúo & Shakira & Maluma]
        C#m       
Tú eres puro, puro chantaje
C#m       
Puro, puro chantaje
G#m            
Siempre es a tu manera
B                   
Yo te quiero aunque no quiera
       C#m        
Tú eres puro, puro chantaje
C#m       
Puro, puro chantaje
G#m              
Vas libre como el aire
B                  
No soy de ti ni de nadie


[Verse 2: Maluma & Shakira]
C#m                             
Como tú me tientas, cuando tú te mueves
C#m
Esos movimientos sexys, siempre me entretienen
          G#m
Sabe' manipularme bien con tus caderas
   B
No sé porque me tienes en lista de espera
C#m
Te dicen por ahí que voy haciendo y deshaciendo
C#m
Que salgo cada noche, que te tengo ahí sufriendo
G#m
Que en esta relación, soy yo la que manda
B                              
No pares bola' a toda esa mala propaganda

[Puente: Shakira & Maluma]
C#m                       
Pa, pa' que te digo na', te comen el oído
C#m
No vaya' a enderezar lo que nació torcido
G#m                      
Y como un loco sigo tras de ti, muriendo por ti
B
Dime que hay pa' mi bebe
N.C
Qué!

[Pre-Coro: Shakira & Maluma]
C#m
Pregúntale a quien tú quieras
C#m                       
Vida, te juro que no es así
G#m
Yo nunca tuve una mala intención
B                         
Y nunca quise burlarme de ti
C#m
Conmigo ves, nunca se sabe
C#m
Un día digo que no, y otro que sí
G#m   
Yo soy masoquista
B
Con mi cuerpo un egoísta

[Coro: Dúo & Shakira & Maluma]
        C#m       
Tú eres puro, puro chantaje
C#m       
Puro, puro chantaje
G#m            
Siempre es a tu manera
B
Yo te quiero aunque no quiera
       C#m        
Tú eres puro, puro chantaje
C#m       
Puro, puro chantaje
G#m               
Vas libre cómo el aire

[Post-Coro: Shakira]                         
C#m
No soy de ti ni de nadie, eh-eh-eh
      C#m             G#m      
Nadie eh-eh-eh, nadie eh-eh-eh, nadie
B
Con mi cuerpo un egoísta


[Coro: Dúo & Shakira & Maluma]
        C#m       
Tú eres puro, puro chantaje
C#m       
Puro, puro chantaje
G#m           
Siempre es a tu manera
B
Yo te quiero aunque no quieras
        C#m       
Tú eres puro, puro chantaje
C#m       
Puro, puro chantaje
G#m              
Vas libre cómo el aire

[Post-Coro: Shakira]                         
                        C#m
No soy de ti ni de nadie (eh-eh-eh)
     C#m             G#m          B
Nadie eh-eh-eh, nadie eh-eh-eh, nadie eh-eh-eh

NTFS HDD plugged to Raspberry Pi 3

Written by pmd - - no comments

Choose where to mount the disk:

mkdir /home/pi/HDD

Partition is NTFS, so if we wanna write on it:

sudo apt-get install ntfs-3g

To know the UUID of the HDD:

sudo blkid

Edit how to mount disk partition:

sudo nano /etc/fstab

Add this line and save:

UUID=AADEEA03DEE9C7A1 /home/pi/HDD ntfs-3g uid=1000,gid=1000,auto,umask=000 0 0

Mount  all filesystems mentioned in fstab to be mounted as indicated :

sudo mount -a

 

Luis Fonsi - Despacito ft. Daddy Yankee

Written by pmd - - no comments


Bm  X  2  4  4  3  2
G   3  5  5  4  3  3
D   X  5  7  7  7  5
A   5  7  7  6  5  5

ms

[Intro]
Ay...
Fonsi
Oh oh...
Oh no, oh no...
Oh...
Yeah...
Dididiri Daddy
Go!

Bm                             G
Si, sabes que ya llevo rato mirándote
D                         A
Tengo que bailar contigo hoy(DY)
Bm                              G
Vi, que tu mirada ya estaba llamándome
D                          A
Muéstrame el camino que yo voy (oh)

[Verse 1]
Bm                              G
Tú, tú eres el imán y yo soy el metal
                                  D
Me voy acercando y voy armando el plan
                                A
Solo con pensarlo se acelera el pulso (oh yeah)
Bm                                   G
Ya, ya me está gustando más de lo normal
                                D
Todos mis sentidos van pidiendo más
                                 A
Esto hay que tomarlo sin ningún apuro

[Chorus]
     Bm
Despacito
                              G
Quiero respirar tu cuello despacito
                            D
Deja que te diga cosas al oído
                                    A
Para que te acuerdes si no estás conmigo
      Bm
Despacito
                               G
Quiero desnudarte a besos despacito
                               D
Firmo en las paredes de tu laberinto
                                  A
Y hacer de tu cuerpo todo un manuscrito
    A   
Sube sube sube, sube sube...

[Post-Chorus]
Bm
Quiero ver bailar tu pelo
              G
Quiero ser tu ritmo
                    D
Que le enseñes a mi boca
                 A
Tus lugares favoritos (favorito, favorito baby)
Bm                               G
Déjame sobrepasar tus zonas de peligro
                    D
Hasta provocar tus gritos
                    A
Y que olvides tu apellido

[Verse 2]
                        Bm
Si te pido un beso, ven dármelo
                   Bm  
Yo sé que estás pensándolo
                 G
Llevo tiempo intentándolo
                      G
Mami esto es dando y dándolo
              D
Sabes que tu corazón conmigo te hace bom bom
              A                            
Sabes que esa beba está buscando de mi bom bom
                 Bm
Ven prueba de mi boca para ver como te sabe
                   G
Quiero quiero, quiero ver cuanto amor a ti te cabe
             D
Yo no tengo prisa yo me quiero dar el viaje
           A
Empezamos lento, después salvaje

[Pre-Chorus]
            Bm
Pasito a pasito, suave suavecito
              G
Nos vamos pegando, poquito a poquito
              D
Cuando tú me besas, con esa destreza
              A          
Veo que eres malicia, con delicadeza
           Bm       
Pasito a pasito, suave suavecito
             G
Nos vamos pegando, poquito a poquito
              D
Y es que esa belleza, es un rompecabezas
            A
Pero pa' montarlo aquí tengo la pieza

[Chorus]
A     Bm
Despacito
                                G
Quiero respirar tu cuello despacito
                           D
Deja que te diga cosas al oído
                                    A
Para que te acuerdes si no estás conmigo
     Bm
Despacito
                               G
Quiero desnudarte a besos despacito
                                D
Firmo en las paredes de tu laberinto
                                   A
Y hacer de tu cuerpo todo un manuscrito
     A
Sube, sube, sube, sube, sube

[Post-Chorus]
Bm
Quiero ver bailar tu pelo
              G
Quiero ser tu ritmo
                    D
Que le enseñes a mi boca
                A
Tus lugares favoritos (favorito, favorito baby)
Bm                               G
Déjame sobrepasar tus zonas de peligro
                    D
Hasta provocar tus gritos
                     A
Y que olvides tu apellido

[Verse 3]
A    Bm
Despacito
                                     G
Vamo' hacerlo en una playa en Puerto Rico
                                 D
Hasta que las olas griten ‘ay bendito'
                                  A
Para que mis hechos se queden contigo

[Outro]
           Bm        
Pasito a pasito, suave suavecito
             G
Nos vamos pegando, poquito a poquito
                    D
Que le enseñes a mi boca
                A
Tus lugares favoritos (favorito, favorito baby)
           Bm
Pasito a pasito, suave suavecito
             G
Nos vamos pegando, poquito a poquito
                   D
Hasta provocar tus gritos (Fonsi)
                      A
Y que olvides tu apellido (DY)
     Bm
Despacito

Дима Билан - Держи

Written by pmd - - 1 comment

ms

вся песня:
Fm   X  8 10 10  9  8
D#   X  6  8  8  8  6
A#m  6  8  8  6  6  6

[Куплет 1, Дима Билан]:
Fm                      D#
Давай с тобой мы отдохнём,
            A#m
С тобой вдвоём. С тобой, вдвоём
Fm                    D#            A#m
Мы этот мир перевернём, с тобой вдвоём!
(С тобой вдвоём!)

[Переход]:
Fm
Скажи, зачем нужны нам эти люди, -
D#               A#m
Мы никому об этом не расскажем.
Fm                     D#
Давай с тобой мы отдохнём,
          A#m
С тобой вдвоём! Ага!

Припев:
Fm
Держи! Держи! Руку мою держи!
D#                      A#m
Что хочешь, скажи! Получишь! Держи! Ага!
Fm
Держи! Держи! Руку мою держи!
D#                      A#m
Что хочешь, скажи! Получишь! Держи! Ага!
Fm D# A#m

[Куплет 2, Дима Билан]:
Давай с тобой мы не уснём
С тобой вдвоём. С тобой вдвоём
Мы эту ночь перевернем, с тобой вдвоём!
(С тобой вдвоём!)

[Переход]:
Скажи, зачем нужны нам эти люди, -
Мы никому об этом не расскажем.
Давай с тобой мы отдохнём,
С тобой вдвоём! Ага!

Припев:
Держи! Держи! Руку мою держи!
Что хочешь, скажи! Получишь! Держи! Ага!
Держи! Держи! Руку мою держи!
Что хочешь, скажи! Получишь! Держи! Ага!

Держи! Держи! Руку ты мою держи!
Что хочешь, скажи! Получишь! Держи! Ага!
Держи! Держи! Руку ты мою держи!
Что хочешь, скажи! Получишь! Держи! Ага!

[Song Instrumental Bridge]:

Держи! Держи!

Ага! Держи! Держи! Руку мою держи!
Что хочешь, скажи! Получишь! Держи! Ага!
Держи! Держи! Руку мою держи!
Что хочешь, скажи! Получишь! Держи! Ага!

Backup ftp server + pluxml on Raspberry

Written by pmd - - no comments

Information from shellhacks.com.

Download

The following command recursively downloads your site with all its files and folders from FTP server and saves them to the current directory.

wget -r -l 0 -nH -X folder_to_skip ftp://user:pass@ftp.server.com

 

option description
user FTP username
pass FTP password
ftp.server.com IP address or domain name of an FTP server
-r Recursive retrieving
-l Maximum recursion depth (0 = unlimit) (default = 5)
-nH Disable generation of host-prefixed directories
-X exclude a list of directories

Backup

Now you can compress the folder with your site as follows:

tar -czf site-backup-$(date +%Y%m%d-%H%M%S).tar.gz yoursite.com

Install pluxml on raspberry pi

I am using nginx + php7 + pluxml following these 3 links:

  1. https://www.raspberrypi.org/documentation/remote-access/web-server/nginx.md
  2. https://blog.norore.fr/index.php?article13/pluxml-nginx-et-php-7-sont-dans-un-bateau
  3. https://docs.nginx.com/nginx/admin-guide/security-controls/configuring-http-basic-authentication/

To find which php version should be installed, you can search what is available:

$ apt-cache search php7

Install php and nginx (see here to install nginx):

$ sudo apt-get install php7.3-fpm php7.3-xml php7.3-gd

Once all is installed, configure php :

$ sudo nano /etc/php/7.3/fpm/pool.d/www.conf
[www]
user = www-data
group = www-data
listen = /run/php/php7.3-fpm.sock
listen.owner = www-data
listen.group = www-data
;listen.mode = 0660
$ sudo nano /etc/nginx/sites-available/default
server {
        listen 80 default_server;
        listen [::]:80 default_server;

        # Add index.php to the list if you are using PHP
        index index.php index.html index.htm index.nginx-debian.html;

        server_name _;

        location @handler {
                rewrite ^/(.*)$ /index.php? last;
        }

        # pass PHP scripts to FastCGI server
        #
        location ^~ /pluxml_folder {
                auth_basic "admin";
                auth_basic_user_file /etc/apache2/.htpasswd;

                location ~ \.php$ {
                        include snippets/fastcgi-php.conf;
                        fastcgi_pass unix:/run/php/php7.3-fpm.sock;
                }
        }

        # deny access to .htaccess files, if Apache's document root
        # concurs with nginx's one
        #
        location ~ /(data/configuration|version|update|\.ht) {
                deny all;
        }
}

Then restart both services.

 

Interesting problem : Nginx sucessfully password protects PHP files, but then prompts you to download them

Answer : The problem is a fundamental misunderstanding as to how nginx processes a request. Basically, nginx chooses one location to process a request.
You want nginx to process URIs that begin with /admin in a location block that requires auth_basic. In addition, URIs that end with .php need to be sent to PHP7.
So you need two fastcgi blocks, one to process normal PHP files and one to process restricted PHP files.

 

SSL certificate with no-ip.com

SSL Certificate Now Included with No-IP Free Dynamic DNS.

Tutorial #0: How to Configure the TrustCor Standard DV SSL
Tutorial #1: NGINX Server setup for TrustCor SSL

Generate the private key and CSR from the NGINX server by running this command:

$ sudo openssl req -nodes -days 365 -newkey rsa:2048 -keyout nginx1-trustcor.key -out nginx1-trustcor.csr
Ignoring -days; not generating a certificate
Generating a RSA private key
.....................................................+++++
.................................................................+++++
writing new private key to 'nginx1-trustcor.key'
-----
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [AU]:FR
State or Province Name (full name) [Some-State]:France
Locality Name (eg, city) []:none
Organization Name (eg, company) [Internet Widgits Pty Ltd]:none
Organizational Unit Name (eg, section) []:none
Common Name (e.g. server FQDN or YOUR name) []:DOMAIN_NAME.ddns.net
Email Address []:none
Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:
An optional company name []:none
$

 

Troubleshooting

Sometimes, I've had the situation where http requests from browsers are being served old versions of the PHP files, missing updates to the PHP scripts that have been uploaded to the server.

To solve this issue, I had to modify the php.ini file by setting :

opcache.enable=0

To find your php.ini location, run this php file on your server:

<?php
phpinfo();
?>

Then to reload php.ini file, restart php-fpm:

$ sudo systemctl stop php7.4-fpm
$ sudo systemctl start php7.4-fpm
$

Source 1, 2

Transmission exclusively using VPN

Written by pmd - - no comments

I would like to have my transmission client to exchange data only through a VPN.

Firewall

First of all, it is necessary to set some rules so the 'debian-transmission' user (running transmission) can only route through the VPN:

# 'debian-transmission' user only accepted through 'tun0'
# after these 3 first rules, transmission cannot access internet
$ sudo iptables -A OUTPUT -m owner --uid-owner 'debian-transmission' -o tun0 -j ACCEPT
$ sudo iptables -A OUTPUT -m owner --uid-owner 'debian-transmission' -o lo -j ACCEPT
$ sudo iptables -A OUTPUT -m owner --uid-owner 'debian-transmission' -j REJECT
# marking all packets used by users different than 'debian-transmission' with '42'
$ sudo iptables -t mangle -A OUTPUT -m owner ! --uid-owner 'debian-transmission' -j MARK --set-mark 42
$ sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
$ sudo sysctl -w 'net.ipv4.conf.eth0.rp_filter=2' # reverse path filtering

FYI: These rules will be set only until next reboot.

FYI: To get a complete presentation of all the netfilter rules, you can use these commands :

$ sudo iptables -vL -t filter
$ sudo iptables -vL -t nat
$ sudo iptables -vL -t mangle
$ sudo iptables -vL -t raw
$ sudo iptables -vL -t security

FYI: To display rules so you can verify there are good :

$ sudo iptables -S ; echo ; sudo iptables -S -t mangle ; echo ; sudo iptables -S -t nat

 

If you are sure that these iptables rules we set are OK, you can make them permanent (resistant to reboot):

$ sudo apt-get install iptables-persistent
$ sudo dpkg-reconfigure iptables-persistent # if already installed

Tap yes to both prompts. Verify it was correcly taken into account especially interfaces :

sudo nano /etc/iptables/rules.v4

Done, these rules are persistent: transmission cannot communicate without an active tun0 interface (VPN).

Routes

The strategy I used is this one:

  • all packets not marked '42' following main route table
  • all packets marked '42' following route table named '42'

Create a systemd .service to create and populate route table '42' when Pi3 starts:

$ sudo nano /etc/systemd/system/copy_route_pmd.service

We will wait to find an IP address containing "192", then we will create the new table "42" and copy all rules from main table to "42" table.

#/etc/systemd/system/copy_route_pmd.service
[Unit]
Description=Copy the route of main table to table 42 at system startup
After = network-online.target
Wants = network-online.target

[Service]
Type=oneshot
#ExecStart=/bin/bash -c "while ! [[ -n $(ifconfig | grep 192) ]]; do sleep 1; done; ip rule add fwmark 42 table 42; ip route show table main | while read LINE; do ip route add $LINE table 42; done"
ExecStart=/bin/bash -c "while ! [[ -n $(ifconfig | grep 192) ]]; do sleep 1; done; ip rule add fwmark 42 table 42; ip route show table main | grep -v tun0 | while read LINE; do ip route add $LINE table 42; done"

[Install]
WantedBy=multi-user.target

We reload systemd to update with the new service we made and make the service execute at system startup.

# Reloading
$ systemctl daemon-reload # Run if *.service file has changed
# Try the new service

$ sudo systemctl start copy_route_pmd.service
# If OK (check tables main and 42), set service to execute at startup
$ sudo systemctl enable copy_route_pmd.service

Now, debian-transmission will use main table to route packets, and users different than debian-transmission will use the table 42.

Link to article to check routes

 

openvpn

Configure openvpn

Make sure that you let openvpn push new rules in main route table in order to use the VPN.

Now that openvpn made up tun0 interface, check that the routes are respected:

$ wget -qO- ifconfig.co
$ sudo -u debian-transmission wget -qO- ifconfig.co

These two commands will return different IP address!

transmission

Install transmission

Verify that transmission-daemon is run by correct user:

$ top -u debian-transmission

Check your visible torrent IP with this: https://torguard.net/checkmytorrentipaddress.php

Access to transmission web interface will require nginx

nginx

Install nginx:

$ sudo apt-get install nginx

Edit the default configuration:

$ sudo nano /etc/nginx/sites-available/default

If the machine does not have an IPv6 address set, you need to comment this line :

listen [::]:80 default_server;

Replace section location by this :

location /transmission {
    proxy_pass http://127.0.0.1:9091;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  }

Restart nginx:

$ sudo service nginx restart

Access your interface worldwide using: http://yourIPadress/transmission/web/

DNS leak

To prevent DNS leak and/or not to rely on the router you are connected to the internet, modify the file:

$ sudo nano /etc/resolv.conf.head
#OpenDns Servers
nameserver 208.67.222.222
nameserver 208.67.220.220
#Google Servers
nameserver 8.8.8.8

In fact I want to set the DNS servers directly in the Raspberry Pi, because it allows me to remove the default route to the router in table 42 and keep it as tidy as possible.

Then reboot the Pi 3:

$ sudo reboot

You can now check that these are the first DNS server is use:

pi@raspberrypi:~ $ cat /etc/resolv.conf
# Generated by resolvconf
#OpenDns Servers
nameserver 208.67.222.222
nameserver 208.67.220.220
#Google Servers
nameserver 8.8.8.8
domain home
nameserver 192.168.1.1

From your Pi3, check the DNS leakage from this website: https://dnsleaktest.com/

Create a torrent on WNR3500L with Transmission

Written by pmd - - no comments

Here is the command line to use if you wanna create a torrent:

transmission-create -o /tmp/mnt/PMD/your_futur.torrent -c "your comments here" -t udp://tracker.openbittorrent.com:80 -t udp://open.demonii.com:1337 /tmp/mnt/PMD/your_file_you_wanna_share.zip

Then you need to:

  1. move your your_file_you_wanna_share.zip in your transmission download folder
  2. add the created torrent your_futur.torrent in your transmission using the web interface by example.
  3. in transmission web interface, right click on the torrent, and choose "verify local data".

You are set to share your file(s) !

Send email from WNR3500L

Written by pmd - - no comments

Router is running Tomato by Shibby.

First install Optware (see how to install here steps 1 to 6).

Then install msmtp:

ipkg install msmtp

Edit the configuration file (you may have to install nano "ipkg install nano"):

nano /opt/etc/msmtprc
account default
host smtp.gmail.com
port 587
auth on
user account@gmail.com
password password
auto_from on
from account@gmail.com
tls on
tls_starttls on
#tls_trust_file /opt/etc/ca-certificates.crt
# Use "tls_certcheck off" if you don't have ca-certificates.crt file.
tls_certcheck off
# Log to a separate file; use with no options to disable this feature
# logfile /opt/logs/msmtp
# Uncomment if you want to log to syslog facility, which is disabled by default
syslog LOG_MAIL

Test it:

echo -e "Subject: subject \n\nThis is the body" | msmtp anotheraccount@gmail.com

Done :)

If you use Gmail you might need to allow less secure apps: https://myaccount.google.com/lesssecureapps

Send email from your Raspberry Pi 3

Written by pmd - - no comments

Simple SMTP is a simple MTA (Mail Transport Agent) to deliver mail from a computer to a mail hub (SMTP server). It can be usefull to send result of your Cron jobs.

Install ssmtp:

sudo apt-get install ssmtp

Configure it:

sudo nano /etc/ssmtp/ssmtp.conf

#
# Config file for sSMTP sendmail
#
# The person who gets all mail for userids < 1000
# Make this empty to disable rewriting.
root=username@gmail.com

# The place where the mail goes. The actual machine name is required no
# MX records are consulted. Commonly mailhosts are named mail.domain.com
mailhub=smtp.gmail.com:587

# Where will the mail seem to come from?
#rewriteDomain=

# The full hostname
hostname=raspberrypi
UseSTARTTLS=YES
AuthUser=username
AuthPass=password


# Are users allowed to set their own From: address?
# YES - Allow the user to specify their own From: address
# NO - Use the system generated From: address
FromLineOverride=YES

Configure the account sending the email:

sudo nano /etc/ssmtp/revaliases

# sSMTP aliases
#
# Format:       local_account:outgoing_address:mailhub
#
# Example: root:your_login@your.domain:mailhub.your.domain[:port]
# where [:port] is an optional port number that defaults to 25.

root:username@gmail.com:smtp.gmail.com:587
pi:username@gmail.com:smtp.gmail.com:587

Try to send an email:

echo "email for test" | ssmtp -vvv email@domaine.com

If you use Gmail you might need to allow less secure apps: https://myaccount.google.com/lesssecureapps

Timer + screen on Raspbian

Written by pmd - - no comments

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 :(

Timer

A timer to restart Raspberry just in case shit happens while playing dumb through ssh:

sudo nano /home/pi/sshcheck.sh
#!/bin/bash
for (( c=$1; c>1; c-- ))
do
   echo -n "Reboot in $c minute(s)...  "
   date +%H:%M
   sleep 1m
done
echo "Reboot in 1 minute(s)..."
sleep 1s
for (( c=59; c>0; c-- ))
do
   echo -e "\e[101mReboot in $c second(s)... (CTRL+C to cancel rebooting)\e[49m"
   sleep 1s
done
echo -e "\e[101mReboot in $c second(s)...\e[49m"
echo -e "\e[101mREBOOT!!!\e[49m"
sudo reboot

Screen

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.

  1. Start a screen :
    $ 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
  2. To resume your screen session use the following command :
    $ screen -dr
  3. 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

Source

Rss feed of the articles