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 | |
# | |
# Script for backing up bitnami app and upload tarballs to S3 | |
set -e | |
usage(){ | |
echo "Usage: BITNAMI_APP=<> BITNAMI_DB_PASSWORD=<> S3_BUCKET=<> $0" | |
exit 1 | |
} |
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 -e | |
# | |
# Wrapper to check all the needed gems are installed | |
GL=$(gem list) | |
for gem in $(cat Gemfile | grep -w gem | cut -f2 -d ' '| tr -d "'"); do | |
if ! $(echo $GL | grep -wq $gem); then | |
gem install bundler | |
bundle install | |
break |
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 | |
# | |
# Just echo everything with Stars Around | |
starprint(){ | |
local INPUT=$* | |
local LENGTH=$(echo "$INPUT" | awk '{print length+4}') | |
line() { for i in $(eval echo "{1..$LENGTH}"); do echo -n '*'; done; echo; } | |
line | |
echo -n "* "; echo -n $INPUT;echo -n " *";echo |
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 | |
random_cowsay() { | |
local INPUT=$* | |
echo $INPUT | cowsay -f $(ls /usr/share/cowsay/cows/ | shuf -n1) | |
} |
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 | |
REMOTE_HOST=ip-10-2-10-197.ec2.internal # Related to PROXY_HOST | |
REMOTE_PORT=27017 | |
LOCAL_PORT=27017 | |
PROXY_HOST=ec2-55-210-99-165.compute-1.amazonaws.com | |
ssh -f -L ${LOCAL_PORT}:${REMOTE_HOST}:${REMOTE_PORT} $PROXY_HOST -N |
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
hostname = '' | |
Resque.workers.each { |w| w.unregister_worker if w.id.start_with?(hostname) } |
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
sudo: required | |
dist: trusty | |
services: | |
- docker | |
cache: | |
- directories: | |
- /var/tmp/docker |
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
console.log('Loading event'); | |
var aws = require('aws-sdk'); | |
exports.handler = function(event, context) { | |
var ecsService = 'sample-webapp'; | |
var ecsCluster = 'sample-cluster'; | |
var ecsRegion = 'us-west-2'; | |
var maxCount = 2; | |
var ecs = new aws.ECS({region: ecsRegion}); |
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 | |
# | |
# Bring ECS Agent config and start consul | |
DC=$(curl -s http://169.254.169.254/latest/meta-data/placement/availability-zone/ | rev | cut -c 2- | rev) | |
ADVERTISE_IP=$(curl -s http://169.254.169.254/latest/meta-data/local-ipv4) | |
ECS_CLUSTER='example' | |
yum install -y aws-cli | |
aws s3 cp s3://ops-yotpo/docker/ecs/ecs.config /etc/ecs/ecs.config |
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 | |
# | |
# Wrapper for CSSH running instances by tag | |
usage(){ | |
cat << EOF >&2 | |
usage: $0 options | |
This script Gathers instances from AWS and runs ClusterSSH to them |
OlderNewer