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
pombredanne /
Last active Jan 7, 2020
Unicode re split issues
$ python
Python 3.6.8 (default, Dec 20 2019, 11:17:32)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> a='İrəli'
>>> len(a)
>>> len(a.lower())
>>> import re
pombredanne /
Created Dec 20, 2019 — forked from thomasst/
Migrate Redis data on Amazon ElastiCache
Copies all keys from the source Redis host to the destination Redis host.
Useful to migrate Redis instances where commands like SLAVEOF and MIGRATE are
restricted (e.g. on Amazon ElastiCache).
The script scans through the keyspace of the given database number and uses
a pipeline of DUMP and RESTORE commands to migrate the keys.
Requires Redis 2.8.0 or higher.
pombredanne /
Created Dec 2, 2019 — forked from cicdw/
complete code of the standup Prefect flow
import datetime
from import Client
import random
import requests
import prefect
from prefect import Flow, Parameter, task
from prefect.client import Secret
from prefect.schedules import CronSchedule
pombredanne /
Last active Dec 30, 2019
Eclectic package manager
# -*- coding: utf-8 -*-
# Copyright (c) the purl authors
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#!/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
You can’t perform that action at this time.