Skip to content

Instantly share code, notes, and snippets.

View fossilet's full-sized avatar
🎯

2f38b454 fossilet

🎯
View GitHub Profile
@fossilet
fossilet / ldap_proxy.py
Last active December 16, 2016 03:15
LDAP proxy with logs
#! /usr/bin/env python
# encoding: utf8
import sys
from functools import partial
from ldaptor.protocols import pureldap
from ldaptor.protocols.ldap import ldapserver
from ldaptor.protocols.ldap.ldapclient import LDAPClient, \
LDAPClientConnectionLostException
@fossilet
fossilet / supervisord
Last active December 16, 2016 03:19
Supervisor 3 init script for CentOS 6.5. `pip install supervisor` does not contain an init script. This adds one.
#!/bin/sh
#
# From: http://serverfault.com/a/259230/53861
#
# INSTALL:
# sudo cp supervisord /etc/init.d
# sudo chkconfig --add supervisord
# sudo chkconfig supervisord on
# service supervisord start
#
@fossilet
fossilet / rqretryworker.py
Created November 2, 2016 07:48 — forked from spjwebster/rqretryworker.py
A basic rq worker that will retry failed jobs before dumping it in the failed queue.
#!/usr/bin/env python
import os, sys
sys.path.append(os.getcwd())
import logging
import rq
MAX_FAILURES = 3
@fossilet
fossilet / getip.py
Created September 19, 2012 04:02 — forked from zhasm/getip.py
Get the local IP and Public IP
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
#
# author : Rex Zhang
"""Get the local IP and Public IP"""
import re
from subprocess import Popen, PIPE
from threading import Lock
@fossilet
fossilet / imapquota.py
Created September 18, 2012 11:27 — forked from zhasm/imapquota.py
Check the quota and usage of the IMAP server.
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
'''Get quota from IMAP server
'''
import argparse
import getpass
import imaplib
import re