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 | |
PKGS="git swift ansible" | |
PKGMGR=yum | |
REPONAME=uat-swiftstack | |
REPOOWNER=encompassdigitalmedia | |
SWIFTRC=/etc/swiftrc-uat-swiftstack | |
grep "^ID=" /etc/os-release | grep ubuntu && PKGMGR=apt | |
# set swift credentials in order to download our SSH deploy key | |
read -p "Please enter the EDMTest Swift password: " ST_KEY |
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 | |
PKGS="git swift ansible" | |
PKGMGR=yum | |
REPONAME=uat-swiftstack | |
REPOOWNER=encompassdigitalmedia | |
SWIFTRC=/etc/swiftrc-uat-swiftstack | |
grep "^ID=" /etc/os-release | grep ubuntu && PKGMGR=apt | |
# set swift credentials in order to download our SSH deploy key | |
read -p "Please enter the EDMTest Swift password: " ST_KEY |
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 | |
PKGS="git swift ansible" | |
PKGMGR=yum | |
REPONAME=uat-swiftstack | |
REPOOWNER=encompassdigitalmedia | |
SWIFTRC=/etc/swiftrc-uat-swiftstack | |
grep "^ID=" /etc/os-release | grep ubuntu && PKGMGR=apt | |
# set swift credentials in order to download our SSH deploy key | |
read -p "Please enter the EDMTest Swift password: " ST_KEY |
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
"ECRRepo": { | |
"Type" : "AWS::ECR::Repository", | |
"Properties" : { | |
"LifecyclePolicy" : { | |
"LifecyclePolicyText" : "{ \"rules\": [ { \"rulePriority\": 10, \"description\": \"remove untagged images except the latest one\", \"selection\": { \"tagStatus\": \"untagged\", \"countType\": \"imageCountMoreThan\", \"countNumber\": 1 }, \"action\": { \"type\": \"expire\" } } ] }" | |
}, | |
"RepositoryName" : { "Ref": "StackName" } | |
} | |
}, |
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
<?php | |
require 'vendor/autoload.php'; | |
$hosts = [ | |
'https://yourhostname.us-east-1.es.amazonaws.com:443' | |
]; | |
$client = Elasticsearch\ClientBuilder::create() // Instantiate a new ClientBuilder | |
->setHosts($hosts) // Set the hosts | |
->build(); | |
$params = [ |
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/sh | |
free -m | awk 'NR==4{print $3 }' |
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/sh | |
free -m | awk 'NR==2{ram=$2; getline; used=$3; printf "%.0f\n", 100-(ram-used)/ram*100 }' |
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/sh | |
# usage: supply a comma-separated list of regions as the first argument | |
# and a comma-separated list of services as the second argument. | |
wget -O /tmp/ip-ranges.json https://ip-ranges.amazonaws.com/ip-ranges.json | |
unset hostcnt | |
unset tcnt | |
for r in $(awsiprangefilter.py -r $1 --services $2) | |
do | |
hostcnt=$(ipcalc $r|grep Hosts|cut -d " " -f 2) |
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/python | |
import json | |
import sys, getopt | |
ip_ranges_file_name = None | |
regions = None | |
services = None | |
try: | |
opts, args = getopt.getopt(sys.argv[1:],"hf:r:s:",["file=","regions=","services=","help"]) |
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
yum -y install httpd bind-utils | |
cd /var/www | |
HOSTIP=$(host $HOSTNAME|tail -1|awk '{print $4}') | |
wget -r --header="Host: $HOSTNAME" $HOSTIP | |
rm -rf html | |
mv $HOSTIP html | |
service httpd start | |
chkconfig httpd on | |
iptables -I INPUT 1 -p tcp --dport 80 -j ACCEPT | |
setenforce 0 |
NewerOlder