Étiquette : linux

  • Offline music

    As crazy as it may sound, I have CDs, I still buy them and, above all, I love listening to them <3

    At home we don’t subscribe to online music services, and while I still listen to the radio a lot, I still love & always enjoy my favorite albums.

    So I don’t have a portable CD player, and I also really want to be able to listen to my music from my smartphone, but without being subscribed to any streaming service. So I opted for a very manual, home-made solution, which works great!

    Play CDs

    Basically, you need a CD player to extract the music, and I’ve got an old Apple USB CD/DVD player that still works just fine! I plugged it into my SteamDeck, and searched the web to find out how to wake up the beast and make it swallow a CD.

    I’m keeping this information carefully – I couldn’t have done it myself without the help of the Internet!

    First of all, I create a text file somewhere, which I named 60-apple-superdrive.rules, into which I copy and paste the following lines:

    # Apple's USB SuperDrive
    ACTION=="add", ATTRS{idProduct}=="1500", ATTRS{idVendor}=="05ac", DRIVERS=="usb", RUN+="/usr/bin/sg_raw /dev/$kernel EA 00 00 00 00 00 01

    Then you need to go through a few command lines to :

    • disable readonly on steamOS
    • copy the file to the right place so that it is taken into account by the system next time
    • install the sg3_utils package
    • trigger the tool
    • hot-activate the device
    • before re-enabling read-only on steamOS
    sudo steamos-readonly disable
    sudo cp 60-apple-superdrive.rules /etc/udev/rules.d/
    sudo pacman -Sy sg3_utils
    sudo udevadm trigger
    sudo sg_raw /dev/sr0 EA 00 00 00 00 00 01
    sudo steamos-readonly enable

    And now, thanks to the magic of Linux, Apple’s disk eater is going to wake up and swallow some CDs!

    Extract audio tracks

    To do this, you need an application capable of extracting tracks from a CD, automatically finding information on the Internet to name the files, and compressing everything into the desired format! I chose to entrust this mission to Asunder and compress my tracks in FLAC format. Obviously, the storage folder is that of my personal Nextcloud.

    Screenshot of Asunder

    Enjoy music

    And finally, all you have to do is enjoy the sound! Any application capable of playing audio files will do. I haven’t yet found the « perfect » application for my Smartphone, and I’m still testing several, but for my SteamDeck it’s already been found: Lollypop.

    Screenshot of Lollypop

  • Ciao Canonical

    Ciao Canonical

    Depuis le temps que je voulais quitter le monde de Canonical, c’est chose faite au moins pour mon serveur très perso qui héberge NextCloud ! Et pour l’occasion j’ai d’abord choisi RockyLinux… pour très vite migrer vers AlmaLinux !

    J’ai été surpris par le nombre, relativement, peu élevé de commandes que j’ai eues à entrer dans le terminal pour que tout fonctionne du premier coup. J’ai listé l’historique ici avec quelques commentaires, en souvenirs et en guise d’inspiration si ça peut aider 😉

    Accès SSH

    Une fois l’installation terminée sur le serveur, avant ma première connexion en SSH depuis mon SteamDeck qui est mon poste principal, je commence par envoyer à mon serveur ma clef publique :

    ssh-copy-id hl0dwig@ssh.monserveur.fr

    Ensuite, depuis le serveur je vais interdire toute connexion SSH par mot de passe en installant mon éditeur de fichier en ligne de commande préféré « nano », en modifiant la ligne du fichier sshd_config « PasswordAuthentication no » et en redémarrant le service :

    sudo dnf install nano
    sudo nano /etc/ssh/sshd_config
    sudo systemctl restart sshd

    Sécurité

    Puis je me connecte maintenant depuis mon client pour la suite de la configuration. Et je commence par activer le firewall :

    sudo systemctl enable --now firewalld
    sudo systemctl status firewalld

    Je regarde sa configuration initiale:

    sudo firewall-cmd --list-all

    J’en profite pour enlever l’autorisation à l’application par défaut pour administrer son serveur depuis une interface web :

    sudo firewall-cmd --zone=public --remove-service=cockpit

    Et j’ajoute par contre des autorisations dont j’aurai besoin principalement :

    sudo firewall-cmd --zone=public --add-service=http
    sudo firewall-cmd --zone=public --add-service=https
    sudo firewall-cmd --zone=public --add-port=8080/tcp
    sudo firewall-cmd --zone=public --add-port=8443/tcp
    sudo firewall-cmd --zone=public --add-port=9000/tcp
    sudo firewall-cmd --zone=public --add-port=11000/tcp
    sudo firewall-cmd --list-services
    sudo firewall-cmd --runtime-to-permanent

    J'installe l'application fail2ban, même si en vrai comme mon infra est dans un tunnel Cloudflare, j'ai moins de risque :
    sudo dnf install epel-release
    sudo dnf install fail2ban
    sudo systemctl enable fail2ban
    sudo systemctl start fail2ban

    Nextcloud

    Je m’occupe ensuite de monter mon disque de sauvegarde au bon endroit et je l’ancre dans le marbre pour qu’il soit présent à chaque redémarrage :

    sudo fdisk -l
    sudo /etc/fstab
    sudo nano /etc/fstab

    Dans le fichier fstab j’ajoute la dernière ligne:

    /dev/sdb1       /mnt/backup     ext4    defaults        0 0

    Je redémarre et vérifie qu’il est bien présent et que j’y accède :

    sudo reboot now
    cd /mnt/backup/
    ls

    Je change le propriétaire du point de montage :

    sudo chown hl0dwig backup

    Je prépare aussi un point de montage supplémentaire pour étendre la zone de stockage de Nextcloud, qu’il ne soit pas limité à la zone où il sera installé :

    mkdir nextcloud-media
    sudo chown -R : /home/hl0dwig/nextcloud-media
    sudo chmod -R 750 /home/hl0dwig/nextcloud-media

    Maintenant je prépare l’accueil de NextCloud AIO en installant Docker :

    sudo dnf check-update
    sudo dnf config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
    sudo dnf install docker-ce docker-ce-cli containerd.io
    sudo systemctl start docker
    sudo systemctl status docker

    Une fois installé je lance le script qui permettra de récupérer ce qu’il faut pour installer un NextCloud tout neuf, avec une configuration particulière chez moi puisqu’il sera derrière un reverse proxy. Aussi je n’oublie pas d’ajouter le point de montage supplémentaire précédemment créé :

    sudo docker run --init --sig-proxy=false --name nextcloud-aio-mastercontainer --restart always --publish 8080:8080 --env APACHE_PORT=11000 --env APACHE_IP_BINDING=0.0.0.0 --env NEXTCLOUD_MOUNT="/home/hl0dwig/nextcloud-media/" --volume nextcloud_aio_mastercontainer:/mnt/docker-aio-config --volume /var/run/docker.sock:/var/run/docker.sock:ro nextcloud/all-in-one:latest

    Et j’ai accès à mon NextCloud ! Toutes les configurations ailleurs (NGINX depuis mon serveur en front, tunnel Cloudflare, DNS…) étaient déjà là et n’ont pas bougé, tout fonctionne du premier coup !

    Enfin comme je suis au courant des controverses de Rocky Linux, je choisis finalement de migrer pour Alma Linux, qui s’est fait en un clin d’oeil grâce à :

    curl -O https://raw.githubusercontent.com/AlmaLinux/almalinux-deploy/master/almalinux-deploy.sh
    sudo bash almalinux-deploy.sh
    sudo reboot now
    cat /etc/redhat-release
    sudo grubby --info DEFAULT | grep AlmaLinux
    sudo dnf update