Skip to content

Instantly share code, notes, and snippets.

View Gargravarr2112's full-sized avatar

Rob J Gargravarr2112

View GitHub Profile
#!/bin/sh
set -eu;
inputFile="$1";
if [ ! -f "$1" ]; then
echo "$1 is not a file!";
exit 1;
fi
@Gargravarr2112
Gargravarr2112 / back-slap.sh
Created December 21, 2018 17:04
Automation-suitable backup and restore script for OpenLDAP
#!/bin/bash
#Backup or restore an OpenLDAP database
#Backup Mode produces time-stamped LDIF files of the config (n=0) and main (n=1) slapd databases. Does not interfere.
#Restore Mode assumes previous backups made by this script. Offers the user the backup file to restore, then in sequence:
#-stops slapd
#-deletes existing slapd config and database files
#-restores the LDIFs
#-sets permissions on restored files
#-starts slapd
#
@Gargravarr2112
Gargravarr2112 / gb.archive.ubuntu.com
Last active February 29, 2024 20:54
Mirror only a few Ubuntu releases using rsync
bionic
bionic-updates
bionic-backports
xenial
xenial-updates
xenial-backports
@Gargravarr2112
Gargravarr2112 / bionic-crypt.cfg
Created October 9, 2019 15:11
Ubuntu preseed to install an 18.04 Desktop OS with disk encryption
#### Contents of the preconfiguration file (for bionic)
### Localization
# Preseeding only locale sets language, country and locale.
d-i debian-installer/locale string en_GB
# Keyboard selection.
# Disable automatic (interactive) keymap detection.
d-i console-setup/ask_detect boolean false
d-i keyboard-configuration/xkb-keymap select gb