Skip to content

Instantly share code, notes, and snippets.

@ibeex
ibeex / sparks.py
Created Dec 7, 2011 — forked from stefanv/sparks.py
Command line sparks in Python
View sparks.py
#!/usr/bin/python
# coding=utf-8
# Python version of Zach Holman's "spark"
# https://github.com/holman/spark
# by Stefan van der Walt <stefan@sun.ac.za>
"""
USAGE:
@ibeex
ibeex / FacebookWordCloud.py
Created Feb 14, 2012 — forked from bostwick/FacebookWordCloud.py
Facebook News Feed Word Cloud
View FacebookWordCloud.py
#!/usr/bin/env python
import sys
import urllib2
import json
from collections import defaultdict
from nltk import word_tokenize
IGNORED_WORDS = ["!", ".", ",", "(", ")", "'s", ":", "?", "...", "$",
@ibeex
ibeex / rc.d
Created Jul 18, 2012 — forked from jippi/rc.d
Logstash Init script
View rc.d
update-rc.d logstash-shipper defaults
update-rc.d logstash-reader defaults
View supervisord.sh
#! /bin/sh
### BEGIN INIT INFO
# Provides: supervisord
# Required-Start: $remote_fs
# Required-Stop: $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Example initscript
# Description: This file should be used to construct scripts to be
# placed in /etc/init.d.
@ibeex
ibeex / proxy.py
Last active Dec 23, 2015 — forked from bxt/proxy.py
View proxy.py
# Originally from http://sharebear.co.uk/blog/2009/09/17/very-simple-python-caching-proxy/
#
# Usage:
# Stup localhost 80000 as proxy in web browser cache will cache the files
# on disc and not redownload it again.
# To clear the cache simply do a `rm *.cached`. To stop the server simply
# send SIGINT (Ctrl-C). It does not handle any headers or post data.
import BaseHTTPServer
import hashlib
View gist:6917820
import os
import signal
import sys
import errno
from jsonrpclib.SimpleJSONRPCServer import SimpleJSONRPCServer
# BOOK-KEEPING
_PIDS = []
View ocr.markdown

Install ImageMagick (>= 6.8.0-10) for image conversion:

brew install imagemagick

Install leptonica (>= 1.69) and tesseract (>= 3.02.02) for OCR:

brew install leptonica
brew install tesseract --all-languages

Or install without --all-languages and install them manually as needed.

View setup.sh
#!/bin/bash
set -eu
_UID=$(id -u)
GID=$(id -g)
# give lxd permission to map your user/group id through
grep root:$_UID:1 /etc/subuid -qs || sudo usermod --add-subuids ${_UID}-${_UID} --add-subgids ${GID}-${GID} root
# set up a separate key to make sure we can log in automatically via ssh
# with $HOME mounted
@ibeex
ibeex / .gitignore
Created Jul 19, 2012 — forked from karmi/.gitignore
Import your Gmail messages into ElasticSearch and search them with a simple web application.
View .gitignore
.DS_Store
*.log
Gemfile.lock
@ibeex
ibeex / foo.log
Created Aug 4, 2012
Flask logging example
View foo.log
A warning occurred (42 apples)
An error occurred