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
# Install ARCH Linux with encrypted file-system and UEFI | |
# The official installation guide (https://wiki.archlinux.org/index.php/Installation_Guide) contains a more verbose description. | |
# Download the archiso image from https://www.archlinux.org/ | |
# Copy to a usb-drive | |
dd if=archlinux.img of=/dev/sdX bs=16M && sync # on linux | |
# Boot from the usb. If the usb fails to boot, make sure that secure boot is disabled in the BIOS configuration. | |
# Set swedish keymap |
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/env bash | |
here="$(cd "$(dirname "$0")"; pwd -P)" | |
cd "$here" | |
source venv/bin/activate | |
IFS=$'\n\t' | |
# if you want a cert with multiple DNS names (SubjectAlternateName), use space-delimited | |
# names in the string array below. e.g.: "example.org www.example.org" will result in | |
# a single certificate file with two SAN fields | |
domains=( |
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
### Keybase proof | |
I hereby claim: | |
* I am thalweg on github. | |
* I am nlopez (https://keybase.io/nlopez) on keybase. | |
* I have a public key whose fingerprint is 55DF 016B 21FD A6AF 0982 87C6 8DA7 AACB F29F 440F | |
To claim this, I am signing this object: |
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/env bash | |
# A simple wrapper for validating locally-stored CloudFormation templates | |
# Requires aws-cli <https://github.com/aws/aws-cli> | |
usage(){ | |
echo "$(basename $0) <cfn.json>" | |
} | |
if (( $# == 0 )); then | |
usage | |
exit 1 |
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/env ruby | |
require 'rubygems' | |
require 'rotp' | |
# use ~/.google_authenticator to store the secret for | |
# compatibility with the google authenticator pam lib | |
secret_file = "#{ENV['HOME']}/.google_authenticator" | |
begin | |
secret = File.open(secret_file).read |
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/env bash | |
set -eu | |
FILE="/etc/varnish/default.vcl" | |
HOST="localhost" | |
PORT="6082" | |
NOW=$(date +%s) | |
NC="nc ${HOST} ${PORT}" | |
error() { | |
echo 1>&2 "Failed to reload ${FILE}." |
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/env sh | |
#configurables | |
DBINSTANCE="yourdbinstanceID" | |
ENDPOINT="XXXXXXXXXXXX.us-east-1.rds.amazonaws.com" | |
USER='yourUser' | |
PASSWD='yourPassword' | |
DB1="yourDatabase1 yourDatabase2" | |
BUCKET='s3://your-bucket' | |
BACKUP_HOME='/mnt/backups' |
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/env awk -f | |
# returns "google.com" when called on "www.google.com" | |
# returns "google.com" when called on "foo.bar.zot.www.google.com" | |
BEGIN { | |
string=ARGV[1]; | |
search="."; | |
n=split(string,array,search); | |
printf("%s%s%s\n",array[n-1],search,array[n]); | |
exit; | |
} |