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:
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).' |
#!/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 |
<?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 |
DECLARE | |
BEGIN | |
FOR i IN 1..100000 LOOP | |
INSERT INTO T1 VALUES (i); | |
END LOOP; | |
COMMIT; | |
END; | |
/ |
#!/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 |
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) |
#!/bin/bash | |
echo "show global status where Variable_name='$4';" | mysql -h$1 -u$2 -p$3 -N | awk '{print $2}' |