Skip to content

Instantly share code, notes, and snippets.

@wvdschel
wvdschel / enable_hibernation.sh
Created October 20, 2022 08:02
Hibernation enablement script for Fedora
#!/bin/bash
# Based on https://fedoramagazine.org/hibernation-in-fedora-36-workstation/
set -eo pipefail
ZRAM_KBYTES=$(cat /proc/swaps | grep zram0 | sed -E 's/\s+/\t/g' | cut -f 3)
TOTAL_RAM=$(free -k | egrep ^Mem: | sed -E "s/ +/\t/g" | cut -f2)
TOTAL_ZRAM=0
UNCOMPRESSED_RAM=${TOTAL_RAM}
for ZRAM in ${ZRAM_KBYTES}; do
#!/bin/bash
# Spotify song recorder. Records songs played back with Spotify to ~/Music, as MP3 files with correct-ish ID3 tags.
# Songs are organized by album, one directory per album.
# Only works on Linux with pulseaudio (or pipewire).
#
# For Ubuntu users: apt install sox libsox-fmt-mp3 id3
# TODO: record into playlist directory instead of album
LAST_FILENAME=""
@Eliastik
Eliastik / update-hosts.sh
Last active January 18, 2024 16:10 — forked from glesica/update-hosts.sh
A quick shell script that will automatically update a Linux HOSTS file to block domains (ads, malwares, ...). Support multiple hosts sources, initial host file and incorrect/malicious entries checking.
#!/bin/bash
# Filename: update-hosts.sh
#
# Author: George Lesica <george@lesica.com>
# Enhanced by Eliastik ( eliastiksofts.com/contact )
# Version 1.3 (22 april 2021) - Eliastik
#
# Description: Replaces the HOSTS file with hosts lists from Internet,
# creating a backup of the old file. Can be used as an update script.