Skip to content

Instantly share code, notes, and snippets.

View larsyencken's full-sized avatar

Lars Yencken larsyencken

View GitHub Profile
@larsyencken
larsyencken / README.md
Created November 14, 2013 22:56
Blog posts on scaling companies
@larsyencken
larsyencken / logger.py
Last active December 28, 2015 08:59
Build a structlog logger which output's JSON
import structlog
l = structlog.get_logger(processors=[
structlog.processors.TimeStamper(),
structlog.processors.JSONRenderer()
])
@larsyencken
larsyencken / install_pyret.sh
Last active December 28, 2015 01:59
Pyret: bootstrap with Marelle
# install Marelle to /usr/local prefix
bash -c "`curl https://raw.github.com/larsyencken/marelle/master/bootstrap_global.sh`"
# install marelle-deps into ~/.marelle/deps
mkdir -p ~/.marelle
pushd ~/.marelle
if [ ! -d deps ]; then
git clone https://github.com/larsyencken/marelle-deps deps
fi
popd
@larsyencken
larsyencken / find_dups.py
Created November 8, 2013 06:02
Walk a local directory and dump JSON records of all the duplicate files.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# find_dups.py
#
import optparse
import json
import hashlib
import os
@larsyencken
larsyencken / error.log
Created October 8, 2013 05:33
Sqoop/Hive thrift error
13/09/02 01:59:19 INFO hive.HiveImport: Exception in thread "main" java.lang.NoSuchMethodError: org.apache.thrift.EncodingUtils.setBit(BIZ)B
13/09/02 01:59:19 INFO hive.HiveImport: at org.apache.hadoop.hive.metastore.api.StorageDescriptor.setNumBucketsIsSet(StorageDescriptor.java:464)
13/09/02 01:59:19 INFO hive.HiveImport: at org.apache.hadoop.hive.metastore.api.StorageDescriptor.setNumBuckets(StorageDescriptor.java:451)
13/09/02 01:59:19 INFO hive.HiveImport: at org.apache.hadoop.hive.ql.metadata.Table.getEmptyTable(Table.java:132)
13/09/02 01:59:19 INFO hive.HiveImport: at org.apache.hadoop.hive.ql.metadata.Table.<init>(Table.java:105)
13/09/02 01:59:19 INFO hive.HiveImport: at org.apache.hadoop.hive.ql.metadata.Hive.newTable(Hive.java:2444)
13/09/02 01:59:19 INFO hive.HiveImport: at org.apache.hadoop.hive.ql.metadata.Hive.getTable(Hive.java:906)
13/09/02 01:59:19 INFO hive.HiveImport: at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.analyzeCreateTable(SemanticAnalyzer.java:9
@larsyencken
larsyencken / unbuffer.py
Last active December 23, 2015 07:59
Python: unbuffer stdout
import os
import sys
# replace stdout with an identical file descriptor of buffer size 0
sys.stdout = os.fdopen(sys.stdout.fileno(), 'w', 0)
diff --git a/old.xml b/new.xml
index 5166764..8a63a78 100644
--- a/old.xml
+++ b/new.xml
@@ -16,4 +16,6 @@
<property><name>dfs.datanode.address</name><value>0.0.0.0:9200</value></property>
<property><name>dfs.name.dir</name><value>/mnt/var/lib/hadoop/dfs-name,/mnt1/var/lib/hadoop/dfs-name</value></property>
<property><name>dfs.datanode.ipc.address</name><value>0.0.0.0:9201</value></property>
+ <property><name>mapred.child.java.opts</name><value>-Xmx2048m</value></property>
+ <property><name>mapred.child.ulimit</name><value>5000000</value></property>
@larsyencken
larsyencken / fix_pip.sh
Created August 7, 2013 02:04
Fix broken pip (ImportError: No module named pkg_resources)
curl https://python-distribute.org/distribute_setup.py | python
@larsyencken
larsyencken / speech.md
Last active December 17, 2015 20:48
Speech for Rod and Elisa's wedding

Hello. My name is Lars, I'm a friend of Rod and Elisa's, and I'd like to say a few words.

I've known Rod since we were both kids. We became friends after his family returned to Melbourne after a few years living in Botswana in Africa. Back then, I was a real brat. But even that early I knew Rod was a good guy.

A few years later we were finishing school, and both entered university to study software. By this time, I'd discovered that not just Rod, but his whole family were smart, kind, and deeply humourous. Plus, his father Ric has a fantastic wine cellar. Naturally, we moved in and shared an apartment.

In another few years we had both graduated. I kept studying, Lauren and I went to Japan and got married, and Rod moved to Spain for some work. We heard about his adventures across Europe, and always asked if he'd met any cute girls, and always the answer was no.

That is, until he came back from Spain. Apparrently, in the last month he was there he had met a special girl, and leaving had been a bit difficult

@larsyencken
larsyencken / install_simplecv.sh
Last active December 17, 2015 18:39
Install SimpleCV on OS X or Ubuntu with Marelle
# install marelle
bash -c "`curl https://raw.github.com/larsyencken/marelle/master/bootstrap.sh`"
# get some packages
mkdir -p ~/.marelle
git clone https://github.com/larsyencken/marelle-deps ~/.marelle/deps
# install simplecv
~/.local/bin/marelle meet simplecv