Skip to content

Instantly share code, notes, and snippets.

FROM debian:bullseye-slim
RUN apt-get update && apt-get -y install --no-install-recommends wget gnupg ca-certificates && rm -rf /var/lib/apt/lists/*
RUN wget https://www.postgresql.org/media/keys/ACCC4CF8.asc -O /etc/apt/trusted.gpg.d/pgdg.asc
RUN echo "deb http://apt.postgresql.org/pub/repos/apt bullseye-pgdg main" > /etc/apt/sources.list.d/pgdg.list
RUN wget https://packagecloud.io/timescale/timescaledb/gpgkey -O /etc/apt/trusted.gpg.d/timescaledb.asc
RUN echo "deb https://packagecloud.io/timescale/timescaledb/debian/ bullseye main" > /etc/apt/sources.list.d/timescaledb.list
RUN apt-get update && apt-get -y install --no-install-recommends \
postgresql-12 \
timescaledb-2-loader-postgresql-12 \
timescaledb-2-postgresql-12 \
@philpep
philpep / watchtower.py
Created August 20, 2018 07:48
Update k8s deployment images when new versions are pushed (by comparing image sha256 digest)
#!/usr/bin/env python3
import collections
import json
import logging
import re
import subprocess
import sys
LOG = logging.getLogger(__name__)
@philpep
philpep / mutt-editor
Created October 30, 2017 16:38
Async editor for mutt
#!/bin/sh
# Async editor for mutt
# Usage: set editor=/path/to/this/script
# It spawn editor in a new background terminal so I can continue reading mail
# while editing.
# The title of the terminal is set to "mutt-edit", this allow me to make it
# floating in i3 with:
# for_window [title="mutt-edit"] floating enable
set -e
@philpep
philpep / test_jenkins.py
Created July 29, 2017 22:00
testinfra docker jenkins example
import docker
import pytest
import testinfra
@pytest.fixture(scope="module", name="host")
def docker_host():
client = docker.from_env()
container = client.containers.run("jenkins", detach=True)
yield testinfra.get_host("docker://{}".format(container.id))
#!/usr/bin/env python
from __future__ import print_function
import ansible.executor.task_queue_manager
import ansible.inventory
import ansible.parsing.dataloader
import ansible.playbook.play
import ansible.plugins.callback
import ansible.vars
@philpep
philpep / vimrc
Created June 15, 2015 09:53
python minimal vimrc
syn on
filetype plugin indent on
autocmd Filetype python set et smarttab ts=4 sw=4 list lcs=tab:>-,trail:.,nbsp:_
@philpep
philpep / wheezy64.conf
Created August 19, 2013 13:11
/etc/ganeti/instance-debootstrap/variants/wheezy64.conf
PROXY="http://192.168.31.254:3142/"
MIRROR="http://ftp.fr.debian.org/debian"
SUITE="wheezy"
ARCH="amd64"
EXTRA_PKGS="acpi-support-base,console-tools,udev,locales,openssh-server,debian-archive-keyring,bzip2,python-apt"
#define LEN(x) (sizeof(x)/sizeof(x[0]))
/* connected leds (map temperature between 0°C and 64 °C) */
static int leds[] = {13, 12, 11, 10, 9, 8};
void setup(void)
{
int i;
Serial.begin(9600);
for (i = 0; i < LEN(leds); i++) {
pinMode(leds[i], OUTPUT);
@philpep
philpep / tempduino.pde
Created January 15, 2012 23:38
Arduino binary temperature meter
#define LEN(x) (sizeof(x)/sizeof(x[0]))
/* connected leds (map temperature between 0°C and 64 °C) */
static int leds[] = {13, 12, 11, 10, 9, 8};
void setup(void)
{
int i;
Serial.begin(9600);
for (i = 0; i < LEN(leds); i++) {
pinMode(leds[i], OUTPUT);
@philpep
philpep / backup_zfs.sh
Created June 23, 2011 20:05
zfs backup script
#!/bin/sh
set -e
# Used in ssh command, example user@host -p 2222
REMOTE_HOST="diophante"
# Source zfs pool
POOL_SRC="tank"