Skip to content

Instantly share code, notes, and snippets.

View kevints's full-sized avatar

Kevin Sweeney kevints

View GitHub Profile
@kevints
kevints / gist:3789782
Created September 26, 2012 18:46
Script to run outerproduct_cuda
#!/bin/sh
export LD_LIBRARY_PATH=/usr/local/cuda-4.2/lib64
exec ./outerproduct_cuda "$@"
@kevints
kevints / pgsql.sh
Created October 25, 2012 02:29
Useful shell functions for pgsql development (CS186)
export PGDATA=$HOME/pgsql/data
export PGPORT=11111
export PGDB=postgres
n=16 p=2q
pgreload() {
pg_ctl stop -m quick
cat /dev/null > $p$n.log
make -j7 CC="ccache gcc" && \
@kevints
kevints / instrument_gc.rb
Created October 30, 2012 22:20
Time for GC pause vs. time for non-GC pause
#!/usr/bin/env ucbruby
def profile_step(start_count)
obj_count = 0
benchmark_start_time = Time.now
iteration_start_time = 0
iteration_end_time = 0
last_iteration_start_time = 0
last_iteration_end_time = 0
import sys
class self_factory(object):
def __getattr__(self, attr):
return self
def __call__(self, *args, **kw):
return self
jar_library = self_factory()
#!/bin/bash
fortune=`fortune startrek`
echo "$fortune"
select answer in yes no; do
case $answer in
yes) break ;;
no) ;;
esac
fortune=`fortune startrek`
echo "$fortune"
@kevints
kevints / gist:8102247
Created December 23, 2013 18:32
fetch binary mesos egg into local pypi mirror
mkdir -p third_party
pushd third_party
wget -c http://downloads.mesosphere.io/master/ubuntu/12.04/mesos_0.15.0-rc4_amd64.egg -O mesos-0.15.0_rc4-py2.7-linux-x86_64.egg
popd
@kevints
kevints / gist:8361414
Last active January 2, 2016 21:09
Create pants-less distribution of the Aurora client for PyPI publication

Create sdists (written to dist/)

% ./pants setup_py src/main/thrift/org/apache/aurora/gen:py-thrift-packaged
Running "/opt/twitter/opt/python/bin/python2.7 setup.py sdist" in /Users/ksweeney/workspace/aurora.2/dist/apache.gen.aurora-0.5.0-snapshot
Wrote /Users/ksweeney/workspace/aurora.2/dist/apache.gen.aurora-0.5.0-snapshot.tar.gz

% ./pants setup_py src/main/thrift/org/apache/thermos:py-thrift
Running "/opt/twitter/opt/python/bin/python2.7 setup.py sdist" in /Users/ksweeney/workspace/aurora.2/dist/apache.gen.thermos-0.5.0-snapshot
Wrote /Users/ksweeney/workspace/aurora.2/dist/apache.gen.thermos-0.5.0-snapshot.tar.gz
~aurora git aurora/. master
% jython -V
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=utf8
Jython 2.7b1
~aurora git aurora/. master
% JYTHONPATH=/tmp/aurora_client jython -m __main__
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=utf8
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/ksweeney/jython2.7b1/Lib/runpy.py", line 175, in run_module
@kevints
kevints / .xinputrc
Created May 5, 2014 22:12
Natural Scrolling on Ubuntu 14.04
# Natural Scrolling
xinput set-button-map 'Logitech USB Laser Mouse' 1 2 3 5 4 6 7 8 9 10 11 12 13 14 15 16
@kevints
kevints / .vimrc
Last active August 29, 2015 14:04
.vimrc
set nocompatible
if $COLORTERM == 'gnome-terminal'
set t_Co=256
endif
execute pathogen#infect()
syntax on
filetype plugin indent on