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
#!/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 | |
# 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
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 | |
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 |
OlderNewer