Skip to content

Instantly share code, notes, and snippets.

#! /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 / cli output
Created December 4, 2012 08:30
homebrew Issue #16269
Mac7o% brew doctor
Your system is raring to brew.
Mac7o [brew doctor] ~ 12-12-04 9:26AM
Mac7o% brew --config
HOMEBREW_VERSION: 0.9.3
HEAD: fc7e4d799c4c212e0843b6ad3d3e72fc09fb4d34
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
@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 / gist:1510386
Created December 22, 2011 13:59
Reliably run unreliable processes
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Run forking multiprocess workers with emphasis's on running reliably long running processes, that
are for one or other reason prone to random crashing. Can be demonised with
http://www.jejik.com/articles/2007/02/a_simple_unix_linux_daemon_in_python/
"""
@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 <stefan@sun.ac.za>
"""
USAGE:
@ibeex
ibeex / gist:1400432
Created November 28, 2011 13:39
Simple web server watchdog
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Simple web server watchdog, edit constants and stop start commands
preferably run with daemon
http://www.jejik.com/articles/2007/02/a_simple_unix_linux_daemon_in_python/
"""
@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