Skip to content

Instantly share code, notes, and snippets.

View seveas's full-sized avatar

Dennis Kaarsemaker seveas

View GitHub Profile
From 4a9745b590c9912d5e1b6e139f0dcbe374196fad Mon Sep 17 00:00:00 2001
From: Dennis Kaarsemaker <dennis@kaarsemaker.net>
Date: Thu, 8 Nov 2012 10:07:57 +0100
Subject: [PATCH] Add a start delay option that allows healthchecks to run
early
When restarting haproxy with the -sf/-st options, the restart is almost
seamless. The problem is that all state (admin down via socket,
monitoring down) gets lost. This delay allows for health checks to
happen before the listeners start and the older process gets killed,
#include <stdio.h>
#include <string.h>
#include <unistd.h>
void print_cmdline(void);
int main(int argc, char **argv) {
char *end;
print_cmdline();
end = argv[argc-1] + strlen(argv[argc-1]);
sbin/MAKEDEV
sbin/mount.crypt_LUKS
sbin/mount.crypto_LUKS
sbin/umount.crypt_LUKS
sbin/umount.crypto_LUKS
usr/bin/AClock
usr/bin/ANTS
usr/bin/ASFileBrowser
usr/bin/ASRun
usr/bin/ASWallpaper
#!/usr/bin/python
#
# List all files that have ever been committed in this repository, in any
# commit in any branch.
import pygit2
import stat
def list_all_files(repo_path):
repo = pygit2.Repository(repo_path)
@seveas
seveas / .gitconfig
Created November 24, 2012 14:34
Hist alias
[alias]
hist = log --graph --color=always --pretty='[%C(cyan)%h%Creset]%C(bold cyan)%d%Creset %s' --all
@seveas
seveas / post-receive
Created November 2, 2012 20:19
Post receive publishing hook
#!/bin/bash
#
# Hook to copy the contents of a static blog generator to its final location.
# Publishing is now a matter of 'git push blog'
set -e
read oldrev newrev refname
if [ $refname = refs/heads/master ]; then
rev=$(echo $newrev | cut -c1-7)
@seveas
seveas / github_mirror.py
Created July 20, 2012 11:37
Github mirror script
#!/usr/bin/python
#
# Script to mirror github repositories and keep them up-to-date
#
# Usage:
#
# ./github_mirror
#
# It mirrors the configured repositories in the current directory
#
@seveas
seveas / gitconfig.sh
Created April 20, 2012 20:47
Git config from ldap (/etc/profile.d/gitconfig.sh)
# Set git user/email based on ldap values
test -x /usr/bin/git || return
test -x /usr/bin/ldapsearch || return
git config --global user.name > /dev/null || {
name=$(ldapsearch -x -LLL "(uid=$USER)" cn | sed -ne 's/^cn: //p')
test -n "$name" && git config --global user.name "$name"
}
@seveas
seveas / mutt-keyring
Created February 5, 2012 23:38
Make mutt fetch passwords from gnome-keyring
#!/usr/bin/python
#
# Fetch passwords for imap/smtp accounts from gnome-keyring
# Adding passwords to gnome-keyring is up to yourself. Passwords added
# by evolution will be picked up, which may help.
#
# Usage in .muttrc:
# source "~/bin/mutt-keyring $folder $smtp_url|"
import gnomekeyring as gk
@seveas
seveas / init.pp
Created September 27, 2011 21:17
lvm recipe for puppet
class lvm {
}
define lvm::volume(
$lv = "LogVol01",
$vg = "VolGroup00",
$size = "",
$auto_extend = true,
$owner = "root",