Skip to content

Instantly share code, notes, and snippets.

View ckelner's full-sized avatar
🐕‍🦺
Datadog

Chris Kelner ckelner

🐕‍🦺
Datadog
View GitHub Profile
@ckelner
ckelner / aws_csv_totaler.py
Created February 3, 2015 17:47
dinky little py script to total up aws consolidated billing csvs. Needed because I have csvs w/ roughly 17mil rows in the ~7Gb file size range.
import csv
import sys
from decimal import Decimal
csv_file = open( sys.argv[1] )
count = 0
total_line_item_cost = Decimal(0)
for row in csv.reader( csv_file ):
count += 1
# get record type (column 4)
The days are long but the decades are short
I turned 30 last week and a friend asked me if I'd figured out any life advice in the past decade worth passing on. I'm somewhat hesitant to publish this because I think these lists usually seem hollow, but here is a cleaned up version of my answer:
1) Never put your family, friends, or significant other low on your priority list. Prefer a handful of truly close friends to a hundred acquaintances. Don’t lose touch with old friends. Occasionally stay up until the sun rises talking to people. Have parties.
2) Life is not a dress rehearsal—this is probably it. Make it count. Time is extremely limited and goes by fast. Do what makes you happy and fulfilled—few people get remembered hundreds of years after they die anyway. Don’t do stuff that doesn’t make you happy (this happens most often when other people want you to do something). Don’t spend time trying to maintain relationships with people you don’t like, and cut negative people out of your life. Negat
@ckelner
ckelner / jquery-draggable-touch.js
Created December 11, 2012 00:39
touch events to work with jquery ui draggable (using HP 4200tm windows 7)
function touchHandler(event){
var touches = event.changedTouches,
first = touches[0],
type = "";
switch(event.type){
case "touchstart": type = "mousedown"; break;
case "touchmove": type="mousemove"; break;
case "touchend": type="mouseup"; break;
default: return;
<item>
<destinationCidrBlock>0.0.0.0/0</destinationCidrBlock>
<instanceId>i-4c52da2f</instanceId>
<instanceOwnerId>592600858309</instanceOwnerId>
<networkInterfaceId>eni-11cd9f7e</networkInterfaceId>
<state>active</state>
<origin>CreateRoute</origin>
</item>
{
"vers": 0.01,
"config": {
"rate": "perhr",
"valueColumns": [
"linux",
"mswin"
],
"currencies": [
"USD"
{
"vers": 0.01,
"config": {
"rate": "perhr",
"valueColumns": [
"linux"
],
"currencies": [
"USD"
],
{
"vers": 0.01,
"config": {
"rate": "perhr",
"valueColumns": [
"mswin"
],
"currencies": [
"USD"
],
{
"vers": 0.01,
"config": {
"rate": "perhr",
"valueColumns": [
"sles"
],
"currencies": [
"USD"
],
{
"vers": 0.01,
"config": {
"rate": "perhr",
"valueColumns": [
"rhel"
],
"currencies": [
"USD"
],
@ckelner
ckelner / single-ri.xml
Created August 16, 2013 14:06
reserved instance object from AWS
<item>
<reservedInstancesId>bbcd9749-595f-4030-9ac8-dde4ab4f71ec</reservedInstancesId>
<instanceType>m1.large</instanceType>
<availabilityZone>us-east-1a</availabilityZone>
<start>2013-08-01T00:00:00.000Z</start>
<duration>94608000</duration>
<fixedPrice>1028.0</fixedPrice>
<usagePrice>0.0</usagePrice>
<instanceCount>1</instanceCount>
<productDescription>Linux/UNIX (Amazon VPC)</productDescription>