Skip to content

Instantly share code, notes, and snippets.

View paulegan's full-sized avatar

Paul Egan paulegan

View GitHub Profile
@paulegan
paulegan / process_bounce_email.py
Created February 1, 2012 05:17
Simple django admin command for processing incoming bounce reports
"""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
@paulegan
paulegan / example.ini
Last active December 14, 2015 06:29
Script for sharing secure data with colleagues by encrypting ini-format file with gpg keys.Import others' public gpg keys to your keyring and then use `ACCESS` section to specify which users or groups can decrypt which ini sections ("*" for everything). On edit/save, a separate encrypted file is created for each user or group. Commit the resulti…
[ACCESS]
myusername = *
email@address = host1 site1
GPG_GROUP = sectionA
[host1]
username = user1
password = xxx
[site1]
@paulegan
paulegan / mule.py
Created April 25, 2014 09:04
uwsgi signal test
import signal
def handler(signum, frame):
print 'trapped', signum
signal.signal(signal.SIGHUP, handler)
signal.signal(signal.SIGALRM, handler)
signal.alarm(1)
while True:
#!/usr/bin/env python
import sys
import os
import glob
from distutils.cmd import Command
from distutils.command.build import build
from setuptools.command.install import install
from setuptools import setup, find_packages
@paulegan
paulegan / bookmarklet.js
Last active March 5, 2017 00:39
Bookmarklet for sorting feedly entries by engagement
javascript:(function () {
function engagement(entry) {
var e = entry.querySelector('[data-dot="engagement-count"]');
if (e) {
var t = e.innerText;
var x = t[t.length - 1] === 'K' ? 1000 : 1;
return parseInt(t) * x;
} else {
return 0;
}
@paulegan
paulegan / modules.txt
Last active August 29, 2015 14:21
baked.js escaping issue
baked@0.2.1:
ecstatic:ecstatic@0.5.8:
ecstatic/node_modules/he:he@0.5.0:
ecstatic/node_modules/mime:mime@1.3.4:
ecstatic/node_modules/minimist:minimist@1.1.1:
ejs:ejs@1.0.0:
gulp:gulp@3.8.11:
gulp/node_modules/archy:archy@1.0.0:
gulp/node_modules/chalk:chalk@0.5.1:
gulp/node_modules/chalk/node_modules/ansi-styles:ansi-styles@1.1.0:
@paulegan
paulegan / settings.py
Created October 20, 2015 15:08
Example of decrypting configuration variables in Python settings file
import os
try:
from Crypto.Cipher import AES as aes
key, iv = os.environ['SETTINGS_KEY'].split(':')
except (ImportError, KeyError):
def _decrypt(s):
return s
else:
def _decrypt(s):
@paulegan
paulegan / dabblet.css
Created December 5, 2017 21:47
Untitled
background-image: linear-gradient(45deg, transparent 50%, rgba(0,0,0,0.1) 50%),
linear-gradient(to bottom right, #1ad162, #68d162, #dfc056, #e55727, #d2100b);
background-size: 5vw 5vw, 100vw 100vh;
color: white;
@paulegan
paulegan / _INSTAPAPER TO FEEDLY_ README.md
Last active March 14, 2023 23:44
Script to that takes Instapaper csv export and imports to Feedly as new entries under a board/tag
@paulegan
paulegan / Location History.ipynb
Last active July 2, 2018 13:19
Location History
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.