Skip to content

Instantly share code, notes, and snippets.

View jerluc's full-sized avatar
😵‍💫

Jeremy Lucas jerluc

😵‍💫
View GitHub Profile
@jerluc
jerluc / makeself.run
Last active January 3, 2016 07:38
Makeself makeself
@jerluc
jerluc / update-resolv-conf
Created January 12, 2014 02:07
OpenVPN resolv.conf update script
#!/bin/bash
#
# Parses DHCP options from openvpn to update resolv.conf
# To use set as 'up' and 'down' script in your openvpn *.conf:
# up /etc/openvpn/update-resolv-conf
# down /etc/openvpn/update-resolv-conf
#
# Used snippets of resolvconf script by Thomas Hood <jdthood@yahoo.co.uk>
# and Chris Hanson
# Licensed under the GNU GPL. See /usr/share/common-licenses/GPL.
@jerluc
jerluc / build.log
Last active December 29, 2015 23:29
Pidgin build failure
 * Package: net-im/pidgin-2.10.7-r5
 * Repository: gentoo
 * Maintainer: polynomial-c@gentoo.org net-im@gentoo.org
 * USE: amd64 dbus elibc_glibc gstreamer gtk kernel_linux ncurses nls python_single_target_python2_7 python_targets_python2_7 userland_GNU xscreensaver
 * FEATURES: preserve-libs sandbox userpriv usersandbox
* dbus is enabled, no way to disable linkage with python => python is enabled
>>> Unpacking source...
>>> Unpacking pidgin-2.10.7.tar.bz2 to /var/tmp/portage/net-im/pidgin-2.10.7-r5/work
>>> Unpacking pidgin-eds-3.6.patch.bz2 to /var/tmp/portage/net-im/pidgin-2.10.7-r5/work
>>> Source unpacked in /var/tmp/portage/net-im/pidgin-2.10.7-r5/work
/*
Copyright 2012 Viktor Klang
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
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
@jerluc
jerluc / hadoop-installation.md
Last active December 21, 2015 23:19
Hadoop CDH3 setup

What you need

By now, you should have the following prerequisites installed and configured on your machine:

  • Ubuntu 12.04
  • Java (Oracle JDK 6; ensure $JAVA_HOME is set)
  • Git
  • Apache Maven

What you get

After successful installation, you should be setup for running:

  • Hadoop (local-mode + pseudo-distributed)
@jerluc
jerluc / instructions.md
Last active December 17, 2015 22:19
These instructions are for my session on rapidly developing software on the Hadoop technology stack through the use of commonly-found test utilities.
@jerluc
jerluc / Markov.scala
Last active December 16, 2015 13:18
My first naive attempt at Markov chains
import util.Random
object Markov extends App {
// Just some long plain-text sources from Project Gutenberg
val sherlockHolmes = "http://www.gutenberg.org/cache/epub/1661/pg1661.txt"
val kingJamesBible = "http://www.gutenberg.org/cache/epub/10/pg10.txt"
@jerluc
jerluc / hello.rift
Last active December 16, 2015 05:08
Rift Source + PEG-generated AST XML
hello {
// Create our simple function
sum(a, b) => a + b
// Create a function to defer the computation
deferredSum(a, b) => => sum(a, b)
// Bind the evaluation of the computation in "myThread" to variable "a"
a := deferredSum(10, 20) @ myThread
// Print out the value once it's available
print(a)
}
@jerluc
jerluc / BrandRecommendation.scala
Created July 27, 2012 19:21
Brand Recommendation Prototype Using Scalding
import com.twitter.scalding._
import scala.util.matching.Regex
class BrandRecommandation(args : Args) extends Job(args) {
val brandData = Tsv(args("input"), ('userId, 'brandId, 'interactions))
val brandIncidence = brandData.groupBy('brandId) { _.size } rename { 'size -> 'brandIncidence }
val brandDataWithIncidence = brandData.joinWithSmaller('brandId -> 'brandId, brandIncidence)
@jerluc
jerluc / ExactMatchPOC.java
Created May 2, 2012 02:44
Exact token pattern matching
public class ExactMatchPOC {
private static final String TOKEN_DELIMITER = " ";
private static final String PHRASE_DELIMITER = ",";
public static void main(String[] args) {
String[] phraseTokens = buildTokenHashArray(args[0]);
String[][] labelTokens = buildMultiTokenHashArray(args[1]);
int i;