April 19 2022, 09:31#

Thunar - Debian Wiki

Lien : https://wiki.debian.org/Thunar#FTP_.2F_SFTP_etc.

Pour accéder aux partages distants (smb, cifs) dans Thunar sur Debian, installer les paquets :

  • gvfs-backends
  • gvfs-fuse

Tags : linux debian xfce cifs smb samba thunar sftp ftp

April 13 2022, 12:54#

regular expression - How can I use sed to replace a multi-line string? - Unix & Linux Stack Exchange

Lien : https://unix.stackexchange.com/questions/26284/how-can-i-use-sed-to-replace-a-multi-line-string/26290#26290

Pour faire suite à mon précédent post, j'ai besoin d'activer la compression de logrotate en décommentant la ligne #compress juste après le commentaire explicatif # uncomment this if you want your log files compressed.

Pour ce faire :

sed '/# uncomment this if you want your log files compressed/{n;/#compress/{s/#compress/compress/;p;d;}}' /etc/logrotate.conf

Quelques explications :

  1. On recherche le pattern # uncomment this if you want your log files compressed
  2. Si on trouve, on passe à la ligne suivante n;
  3. On recherche le pattern #compress
  4. Si on trouve, on substitut #compress par compress
  5. On imprime p;
  6. On supprime l'occurence d;

Cheatsheet :

:  # label
=  # line_number
a  # append_text_to_stdout_after_flush
b  # branch_unconditional
c  # range_change
d  # pattern_delete_top/cycle
D  # pattern_ltrunc(line+nl)_top/cycle
g  # pattern=hold
G  # pattern+=nl+hold
h  # hold=pattern
H  # hold+=nl+pattern
i  # insert_text_to_stdout_now
l  # pattern_list
n  # pattern_flush=nextline_continue
N  # pattern+=nl+nextline
p  # pattern_print
P  # pattern_first_line_print
q  # flush_quit
r  # append_file_to_stdout_after_flush
s  # substitute
t  # branch_on_substitute
w  # append_pattern_to_file_now
x  # swap_pattern_and_hold
y  # transform_chars

Tags : linux unix sed logrotate log cheatsheet

April 13 2022, 08:52#

regex - How to find patterns across multiple lines using grep? - Stack Overflow

Lien : https://stackoverflow.com/questions/2686147/how-to-find-patterns-across-multiple-lines-using-grep/25180652#25180652

Cas d'école : je cherche à savoir si la compression des logs est activée dans logrotate.conf

Voici ce que je recherche :

# uncomment this if you want your log files compressed
compress

Solution : utilisation de PCRE (Perl-Compatible Regular Expressions) avec grep

grep -Pzl '(?s)# uncomment this if you want your log files compressed.*\ncompress' /etc/logrotate.conf

-P pour utiliser PCRE -z pour traiter l'entrée sur plusieurs lignes, chacune se terminant par un zéro à la place d'une nouvelle ligne -l liste uniquement les fichiers correspondants (?s) activer PCRE_DOTALL, ce qui veut dire qu'un point . correspond à n'importe quel caractère ou nouvelle ligne

Tags : linux log logrotate grep perl

April 03 2022, 14:28#

Using a webcam on FreeBSD in web browsers

Lien : https://www.davidschlachter.com/misc/freebsd-webcam-browser

How to use your webcam with Chrome and Firefox in FreeBSD

Installation

pkg inst pwcview v4l-utils v4l_compat webcamd
kldload cuse
sysrc -f /boot/loader.conf cuse_load=YES
sysrc webcamd_enable=YES
pw groupmod webcamd -m user
service devd restart
service webcamd start

A reboot is highly recommended

Then, we can test with pwcview

pwcview -d /dev/video0

Tags : freebsd chromium firefox webcam

January 28 2022, 09:56#

Red Hat Enterprise Linux - How to Manually Re-enable Failed Paths Reported by Multipath

Lien : https://support.hpe.com/hpesc/public/docDisplay?docId=emr_na-c03113986

When running the multipath command several devices report failed paths. After Checking confirmed that the underlying storage devices were all online and available but the device mapper multipath layer did not automatically re-enable the paths. Although a full server reboot would recover access to all paths a non-disruptive manual procedure was preferred that could be performed online.

Supprimer un path

echo 1 > /sys/block/sdcu/device/delete

Puis rescan pour remonter le path

Tags : linux multipath san redhat lun

January 21 2022, 16:17#

Script to Identify LUN ID, WWN or WWID, Vendor name and File systems on any block device in Linux | UnixUtils

Lien : https://unixutils.com/identify-lun-id-wwn-wwid-vendor-name-file-systems-block-device-linux/

#!/bin/bash

# Bash Script to identify disk, Vendor name, Serial & WWN for all kinds of Mounted Block devices

for i in `lsblk | grep disk | egrep -v 'Vx|ram|raw|loop|fd|md|dm-|sr|scd|st' | awk '{ print $1 }'`
do
    lsblk /dev/$i | awk '{print "MOUNT="$NF}' | grep -i '/'
    if [ $? = "0" ]; then
        lsblk /dev/$i | grep disk | awk '{print "BLOCK_SIZE="$4}'
        udevadm info --query=all --name /dev/$i | egrep 'DEVNAME=|ID_VENDOR=|ID_SERIAL_RAW=|ID_WWN=|ID_PATH=|ID_SCSI_SERIAL=' | awk '{ print $2 }'
        echo "--------------"
    fi
done

Tags : linux lun wwn multipath powerpath lsblk shell script san

January 20 2022, 16:11#

Best BAKA compilation in anime - YouTube

Lien : https://www.youtube.com/watch?v=h2LKE7SUDZM

Tout est dans le titre :)

Tags : anime baka vidéo youtube

January 19 2022, 15:19#

Tester la vitesse de transfert de données entre deux serveurs

On envoi un demi giga environ pour voir à quelle vitesse c'est transféré.

dd if=/dev/zero bs=1024k count=512 | ssh user@remote.host 'cat >> /dev/null'

Tags : unix dd ssh réseau performance serveur

January 19 2022, 13:16#

Linux and Unix Test Disk I/O Performance With dd Command

Lien : https://www.cyberciti.biz/faq/howto-linux-unix-test-disk-performance-with-dd-command/

  • How can I use dd command on a Linux to test I/O performance of my hard disk drive?
  • How do I check the performance of a hard drive including the read and write speed on a Linux operating systems?
  • How can I use the dd command under Linux I/O performance test?

Exemple de test de performance écriture disque avec dd

dd if=/dev/zero of=test.file bs=64M count=16 oflag=dsync

Tags : linux unix dd performance disque hdd ssd

January 07 2022, 11:33#

GitHub - awesome-selfhosted/awesome-selfhosted: A list of Free Software network services and web applications which can be hosted on your own servers

Lien : https://github.com/awesome-selfhosted/awesome-selfhosted

A list of Free Software network services and web applications which can be hosted on your own servers - GitHub - awesome-selfhosted/awesome-selfhosted: A list of Free Software network services and web applications which can be hosted on your own servers

Tags : self-hosting logiciel open-source github

January 05 2022, 09:27#

shell - Pipe input into a script - Stack Overflow

Lien : https://stackoverflow.com/questions/19408649/pipe-input-into-a-script/46726373#46726373

Alimenter un script depuis stdin :

#!/bin/bash
# Check to see if a pipe exists on stdin.
if [ -p /dev/stdin ]; then
        echo "Data was piped to this script!"
        # If we want to read the input line by line
        while IFS= read line; do
                echo "Line: ${line}"
        done
        # Or if we want to simply grab all the data, we can simply use cat instead
        # cat
else
        echo "No input was found on stdin, skipping!"
        # Checking to ensure a filename was specified and that it exists
        if [ -f "$1" ]; then
                echo "Filename specified: ${1}"
                echo "Doing things now.."
        else
                echo "No input given!"
        fi
fi

Tags : unix shell script

January 02 2022, 08:56#

Don't Look Up

Lien : https://www.presse-citron.net/dont-look-up-notre-critique-cosmique-entre-rires-et-larmes/

Disponible sur Netflix depuis le 24 décembre, Don’t Look Up : Déni Cosmique est une satire grinçante de la société. Critique.

Tags : presse-citron film

December 31 2021, 11:20#

RainLoop Webmail

Lien : https://www.rainloop.net/

RainLoop Webmail - Simple, modern & fast web-based email client.

Note sur le chiffrement de mail :

Pour chiffrer/signer un mail, il faut avant tout importer les clés publiques et privées.

Pour ma part, j'ai exporté les clés au format ASCII pour pouvoir les importer dans RainLoop.

Exporter la clé publique

gpg --output pubkey.txt --armor --export mail@example.com

Exporter la clé privée

gpg --output private.txt --armor --export-secret-key mail@example.com

Reste plus qu'à copier/coller le contenu des fichiers texte générés dans le formulaire Importer la clé OpenPGP.

Tags : mail webmail php gpg openpgp chiffrement cybersécurité imap smtp

December 31 2021, 11:16#

Polar ProTrainer

Ci-dessous, une vieille note sur l'installation de Polar ProTrainer 5 sur Ubuntu Linux 18.04 à l'aide de Wine.

Installation de Wine

Avant d'installer Wine, il faut s'assurer d'avoir accès aux paquets pour les architectures 32-bit (i386) :

sudo dpkg --add-architecture i386

Ajout des dépôts de WineHQ

wget -O - https://dl.winehq.org/wine-builds/winehq.key | sudo apt-key add -
sudo add-apt-repository 'deb https://dl.winehq.org/wine-builds/ubuntu/ bionic main'

Installation du paquet libfaudio0

wget https://download.opensuse.org/repositories/Emulators:/Wine:/Debian/xUbuntu_18.04/i386/libfaudio0_19.07-0~bionic_i386.deb
sudo dpkg -i libfaudio0_19.07-0~bionic_i386.deb
sudo apt-get install -f

Installation de Wine

sudo apt install --install-recommends winehq-stable

Installation de la dernière version de winetricks

sudo apt install cabextract libmspack0
wget https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks
chmod 750 winetricks

Préparation de la bouteille Wine

export WINEPREFIX=$HOME/.wine-PolarProTrainer5
WINEARCH=win32 ./winetricks win7

Récupérer le setup de Polar ProTrainer 5

wget https://service.polar.com/downloads/protrainer5/setup_5_40_171.exe

Installation de Polar ProTrainer 5

wine setup_5_40_171.exe

Tags : logiciel ubuntu wine sport

December 31 2021, 11:12#

Garmin Express

Ci-dessous, une vieille note sur l'installation de Garmin Express :

Installer Garmin Express sur Ubuntu Linux 18.04 à l'aide de Wine.

Avant d'installer Wine, il faut s'assurer d'avoir accès aux paquets pour les architectures 32-bit (i386) :

sudo dpkg --add-architecture i386

Ajout des dépôts de WineHQ

wget -O - https://dl.winehq.org/wine-builds/winehq.key | sudo apt-key add -
sudo add-apt-repository 'deb https://dl.winehq.org/wine-builds/ubuntu/ bionic main'

Installation du paquet libfaudio0

wget https://download.opensuse.org/repositories/Emulators:/Wine:/Debian/xUbuntu_18.04/i386/libfaudio0_19.07-0~bionic_i386.deb
sudo dpkg -i libfaudio0_19.07-0~bionic_i386.deb
sudo apt-get install -f

Installation de Wine

sudo apt install --install-recommends winehq-stable

Installation de la dernière version de winetricks

sudo apt install cabextract libmspack0
wget https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks
chmod 750 winetricks

Préparation de la bouteille Wine

export WINEPREFIX=$HOME/.wine-GarminExpress
WINEARCH=win32 ./winetricks cabinet corefonts vcrun2010 dotnet472
./winetricks win7

Récupérer le setup de Garmin Express

wget https://download.garmin.com/omt/express/GarminExpress.exe

Installation de Garmin Express

wine explorer /desktop=garmin,1024x768 GarminExpress.exe

Lien utile : https://www.christitus.com/garmin-express-linux/

Tags : gps garmin logiciel wine ubuntu

December 31 2021, 11:03#

Free Accounting Software - Akaunting

Lien : https://akaunting.com/

Akaunting is a free, open-source, and online accounting software for small businesses and freelancers. Send invoices and track expenses.

Note du 13 avril 2020 :

Après installation, pour faire fonctionner HTTPS via HAProxy :

cd /var/www/akaunting
sudo -u www /usr/local/bin/php artisan vendor:publish --provider="Fideloper\Proxy\TrustedProxyServiceProvider"

Puis modifier config/trustedproxy.php pour ajouter l'IP de HAProxy

Tags : comptabilité open-source logiciel web freebsd apache haproxy

December 31 2021, 08:26#

Knarfworld | Science-fiction humoristique en MP3 et en BD

Lien : https://www.knarfworld.net/

Tags : mp3 naheulbeuk saga audio

December 31 2021, 08:25#

Donjon de Naheulbeuk OFFICIEL - News et téléchargement

Lien : http://www.penofchaos.com/warham/donjon.htm

Tags : mp3 naheulbeuk saga audio

December 30 2021, 16:20#

Le Mystère des pingouins - film 2019 - AlloCiné

Lien : https://www.allocine.fr/film/fichefilm_gen_cfilm=265663.html

Le Mystère des pingouins est un film réalisé par Hiroyasu Ishida avec les voix de Kana Kita, Yû Aoi.

Synopsis : Quand des pingouins apparaissent partout dans sa petite ville, semant au passage une joyeuse pagaille, le jeune Aoyama se dit qu’il y a là une enquête à mener. Ce studieux élè...

Tags : anime

December 30 2021, 16:08#

DragonFlyBSD: RunSecureBrowser

Lien : https://www.dragonflybsd.org/docs/handbook/RunSecureBrowser/

Tags : unix bsd cybersécurité firefox