This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# tested with hbase 0.19.3 and jython 2.2.1 | |
import java.lang | |
from org.apache.hadoop.hbase import HBaseConfiguration, HTableDescriptor, HColumnDescriptor, HConstants | |
from org.apache.hadoop.hbase.client import HBaseAdmin, HTable | |
from org.apache.hadoop.hbase.io import BatchUpdate, Cell, RowResult | |
# First get a conf object. This will read in the configuration | |
# that is out in your hbase-*.xml files such as location of the | |
# hbase master node. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# This program has two feature. | |
# | |
# 1. Create a disk image on RAM. | |
# 2. Mount that disk image. | |
# | |
# Usage: | |
# $0 <dir> <size> | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from StringIO import StringIO | |
import boto.s3 | |
from django.conf import settings | |
class MultiPartUploader: | |
counter = 0 | |
def __init__(self, bucket_name, key_name, buf_size=32768): | |
self.connection = boto.connect_s3(settings.AWS_ACCESS_KEY_ID, settings.AWS_SECRET_ACCESS_KEY) | |
self.bucket = self.connection.get_bucket(bucket_name) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 0 is too far from ` ;) | |
set -g base-index 1 | |
# Automatically set window title | |
set-window-option -g automatic-rename on | |
set-option -g set-titles on | |
#set -g default-terminal screen-256color | |
set -g status-keys vi | |
set -g history-limit 10000 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# bash generate random alphanumeric string | |
# | |
# bash generate random 32 character alphanumeric string (upper and lowercase) and | |
NEW_UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1) | |
# bash generate random 32 character alphanumeric string (lowercase only) | |
cat /dev/urandom | tr -dc 'a-z0-9' | fold -w 32 | head -n 1 |
##git mergetool
In the middle file (future merged file), you can navigate between conflicts with ]c
and [c
.
Choose which version you want to keep with :diffget //2
or :diffget //3
(the //2
and //3
are unique identifiers for the target/master copy and the merge/branch copy file names).
:diffupdate (to remove leftover spacing issues)
:only (once you’re done reviewing all conflicts, this shows only the middle/merged file)
#launchd
Usage
I have a bash script called foo.sh
that takes one command line argument, bar
. I want it to run every 60
seconds and load at startup.
- an XML
plist
is Apple Property List com.mydomain.foo.plist
Name of launchd plist file should be a reverse fqdn, like (this may not be required, but convention)com.mydomain.foo.plist
lives in$HOME/Library/LaunchAgents
and is ran as that user.com.mydomain.foo.plist
can also live/Library/LaunchDaemons
or/Library/LaunchAgents
, have requirements, ran asroot
- Load
plist
withlaunchctl load com.mydomain.foo.plist
- Unload
plist
withlauchctl unload com.mydomain.foo.plist
OlderNewer