Skip to content

Instantly share code, notes, and snippets.

import os
import signal
import sys
import errno
from jsonrpclib.SimpleJSONRPCServer import SimpleJSONRPCServer
# BOOK-KEEPING
_PIDS = []

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.

@ibeex
ibeex / gist:7318259
Created November 5, 2013 12:21
subversion, build log
%brew --config
HOMEBREW_VERSION: 0.9.5
ORIGIN: https://github.com/mxcl/homebrew.git
HEAD: 83234d9ceb6c88592dd3bb4848e31b59d3da81eb
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
CPU: quad-core 64-bit sandybridge
OS X: 10.8.5-x86_64
Xcode: 5.0.1
CLT: 5.0.1.0.1.1377666378
@ibeex
ibeex / bash
Created August 2, 2016 18:11
qutebrowser
~/Downloads ❯❯❯ python3 -c "import PyQt5; print(PyQt5)" ⏎
<module 'PyQt5' from '/usr/local/lib/python3.5/dist-packages/PyQt5/__init__.py'>
~/Downloads ❯❯❯ python3 -vc "from PyQt5 import QtWebKit" 2&> pyqtbw
import _frozen_importlib # frozen
import _imp # builtin
import sys # builtin
import _frozen_importlib # frozen
import _imp # builtin
import sys # builtin
#!/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
let barposition = "bottom"
map J nextTab
map K previousTab
let hintcharacters = "asdfghjklqwert"
let blacklists = ["http://newsblur.com/*","https://www.ebay.com/*"]
[I] ➜ qutebrowser --debug
11:31:15 DEBUG init earlyinit:init_log:366 Log initialized.
11:31:15 DEBUG init earlyinit:fix_harfbuzz:204 Using system harfbuzz engine (auto)
11:31:16 DEBUG init app:__init__:762 Qt arguments: ['/nix/store/fg1jg2hvk8626p9b45ib78q8hf46qw1n-qutebrowser-0.10.1/bin/.qutebrowser-wrapped'], based on Namespace(backend=None, basedir=None, color=True, command=[], debug=True, debug_exit=False, enable_webengine_inspector=False, force_color=False, harfbuzz='auto', json_args=None, json_logging=False, logfilter=None, loglevel='info', loglines=2000, no_err_windows=False, nowindow=False, override_restore=False, pdb_postmortem=False, qt_arg=None, qt_flag=None, relaxed_config=False, session=None, target=None, temp_basedir=False, temp_basedir_restarted=None, temp_settings=[], url=[], version=False)
Gtk-Message: Failed to load module "unity-gtk-module"
(python3.6m:22623): Gtk-WARNING **: Theme parsing error: gtk-dark.css:384:8: not a number
(python3.6m:22623): Gtk-WARNING *
@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 / foo.log
Created August 4, 2012 13:46
Flask logging example
A warning occurred (42 apples)
An error occurred
@ibeex
ibeex / auth.py
Created October 14, 2011 20:04
Python LDAP (ActiveDirectory) authentication
import ldap
def check_credentials(username, password):
"""Verifies credentials for username and password.
Returns None on success or a string describing the error on failure
# Adapt to your needs
"""
LDAP_SERVER = 'ldap://xxx'
# fully qualified AD user name
LDAP_USERNAME = '%s@xxx.xx' % username