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 | |
| # From a cloud instance of Kobo-Docker, pull all of the attachments | |
| # and place them in a (much cheaper) Spaces filebin. | |
| # Assumes a Kobo-Docker instance running on a DO Ubuntu 16.04 instance | |
| # Need Amazon's CLI utility to manage transfers to/from spaces | |
| sudo apt install s3cmd |
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
| region=us-east-1 | |
| s3_bucket_name=$1 | |
| sns_topic_name=$2 | |
| sqs_queue_name=$sns_topic_name | |
| # create the SNS topic | |
| sns_topic_arn=$(aws sns create-topic \ | |
| --region "$region" \ | |
| --name "$sns_topic_name" \ | |
| --output text \ |
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 | |
| echo "CREATING SUBSCRIPTION WITH QUEUE ARN" | |
| set -e | |
| ENDPOINT_URL="http://localhost:4100" | |
| export AWS_DEFAULT_REGION="us-east-1" | |
| export AWS_SECRET_ACCESS_KEY="fakefakefake" | |
| export AWS_ACCESS_KEY_ID="faketyfakefake" | |
| TOPIC_ARN=$(aws --endpoint-url $ENDPOINT_URL sns create-topic --name test-topic | jq -r ".TopicArn") |
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 | |
| REGION="eu-central-1" | |
| BACKEND_URL="https://backup.${REGION}.amazonaws.com" | |
| #get curent account id | |
| ACCOUNT="$(aws sts get-caller-identity --query 'Account')" | |
| ACCOUNT_ID="$(echo ${ACCOUNT} | sed 's/"//g')" | |
| echo "Current Account ID: ${ACCOUNT_ID}" |
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 | |
| # Forward Notification to AWS SNS | |
| if [ "$NOTIFY_WHAT" = HOST ] | |
| then | |
| aws sns publish --topic-arn arn:aws:sns:eu-central-1:123123123123:Alerts --message "$NOTIFY_HOSTNAME $NOTIFY_HOSTOUTPUT " | |
| else | |
| aws sns publish --topic-arn arn:aws:sns:eu-central-1:123123123123:Alerts --message "$NOTIFY_HOSTNAME $NOTIFY_SERVICEDESC $NOTIFY_SERVICEOUTPUT " | |
| fi | |
| # |
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 | |
| SH_KNIFE="/usr/local/chef/chef-repo/knife_parallel.bash" | |
| LOG_FILE="/usr/local/chef/chef-repo/knife_base.log" | |
| func_usage() { | |
| echo "Usage: `basename $0` {bootstrap|prepare|cook}" | |
| return 0 | |
| } |
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 | |
| PORT=80 | |
| HP=:$PORT | |
| echo 'Checking to see if Apache is up...' | |
| if ( /usr/sbin/lsof -Pni $HP | grep "$PORT (LISTEN)" 2>&1 >/dev/null ); then | |
| echo 'Apache is up'; | |
| else | |
| echo 'Apache is down, restarting...'; | |
| /sbin/service httpd restart | |
| logger -p mail.info apache_check_restart.sh restarting Apache |
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 | |
| # Currently Supported Operating Systems: | |
| # | |
| # RHEL 5, 6, 7 | |
| # CentOS 5, 6, 7 | |
| # Debian 7, 8 | |
| # Ubuntu 12.04 - 18.04 | |
| # SUSE 12- 15 | |
| # |
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 | |
| # | |
| # Shell script for remote deployment. | |
| # | |
| # Notes: | |
| # - Git is assumed | |
| # - Composer is assumed | |
| # - NPM is assumed | |
| # - Windows host and Cygwin environment is assumed |
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
| #!/usr/bin/env bash | |
| #https://www.shellscript.sh/functions.html | |
| install_gist() { | |
| echo " | |
| ______________________________________________________________________________________ | |
| install bash framework | |
| ______________________________________________________________________________________ |
NewerOlder