Skip to content

Instantly share code, notes, and snippets.

@incrazyboyy
incrazyboyy / btrfs-backup.sh
Created June 14, 2023 10:48
Script for easy backup of your /home directory to an external drive utilizing the snapshot capabilities of btrfs.
#!/bin/bash
# config
username=user
backupdir="/media/$username/externalDrive"
name=$(date +Backup\ %Y-%m-%d\ %H:%M)
partuuid="3e45a3de-01" # find your partition uuid by running blkid
# check for root permission
if [[ $UID -ne 0 ]]
@incrazyboyy
incrazyboyy / mount-bitlocker.sh
Last active June 14, 2023 10:52
Mount a single bitlocker volume. Run it with sudo and without any arguments. If multiple bitlocker drives are connected, only the first one will be used.
#!/bin/bash
set -e
for dev in /dev/sd?1
do
if [[ $(blkid -o value -s TYPE $dev) == "BitLocker" ]]
then
dev_name=$(basename $dev)
mount_path="/media/$SUDO_USER/$dev_name"
dislocker_path="/media/bitlocker/$dev_name"
mkdir -p $dislocker_path