This file contains hidden or 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 -e | |
TZ=Europe/London | |
TODAY=$(gdate -Idate) | |
DAYS_90_FUTURE=$(gdate --date="+90 days" +"%Y-%m-%d") | |
SILENT=0 | |
# Set up a handy log output function | |
# |
This file contains hidden or 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 -e | |
TODAY=$(date -Idate) | |
TZ=Europe/London | |
################################################################################ | |
# Author: | |
# Ash Davies <@DrizzlyOwl> | |
# Version: |
This file contains hidden or 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 -e | |
TZ=Europe/London | |
TODAY=$(date -Idate) | |
DATE_90=$(date --date="90 days ago" +"%Y-%m-%d") | |
SILENT=0 | |
################################################################################ | |
# Author: |
This file contains hidden or 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 -euo pipefail | |
# Default values for CLI flags | |
SERVER="" | |
DATABASE="" | |
# Use a Service Principal or an Azure AD user with admin rights for your SQL Server | |
USERNAME="" | |
PASSWORD="" # Or use "your_service_principal_client_secret" for Service Principal |
This file contains hidden or 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 | |
# Echo usage if something isn't right. | |
usage() { | |
echo "Usage: $0" | |
echo " [-r <resource-group>] Name of the Azure Resource Group" | |
echo " [-v <keyvault>] Name of the Key Vault that will hold the Customer Managed Key" | |
echo " [-s <storage-account>] Name of the target Storage Account that needs to have CMK Encryption enabled" | |
echo " [-k <key-name>] Name of the new CMK" | |
echo " [-e <email>] Email address of the user-managed identity that can access the Key Vault" 1>&2; exit 1; |
This file contains hidden or 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 | |
# | |
# Author: Ash Davies | |
# Description: Checks a Cloudfuse mountpoint and reinitialises it if the mount goes missing | |
# | |
VOLUME="/path/to/content/uploads" | |
PROBE="$VOLUME/mounty.probe" | |
FOLDER="/path/to/cloudfuse/mount/" |
This file contains hidden or 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 onOpen() { | |
var ui = SpreadsheetApp.getUi(); | |
ui.createMenu('Rackspace API') | |
.addItem('Fetch latest billing data','fetchBilling') | |
.addToUi(); | |
} | |
function fetchBilling() { | |
var spreadsheet = SpreadsheetApp.getActiveSpreadsheet(); | |
console.log('Task started'); |
This file contains hidden or 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 | |
# @author Ash Davies <[email protected]> | |
FROM=$1 | |
TO=$2 | |
FILENAME=wp-config.php | |
BACKUP_FIRST=yes | |
TMP=$(mktemp) | |
# Terminate on any errors |
This file contains hidden or 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
import json,sys; | |
a = json.load(sys.stdin); | |
packages = a['installed']; | |
num_packages = len(packages); | |
are_available_updates = bool(num_packages); | |
if are_available_updates: | |
print("There are "+str(num_packages)+" package updates available"); | |
print("\n"); |
This file contains hidden or 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
# Google Calendar | |
https://calendar.google.com/calendar/render | |
?action=TEMPLATE | |
# dates: URL Encoded start and end dates with TZ and / separator | |
# e.g. "20211126T161500Z/20211126T164500Z" | |
&dates=20211126T161500Z%2F20211126T164500Z | |
# details: URL encoded event description | |
# e.g. "Here's my event description" | |
&details=Here%27s%20my%20event%20description | |
# location: URL encoded address |
NewerOlder