Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
set -e
SOURCES="$HOME/Git/misc/microsoft"
VSCODE="$HOME/Downloads/vscode"
VSCODIUM="$HOME/Downloads/vscodium"
REPOS="$HOME/Git/"
ARGS="--extensions-dir $HOME/debugging/extensions"
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2020 Olaf Lessenich <xai@linux.com>
#
# Distributed under terms of the MIT license.
from datetime import timedelta, datetime
import argparse
@xai
xai / reversewords.awk
Created March 3, 2020 10:52
reverse words in second column
{
OFS=FS
n=split($2, words, " ")
$2=""
for(i=n;i>=1;i--) $2=$2 words[i] " "
gsub(/ +$/, "", $2)
print
}

Keybase proof

I hereby claim:

  • I am xai on github.
  • I am xaitax (https://keybase.io/xaitax) on keybase.
  • I have a public key ASATxk26Xp4Br3HtDcOnF60lR6oZw8qNKhjM4hk_l8FDAQo

To claim this, I am signing this object:

@xai
xai / find-by-hash.sh
Last active March 13, 2019 18:16 — forked from mloberg/gist:3750653
Find file in git based on md5 checksum.
#!/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"
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 February 26, 2018 16:17
Merge example
int f(int x) {
return x;
}
@xai
xai / diff.py
Last active March 20, 2017 15:37
Identify changes using libgit2 combined with google's diff approach
#!/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 March 13, 2017 16:32
Anonymize logfiles
#!/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