Skip to content

Instantly share code, notes, and snippets.

View bcicen's full-sized avatar

bradley bcicen

View GitHub Profile
#!/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
class mysqld::release::initialize{
file { "/var/lib/mysql_multi":
ensure => "directory",
owner => mysql,
group => mysql,
mode => 755,
}
define initdatadirs {
#!/usr/bin/python2
import sys
a = sys.argv[1]
print "finding prime factors of %d" % int(a)
def findfirstfactor(number):
b = 1
test = 1
#!/bin/bash
cat <<EOF
hello
there
EOF
function hered1(){
cat <<EOF
hello
there
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
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()
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);
@bcicen
bcicen / glrun.sh
Last active August 29, 2015 14:03
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
import random
ranges = [
32767,
2147483647,
9223372036854775807,
]
for range in ranges:
print('generating integers in range 0-%i') % range
count = 0
cur_rand = 0
$ 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