Skip to content

Instantly share code, notes, and snippets.

Working from home

Ben Mezger (seds) benmezger

Working from home
View GitHub Profile
View gist:2774857
Author: Ephexeve M
Date: Mon May 21 11:48:10 CEST 2012
System: Unix
import pages
from sys import argv, exit
View gist:2774941
if response.status:
if self.write:
with open(self.filename, "w") as data:
data.writelines("\n" + host + "--" + str(response.status))
print "%s Status: %s" % (host, response.status)
benmezger / gist:3923484
Created Oct 20, 2012 — forked from aukevs/gist:2169369
Happy Birthday Ben
View gist:3923484
# student.rb
class Student
def age
unless read_attribute(:birthdate) == nil
dob = read_attribute(:birthdate)
now =
now.year - dob.year - ((now.month > dob.month || (now.month == dob.month && >= ? 0 : 1)
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("")

My modified fork of agnoster.zsh-theme

A ZSH theme optimized for people who use:

  • Solarized
  • Git
  • Unicode-compatible fonts and terminals (I use iTerm2 + Menlo)



Linux Backup Solutions

I've been looking for the best Linux backup system, and also reading lots of HN comments.

Instead of putting pros and cons of every backup system I'll just list some deal-breakers which would disqualify them.

Also I would like that you, the HN community, would add more deal breakers for these or other backup systems if you know some more and at the same time, if you have data to disprove some of the deal-breakers listed here (benchmarks, info about something being true for older releases but is fixed on newer releases), please share it so that I can edit this list accordingly.

Bacula (from the Why section on Burp)

  • Too complex to configure
  • Stores catalog separate from backups, need to backup catalog
benmezger / The Technical Interview Cheat
Last active Aug 29, 2015 — forked from TSiege/The Technical Interview Cheat
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.
View The Technical Interview Cheat

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

###Array ####Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.
benmezger / preprocessor_fun.h
Last active Aug 29, 2015 — forked from aras-p/preprocessor_fun.h
Things to commit just before leaving your job
View preprocessor_fun.h
// Just before switching jobs:
// Add one of these.
// Preferably into the same commit where you do a large merge.
// This started as a tweet with a joke of "C++ pro-tip: #define private public",
// and then it quickly escalated into more and more evil suggestions.
// I've tried to capture interesting suggestions here.
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_,
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant,
You can’t perform that action at this time.