Skip to content

Instantly share code, notes, and snippets.

@airawat
airawat / 00-OozieWorkflowStreamingMRAction-Python
Last active November 21, 2018 06:24
Sample of an Oozie workflow with streaming action - parses Syslog generated log files using python -regex
This gist includes oozie workflow components (streaming map reduce action) to execute
python mapper and reducer scripts to parse Syslog generated log files using regex;
Usecase: Count the number of occurances of processes that got logged, by month, and process.
Pictorial overview of workflow:
--------------------------------
http://hadooped.blogspot.com/2013/07/apache-oozie-part-5-oozie-workflow-with.html
Includes:
---------
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.4'
}
}
apply plugin: 'android'
@gdamjan
gdamjan / README.md
Last active May 3, 2024 07:59
Setup for an easy to use, simple reverse http tunnels with nginx and ssh. It's that simple there's no authentication at all. The end result, a single ssh command invocation gives you a public url for your web app hosted on your laptop.

What

A lot of times you are developing a web application on your own laptop or home computer and would like to demo it to the public. Most of those times you are behind a router/firewall and you don't have a public IP address. Instead of configuring routers (often not possible), this solution gives you a public URL that's reverse tunnelled via ssh to your laptop.

Because of the relaxation of the sshd setup, it's best used on a dedicated virtual machine just for this (an Amazon micro instance for example).

Requirements

@jpanganiban
jpanganiban / gist:3844261
Created October 6, 2012 07:05
Pygame + OpenCV Real-time Face Detection
#!/usr/bin/env python
from pygame import camera
import pygame
import time
import cv
import os
# Recognition
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@bradmontgomery
bradmontgomery / dummy-web-server.py
Last active May 14, 2024 18:19
a minimal http server in python. Responds to GET, HEAD, POST requests, but will fail on anything else.
#!/usr/bin/env python
"""
Very simple HTTP server in python (Updated for Python 3.7)
Usage:
./dummy-web-server.py -h
./dummy-web-server.py -l localhost -p 8000
Send a GET request:
@mbostock
mbostock / .block
Last active March 7, 2024 22:20
Collapsible Force Layout
license: gpl-3.0
@zeuxisoo
zeuxisoo / gist:1008973
Created June 5, 2011 13:44
[Android] Create and Remove Desktop Shortcut

Create

private void addShortcut(){  
	Intent shortcut = new Intent("com.android.launcher.action.INSTALL_SHORTCUT");
          
	// Shortcut name
	shortcut.putExtra(Intent.EXTRA_SHORTCUT_NAME, getString(R.string.app_name));  
	shortcut.putExtra("duplicate", false);	// Just create once
package com.pivotallabs;
import android.util.Log;
import com.xtremelabs.robolectric.Robolectric;
import com.xtremelabs.robolectric.RobolectricTestRunner;
import com.xtremelabs.robolectric.util.Implements;
import org.junit.Test;
import org.junit.runner.RunWith;
@RunWith(RobolectricTestRunner.class)
@DaveEveritt
DaveEveritt / Add field to an existing Django app with South
Created June 25, 2010 20:48
quickly add field(s) to existing Django models with South
====================================================================
Simple-as-possible instructions to add a field (or more) using South
to an existing Django model with existing data.
====================================================================
Two versions:
1. Super-condensed (the bare minimum - jfdi)
2. Detailed-but-brief (if you want more information).
Notes: