Skip to content

Instantly share code, notes, and snippets.

Olaf Lessenich xai

View GitHub Profile
@xai
xai / find-by-hash.sh
Last active Mar 13, 2019 — forked from mloberg/gist:3750653
Find file in git based on md5 checksum.
View find-by-hash.sh
#!/bin/sh
usage() {
echo "Usage: $0 [-m] [-s] hash file"
echo "\t-m use md5 for hashing"
echo "\t-s use sha1 for hashing (this is the default)"
exit 1
}
HASHCMD="sha1sum"
View killfile.sieve
require "vacation";
if anyof (address "From" "bunghole@company.org")
{
vacation :days 1 :addresses ["me@company.org"]
"This mail will not be read by me, it has been expunged to /dev/null instead.
Apparently, I put your mail address into my killfile.
You sent me an unusual amount of annoying, unsolicited, and undesirable mail in the past.
This is not an error, I register each killfile entry manually and very carefully.
@xai
xai / base.c
Created Feb 26, 2018
Merge example
View base.c
int f(int x) {
return x;
}
@xai
xai / diff.py
Last active Mar 20, 2017
Identify changes using libgit2 combined with google's diff approach
View diff.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2017 Olaf Lessenich <xai@linux.com>
#
# Distributed under terms of the MIT license.
import sys
from pygit2 import Repository
@xai
xai / anonymize.py
Created Mar 13, 2017
Anonymize logfiles
View anonymize.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2017 Olaf Lessenich <xai@linux.com>
#
# Distributed under terms of the MIT license.
"""
Anonymize logfiles
You can’t perform that action at this time.