Skip to content

Instantly share code, notes, and snippets.

View pombredanne's full-sized avatar

Philippe Ombredanne pombredanne

View GitHub Profile
#!/usr/bin/env python
#################
## CREDENTIALS ##
#################
GH_PERSONAL_ACCESS_TOKEN = ''
BB_USERNAME = ''
BB_APP_PASSWORD = ''
BB_OAUTH_KEY = ''
@pombredanne
pombredanne / git-repo-mirror.md
Created March 28, 2020 17:56 — forked from schmich/git-repo-mirror.md
Mirroring a repo to BitBucket
@pombredanne
pombredanne / migrate-redis.py
Created December 20, 2019 16:09 — forked from thomasst/migrate-redis.py
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
pombredanne / post_standup_flow.py
Created December 2, 2019 00:17 — forked from cicdw/post_standup_flow.py
complete code of the standup Prefect flow
import datetime
from google.cloud.firestore 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
pombredanne / notbash-parser.py
Created October 10, 2019 09:07 — forked from pyropeter/LICENSE
PKGBUILD parser
#!/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
pombredanne / extractinfo.sh
Created September 22, 2019 14:23 — forked from NicolasEhrhardt/extractinfo.sh
{OpenVPN, Freebox, Ubuntu} Script de reformatage du fichier de configuarion
#/bin/bash
# make output file
basedir=~/.openvpn
vpnconfigdir=$basedir/$2
mkdir -p $basedir
mkdir -p $vpnconfigdir
# print Gateway
sed -n 's/remote \([^ ]\+\) [0-9]\+/passerelle: \1/p' $1
@pombredanne
pombredanne / pyshbang
Created September 10, 2019 08:46 — forked from tritium21/pyshbang
#!/bin/sh
""":"
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
pombredanne / pdfiinfo.py
Created August 11, 2019 22:30 — forked from godber/AUTHORS
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:
Title: PUBLIC MEETING AGENDA
Author: Customer Support
Creator: Microsoft Word 2010
@pombredanne
pombredanne / altgzip.py
Created August 7, 2019 12:25 — forked from nczeczulin/altgzip.py
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
pombredanne / docker_pulp_env.sh
Created August 2, 2019 16:18 — forked from nextrevision/docker_pulp_env.sh
Configures a complete pulp environment with docker-machine
#!/bin/bash
ACTION=$1
PULP_IMAGES=(
pulp/mongodb
pulp/qpid
pulp/base
pulp/worker
pulp/apache