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 | |
if test $# -ne 1; then | |
echo "Usage: `basename $0 .sh` <process-id>" 1>&2 | |
exit 1 | |
fi | |
if test ! -r /proc/$1; then | |
echo "Process $1 not found." 1>&2 | |
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
DECLARE | |
BEGIN | |
FOR i IN 1..100000 LOOP | |
INSERT INTO T1 VALUES (i); | |
END LOOP; | |
COMMIT; | |
END; | |
/ |
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
from django import forms | |
from django.core import validators | |
from django.core.exceptions import ValidationError | |
class MinLengthValidator(validators.MinLengthValidator): | |
message = 'Ensure this value has at least %(limit_value)d elements (it has %(show_value)d).' | |
class MaxLengthValidator(validators.MaxLengthValidator): | |
message = 'Ensure this value has at most %(limit_value)d elements (it has %(show_value)d).' |
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
AZ=`curl http://169.254.169.254/2012-01-12/meta-data/placement/availability-zone 2> /dev/null` | |
if [[ $AZ =~ 'us-east-1' ]]; then # N. Virginia | |
elif [[ $AZ =~ 'us-west-2' ]]; then # Oregon | |
elif [[ $AZ =~ 'us-west-1' ]]; then # N. California | |
elif [[ $AZ =~ 'eu-west-1' ]]; then # Ireland | |
elif [[ $AZ =~ 'ap-southeast-1' ]]; then # Singapore | |
elif [[ $AZ =~ 'ap-northeast-1' ]]; then # Tokyo | |
elif [[ $AZ =~ 'ap-southeast-2' ]]; then # Sydney | |
elif [[ $AZ =~ 'sa-east-1' ]]; then # Sao Paulo | |
else # Others |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<opml version="1.0"> | |
<head> | |
<title>AWS RSS Feeds</title> | |
</head> | |
<body> | |
<outline title="AWS Status" text="AWS Status"> | |
<outline text="Amazon Mobile Analytics (N. Virginia) Service Status" title="Amazon Mobile Analytics (N. Virginia) Service Status" type="rss" xmlUrl="http://status.aws.amazon.com/rss/analytics-us-east-1.rss" htmlUrl="http://status.aws.amazon.com/" rssfr-favicon="http://status.aws.amazon.com/favicon.ico"/> | |
<outline text="Amazon AppStream (N. Virginia) Service Status" title="Amazon AppStream (N. Virginia) Service Status" type="rss" xmlUrl="http://status.aws.amazon.com/rss/appstream-us-east-1.rss" htmlUrl="http://status.aws.amazon.com/" rssfr-favicon="http://status.aws.amazon.com/favicon.ico"/> | |
<outline text="Auto Scaling (Tokyo) Service Status" title="Auto Scaling (Tokyo) Service Status" type="rss" xmlUrl="http://status.aws.amazon.com/rss/autoscaling-ap-northeast-1.rss" htmlUrl="http://status.a |
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 | |
# $1: Region | |
# $2: Namespace | |
# $3: Dimensions | |
# $4: Metric Name | |
# $5: Start Time (before n min) | |
# $6: Period (min) | |
# $7: Statistics (SampleCount, Average, Sum, Minimum, Maximum) | |
# $8: Output value when the result is null |
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 | |
export AWS_ACCESS_KEY_ID= | |
export AWS_SECRET_ACCESS_KEY= | |
/usr/local/bin/aws autoscaling set-desired-capacity --region "$1" --auto-scaling-group-name "$2" --desired-capacity "$3" --no-honor-cooldown |
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 | |
mysqladmin -h$1 -u$2 -p$3 ping | grep -c alive |
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 | |
echo "show global status where Variable_name='$4';" | mysql -h$1 -u$2 -p$3 -N | awk '{print $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 | |
#-*- coding: utf-8 -*- | |
# Install | |
# apt-get install xvfb python-imaging (firefox or chromium-chromedriver) | |
# pip install selenium pyvirtualdisplay boto | |
import sys | |
import os | |
import socket |
OlderNewer