Skip to content

Instantly share code, notes, and snippets.

View seveas's full-sized avatar

Dennis Kaarsemaker seveas

View GitHub Profile
#!/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)
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
@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 / 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 / hpilo.py
Last active October 12, 2019 10:56
# (c) 2011-2013 Dennis Kaarsemaker <dennis@kaarsemaker.net>
# see COPYING for license details
# Test edit!
import os
import platform
import random
import re
import socket
import subprocess
@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 / 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
@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