Skip to content

Instantly share code, notes, and snippets.

View mgedmin's full-sized avatar

Marius Gedminas mgedmin

View GitHub Profile
# Migrate from sentry-comments to build in notes.
#
# See also https://github.com/andialbrecht/sentry-comments/issues/11
# Especially when you're upgrading from Sentry 6.3.
#
# To run this script:
# sentry --config=your.conf.py shell
# >>> import migratecomments.py
# >>> migratecomments.migrate()
#
#!/usr/bin/python
import hashlib, time
try:
from urllib.request import urlopen
except ImportError:
from urllib import urlopen
url = 'https://pypi.python.org/packages/source/v/virtualenv/virtualenv-1.10.1.tar.gz'
md5sum_expected = '3a04aa2b32c76c83725ed4d9918e362e'
response = urlopen(url)
@mgedmin
mgedmin / StartSSL.md
Last active October 22, 2023 07:52
Free StartSSL.com SSL certificate HOWTO

How to get a free StartSSL.com SSL certificate

I'm writing this up from memory, so errors may appear.

This has been updated to use SHA256 certificates.

Start

  1. Go to http://www.startssl.com/
  2. Click on 'Control Panel'
@wuub
wuub / README.md
Last active December 25, 2015 20:59
LD_PRELOAD hook for vaurien proof of concept
  1. compile shared library:
$ cc -shared -fPIC -Wl,--no-as-needed -ldl -lpthread -Wl,-soname=forward.so -o forward.so forward.c
  1. Run standard redis server in separate terminal
$ redis-server
@mgedmin
mgedmin / conf.py.rst
Created July 22, 2013 10:37
HOWTO add "Show on GitHub" and "Edit on GitHub" links to the Sphinx sidebar

Edit on GitHub links for Sphinx

Create _ext/ and _templates/ subdirectories.

Move edit_on_github.py into the _ext/ subdirectory.

Move sourcelink.html into the _templates/ subdirectory.

Add the following after the import sys, os line :

@joejulian
joejulian / set_gnome-terminal_transparency.sh
Last active March 25, 2021 15:01 — forked from nirbheek/set_gnome-terminal_transparency.sh
A tiny script to set the transparency of the current X window. If "all" is specified, it tries to find all gnome-terminal windows and applies the transparency to all of them.
#!/bin/bash
# vim: set sts=4 sw=4 et tw=0 :
#
# License: BSD
: ${XWININFO:=$(type -P xwininfo)}
[[ -z ${XWININFO} ]] && { echo "You need to install xwininfo"; exit 1; }
: ${XPROP:=$(type -P xprop)}
[[ -z ${XPROP} ]] && { echo "You need to install xprop"; exit 1; }
@juliepagano
juliepagano / 101_off_limits.md
Last active December 16, 2020 09:37
101 conversations I generally don't want to have...

This list now exists over at http://juliepagano.com/blog/2013/11/02/101-off-limits/ and will be updated there.

I keep saying that impromptu, unwanted feminism 101 discussions are exhausting and not a good use of my resources. Then people ask what I mean by 101, so I'm starting to make a list. This list will change over time - I recommend checking back.

I highly recommend checking this list before engaging with me about feminism if you're new to it. It'll save both of us a lot of time and frustration.

Diversity in tech

Women aren't equally represented in tech because biology

Nope. This argument is bad and the science does not support it. Unfortunately, every time you say this out loud, you are contributing to cultural problems that do decrease the number of women in tech.

@rygorous
rygorous / gist:5312588
Created April 4, 2013 17:59
GDraw extension wrangling
///////////////////////////////////////////////////////////////////////////////
//
// Extensions (we map to GL 2.0 function names for a uniform interface
// across platforms)
//
#define GDRAW_GL_EXTENSION_LIST \
/* identifier import procname */ \
/* GL_ARB_multitexture */ \
GLE(ActiveTexture, "ActiveTextureARB", ACTIVETEXTUREARB) \
@mgedmin
mgedmin / virtual-bootstrap.sh
Created March 22, 2013 10:30
Shell script to bootstrap a package that uses zc.buildout, wrapped in a virtualenv for site isolation
#!/bin/bash
if [ "${0##*/}" == "virtual-bootstrap-py3" ]; then
python=python3.3
else
python=python2.7
fi
if [ -n "$(netstat -tnl | grep ':3128 ')" ]; then
export http_proxy=http://localhost:3128
echo "Using a local Squid proxy."
fi
@davidfraser
davidfraser / OfficeCleaner.py
Created March 19, 2013 08:24
Clean up XHTML by removing extraneous things - in particular those generated by copying and pasting out of Microsoft Office products
import cssutils
from xml.sax import saxutils
from lxml.html import tostring, fromstring, clean
from lxml import etree
import logging
class Cleaner(clean.Cleaner):
def clean_html(self, html):
if not isinstance(html, unicode):