Skip to content

Instantly share code, notes, and snippets.

@Tamal
Tamal / set-chroot.sh
Last active June 29, 2024 10:13
Setting up chroot from a live image in Fedora. Regenerate grub2 for Fedora.
$ # Use Live CD to boot
$ sudo su # Switch to root
$ fdisk -l # Get names of root, boot & EFI partition names. you can also use blkid
$ mount /dev/mapper/fedora_localhost--live-root /mnt # mount root partition
$ cat /mnt/etc/fedora-release
Fedora release 31 (Thirty One)
$ mount /dev/nvme0n1p2 /mnt/boot # mount boot partition
$ mount /dev/nvme0n1p1 /mnt/boot/efi # mount EFI partition
# Note: If you are not able to mount EFI partition ('Input/Output error'),
# You may have to repair ESP file system or format ESP.
@AnthonyWharton
AnthonyWharton / automatedManualCertbotRenewal.sh
Last active April 12, 2024 02:23
FreeDNS (afraid.org) Cerbot/Let's Encrypt Manual Automation Script
#!/bin/bash
# Copyright 2018, Anthony Wharton
# Single script that can be called that generates certificates using the
# certbotFreeDNSAuthHook.sh and certbotFreeDNSCleanupHook.sh scripts.
# This should be used as guidence of my usage, and changed to your needs. Note
# the generic `/path/to/...` and `DOMAIN.COM`, which should be replaced with
# your script location and domain respectively. In addition, for this to be
# used on a live system, one must remove the `--dry-run` flag.
@linosteenkamp
linosteenkamp / speedtest.sh
Last active August 29, 2021 16:11
Execute speedtest-cli and store result in sqlite database
#!/bin/bash
# Path to speedtest-cli (Change this to match the path to your speedtest-cli executable)
SPEEDTEST_CLI_PATH="/usr/local/bin/speedtest-cli"
# Path to the sqlite database (Change this to suit your needs)
#DB_PATH="/home/lino/speedlog.db"
DB_PATH="/var/www/speedtest-api/speedtest.db"
# Create test table SQL statement