- install coffee script
npm install coffee-script - install AWS CLI (optional)
pip install awscli
-
update_interface_config
to prevent new interface is added when stop/start instance in EC2 classic or create imaage with existing interface -
add_new_serial_if || log_failure_msg "can't add serial interfaces"
no serial interface in EC2
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 -x | |
# function to get meta-data info | |
function m () | |
{ | |
curl --retry 3 --retry-delay 0 --silent --fail http://169.254.169.254/latest/meta-data/$1 | |
} | |
# EIP for each AZ | |
declare -A EIP | |
EIP['ap-northeast-1a']='eipalloc-5887903a' |
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 | |
# This script will monitor another NAT instance and take over its routes | |
# if communication with the other instance fails | |
# NAT instance variables | |
# Other instance's IP to ping and route to grab if other node goes down | |
NAT_ID= | |
NAT_RT_ID= | |
# My route to grab when I come back up |
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 -x | |
# function to get meta-data info | |
function m () | |
{ | |
curl --retry 3 --retry-delay 0 --silent --fail http://169.254.169.254/latest/meta-data/$1 | |
} | |
# get REGION and setenv | |
export AWS_DEFAULT_REGION=`m placement/availability-zone | sed 's/.$//'` |
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 | |
count=3 | |
timeout=2 | |
success=0 | |
for ip in `echo $PATH_INFO | perl -pe 's#[^\d\./]##g;s#/#\ #g'` | |
do | |
ping $ip -c $count -W $timeout > /dev/null && success=1 | |
done |
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
> acl-2.2.49-6.9.amzn1.x86_64 | |
> acpid-1.0.10-2.1.6.amzn1.x86_64 | |
> alsa-lib-1.0.22-3.9.amzn1.x86_64 | |
> at-3.1.10-43.8.amzn1.x86_64 | |
> attr-2.4.44-7.9.amzn1.x86_64 | |
> aws-amitools-ec2-1.4.0.9-2.0.amzn1.noarch | |
> aws-apitools-as-1.0.61.3-1.0.amzn1.noarch | |
> aws-apitools-common-1.1.0-1.8.amzn1.noarch | |
> aws-apitools-ec2-1.6.12.0-1.0.amzn1.noarch | |
> aws-apitools-elb-1.0.23.0-1.0.amzn1.noarch |
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 ruby | |
require 'aws-sdk' | |
ec2 = AWS::EC2.new | |
# delete vpn connections w/ both tunnels down | |
puts "checking unused VPN connections" | |
ec2.vpn_connections.filter('state','available').each{|vpn| | |
if vpn.vgw_telemetry[0].status == :down && vpn.vgw_telemetry[1].status == :down | |
puts " deleting #{vpn.id}" |
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 | |
USERNAME=hoge@example.com | |
PASSWORD=somepassword | |
cd /var/tmp | |
yum -y groupinstall "Development Tools" | |
yum -y install libcurl-devel python-devel yasm | |
easy_install pip | |
pip install numpy pyserial Mako |
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
// ==UserScript== | |
// @name Youtube hide appbar | |
// @namespace j3tm0t0.gmail.com | |
// @version 0.1 | |
// @description disabling annoying appbar | |
// @include https://*youtube.com | |
// @include https://*youtube.com/* | |
// ==/UserScript== | |
document.querySelector('div#appbar-guide-menu').style.display='none'; |