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 | |
# | |
# Nagios plugin to check for inserts updates deletes drops alters creates on slave DBs due to http://bugs.mysql.com/bug.php?id=58669 | |
function usage(){ | |
echo "Usage: $0 [mysql socket]" | |
} | |
if [ $# -eq 0 ]; then |
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
class mysqld::release::initialize{ | |
file { "/var/lib/mysql_multi": | |
ensure => "directory", | |
owner => mysql, | |
group => mysql, | |
mode => 755, | |
} | |
define initdatadirs { |
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/python2 | |
import sys | |
a = sys.argv[1] | |
print "finding prime factors of %d" % int(a) | |
def findfirstfactor(number): | |
b = 1 | |
test = 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
#!/bin/bash | |
cat <<EOF | |
hello | |
there | |
EOF | |
function hered1(){ | |
cat <<EOF | |
hello | |
there |
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
RANGES="100 1000 10000 100000" | |
for RANGE in $RANGES; do | |
echo "Generating random numbers with a ceiling of $RANGE" | |
while :; do | |
nowtest=$((RANDOM%$RANGE+0)) | |
echo -n $nowtest | |
[[ $nowtest == $lasttest ]] && echo && echo "found side by side collision after $tests tests" && break | |
let tests++ | |
lasttest=$nowtest |
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 | |
from setuptools import setup, find_packages | |
here = os.path.abspath(os.path.dirname(__file__)) | |
with open(os.path.join(here, 'README.md')) as f: | |
README = f.read() | |
with open(os.path.join(here, 'CHANGES.md')) as f: | |
CHANGES = f.read() |
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
var dCursor = db.realtime.find( { profileId: "673772" }); | |
var dDocument = dCursor.hasNext() ? dCursor.next() : null; | |
getsize = function(doc) { | |
var dSize = Object.bsonsize(doc); | |
print(dSize) | |
} | |
dCursor.forEach(getsize); |
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
docker run --name=gitlab -d \ | |
-e "GITLAB_HTTPS=true" -e "SSL_SELF_SIGNED=true" \ | |
-e "GITLAB_HTTPS_ONLY=false" -e "HTTPARTY_TIMEOUT=60" \ | |
-v /opt/gitlab/data:/home/git/data sameersbn/gitlab:7.0.0 |
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 random | |
ranges = [ | |
32767, | |
2147483647, | |
9223372036854775807, | |
] | |
for range in ranges: | |
print('generating integers in range 0-%i') % range | |
count = 0 | |
cur_rand = 0 |
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
$ python2 ~/bin/random_test.py | |
generating integers in range 0-32767 | |
found sequential random collision after 22893 iterations | |
generating integers in range 0-2147483647 | |
found sequential random collision after 340197 iterations | |
generating integers in range 0-9223372036854775807 | |
found sequential random collision after 132434 iterations | |
$ python2 ~/bin/random_test.py | |
generating integers in range 0-32767 | |
found sequential random collision after 27756 iterations |
OlderNewer