Skip to content

Instantly share code, notes, and snippets.

@bennate
bennate / centos6-x86_64-python_env_setup
Last active February 29, 2016 20:17 — forked from floer32/centos_python_env_setup
CentOS 6: Install Python 2.7.4, pip, virtualenv, and virtualenvwrapper on CentOS (plus some bonus items at the end if you want). You should probably run with `sudo`.
#!/bin/bash
# Source: http://toomuchdata.com/2012/06/25/how-to-install-python-2-7-3-on-centos-6-2/
# Install stuff #
#################
# Install development tools and some misc. necessary packages
yum -y groupinstall "Development tools"
yum -y install zlib-devel # gen'l reqs
"""Simple django admin command for processing incoming bounce reports.
This script depends on flufl.bounce_ for processing the bounce reports. The
flufl packages are a spinoff from the mailman project so are pretty robust and
have good coverage of real-world bounce reports.
You will usually need a small wrapper script to use this with a mail server.
For example to use with sendmail put this in `/etc/smrsh/process_site_bounces`::
#!/bin/sh
@bennate
bennate / gist:10691377
Created April 15, 2014 00:04
Automatic FTP backup for servers using duplicity
Automatic FTP backup for servers
Posted on January 28, 2012
Today I need to find a way to do some backup on an FTP server. Of course there is a lot of way to do that, but I need something automatic that does some full (monthly) and incremental (daily) backup. I decided to use duplicity because it’s a really simple and effective software. The main issue, is that duplicity command line is a bit hard to remember for me. So why not simply write a simple python script that does the job for me.
So here, we are :
#!/usr/bin/python
# Edit DATA and DEST
DATA='/var/www'
DEST='ftp://username:password@ftp.server/backup'
#!/usr/bin/env python
# -*- coding: utf-8 -*-
""" """
import json
from urllib2 import urlopen
from lxml.html import document_fromstring
from lxml.cssselect import CSSSelector as cs
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Simple async crawler/callback queue based on gevent."""
import traceback
import logging
import httplib2
import gevent