Skip to content

Instantly share code, notes, and snippets.


Ben Mezger (seds) benmezger

Block or report user

Report or block benmezger

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
benmezger /
Created Dec 11, 2015 — forked from 1stvamp/
Script to install cURL CA certificates on OS X without macports
mkdir /tmp/curl-ca-bundle
cd /tmp/curl-ca-bundle
tar xzf curl-7.22.0.tar.bz2
cd curl-7.22.0/lib/
if [ ! -d /usr/share/curl/ ]; then
sudo mkdir -p /usr/share/curl/
View gist:5081940
import random
import hahaha
import hihihi
print "Hello, this is the end of the file"
In [1]: from modulefinder import ModuleFinder
benmezger / gist:5130523
Created Mar 10, 2013
Perhaps a robotparser module bug?
View gist:5130523
In [65]: rp.set_url("")
In [66]: rp.can_fetch("Hello_crawler", "")
Out[66]: True
In [67]: rp.can_fetch("Hello_crawler", "")
Out[67]: True
benmezger / gist:5135315
Created Mar 11, 2013
robotparser failing?
View gist:5135315
In [2]: import robotparser
In [3]: x = robotparser.
robotparser.Entry robotparser.RuleLine robotparser.urllib
robotparser.RobotFileParser robotparser.URLopener robotparser.urlparse
In [3]: x = robotparser.RobotFileParser()
In [4]: x.set_url("")
benmezger /
Created Dec 30, 2015 — forked from StefanWallin/
nginx ssl config with multiple SNI vhosts and A+ SSL Labs score as of 2014-11-05

Configuring nginx for SSL SNI vhosts



  • My version of konklones SSL config does not have SPDY support(my nginx+openssl does not support it)
  • You need a default ssl server (
  • Some SSL-options have to be unique across your instance, so it's easier to have them in a common file(ssl.conf).
benmezger / nginx.conf
Created Feb 12, 2016 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here
View nginx.conf
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
benmezger / site.conf
Created Feb 12, 2016 — forked from paskal/site.conf
Nginx configuration for best security and modest performance. Full info on
View site.conf
#
# latest version on
# security test score:
# your nginx version might not have all directives included, test this configuration before using in production against your nginx:
# $ nginx -c /etc/nginx/nginx.conf -t
server {
# public key, contains your public key and class 1 certificate, to create:
# (example for startssl)
# $ (cat & wget -O - | tee -a /etc/nginx/ssl/domain.pem > /dev/null
benmezger / README.rst
Created Mar 16, 2016 — forked from dupuy/README.rst
Common markup for Markdown and reStructuredText
View README.rst

Markdown and reStructuredText

GitHub supports several lightweight markup languages for documentation; the most popular ones (generally, not just at GitHub) are Markdown and reStructuredText. Markdown is sometimes considered easier to use, and is often preferred when the purpose is simply to generate HTML. On the other hand, reStructuredText is more extensible and powerful, with native support (not just embedded HTML) for tables, as well as things like automatic generation of tables of contents.

benmezger / index.html
Created Mar 24, 2016
Dynamic URL using javascript (for subdomains with different tld)
View index.html
<pre id="bar"><a id="blog">BLOG</a> XOR <a id="about" title="">ABOUT</a> XOR <a id="code">CODE</a> XOR <a id="photos" title="">PHOTOS</a></pre></td></tr>
function makeUrl(_id){
var protocol = window.location.protocol;
var url ="www.", "");
var new_url = protocol + "//" + _id + "." + url;
document.getElementById(_id).setAttribute("href", new_url);
benmezger /
Created Mar 27, 2016 — forked from bearfrieze/
Comprehensions in Python the Jedi way

Comprehensions in Python the Jedi way

Beautiful is better than ugly. Explicit is better than implicit.

-- The Zen of Python

I frequently deal with collections of things in the programs I write. Collections of droids, jedis, planets, lightsabers, starfighters, etc. When programming in Python, these collections of things are usually represented as lists, sets and dictionaries. Oftentimes, what I want to do with collections is to transform them in various ways. Comprehensions is a powerful syntax for doing just that. I use them extensively, and it's one of the things that keep me coming back to Python. Let me show you a few examples of the incredible usefulness of comprehensions.

All of the tasks presented in the examples can be accomplished with the extensive standard library available in Python. These solutions would arguably be more terse and efficient in some cases. I don't have anything against the standard library. To me there is a certain

You can’t perform that action at this time.