grub-mkconfig -o /boot/grub/grub.cfg
Insert in place with regex:
sed -e -i '/pattern/r file.txt' input.txt
Ou comment lire un capteur de température DS18B20 sur un RaspberryPi 3.
Voir aussi :
A regarder.
via SebSauvage.
1h;1!H;${;g;s/<h2.*</h2>/No title here/g;p;}
PC sous Linux :D
1) enter copy mode using Control+b [
2) navigate to beginning of text, you want to select and hit Space
3) move around using arrow keys to select region
4) when you reach end of region simply hit Enter to copy the region
5) now Control+b ] will paste the selection
Configuration du fichier "/boot/config.txt" pour que l'écran s'affiche sur le touchscreen Waveshare. Cela peut aussi se faire plus tard mais uniquement via un écran plus standard ou via SSH, puisque rien ne s'affiche sur l'écran Waveshare sans cette modification.
## Parameters for Waveshare touchscreen
max_usb_current=1
hdmi_group=2
hdmi_mode=1
hdmi_mode=87
hdmi_cvt=1024 600 60 6 0 0 0
Configuration du fichier "/boot/config.txt" pour activer une sonde température DS18B20 (il y aura d'autres commandes à activer par la suite)
## Parameters for temperature sensor DS18B20
dtoverlay=w1-gpio
network={
ssid="Access Point SSID"
psk="Your_wifi_password"
}
apt install vim tmux
apt install xscreensaver
# Virtual keyboard, azerty, http://www.framboise314.fr/florence-un-autre-clavier-virtuel-pour-le-raspberry-pi/
apt install florence at-spi2-core && setxkbmap fr
# Install hubiC and configure DBus
wget http://mir7.ovh.net/ovh-applications/hubic/hubiC-Linux/2.1.0/hubiC-Linux-2.1.0.53-linux.deb -O hubic.deb
sudo dpkg -i hubic.deb
sudo apt install -f
dbus-launch --sh-syntax
export DBUS_SESSION_BUS_ADDRESS='unix:abstract=/tmp/dbus-xxxx,guid=xxxx' # Copy/paste the bus data address and export the settings (change ‘xxxx’ with your own data from the previous command output)
# Configuration hubiC and connect the account
mkdir /home/pi/hubic
hubic login login@domain.tld /home/pi/hubic
hubiC (le "Dropbox" d'OVH) fonctionne bien sous Windows et Linux, ce n'est pas aussi finalisé que Dropbox, mais ça fait le job.
Sous Linux, je trouve qu'il consomme souvent trop de CPU, donc je fais ceci pour le limiter à 10% :
ps aux | grep hubic
cpulimit -p <PID hubiC> -l 10 &
Au passage, mon code parainnage hubiC est "TJHNOY". ça fait 5go de stockage en plus pour vous (soit 30go au lieu de 25go) et 5go de stockage en plus pour moi. Enjoy!