This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
# Usage: 'backup' alone will back the system up | |
# 'backup ARGS' will run borg with ARGS, configuring repository location, passphrase etc. | |
# e.g., 'backup list ::' will list backups in the repository | |
# Goals: run on RHEL 8's default Python interpreter (3.6) with no non-RHEL packages required | |
# Non-goals: backing up multiple filesystems, any configurability save modifying values set | |
# in code. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -eux | |
mapfile domains <<- EOF | |
example.com,www.example.com apache2 | |
example.net apache2 | |
imap.example.com dovecot | |
smtp.example.com exim4 | |
mumble.example.com mumble-server |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
import subprocess | |
import sys | |
import tempfile | |
def main(): | |
kw = 'answered-learned-ham' | |
max_size = 2*2**20 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Permission to use, copy, modify, and/or distribute this software for | |
any purpose with or without fee is hereby granted. | |
THE SOFTWARE IS PROVIDED “AS IS” AND THE AUTHOR DISCLAIMS ALL | |
WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES | |
OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE | |
FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY | |
DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Run with: | |
groovy | |
-cp '/etc/hadoop/conf:/usr/lib/hadoop/*:/usr/lib/hadoop/lib/*' | |
hdfs-site.xml | |
yarn-site.xml | |
mapred-site.xml | |
/vagrant/config.groovy | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
case $(locale charmap) in | |
UTF-8) | |
_smile_happy='☺' | |
_smile_frown='☹' | |
;; | |
*) | |
_smile_happy=':)' | |
_smile_frown=':(' | |
;; | |
esac |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ x=$(od -v -t x1 -A n -N $((256/8)) < /dev/urandom | tr -d '[:space:]') | |
$ echo $x | |
807ee2385fb310491e126f248f66fded432d438b1a00133cf00456e85e59f04a | |
$ python mnemonic.py $x | |
aside enough match affection fill conversation replace toe mud forget enough bloom gently sunlight out relationship gentle lovely claw dot illuminate marry king grant | |
$ python mnemonic.py aside enough match affection fill conversation replace toe mud forget enough bloom gently sunlight out relationship gentle lovely claw dot illuminate marry king grant | |
807ee2385fb310491e126f248f66fded432d438b1a00133cf00456e85e59f04a |