Skip to content

Instantly share code, notes, and snippets.

View caleblloyd's full-sized avatar

Caleb Lloyd caleblloyd

View GitHub Profile

Linux Bare Metal

base="/tmp/storage-bench-file"
clearcache="sync && echo 3 > /proc/sys/vm/drop_caches"
for i in `seq 1 3`; do eval $clearcache && dd if=$base of=$base-w count=512 bs=1024k; rm -f $base-w; done
for i in `seq 1 3`; do eval $clearcache && dd if=$base of=/dev/null bs=4096k; done
rm -f $base

Linux Container

@caleblloyd
caleblloyd / mysql-backup-gcs.py
Last active December 11, 2015 20:16
MySQL Backup to Google Cloud Storage with Hipchat Integration
#!/usr/bin/env python
from __future__ import print_function
from datetime import datetime
import json
import os
import subprocess
import sys
# only use a-zA-Z-_, this becomes part of the backup file name