Skip to content

Instantly share code, notes, and snippets.

Avatar

Sébastien Fievet zyegfryed

View GitHub Profile
@zyegfryed
zyegfryed / cloudinit.yml
Last active Jul 30, 2021
API error when provisioning VMs with cloud-init
View cloudinit.yml
#cloud-config
apt:
sources:
sury.list:
source: "deb https://packages.sury.org/php $RELEASE main"
key: |
-----BEGIN PGP PUBLIC KEY BLOCK-----
mQGNBFyPb58BDADTDlJLrGJktWDaUT0tFohjFxy/lL2GcVYp4zB981MWIDC0aIQZ
@zyegfryed
zyegfryed / .aliases
Last active Jan 15, 2021
kargo alias
View .aliases
#
# Usage: kargo manifests kargo.edn
#
# Note: MUST be a function and NOT an alias because `pwd` MUST be interpreted each time the command runs.
# When using an alias, `pwd` will resolve to $HOME instead!
#
function kargo() {
docker run --rm -v `pwd`:`pwd` -w `pwd` \
-e ENVIRONMENT=${ENVIRONMENT:=preprod} \
-e ZONE=${ZONE:=ch-gva2-1} \
View .aliases
#
# Usage: cljfmt [check|fix] <FILE_OR_PATH>
#
alias cljfmt="clojure -Sdeps '{:deps {cljfmt/cljfmt {:mvn/version \"0.7.0\"}}}' -m cljfmt.main"
@zyegfryed
zyegfryed / postmortem.md
Created Jun 19, 2020 — forked from mlafeldt/postmortem.md
Example Postmortem from SRE book, pp. 487-491
View postmortem.md

Shakespeare Sonnet++ Postmortem (incident #465)

Date

2015-10-21

Authors

  • jennifer
  • martym
@zyegfryed
zyegfryed / pdf.py
Created Apr 13, 2011
Outputting PDFs with Django and FDFgen
View pdf.py
# -*- coding: utf-8 -*-
import codecs
import subprocess
from fdfgen import forge_fdf
from django.template import Template, loader
from django.template.loader import find_template, LoaderOrigin
class PdfTemplateError(Exception):
@zyegfryed
zyegfryed / initd_tuqtng
Created Nov 28, 2013
Couchbase Query Engine (tuqtng) init script
View initd_tuqtng
#!/bin/bash
#
# /etc/rc.d/init.d/tuqtng
#
# Start up the Couchbase Query Language service daemon
#
# chkconfig: 2345 20 80
#
# processname: tuqtng
# config: /etc/sysconfig/tuqtng
@zyegfryed
zyegfryed / install.sh
Created Aug 24, 2012
pystatsd installation script
View install.sh
apt-get install python-pip
pip install pystatsd
cat > /etc/default/statsd <<EOF
STATSD_PORT=8125 # port to run on (default: 8125)
PCT=90 # stats pct threshold (default: 90)
GRAPHITE_HOST=localhost # host to connect to graphite on (default: localhost)
GRAPHITE_PORT=2003 # port to connect to graphite on (default: 2003)
USER=nobody # user to run statsd as
@zyegfryed
zyegfryed / .env
Created Aug 18, 2012
Procfile and environment file that plays nice with Python and foreman
View .env
PORT=8000
VENV_HOME=/usr/local/venv/develop
PYTHONUNBUFFERED=true
@zyegfryed
zyegfryed / indexes.py
Created Aug 18, 2012
Configurable SearchIndex for Haystack
View indexes.py
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
# Python 2.7 has an importlib with import_module; for older Pythons,
# Django's bundled copy provides it.
try: # pragma: no cover
from importlib import import_module # pragma: no cover
except ImportError: # pragma: no cover
from django.utils.importlib import import_module # pragma: no cover
@zyegfryed
zyegfryed / check_for_updates.py
Created Apr 19, 2011 — forked from coordt/check_for_updates.py
Check locally installed packages against one or more package indexes for updates and list them. Using subprocess instead of stdout (wasn't working on my MacPython 2.6.1)
View check_for_updates.py
#!/usr/bin/env python
"""
Use pip to get a list of local packages to check against one or more package
indexes for updated versions.
"""
import sys
import xmlrpclib
import subprocess
from distutils.version import StrictVersion, LooseVersion