Skip to content

Instantly share code, notes, and snippets.

View agateau's full-sized avatar

Aurélien Gâteau agateau

View GitHub Profile
import os
import sys
import time
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker, relationship
from sqlalchemy import create_engine, Column, Integer, Unicode, ForeignKey
COUNT = 100
@agateau
agateau / git-push
Last active April 4, 2017 09:07
Git hook to prevent pushing to a list of branches
#!/bin/bash
# Copy this as .git/hooks/pre-push
# Customize PROTECTED_BRANCHES
# Make it executable
set -e
PROTECTED_BRANCHES="master release"
confirm() {
local local_branch
@agateau
agateau / zzcat
Created April 16, 2020 10:58
Cat log-rotated log files passed as arguments in the right order, unpacking them with zcat, bzcat or xzcat if necessary.
#!/usr/bin/env python3
"""
Cat log-rotated log files passed as arguments in the right order, unpacking
them with zcat, bzcat or xzcat if necessary.
"""
import argparse
import os
import subprocess
import sys
#!/usr/bin/env python3
"""
Change the installation prefix of a Qt install
"""
import argparse
import os
import sys
from pathlib import Path
@agateau
agateau / whichpkg
Created November 17, 2021 08:24
Scrape packages.ubuntu.com to list packages containing a given file
#!/usr/bin/env python3
"""
Scrape packages.ubuntu.com to list packages containing a given file.
"""
import argparse
import subprocess
import sys
import urllib.request