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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>tableToExcel Demo</title> | |
<script src="tableToExcel.js"></script> | |
</head> | |
<body> | |
<h1>tableToExcel Demo</h1> | |
<p>Exporting the W3C Example Table</p> |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>tableToExcel Demo</title> | |
<script src="tableToExcel.js"></script> | |
</head> | |
<body> | |
<h1>tableToExcel Demo</h1> | |
<p>Exporting the W3C Example Table</p> |
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
-- Provide a log file debugging statement. | |
SELECT 'DROP PROCEDURE IF EXISTS dropForeignKeys'; | |
-- Conditionally drop the procedure. | |
DROP PROCEDURE IF EXISTS dropForeignKeys; | |
-- Provide a log file debugging statement. | |
SELECT 'CREATE PROCEDURE dropForeignKeys'; | |
-- Change delimiter to create procedure. |
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 python | |
import json | |
import requests | |
def process(obj, ds): | |
data = {} | |
values = obj[ds]['value'] | |
index = obj[ds]['dimension'][obj[ds]['dimension']['id'][1]]['category']['index'] | |
labels = obj[ds]['dimension'][obj[ds]['dimension']['id'][1]]['category']['label'] |
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 python | |
import json | |
import requests | |
def process(obj, ds): | |
data = {} | |
values = obj[ds]['value'] | |
index = obj[ds]['dimension'][obj[ds]['dimension']['id'][1]]['category']['index'] | |
labels = obj[ds]['dimension'][obj[ds]['dimension']['id'][1]]['category']['label'] |
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
import argparse | |
import json | |
import time | |
import boto.ec2 | |
# Set up argument parser | |
parser = argparse.ArgumentParser( | |
description='Request AWS EC2 spot instance and tag instance and volumes.', |
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
$ cd /tmp | |
$ echo "foo bar baz foo foo quz" > test1 | |
$ echo "bar bar foo bar baz foo quz foo foo" > test2 | |
$ sed -i '.bak' 's/foo/replaced/g' test* | |
$ tail test1 test2 | |
==> test1 <== | |
replaced bar baz replaced replaced quz | |
==> test2 <== | |
bar bar replaced bar baz replaced quz replaced replaced |
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
import psutil | |
import simplejson | |
import time | |
import urllib2 | |
# Sends the CPU and memory usage stats to Loggly. Sends both a machine total and per process. | |
def log(): | |
"""""" | |
proc_dict = {} |
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 | |
# | |
# Convert a Row-Based-Replication binary log to Statement-Based-Replication format, cheating a little. | |
# This script exists since Percona Toolkit's pt-query-digest cannot digest RBR format. The script | |
# generates enough for it to work with. | |
# Expecting standard input | |
# Expected input is the output of "mysqlbinlog --verbose --base64-output=DECODE-ROWS <binlog_file_name>" | |
# For example: | |
# $ mysqlbinlog --verbose --base64-output=DECODE-ROWS mysql-bin.000006 | python binlog-rbr-to-sbr.py | pt-query-digest --type=binlog --order-by Query_time:cnt --group-by fingerprint | |
# |
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 parse_conn import parse_connection | |
import unittest | |
class InvalidInputs(unittest.TestCase): | |
def testNoAt(self): | |
"""parse_connection should raise an exception | |
for an invalid connection string""" | |
self.assertRaises(ValueError, parse_connection, 'invalid uri') | |
if __name__ == "__main__": |
OlderNewer