Skip to content

Instantly share code, notes, and snippets.

View seveas's full-sized avatar

Dennis Kaarsemaker seveas

View GitHub Profile
@seveas
seveas / stdout
Last active January 5, 2021 19:23
#!/bin/bash
if [ "$1" == "--noop" ]; then
NOOP=1
VERBOSE=1
fi
# We only support stretch or newer
if [ "$(lsb_release -cs)" == "jessie" ]; then
exit 0
@seveas
seveas / .deploy
Last active December 21, 2020 17:31
#!/bin/bash
#
# Usage:
#
# To deploy the current branch to production
#
# .deploy
#
# To deploy the current branch to a different environment
#
package scattergather
import (
"context"
"sync"
)
type ScatteredFunction func(context.Context, ...interface{})(interface{}, error)
type ScatterGather struct {
@seveas
seveas / rover.py
Last active July 1, 2017 20:38 — forked from andywarburton/rover.py
simple script for controlling motors and lights with piborg zero motor controller and a raspberry pi
#!/usr/bin/env python
# coding: Latin-1
# Load library functions we want
from inputs import get_gamepad
import piconzero as pz
import time
import sys
import random
import colorsys
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://nl.archive.ubuntu.com/ubuntu/ xenial main restricted
deb-src http://nl.archive.ubuntu.com/ubuntu/ xenial main restricted
## Major bug fix updates produced after the final release of the
## distribution.
deb http://nl.archive.ubuntu.com/ubuntu/ xenial-updates main restricted
deb-src http://nl.archive.ubuntu.com/ubuntu/ xenial-updates main restricted
options {
directory "/home/dennis/pdns-bug/inst/var/run/pdns-server/";
};
zone "example.com" IN {
type master;
file "example.com.zone";
};
<VirtualHost 10.0.0.1:80>
ServerName git.example.com
DocumentRoot /gitroot
# smart transport
SetEnv GIT_PROJECT_ROOT /gitroot
ScriptAlias /git/ /usr/libexec/git-core/git-http-backend/
1 cherry-pick
1 credential-cache
1 gc
1 help
1 minitrue
1 mv
1 rm
1 shortlog
1 staus
1 unpack
cd /tmp
mkdir foo
cd foo
git init
fortune > bar
git add bar
git commit "-m$(fortune)"
git tag base
for i in $(seq 4096); do echo "--- $i ---"; git checkout -b branch-$i base; fortune > bar-$i; git add bar-$i; git commit "-m$(fortune)"; done
git checkout base
[dkaarsemaker@blog-001 ~]$ cat /srv/blog/blog.git/hooks/post-receive
#!/bin/bash
BLOG_PATH="/srv/blog";
REPO_PATH="${BLOG_PATH}/blog.git/";
WWW_PATH="${BLOG_PATH}/current";
CURRENT_SHA1=`cat ${REPO_PATH}/refs/heads/master`;
PUBLISH_DIR="${BLOG_PATH}/${CURRENT_SHA1}";
WORK_DIR="${PUBLISH_DIR}_workdir"