Skip to content

Instantly share code, notes, and snippets.

Philippe Ombredanne pombredanne

Block or report user

Report or block pombredanne

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
#!/usr/bin/env python2
# This is a parser for bash-style variable assignments.
# It fully (?) supports the syntax w/o braces, the ${}-syntax
# is implemented very hackish. (There are also detailed
# TODO-comments in various places)
# This is meant for Archlinux' AUR to be used to parse
# PKGBUILD's properly.
pombredanne /
Created Sep 22, 2019 — forked from NicolasEhrhardt/
{OpenVPN, Freebox, Ubuntu} Script de reformatage du fichier de configuarion
# make output file
mkdir -p $basedir
mkdir -p $vpnconfigdir
# print Gateway
sed -n 's/remote \([^ ]\+\) [0-9]\+/passerelle: \1/p' $1
View pyshbang
which python3 >/dev/null 2>&1 && exec python3 "$0" "$@"
which python >/dev/null 2>&1 && exec python "$0" "$@"
which python2 >/dev/null 2>&1 && exec python2 "$0" "$@"
echo "Error: configure wrapper requires python"
exec echo "Either install python, or use cmake directly"
pombredanne / SPDX License Expressions
Last active Sep 7, 2019
SPDX License Expressions 2.0 and 2.1
View SPDX License Expressions
# SPDX License Expressions
## Overview
Often a single license can be used to represent the licensing terms of a source
code or binary file, but there are situations where a single license identifier
is not sufficient. A common example is when software is offered under a choice
of one or more licenses (e.g., GPL-2.0 OR BSD-3-Clause). Another example is when
a set of licenses is needed to represent a binary program constructed by
compiling and linking two (or more) different source files each governed by
pombredanne /
Created Aug 11, 2019 — forked from godber/
A simple python wrapper of the pdfinfo command line tool.
def pdfinfo(infile):
Wraps command line utility pdfinfo to extract the PDF meta information.
Returns metainfo in a dictionary.
sudo apt-get install poppler-utils
This function parses the text output that looks like this:
Author: Customer Support
Creator: Microsoft Word 2010
pombredanne /
Created Aug 7, 2019 — forked from nczeczulin/
Ignore gzip trailing garbage during reads.
import gzip
import logging
_logger = logging.getLogger(__name__)
# monkey patch for 2.7
import sys
if sys.version_info[:2] == (2, 7):
# ripped from py 3.4 gzip module
# modified for py 2.7 _read()
def read1(self, size=-1):
pombredanne /
Created Aug 2, 2019 — forked from nextrevision/
Configures a complete pulp environment with docker-machine
pombredanne / gist:1e0450539cf6945b02a79f0b30a6ce39
Created Jul 17, 2019 — forked from bessarabov/gist:674ea13c77fc8128f24b5e3f53b7f094
One-liner to generate data shown in post 'At what time of day does famous programmers work?' —
View gist:1e0450539cf6945b02a79f0b30a6ce39
git log --author="Linus Torvalds" --date=iso | perl -nalE 'if (/^Date:\s+[\d-]{10}\s(\d{2})/) { say $1+0 }' | sort | uniq -c|perl -MList::Util=max -nalE '$h{$F[1]} = $F[0]; }{ $m = max values %h; foreach (0..23) { $h{$_} = 0 if not exists $h{$_} } foreach (sort {$a <=> $b } keys %h) { say sprintf "%02d - %4d %s", $_, $h{$_}, "*"x ($h{$_} / $m * 50); }'
# 1. fetch
# 2. cd to the directory where this is saved and run this:
python -c "import tarfile;'non_unicode.tgz').extractall(u'.')"
You can’t perform that action at this time.