I hereby claim:
- I am eerien on github.
- I am eerien (https://keybase.io/eerien) on keybase.
- I have a public key whose fingerprint is F6EA 0D1C 16A6 6B58 E47A E59B A439 6D42 EFAD 7DCF
To claim this, I am signing this object:
class Paginator(object): | |
def __init__(self, object_list, per_page=10, latest_id=None, latest_id_field='id', order_by='desc'): | |
assert type(latest_id_field) == str | |
self.object_list = object_list | |
self.per_page = per_page | |
self.latest_id = latest_id | |
self.latest_id_field = latest_id_field | |
self.order_by = order_by |
I hereby claim:
To claim this, I am signing this object:
import requests | |
import json | |
class ZabbixAPI(): | |
ZBX_COMMON_HEADERS = {'Content-Type': 'application/json-rpc'} | |
def __init__(self, url, username, password): | |
self.url = url | |
self._login(username, password) |
#!/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 |
#!/bin/bash | |
echo "show global status where Variable_name='$4';" | mysql -h$1 -u$2 -p$3 -N | awk '{print $2}' |
#!/bin/bash | |
mysqladmin -h$1 -u$2 -p$3 ping | grep -c alive |
#!/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 |
#!/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 |
<?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 |
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 |