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
server { | |
listen 80; | |
listen 443 ssl http2; | |
# make yourself an SSL certificate for *.test.test (and your dhparam file if you're so inclined) | |
ssl_certificate /etc/nginx/ssl/test.cert; | |
ssl_certificate_key /etc/nginx/ssl/test.key; | |
# your other favourite SSL settings go here |
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
#### Set prompt basics #### | |
# set variable identifying the chroot you work in (used in the prompt below) | |
if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then | |
debian_chroot=$(cat /etc/debian_chroot) | |
fi | |
# set a fancy prompt (non-color, unless we know we "want" color) | |
case "$TERM" in | |
xterm-color) color_prompt=yes;; |
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 | |
tailscale status | while IFS= read -r aHost; do | |
hostname=$(echo "$aHost" | awk '{print $2}' | cut -d '-' -f 1) | |
ip=$(echo "$aHost" | awk '{print $1}') | |
hostctl add domains tailscale "$hostname.ts" --ip "$ip" | |
done |
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 | |
# run these first to install certbot globally with the route53 plugin | |
# $ sudo apt install python-setuptools | |
# $ sudo easy_install pip | |
# $ sudo -H pip install certbot-dns-route53 | |
# verify the route53 plugin is present | |
# $ certbot plugins |
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
SELECT sizes.dbname, orgs.`name` AS org, servers.`name` AS `server`, sizes.size | |
FROM ( | |
SELECT substring(sizes.table_schema, 15) AS fakeid, sizes.table_schema AS dbname, ROUND(SUM(sizes.data_length + sizes.index_length) / 1024 / 1024, 1) AS size | |
FROM information_schema.`TABLES` AS sizes | |
GROUP BY sizes.table_schema | |
) AS sizes, postal.servers AS servers, postal.organizations AS orgs | |
WHERE servers.id = sizes.fakeid | |
AND servers.organization_id = orgs.id | |
ORDER BY org, `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
#!/bin/bash | |
# usage | |
# downloadgithubasset.sh mozilla/sops | |
# downloadgithubasset.sh mozilla/sops 3.4.0 | |
if ! [ -x "$(command -v jq)" ]; then | |
echo 'Error: jq is not installed.' >&2 | |
exit 1 | |
fi |
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 | |
if [ -z "$1" ]; then | |
echo "Please specify domain name" | |
exit 1 | |
fi | |
initials="WH" | |
delegationsetid="YOUR-DELEGATED-SET-ID" |
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 | |
target="s3://your-AWS-bucket-here/" | |
file="" | |
# if you're looking for a specific file extension | |
# you can do something like this instead | |
# while [[ "$target" != *.tgz ]]; do | |
# while there is a slash at the end of the path |
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
" syntax highlighting | |
syntax on | |
" todo: experiment with colour schemes | |
"colorscheme elflord | |
" might help vim cope with random terminals and colours | |
" by reminding it that the background is dark | |
set background=dark |
NewerOlder