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 __future__ import print_function | |
import argparse | |
import codecs | |
import hashlib | |
import os | |
import subprocess | |
import sys | |
import time | |
try: |
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 os | |
import subprocess | |
import sys | |
def run_checksum(basedir, filename, output): | |
args = ['xxhsum', filename] | |
process = subprocess.Popen(args, stdout=output, close_fds=True, cwd=basedir) | |
if process.wait() != 0: | |
raise subprocess.CalledProcessError(process.returncode, args) |
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
package main | |
import ( | |
"database/sql" | |
"flag" | |
"log" | |
"os" | |
"time" | |
_ "github.com/go-sql-driver/mysql" |
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
package filesystem | |
// See: https://talks.golang.org/2012/10things.slide#1 | |
// Also see github.com/spf13/afero | |
// Playground for testing some fake / TDD ideas around filesystem bits | |
// With https://github.com/maxbrunsfeld/counterfeiter can be used | |
// to Stub out various os.* bits to focus tests | |
import ( |
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 | |
## Chug github.com/cloudfoundry/lager logs | |
import json | |
import sys | |
import datetime | |
for line in sys.stdin: | |
try: |
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
package main | |
import ( | |
"fmt" | |
"os" | |
"syscall" | |
"unsafe" | |
) | |
func fincore(path string) { |
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
package main | |
import ( | |
"fmt" | |
"os" | |
"path/filepath" | |
"golang.org/x/sys/unix" | |
) |
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
if [[ ! -z $WSREP_SST_OPT_BINLOG ]];then | |
BINLOG_DIRNAME=$(dirname $WSREP_SST_OPT_BINLOG) | |
BINLOG_FILENAME=$(basename $WSREP_SST_OPT_BINLOG) | |
# To avoid comparing data directory and BINLOG_DIRNAME | |
mv $DATA/${BINLOG_FILENAME}.* $BINLOG_DIRNAME/ 2>/dev/null || true | |
pushd $BINLOG_DIRNAME &>/dev/null | |
for bfiles in $(ls -1 ${BINLOG_FILENAME}.[0-9]*);do |
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 os | |
import pprint | |
import random | |
import MySQLdb | |
c = MySQLdb.connect(read_default_file=os.path.abspath('my.sandbox.cnf'), db='test') | |
cursor = c.cursor() |
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
""" | |
Iterative table checksum of tables with composite keys | |
This uses an algorithm similar to mk-table-sync's Nibble | |
algorithm but intended purely for checking if a master/slave | |
are in sync. | |
""" | |
import os, sys | |
import time | |
import warnings |
NewerOlder