Les Orgres de Barback - Rue de Panam

Written by pmd - - no comments
Riff:             Accords :
e-|-------------   A#/Bb  x 1 3 3 3 1
B-|-------------   F      1 3 3 2 1 1
G-|-------------   Gm     3 5 5 3 3 3
D-|-------------   Dm     x 5 7 7 6 5
A-|---------0---   Cm     x 3 5 5 4 3
E-|-1---3-------

Rythme :
Riff A# F A# F Riff
Gm Dm Gm Dm Gm Dm Cm F

ms

Dans une rue de Panam
Errant au bord de l'eau
J'fumais mon Amsterdam
Pour finir au bistrot
Y'avait là deux-trois femmes
Qui faisaient le tapin
Moi, j'aiguisais ma lame
Pour planter les rupins

Les gens de bon quartier,
Les touristes, les vieillards,
Aiment bien s'promener le long des grands boul'vards
Ils achètent des souv'nirs, des tours Eiffel en plastique
Les saltimbanques les font rire mais faudrait qu'on leur explique

Qu'il y a d'la merde partout, de la drogue
Et surtout des jeunes en galère qui trafiquent la misère
Ouais ! j'dois bien avouer que j'y passe toutes mes journées
C'est que parfois à Paris, c'est la joie et la folie ...

Mais croyez-moi, bientôt les flics auront du boulot
Car tous les vagabonds parlent de révolution
Un jour, toutes nos chansons, ouais, vous désarmeront
Il n'y aura plus qu'la folie, la joie et l'anarchie,
La joie et l'anarchie,
La joie dans Paris.

Gateau au chocolat

Written by pmd - - no comments

Inspiré de la recette "Gâteau au chocolat fondant rapide" prise sur le site Marmiton.

Ingrédients :

  1. 200g de chocolat à pâtisser noir
  2. 100g de beurre (mais j'ai mis 50g...)
  3. 3 oeufs
  4. 50g de farine de blé (= 119mL)
  5. 100g de sucre en poudre (= 181mL)

Recette :

  1. Préchauffez votre four à 180°C (thermostat 6).
    Dans une casserole, faites fondre le chocolat et le beurre coupé en morceaux à feu très doux.
  2. Dans un saladier, ajoutez le sucre, les oeufs, la farine. Mélangez.
  3. Ajoutez le mélange chocolat/beurre. Mélangez bien.
  4. Beurrez et farinez votre moule puis y versez la pâte à gâteau.
  5. Faites cuire au four environ 20 minutes.
  6. A la sortie du four le gâteau ne paraît pas assez cuit. C'est normal, laissez-le refroidir puis démoulez- le.

Notes :

  1. je n'ai mis que 50g de beurre et ajouté 2 cuillères à café de levure.
  2. temps de cuisson : 25min
  3. c'est bon

Installing Wordpress

Written by pmd - - no comments

Après achat de NDD + hebergement chez OVH; Manager : https://www.ovhtelecom.fr/manager/

Après l'installation de Wordpress, mise en place de quelques Extensions :

  • WPForms Lite
    • Pour faire un formulaire de contact
  • MonsterInsights - Google Analytics pour WordPress
    • Pour avoir des informations sur qui vient
  • Yoast SEO
    • Pour améliorer l'indexage sur les moteurs de recherche
    • Toujours utiliser les titres, catégories et tags!
    • Toujours faire des liens internes vers d'autres articles du site!
    • Google Search Console
  • Insert Headers and Footers
    • Ca va servir pour Adsense et pour Advanced noCaptcha
  • Adsense
    • https://www.wpbeginner.com/beginners-guide/how-to-add-google-adsense-to-your-wordpress-site/
    • Pour Adsence, il faut que le site ait déjà un minimum de contenu (10 pages ?)
  • Jackmail.com (Mailchimp semble interressant aussi)
    • Pour récupérer les emails des surfers
    • https://www.jackmail.com/docs/fr/delivrabilite/personnaliser-son-nom-de-domaine-guide-ovh
  • SendinBlue
    • Jackmail pas terrible, rien reçu sur les adresses en @mail.ru
    •  
  • Ninja Forms – The Easy and Powerful Forms Builder
    • Pour faire un formulaire de contact qu'on peut coupler à Jackmail
  • Advanced noCaptcha & invisible captcha
    • Pour ajouter le captcha de google pour filtrer une partie du spam
  • GDPR Cookie Consent
    • Pour respecter les lois EU et les conditions d'Adsense...
  • Advanced Gutenberg Blocks
    • pour avoir plus de bloc de rédaction/présentation rapidement accessibles
  • Pour faire des tableau, c'est la misère :
    • https://wordpress.org/plugins/jtrt-responsive-tables/ (à tester)
    • TablePress
    • NinjaTables (trop de paramètres payants)
  • Easy WP SMTP

https://www.wpbeginner.com/beginners-guide/11-ways-to-get-more-comments-on-your-wordpress-blog-posts/

L'expérience est toujours en cours...

https://alternativeto.net/list/72/extensions-to-make-wordpress-do-anything

Source 1, 2

dhcpcd and dhcpcd-run-hooks on Raspbian

Written by pmd - - no comments

If you are using Raspbian GNU/Linux 9 (stretch), then you are most likely using dhcpcd as your DHCP and DHCPv6 client. How to know your OS version? Here :

$ cat /etc/os-release
PRETTY_NAME="Raspbian GNU/Linux 9 (stretch)"
NAME="Raspbian GNU/Linux"
VERSION_ID="9"
VERSION="9 (stretch)"
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"
  • dhcpcd gets the host information (IP address, routes, etc) from a DHCP server and configures the network interface of the machine on which it is running. Manual of DHCPCD(8).
  • dhcpcd-run-hooks is a DHCP client configuration script. It is used by dhcpcd to run any system and user defined hook scripts. Manual of DHCPCD-RUN-HOOKS(8).

dhcpcd

It seems that to restart all network interfaces this works :

$ sudo systemctl restart dhcpcd.service

To understand what happened, better read dhcpcd logs, here is what we can see:

$ journalctl -u dhcpcd
Dec 21 15:38:04 raspberrypi systemd[1]: Stopping dhcpcd on all interfaces...
Dec 21 15:38:04 raspberrypi dhcpcd[15174]: sending signal TERM to pid 14888
Dec 21 15:38:04 raspberrypi dhcpcd[15174]: waiting for pid 14888 to exit
Dec 21 15:38:04 raspberrypi dhcpcd[14888]: received SIGTERM, stopping
Dec 21 15:38:04 raspberrypi dhcpcd[14888]: eth0: removing interface
Dec 21 15:38:04 raspberrypi dhcpcd[14888]: wlan0: removing interface
Dec 21 15:38:04 raspberrypi dhcpcd[15174]: sending signal TERM to pid 14888
Dec 21 15:38:04 raspberrypi dhcpcd[15174]: waiting for pid 14888 to exit
Dec 21 15:38:05 raspberrypi systemd[1]: Stopped dhcpcd on all interfaces.
Dec 21 15:38:05 raspberrypi systemd[1]: Starting dhcpcd on all interfaces...
Dec 21 15:38:05 raspberrypi dhcpcd[15180]: dev: loaded udev
Dec 21 15:38:05 raspberrypi systemd[1]: Started dhcpcd on all interfaces.
Dec 21 15:38:05 raspberrypi dhcpcd-run-hooks[15203]: wlan0: starting wpa_supplicant
Dec 21 15:38:05 raspberrypi dhcpcd[15185]: eth0: waiting for carrier
Dec 21 15:38:05 raspberrypi dhcpcd[15185]: wlan0: waiting for carrier
Dec 21 15:38:06 raspberrypi dhcpcd[15185]: wlan0: carrier acquired
Dec 21 15:38:06 raspberrypi dhcpcd[15185]: DUID 00:01:00:01:21:b0:de:63:b8:27:eb:4d:6c:87
Dec 21 15:38:06 raspberrypi dhcpcd[15185]: wlan0: IAID eb:5d:6d:97
Dec 21 15:38:06 raspberrypi dhcpcd[15185]: wlan0: adding address fe80::2882:e851:cf0c:9242
Dec 21 15:38:06 raspberrypi dhcpcd[15185]: wlan0: soliciting an IPv6 router
Dec 21 15:38:06 raspberrypi dhcpcd[15185]: wlan0: rebinding lease of 192.168.254.200
Dec 21 15:38:06 raspberrypi dhcpcd[15185]: wlan0: leased 192.168.254.200 for 86400 seconds
Dec 21 15:38:06 raspberrypi dhcpcd[15185]: wlan0: adding route to 192.168.254.0/24
Dec 21 15:38:06 raspberrypi dhcpcd[15185]: wlan0: adding default route via 192.168.254.1
Dec 21 15:38:19 raspberrypi dhcpcd[15185]: wlan0: no IPv6 Routers available

Source

dhcpcd-run-hooks

dhcpcd runs /lib/dhcpcd/dhcpcd-run-hooks. This script runs each script found in /lib/dhcpcd/dhcpcd-hooks in a lexical order.
dhcpcd-run-hooks is used by dhcpcd to run any system and user defined hook scripts. System hook scripts are found in /lib/dhcpcd/dhcpcd-hooks.
There is a list of reasons why dhcpcd-run-hooks could be invoked, such as BOUND (= dhcpcd obtained a new lease from a DHCP server = computer has an IP assigned on the interface).
Many variables will then be set, along with any protocol supplied ones, such as :

  • $interface : the name of the interface
  • $reason : reason why dhcpcd-run-hooks was invoked
  • $if_up : true if the interface is up, otherwise false.

To know what is the current IPv4 address after an interface BOUNDed dhcpcd obtained a new lease from a DHCP server.:

ifconfig $interface | grep "inet " | awk '{print $2}'

I created /lib/dhcpcd/dhcpcd-hooks/60-test_by_pmd in order to play with this functionality. Shell script I used in order to check IP after new DHCP lease was obtained (writing output in /home/pi/test.txt in order to see what happened afterward):

if [ "$reason" = "BOUND" ] && [ "$if_up" = "true" ]; then
     echo "$(date +"%d-%m-%y %H:%M:%S ") $reason $interface IP:$if_up DOWN:$if_down" >> /home/pi/test.txt
     ifconfig $interface | grep "inet " | awk '{print $2}' >> /home/pi/test.txt
fi

Sources : both manuals.

AUTO-Update of openvpn configuration

Written by pmd - - no comments

It happens that NordVPN openvpn configuration files don't work anymore after a while.

I made a bash script to update the configuration easy and fast:

#!/bin/bash
# Mise a jour de la configuration NordVPN
# Dossier temporaire
DOSSIER_TEMP="/home/pi/NordVPNautoUpdate"
#Dossier des configurations openvpn
DOSSIER_OPENVPN="/etc/openvpn"
CONF_OPENVPN="server.conf"
AUTOLOGIN_OPENVPN="login.txt"
# Pays
PAYS="ua"
# TCP ou UDP?
PROTO="udp"
# Archive de configuration NordVPN
ARCHIVE_NORDVPN="https://downloads.nordcdn.com/configs/archives/servers/ovpn.zip"
FICHIER=$(echo -n $ARCHIVE_NORDVPN | awk -F "/" '{printf $NF}')

# On supprime et on crée le dossier temp
rm -rf $DOSSIER_TEMP
mkdir $DOSSIER_TEMP

# On télécharge tous les fichiers de conf NordVPN
wget $ARCHIVE_NORDVPN -P $DOSSIER_TEMP

# On dézip l'archive téléchargée
mkdir $DOSSIER_TEMP/temp
unzip -q "$DOSSIER_TEMP/$FICHIER" -d $DOSSIER_TEMP/temp

# On garde que les conf d'un certain pays
mv $DOSSIER_TEMP/temp/ovpn_$PROTO/$PAYS[0-9]*$PROTO* $DOSSIER_TEMP/
rm -r $DOSSIER_TEMP/temp

# On supprime les conf double-VPN et l'archive zip
NbConf=0
for ConfOpenVPN in $DOSSIER_TEMP/*; do
        if [[ $ConfOpenVPN != */$PAYS[0-9]*$PROTO* ]]; then
                rm $ConfOpenVPN
        else
                # On compte le nombre de conf restantes
                NbConf=$((NbConf+1))
        fi
done

# On choisi une conf au hasard
NbConf=$((1 + RANDOM % $NbConf))
COMPTEUR=0
for ConfOpenVPN in $DOSSIER_TEMP/*; do
        COMPTEUR=$((COMPTEUR+1))
        if [[ $COMPTEUR -eq $NbConf ]]; then
            # On modifie la configuration pour authentification automatique
            sed -i "s@auth-user-pass@auth-user-pass $DOSSIER_OPENVPN/$AUTOLOGIN_OPENVPN@" $ConfOpenVPN
            # On déplace la conf dans le dossier openvpn
            sudo cp -f $ConfOpenVPN $DOSSIER_OPENVPN
            sudo cp -f $ConfOpenVPN $DOSSIER_OPENVPN/$CONF_OPENVPN
                        # On informe
                        echo "Configuration installée :"
                        echo $ConfOpenVPN | awk -F "/" '{printf $NF}'
                        echo ""
        fi
done

# On supprime le dossier temporaire
rm -rf $DOSSIER_TEMP
# On redémarre openvpn avec la nouvelle configuration
sudo service openvpn restart

Then simply execute the script:

bash NordVPNautoUpdate.sh

Unlock standalone Airsonic database

Written by pmd - - no comments

If your airsonic is stucked for some reasons such as Liquibase Update Failed and Waiting for changelog lock...

liquibase.exception.LockException: Could not acquire change log lock. Currently locked by 192.168.254.200 (192.168.254.200) since 18/11/18 16:39
  1. Stop Airsonic for sure :
    sudo service airsonic stop
  2. Read logs /var/airsonic/airsonic.log :
    nano /var/airsonic/airsonic.log
  3. Backup your database folder /var/airsonic/db :
    sudo cp /var/airsonic/db /var/airsonic/db_backup
  4. Edit /var/airsonic/db/airsonic.script :
    sudo nano /var/airsonic/db/airsonic.script
    • remove all lines where you can find DATABASECHANGELOGLOCK by example :
      • CREATE MEMORY TABLE DATABASECHANGELOGLOCK.....
      • INSERT INTO DATABASECHANGELOGLOCK VALUES(1,TRUE,'2018-11-18 16:39:56.266000000','192.168.254.200 (192.168.254.200)')
  5. Save file.
  6. Start Airsonic :
    sudo service airsonic start
  7. Check Airsonic status :
    sudo service airsonic status

If you wanna reset your Airsonic music server, just delete the database /var/airsonic/db ...

Source 1, 2, 3.

Update Airsonic on Raspberry Pi 3

Written by pmd - - no comments

How to update a standalone Airsonic

  • Stop the current running Airsonic:
$ sudo systemctl stop airsonic.service
$ cd /var/airsonic/
$ sudo mv airsonic.war airsonic.war.10.1.1.bak
$ sudo wget https://github.com/airsonic/airsonic/releases/download/v10.1.2/airsonic.war --output-document=/var/airsonic/airsonic.war
  • Put good rights to all folder (new airsonic.war is not owned by airsonic), and verify it has been applied:
$ sudo chown -R airsonic:airsonic /var/airsonic
$ ls
total 151M
-rw-r--r--  1 airsonic airsonic 760K Oct 11 19:52 airsonic.log
-rw-r--r--  1 airsonic airsonic  11M Oct  3 00:20 airsonic.log.1
-rw-r--r--  1 airsonic airsonic  978 Oct 11 04:00 airsonic.properties
-rw-r--r--  1 airsonic airsonic  70M Jul 28 22:10 airsonic.war
-rw-r--r--  1 airsonic airsonic  70M Dec 16  2017 airsonic.war.10.1.1.bak
drwxr-xr-x  2 airsonic airsonic 4.0K Oct 11 19:49 db
drwxr-xr-x  2 airsonic airsonic  20K Sep 14 16:08 lastfmcache
drwxr-xr-x  7 airsonic airsonic 4.0K Jul 22 10:36 lucene2
-rw-r--r--  1 airsonic airsonic  741 Oct 11 19:50 rollback.sql
drwxr-xr-x 16 airsonic airsonic 4.0K Oct  4 17:45 thumbs
drwxr-xr-x  2 airsonic airsonic 4.0K Jul 22 10:54 transcode
  • Start updated Airsonic and restart proxy server:
$ sudo systemctl start airsonic.service
$ sudo service nginx restart

Nothing too hard, basically, you need to replace the airsonic.war by the updated one.

PluXml 5.6 / CKEditor 4.7.3 modification to get more handy

Written by pmd - - no comments

PluXml 5.6 / CKEditor 4.7.3 modification to get handy code <div>

I modified the file /plugins/ckeditor/ckeditor/styles.js to have a much more easier way to put code in my memo.

Before:

    {
        name: 'Special Container',
        element: 'div',
        styles: {
            padding: '5px 10px',
            background: '#eee',
            border: '1px solid #ccc'
        }
    },

After:

    {
        name: 'Special Container',
        element: 'div',
        styles: {
            padding: '5px 10px',
            background: '#eee',
            border: '1px solid #ccc',
            'white-space': 'nowrap',
            'overflow': 'auto',
            'font-family': 'monospace, monospace',
            'font-size': '0.9rem'
        }
    },

Modification to get better visual when using <kbd>

In PluxXML Administration > Parameters > Themes > Edit Theme files > /css/plucss.css I have set this for <kbd> HTML tag.

kbd {
    background-color: #eee;
    border-radius: 3px;
    border: 1px solid #b4b4b4;
    box-shadow: 0 1px 1px rgba(0, 0, 0, .2), 0 2px 0 0 rgba(255, 255, 255, .7) inset;
    color: #333;
    display: inline-block;
    font-size: .85em;
    font-weight: 700;
    line-height: 1;
    padding: 2px 4px;
    white-space: nowrap;
   }
  • Before : CTRL + ALT + DEL
  • After : CTRL + ALT + DEL

CSS source

Rss feed of the articles