Skip to content

Instantly share code, notes, and snippets.


Brian Cline briancline

  • SoftLayer / IBM Cloud
  • Dallas, Texas
View GitHub Profile
briancline / forfuckssake.txt
Created February 7, 2014 03:02
“uh oh” (heap02:/dev/sde was added today to replace the problematic sdc)
View forfuckssake.txt
discovery:~% ssh heap01 'df -h | grep osd'
/dev/sdb1 2.8T 2.3T 463G 84% /var/lib/ceph/osd/ceph-0
/dev/sdc1 2.8T 2.1T 646G 77% /var/lib/ceph/osd/ceph-4
/dev/sdd1 2.8T 2.3T 521G 82% /var/lib/ceph/osd/ceph-6
discovery:~% ssh heap02 'df -h | grep osd'
/dev/sdb1 2.8T 2.7T 53G 99% /var/lib/ceph/osd/ceph-1
/dev/sdc1 1.9T 1.9T 2.4G 100% /var/lib/ceph/osd/ceph-3
/dev/sdd1 2.8T 2.7T 80G 98% /var/lib/ceph/osd/ceph-5
/dev/sde1 2.8T 929G 1.9T 34% /var/lib/ceph/osd/ceph-2
briancline /
Last active August 29, 2015 13:56
Parallel stuff on the shell with gnu parallel utility
#!/usr/bin/env bash
## You can use this to crush images in parallel via the shell alone.
## Make sure the GNU parallel utility is installed:
## - apt-get install parallel
## - yum install parallel
## For a simple example, run the following to simulate with echo and sleep:
## ls --color=no /usr/share/doc | parallel -j 16 --gnu -i -- 'sh -c "sleep 0.5 && echo {}"'
## (-i tells parallel to substitute a filename when it sees {} in the command, rather than
## simply appending it to the command, as it would normally do if you omit -i)
briancline /
Last active August 29, 2015 13:56
Ceph QEMU trimmer script
# Since Ceph's TRIM/discard support for the rbd kernel module driver has been
# an open TODO for half a decade, this script attempts to boot up a minimal
# Ubuntu QEMU+KVM guest to do such bidding. Due to mysterious raisins, librbd
# has discard support, whereas the rbd kernel module does not... and QEMU uses
# librbd, hence this wasteful script.
# On "decent" server hardware at home, this completes in just under 60sec for
# a 100GB rbd image.
briancline /
Created March 5, 2014 19:47
Safe-ish version number list parsing from stdin
#!/usr/bin/env python
from __future__ import print_function
import sys
def _leloo_multiparse(v):
parse_fn = None
import pkg_resources
briancline / gotemp-read-osx.cpp
Last active August 29, 2015 13:57
OSX C++ version of the Python script I normally use under Linux to gather temperature from Go!Temp temperature sensors. Thanks for making everything about USB HID difficult, Apple.
View gotemp-read-osx.cpp
* Ugh. This code is pretty bad. But, it's the only basis I've been able
* to use successfully on OSX, since Apple stupidly auto-claims every single
* HID device on the system, making it unwritable via libusb, etc. unless you
* write an actual driver for it.
* So this will have to do.
briancline / cashmoney.c
Last active August 29, 2015 13:57
Cashmoney Indentation Standard (C$'14)
View cashmoney.c
#include <stdio.h>
#define $$$ /**/
int main(int argc, char* argv[]) {
$$$ $$$ $$$ $$$ printf("cashmoney indentation or bust\n");
$$$ $$$ $$$ $$$ return 0;
briancline /
Created April 8, 2014 04:12
Example Philips Hue dim script
#!/usr/bin/env python
from __future__ import print_function
from heliotron import Bridge
# ...and by heliotron I mean
bridge = Bridge(ip='', app_name='testscript')
lights = bridge.get_lights()
print('Good night!')
briancline / gist:e9b019c778a97027fce3
Last active August 29, 2015 14:01
Finding default mutables in Python via Sublime Text
View gist:e9b019c778a97027fce3

Matches all defs, including multi-line defs:


Matches all instances of ={ and =[:

briancline /
Last active August 29, 2015 14:02
Useful random junk

Python Stuff

pip install

Linux Containers (LXC) Stuff

View gitignore-autocomplete.txt
discovery.dfw1:~% gitignore
zsh: do you wish to see all 112 possibilities (28 lines)? y
Actionscript Erlang Mercury Scrivener
Ada ExpressionEngine MetaProgrammingSystem Sdcc
Agda ExtJS-MVC Meteor SeamGen
Android Fancy Node SketchUp
AppceleratorTitanium Finale OCaml SugarCRM
ArchLinuxPackages ForceDotCom Objective-C Swift
Autotools Fortran Opa Symfony
Bancha FuelPHP OpenCart Symfony2