Install a newer package version than available on PyPI

Written by pmd - - no comments

Try to simply update

pi@raspberrypi:~ $ sudo python3 -m pip install --upgrade mplfinance --no-cache-dir
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Requirement already up-to-date: mplfinance in /usr/local/lib/python3.7/dist-packages (0.11.0)
Requirement already satisfied, skipping upgrade: matplotlib in /usr/lib/python3/dist-packages (from mplfinance) (3.0.2)
pi@raspberrypi:~ $

It says the package is already at the newer version 0.11, but on github.com/matplotlib/mplfinance there is even newer.

Alternative that worked

Download the sources :

pi@raspberrypi:~ $ wget https://github.com/matplotlib/mplfinance/archive/master.zip
--2020-08-20 21:01:12--  https://github.com/matplotlib/mplfinance/archive/master.zip
Resolving github.com (github.com)... 140.82.118.4
Connecting to github.com (github.com)|140.82.118.4|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://codeload.github.com/matplotlib/mplfinance/zip/master [following]
--2020-08-20 21:01:12--  https://codeload.github.com/matplotlib/mplfinance/zip/master
Resolving codeload.github.com (codeload.github.com)... 140.82.112.9
Connecting to codeload.github.com (codeload.github.com)|140.82.112.9|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [application/zip]
Saving to: ‘master.zip’

master.zip  [                         <=>                ]  19.37M   208KB/s    in 94s

2020-08-20 21:02:46 (212 KB/s) - ‘master.zip’ saved [20307580]

pi@raspberrypi:~ $

Unzip :

pi@raspberrypi:~ $ unzip master.zip -d mplfinance
Archive:  master.zip
3af71a860c9eb646b92a6c9d4d4ab0a129f3db79
   creating: mplfinance/mplfinance-master/
   creating: mplfinance/mplfinance-master/.github/
   creating: mplfinance/mplfinance-master/.github/ISSUE_TEMPLATE/
  inflating: mplfinance/mplfinance-master/.github/ISSUE_TEMPLATE/ask-a-question.md
  inflating: mplfinance/mplfinance-master/.github/ISSUE_TEMPLATE/bug_report.md
[... many lines ...]
finishing deferred symbolic links:
  mplfinance/mplfinance-master/examples/original_flavor/data -> ../data
pi@raspberrypi:~ $

Go in unziped folder :

pi@raspberrypi:~ $ cd mplfinance/mplfinance-master/
pi@raspberrypi:~/mplfinance/mplfinance-master $

Install :

pi@raspberrypi:~/mplfinance/mplfinance-master $ sudo python3 -m pip install .
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Processing /home/pi/mplfinance/mplfinance-master
Requirement already satisfied: matplotlib in /usr/lib/python3/dist-packages (from mplfinance==0.12.7a1) (3.0.2)
Requirement already satisfied: pandas in /usr/local/lib/python3.7/dist-packages (from mplfinance==0.12.7a1) (1.0.3)
Requirement already satisfied: python-dateutil>=2.6.1 in /usr/lib/python3/dist-packages (from pandas->mplfinance==0.12.7a1) (2.7.3)
Requirement already satisfied: pytz>=2017.2 in /usr/lib/python3/dist-packages (from pandas->mplfinance==0.12.7a1) (2019.1)
Requirement already satisfied: numpy>=1.13.3 in /usr/lib/python3/dist-packages (from pandas->mplfinance==0.12.7a1) (1.16.2)
Building wheels for collected packages: mplfinance
  Running setup.py bdist_wheel for mplfinance ... done
  Stored in directory: /root/.cache/pip/wheels/4e/71/07/c9cc7215e05dd2bcc76f171eaf646c5e069e3bc296fb8defb9
Successfully built mplfinance
Installing collected packages: mplfinance
  Found existing installation: mplfinance 0.11.0
    Uninstalling mplfinance-0.11.0:
      Successfully uninstalled mplfinance-0.11.0
Successfully installed mplfinance-0.12.7a1
pi@raspberrypi:~/mplfinance/mplfinance-master $

Done, should be good.

Source

Check connectivity and switch on/off a LED (GL-AR150)

Written by pmd - - no comments

Shell script that will check if there is connectivity to a defined website every 60 seconds and switch ON/OFF the led :

  • /usr/bin/WANLED :
#!/bin/sh
while [ true ]; do
        /usr/bin/wget -q --tries=2 --spider https://www.google.com
        if [ $? -eq 0 ]; then
                #echo "Connected ! LED RED OFF. LED GREEN ON."
                echo "none" >  /sys/class/leds/orange:wlan/trigger
                echo "default-on" >  /sys/class/leds/green:configurable/trigger
        else
                #echo "Not connected ! LED RED ON. LED GREEN OFF."
                echo "default-on" >  /sys/class/leds/orange:wlan/trigger
                echo "none" >  /sys/class/leds/green:configurable/trigger
        fi
        sleep 60
done

Check which LEDs are available and modify in above script if necessary:

root@OpenWrt:~# ls /sys/class/leds
ath9k-phy0          green:configurable  green:power         orange:wlan

If --tries option is not recognized, you may need to install proper wget. Check like this:

root@OpenWrt:~# ls -la $(which wget)
lrwxrwxrwx    1 root     root            18 Apr 27 20:28 /usr/bin/wget -> /bin/uclient-fetch # Need to get proper wget
root@OpenWrt:~# opkg install wget-ssl
Downloading [...]
[...]
Signature check passed.
root@OpenWrt:~# ls -la $(which wget)
lrwxrwxrwx    1 root     root            21 May 21 06:16 /usr/bin/wget -> /usr/libexec/wget-ssl # No need to get proper wget

Schell script to autostart the above script :

  • /etc/init.d/WANLED :
#!/bin/sh /etc/rc.common

START=99
STOP=1

start(){
        /usr/bin/WANLED &
}

stop(){
        killall -9 WANLED
}

Now let's make these script executable and started at startup:

# chmod +x /usr/bin/WANLED
# chmod +x /etc/init.d/WANLED
# /etc/init.d/WANLED enable
# /etc/init.d/WANLED start

Now the orange LED should be ON when there is no connectivity to Google.

LEDs may be driven by other component. To be sure it is not, go to System > LED Configuration.
In my case it looks like this:

 Name               | LED Name           | Trigger |
--------------------|--------------------|---------|--------------
 green:power        | green:power        | none    | ☰EditDelete
 green:configurable | green:configurable | none    | ☰EditDelete
 orange:wlan        | orange:wlan        | none    | ☰EditDelete

FYI OpenWRT in use was : OpenWrt 22.03.5, r20134-5f15225c1e

Source: LED, Start script at startup, LED on when Internet is available

Руки Вверх - Он Тебя Целует

Written by pmd - - no comments
C#m  4 4 3 3 2 4
A    5 7 7 6 5 5
B    7 9 9 8 7 7
G#m  4 5 5 4 4 4

ms

C#m            A
Вечером теплым брожу один
B               G#m
"Ты не можешь ее вернуть" - шепчет мне нежно дождь
C#m            A
Знаю, что встречу тебя с другим
B               G#m
Лучше это была б не ты, но рядом с ним ты идешь
C#m            A
Я ж тебя так любил, так любил
B               G#m
Думал, что ты ждала меня. Что же ты сделала
C#m            A
Я ж тебя так любил, так любил
B               G#m
А теперь потерял тебя

 

Припев.
C#m            A
А он тебя целует, говорит что любит
B               G#m
И ночами обнимает, к сердцу прижимает
C#m            A
А я мучаюсь от боли со своей любовью
B               G#m
Фотографии в альбоме о тебе напомнят

А он тебя целует, говорит что любит
И ночами обнимает, к сердцу прижимает
А я мучаюсь от боли со своей любовью
Фотографии в альбоме о тебе напомнят

О тебе...

Вечером теплым гремит гроза
Снова вижу я вас вдвоем, ты улыбаешься
В сторону я отвожу глаза
Что же делаешь ты со мной, зачем издеваешься
Я ж тебя так любил, так любил
Думал, что ты ждала меня. Что же ты сделала
Я ж тебя так любил, так любил
А теперь потерял тебя
А он тебя целует, говорит что любит
И ночами обнимает, к сердцу прижимает.

Source 1, 2, 2

Classified in : Guitare - Tags : none

Tryo - L'Hymne De Nos Campagnes

Written by pmd - - 1 comment
Accords :
Dm     x 5 7 7 6 5
Bb     6 8 8 7 6 6
A      5 7 7 6 5 5

Rythme :
Dm Dm Bb A

ms

Si tu es né dans une cité HLM
Je te dédicace ce poème
En espérant qu'au fond de tes yeux ternes
Tu puisses y voir un petit brin d'herbe

Et les mans faut faire la part des choses
Il est grand temps de faire une pause
De troquer cette vie morose
Contre le parfum d'une rose

C'est l'hymne de nos campagnes
De nos rivières, de nos montagnes
De la vie man, du monde animal
Crie-le bien fort, use tes cordes vocales!

Pas de boulot, pas de diplômes
Partout la même odeur de zone
Plus rien n'agite tes neurones
Pas même le shit que tu mets dans tes cônes
Va voir ailleurs, rien ne te retient
Va vite faire quelque chose de tes mains
Ne te retourne pas ici tu n'as rien
Et sois le premier à chanter ce refrain

C'est l'hymne de nos campagnes
De nos rivières, de nos montagnes
De la vie man, du monde animal
Crie-le bien fort, use tes cordes vocales!

Assieds-toi près d'une rivière
Écoute le coulis de l'eau sur la terre
Dis-toi qu'au bout, hé! il y a la mer
Et que ça, ça n'a rien d'éphémère
Tu comprendras alors que tu n'es rien
Comme celui avant toi, comme celui qui vient
Que le liquide qui coule dans tes mains
Te servira à vivre jusqu'à demain matin!

C'est l'hymne de nos campagnes
De nos rivières, de nos montagnes
De la vie man, du monde animal
Crie-le bien fort, use tes cordes vocales!
Assieds-toi près d'un vieux chêne
Et compare le à la race humaine
L'oxygène et l'ombre qu'il t'amène
Mérite-t-il les coups de hache qui le saigne?
Lève la tête, regarde ces feuilles
Tu verras peut-être un écureuil
Qui te regarde de tout son orgueil
Sa maison est là, tu es sur le seuil

C'est l'hymne de nos campagnes
De nos rivières, de nos montagnes
De la vie man, du monde animal
Crie-le bien fort, use tes cordes vocales!
Crie-le bien fort, use tes cordes vocales!

Peut-être que je parle pour ne rien dire
Que quand tu m'écoutes tu as envie de rire
Mais si le béton est ton avenir
Dis-toi que c'est la forêt qui fait que tu respires
J'aimerais pour tous les animaux
Que tu captes le message de mes mots
Car un lopin de terre, une tige de roseau
Servira la croissance de tes marmots!
Servira la croissance de tes marmots!

C'est l'hymne de nos campagnes
De nos rivières, de nos montagnes
De la vie man, du monde animal
Crie-le bien fort, use tes cordes vocales!

C'est l'hymne de nos campagnes
De nos rivières, de nos montagnes
De la vie man, du monde animal
Crie-le bien fort, use tes cordes vocales, hey!

Source

Rss feed of the articles