Skip to content

Instantly share code, notes, and snippets.

@sit
sit / dump_cloudera_manager.py
Created October 29, 2013 03:38
A quick and dirty script to dump the cluster/service/role configuration via the Cloudera Manager API http://cloudera.github.io/cm_api/.
#!/usr/bin/env python
from cm_api.api_client import ApiResource
def main(args):
cm_host = get(args, 1, "localhost")
cm_user = get(args, 2, "admin")
cm_pass = get(args, 3, "admin")
api = ApiResource(cm_host, username=cm_user, password=cm_pass)
@sit
sit / import_dayone.py
Created December 31, 2013 05:23
Import various text files into DayOne without using the DayOne CLI.
#
# Usage: mkdir /tmp/export; find path -name *.html | xargs python
# import_dayone.py | tee /tmp/export.log
#
import datetime
import plistlib
import pytz
import uuid
import sys
@sit
sit / private-chrome.sh
Created January 2, 2014 03:03
Wrapper script to always use a secure user dir for Google Chrome. I find this useful for protecting private caches on a work computer.
#!/bin/sh
#
# Mount a truecrypt volume on /media/truecrypt1
USER_DATA_DIR=/media/truecrypt1/Chrome/$USER
if [ ! -d $USER_DATA_DIR ]; then
echo No secure data directory $USER_DATA_DIR 1>&2
exit 1;
fi
@sit
sit / keybase.md
Last active April 14, 2016 01:30
keybase.md

Keybase proof

I hereby claim:

  • I am sit on github.
  • I am emilsit (https://keybase.io/emilsit) on keybase.
  • I have a public key ASDX1Y165C9JTvdEJp0_CsOFCp1ZJde9srVIXqgGgjWBHQo

To claim this, I am signing this object: