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 | |
# Ping a host and for any timeouts, print the ICMP sequence number and date | |
set -eEfuo pipefail | |
IFS=$'\n' | |
declare -i ICMP_SEQ ICMP_TIMEOUT_IN_SECONDS=1 | |
TARGET_IP=${1} | |
shift |
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
--- | |
# This playbook rotates Ansible Vault-encrypted secrets that are defined | |
# as dictionaries in the group_vars of an Ansible repository. | |
# | |
# The changes are split over multiple tasks, because the dictionary logic | |
# doesn't handle looping over secrets on differing levels within a | |
# dictionary. | |
- hosts: "all" | |
user: "ansible" |
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
--- | |
- name: "update all packages" | |
systemd: | |
name: "apt-daily-upgrade.service" | |
state: "started" | |
- name: "check if updating is done" | |
systemd: | |
name: "apt-daily-upgrade.service" | |
state: "stopped" |
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 | |
dig +short whoami.akamai.net | xargs whois | grep -oP '^netname:\s+\K.+$' |
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 -Eefuo pipefail | |
IFS=$'\n\t' | |
# Set these vars first | |
host="${1}" | |
record_type="${2}" | |
request_limit=5 |
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 | |
# Unofficial Bash strict mode | |
set \ | |
-o errexit \ | |
-o errtrace \ | |
-o noglob \ | |
-o nounset \ | |
-o pipefail | |
IFS=$'\n\t' |
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
function showMyGroups() { | |
var current_sheet; | |
var groups; | |
current_sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet(); | |
groups = GroupsApp.getGroups(); | |
if (groups.length > 0) { | |
current_sheet.clearContents(); | |
current_sheet.getRange(1, 1).setValue("You are a member of " + groups.length + " groups:"); |