Skip to content

Instantly share code, notes, and snippets.

View ThomDietrich's full-sized avatar

Thomas Dietrich ThomDietrich

  • Erfurt, Germany
View GitHub Profile
@ThomDietrich
ThomDietrich / git-anonymize
Created January 12, 2021 12:17 — forked from pozorvlak/git-anonymize
Anonymise Git history
#!/bin/sh
# Suppose you want to do blind reviewing of code (eg for job interview
# purposes). Unfortunately, the candidates' names and email addresses are
# stored on every commit! You probably want to assess each candidate's version
# control practices, so just `rm -rf .git` throws away too much information.
# Here's what you can do instead.
# Rewrite all commits to hide the author's name and email
for branch in `ls .git/refs/heads`; do
@ThomDietrich
ThomDietrich / restic-benchmark-dedup.sh
Last active August 12, 2020 22:46
Benchmark to understand the effect of compressed archives on a restic repository
#!/bin/bash
BASE="$(pwd)/temp_test_deduplication"
SOURCE="$BASE/input"
REPO_BASE="$BASE/repo"
NUM_FILES=16
FILE_SIZE="8M"
export RESTIC_PASSWORD="password123"
############################################################
@ThomDietrich
ThomDietrich / amtrak.csv
Last active March 11, 2019 08:56 — forked from brentajones/amtrak.csv
Amtrak stations, dumped from National Transportation Atlas Database (2015) - Fix newlines and tabs
We can make this file beautiful and searchable if this error is corrected: It looks like row 9 should actually have 12 columns, instead of 2. in line 8.
X,Y,OBJECTID,STNCODE,STNNAME,ADDRESS1,ADDRESS2,CITY,STATE,ZIP,STNTYPE,STFIPS
-82.44084200005824,38.415404999740986,1,HUN,"Huntington, West Virginia",1050 8th Avenue,,Huntington,WV,25701,RAIL,54
-97.930060999815225,38.055858999992893,2,HUT,"Hutchinson, Kansas",North Walnut St & East 3rd Ave,,Hutchinson,KS,67501,RAIL,20
-85.469924999738907,43.395728999693631,3,HWC,"Howard City, Michigan",130 North Ensley St.,Sunoco Station,Howard City,MI,49323,BUS,26
-116.233170000495079,33.714751999705072,4,IDO,"Indio, California",NE Corner Hywy-111 and Monroe Street,Sunline Bus Stop,Indio,CA,92201-3917,BUS,06
-94.429297999503035,39.086975000296093,5,IDP,"Independence, Missouri",600 South Grand Ave.,,Independence,MO,64050-3564,RAIL,29
-86.160309000060295,39.762154000007172,6,IND,"Indianapolis, Indiana",350 South Illinois Street,,Indianapolis,IN,46225-1198,RAIL,18
-117.759192999657159,33.674767000296868,7,IRV,"Irvine, California",15215 Barranca Parkway,Irvine Transportation Center,Irvine,CA,92618,RAIL,06
-90.190598000297427,32.
@ThomDietrich
ThomDietrich / keybase.md
Created February 13, 2018 14:17
keybase.md

Keybase proof

I hereby claim:

  • I am thomdietrich on github.
  • I am thomdietrich (https://keybase.io/thomdietrich) on keybase.
  • I have a public key ASAgis3tR2csGySTlVf2bElWhPNDi7_SdtT_m6bT7PNl8wo

To claim this, I am signing this object:

@ThomDietrich
ThomDietrich / diff.diff
Last active February 3, 2017 13:39
Diff
diff --git i/addons/bindings.md w/addons/bindings.md
index 87cc88d..7211ef3 100644
--- i/addons/bindings.md
+++ w/addons/bindings.md
@@ -7,20 +7,23 @@ title: Bindings
# Bindings
-Bindings connect your smart home's devices and technologies to openHAB.
+Bindings connect your smart home's devices and technologies to openHAB.
@ThomDietrich
ThomDietrich / README.md
Created December 21, 2016 16:59
kodi PR

Kodi Binding

Kodi (formerly known as XBMC) is an free and open source (GPL) software media center for playing videos, music, pictures, games, and more. Kodi runs on Linux, OS X, Windows, iOS, and Android. It allows users to play and view most videos, music, podcasts, and other digital media files from local and network storage media and the internet.

The Kodi Binding integrated Kodi media center support with openHAB, allowing both controlling the player as well as retrieving player status data like the currently played movie title.

The Kodi binding is the successor to the openHAB 1.x xbmc binding.

@ThomDietrich
ThomDietrich / gist:df9fb52ac2a5be466963c3b1c219a27e
Last active November 1, 2016 17:52
How to create multiple PullRequests
I found it very useful to use a GUI in the beginning. Many might argue that only by using the command line you will really understand the git internals but that's not what you are looking for in the beginning. I can recommend **GitKraken** as an easy to use and intuitive solution and my personal favorite is **SmartGit** (powerful, free, platform independent). I can not recommend the famous SourceTree as it will just throw the command line output at you and you'll have to figure out what's going on... in this case you are better off with the command line to begin with... But that is just my opinion!
Example for what you did here, maybe it's useful to kickstart your crash course:
* The first thing you do is **create a fork** of my repository on GitHub. Neither of the mentioned clients can do that for you (there are yet other tools out there).
* Next you would **clone your repository** in SmartGit and make sure to tick **"Create upstream remote"**. This way you will not only clone your repo but also see chang
@ThomDietrich
ThomDietrich / sine.py
Last active February 6, 2020 00:04 — forked from otoolep/sine.py
Pump a sine wave signal as data points into a influxdb database
#!/usr/bin/python
# A little script to send test data to an influxdb installation
# Attention, the non-core library 'requests' is used. You'll need to install it first:
# http://docs.python-requests.org/en/master/user/install/
import json
import math
import requests
import sys
@ThomDietrich
ThomDietrich / git-create-revisioninfo-hook.sh
Last active December 19, 2022 15:23
git hook for revision and branch version file
#!/bin/bash
## Automatically generate a file with git branch and revision info
##
## Example:
## [master]v2.0.0-beta-191(a830382)
## Install:
## cp git-create-revisioninfo-hook.sh .git/hooks/post-commit
## cp git-create-revisioninfo-hook.sh .git/hooks/post-checkout
## cp git-create-revisioninfo-hook.sh .git/hooks/post-merge
@ThomDietrich
ThomDietrich / zfs_report.sh
Created January 5, 2016 12:22 — forked from cypres/zfs_report.sh
ZFS scripts
#!/bin/sh
echo "ZFS listing:"
/sbin/zfs list
echo
echo "ZFS compression ratio:"
/sbin/zfs get compressratio | /usr/bin/grep -v @
echo