Skip to content

Instantly share code, notes, and snippets.

@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 / 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: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 / 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 / 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 / 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
#! /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 / gist:5141917
Created March 12, 2013 10:41
Gtk+ failed to build on 10.8.2
brew doctor
Warning: Some installed formula are missing dependencies.
You should `brew install` the missing dependencies:
brew install gtk+
Run `brew missing` for more details.
brew --config
HOMEBREW_VERSION: 0.9.4
@ibeex
ibeex / gist:5568501
Created May 13, 2013 13:59
livestreamer
livestreamer -p "/Applications/VLC.app/Contents/MacOS/VLC -vvv" --verbose-player http://www.twitch.tv/thegdstudio 480p
[cli][info] Found matching plugin justintv for URL http://www.twitch.tv/thegdstudio
[cli][info] Opening stream: 480p
[cli][info] Starting player: /Applications/VLC.app/Contents/MacOS/VLC -vvv
VLC media player 2.0.6 Twoflower (revision 2.0.6-9-gda489c1)
[0x1002070a0] main libvlc debug: VLC media player - 2.0.6 Twoflower
[0x1002070a0] main libvlc debug: Copyright © 1996-2013 VLC authors and VideoLAN
[0x1002070a0] main libvlc debug: revision 2.0.6-9-gda489c1
[0x1002070a0] main libvlc debug: configured with ../extras/package/macosx/../../../configure '--prefix=/Users/fkuehne/Desktop/videolan/gits/vlc-2.0/release/vlc_install_dir' '--enable-macosx' '--enable-merge-ffmpeg' '--enable-growl' '--enable-faad' '--enable-flac' '--enable-theora' '--enable-shout' '--enable-ncurses' '--enable-twolame' '--enable-realrtsp' '--enable-libass' '--enable-macosx-audio' '--enable-macosx-eyetv' '--enable-macosx-qtki
@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