Skip to content

Instantly share code, notes, and snippets.

#!/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

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.

import os
import signal
import sys
import errno
from jsonrpclib.SimpleJSONRPCServer import SimpleJSONRPCServer
# BOOK-KEEPING
_PIDS = []
@ibeex
ibeex / proxy.py
Last active December 23, 2015 10:19 — forked from bxt/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
#! /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 / foo.log
Created August 4, 2012 13:46
Flask logging example
A warning occurred (42 apples)
An error occurred
@ibeex
ibeex / .gitignore
Created July 19, 2012 11:38 — forked from karmi/.gitignore
Import your Gmail messages into ElasticSearch and search them with a simple web application.
.DS_Store
*.log
Gemfile.lock
@ibeex
ibeex / rc.d
Created July 18, 2012 09:36 — forked from jippi/rc.d
Logstash Init script
update-rc.d logstash-shipper defaults
update-rc.d logstash-reader defaults
@ibeex
ibeex / FacebookWordCloud.py
Created February 14, 2012 15:14 — forked from bostwick/FacebookWordCloud.py
Facebook News Feed Word Cloud
#!/usr/bin/env python
import sys
import urllib2
import json
from collections import defaultdict
from nltk import word_tokenize
IGNORED_WORDS = ["!", ".", ",", "(", ")", "'s", ":", "?", "...", "$",
@ibeex
ibeex / sparks.py
Created December 7, 2011 08:26 — forked from stefanv/sparks.py
Command line sparks in Python
#!/usr/bin/python
# coding=utf-8
# Python version of Zach Holman's "spark"
# https://github.com/holman/spark
# by Stefan van der Walt <[email protected]>
"""
USAGE: