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
# List key pairs on the account | |
aws ec2 describe-key-pairs --query 'KeyPairs[*].KeyName' --output table | |
# Find instances that uses a key pair you found out above | |
aws ec2 describe-instances --filters Name=instance-state-name,Values=running Name=key-name,Values="KP-NAME" --query 'Reservations[*].Instances[*].InstanceId' | |
# If you get an empty response, you can opt to delete it with: | |
aws ec2 delete-key-pair --key-name KP-NAME |
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
prefix=your-queue-prefix" | |
region="your-region" | |
queues=$(aws sqs list-queues --queue-name-prefix $prefix --region $region) | |
for q in ${queues[@]} | |
do | |
if [ "${q:0:1}" == "\"" ]; then | |
x=${q:1:${#q}-3} | |
if [ $x != "QueueUrls" ]; then | |
aws sqs delete-queue --region $region --queue-url $x | |
fi |
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 | |
NODE="YOUR NODE NAME" | |
IFS=$'\n' | |
for line in $(curl -s 'localhost:9200/_cat/shards' | fgrep UNASSIGNED); do | |
INDEX=$(echo $line | (awk '{print $1}')) | |
SHARD=$(echo $line | (awk '{print $2}')) | |
curl -XPOST 'localhost:9200/_cluster/reroute' -d '{ | |
"commands": [ | |
{ |
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
# Find the IAM username belonging to the command line parameter | |
# Useful for finding IAM user corresponding to a compromised AWS credential | |
# Requirements: | |
# | |
# Environmental variables: | |
# AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY | |
# python: | |
# boto |
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 | |
apt-get update | |
apt-get install -y python-software-properties software-properties-common | |
add-apt-repository ppa:chris-lea/node.js | |
apt-get update | |
apt-get install nodejs |
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 | |
# node.js using PPA (for statsd) | |
sudo apt-get -y install python-software-properties | |
sudo apt-add-repository -y ppa:chris-lea/node.js | |
sudo apt-get update | |
sudo apt-get -y install nodejs | |
# Install git to get statsd | |
sudo apt-get -y install git |
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 | |
sudo -s | |
yum -y update | |
yum -y install mdadm sysstat | |
cat <<EOF > /etc/yum.repos.d/10gen.repo2 | |
[10gen] | |
name=10gen Repository | |
baseurl=http://downloads-distro.mongodb.org/repo/redhat/os/x86_64 | |
gpgcheck=0 |
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 -s | |
curl -L get.rvm.io | bash -s stable | |
source /etc/profile.d/rvm.sh | |
rvm requirements | |
rvm install 1.9.3 | |
rvm use 1.9.3 --default | |
# ruby -v | |
# should be ruby 1.9.3 | |
rvm rubygems current | |
# gem -v |
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 -s | |
## dependencies to build | |
yum -y groupinstall "Development Tools" | |
## download and build | |
cd /opt | |
wget http://nodejs.org/dist/node-latest.tar.gz | |
tar zxf node-latest.tar.gz | |
cd node-latest | |
./configure |
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
# update | |
sudo yum -y update | |
sudo yum -y upgrade | |
# enable EPEL6 by changing enabled=0 -> enabled=1 | |
sudo vim /etc/yum.repos.d/epel.repo | |
# install htop | |
sudo yum install htop |
NewerOlder