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
tfschema () { | |
if [ $# -ne 2 ] | |
then | |
echo -e "This function requires exactly two arguments, in order: providername resourcename " | |
echo "Try: tfschema registry.terraform.io/hashicorp/vsphere vsphere_virtual_machine" | |
echo "It is required to have already run terraform init with HCL for the provider used in the first argument." | |
echo "Try again. You have 1 life remaining. Exiting..." | |
return | |
fi | |
if ! which terraform >/dev/null 2>&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 | |
#set -x | |
#DEBUG=echo | |
# Runs via cron to shut down the instance if it's not in use for 5 minutes | |
# Starts checks after it's been up more than 500secs | |
# Won't kick you out if you're ssh'ed in and it's idle. | |
# crontab -l|grep idle | |
# */6 * * * * /root/bin/idle.sh >/dev/null 2>&1 | |
until $(awk '$1>500{exit 1}' /proc/uptime) |
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/sh | |
# Install the AWS CLI, set up an IAM user for the instance(s) you want to control. | |
# Pull the AWS keys for the IAM user and run aws configure to add them. | |
# I run this on Sophos UTM and have Sophos run a reverse proxy from the \ | |
# $ROUTERIP:32400 to $PLEXHOST:32400 | |
# set -x | |
# started with screen -Sdm a '/root/bin/awscheck.sh'een -Sdm a '/root/bin/awscheck.sh'screen -Sdm a '/root/bin/awscheck.sh'screen -Sdm a '/root/bin/awscheck.sh'n -Sdm a '/root/bin/awscheck.sh' | |
PLEXHOST=dokie.duckdns.org | |
WANIF=eth2 |