Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am lsheng on github.
  • I am lsheng (https://keybase.io/lsheng) on keybase.
  • I have a public key whose fingerprint is 30AA 1375 0A2A 8208 FAF2 D352 A2DB A196 E6D6 B937

To claim this, I am signing this object:

@lsheng
lsheng / 13_bento_suspend
Created December 10, 2013 19:16
Hook to automatically stop Bento cluster instances on suspend.
#!/bin/bash
# Put this file in /etc/pm/sleep.d for Ubuntu machines.
BENTO=$(ps aux | grep 'bento' | grep 'java')
if [[ ! -z $BENTO ]]; then
BENTO_PID=$(echo $BENTO | awk '{print $2}')
BENTO_PID_FILE=$(echo $BENTO | sed -e 's/.*-cp ://g' | sed -e 's/cluster.*/cluster/')/state/bento-cluster.pid
else
exit $NA
@lsheng
lsheng / GenericUDFTimestampFilter.java
Created June 27, 2013 07:41
GenericUDFTimestampFilter
/**
* (c) Copyright 2013 WibiData, Inc.
*
* See the NOTICE file distributed with this work for additional
* information regarding copyright ownership.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
@lsheng
lsheng / generate-import-descriptor.sh
Created March 14, 2013 22:23
Script that generates a flat import descriptor based on the headers of a CSV
#!/bin/bash
# Generates a flat import descriptor based on the headers of a CSV
FILENAME=$1
if [ ! -e "$FILENAME" ]; then
echo "Could not find file: $FILENAME"
exit 1
fi
echo "{"
@lsheng
lsheng / generate-ddl.sh
Created March 14, 2013 22:20
Script to generate a flat Kiji schema shell DDL based on the headers for a CSV
#!/bin/bash
# Generates a flat Kiji schema shell DDL based on the headers for a CSV
FILENAME=$1
if [ ! -e "$FILENAME" ]; then
echo "Could not find file: $FILENAME"
exit 1
fi