Skip to content

Instantly share code, notes, and snippets.

View michael-k's full-sized avatar

Michael K. michael-k

  • North Ayrshire, Scotland
View GitHub Profile
#
# Copyright (C) 2013 Vinay Sajip. New BSD License.
#
import os
import os.path
from subprocess import Popen, PIPE
import sys
from threading import Thread
from urllib.parse import urlparse
from urllib.request import urlretrieve
@michael-k
michael-k / git-unsorted-log.go
Last active May 19, 2021 17:14 — forked from timhughes/git-unsorted-log.go
An example of howto use git2go (https://github.com/libgit2/git2go) which is a libgit2 (https://libgit2.github.com/) bindings package for golang.
/*
requires libgit2
*/
package main
import (
"github.com/libgit2/git2go"
"fmt"
@michael-k
michael-k / README.md
Last active August 29, 2015 14:20
Windpool Windparks

Icon windmill.svg was created by Edward Boatman and is licensed as Creative Commons – Attribution (CC BY 3.0).

Create TopoJSON file from GeoJSON files with:

topojson -o de-wind.json --id-property id --properties name=name --properties color=color --properties count=count -- de.geojson wind.geojson
@michael-k
michael-k / git-lfs-diff.sh
Created June 26, 2015 10:22
Git LFS Diff
#!/bin/sh
if [ $# -ne 3 ] ; then
echo "Usage: $0 <ref> <ref> <filename>"
exit 1
fi
RevA=$1
RevB=$2
File=$3
@michael-k
michael-k / docker-compose.md
Last active October 28, 2015 14:47
workarounds

Error:

docker-compose up                                                                                                  :(
nummer5_celery_1 is up-to-date
Starting nummer5_data_1...
Cannot start container aad918df3938b44c4419799b309206e38e66d75e41daf99634444b3771c2fbdd: [8] System error: Unit docker-aad918df3938b44c4419799b309206e38e66d75e41daf99634444b3771c2fbdd.scope already exists.

Workaround:

from collections import defaultdict
import datetime
import pandas as pd
def data(filename='/home/mfk/Halbstd-Werte-Stuttgart-Mitte-SZ_2015.xls', sheetname='Okt. 2015'):
raw_data = pd.read_excel(
io=filename,
sheetname=sheetname,
@michael-k
michael-k / Dockerfile
Created March 7, 2017 18:22 — forked from mixja/Dockerfile
Docker Health Check using Make
FROM nginx
HEALTHCHECK --interval=3s --retries=20 CMD curl -fs http://localhost:${HTTP_PORT:-8000}
#!/bin/bash
set -e
# Installation
# 1. Setup go-acd (https://github.com/go-acd/acd). You need to chmod
# acd-token.json to 0600 and manually create $HOME/.config/acd.json
# like the following:
# {"tokenFile":"/home/you/.config/acd-token.json","cacheFile":"/home/you/.cache/go-acd.cache"}
# Then make sure the `acd` command works. Note that the first run may
# take some time as it will fetch the full list of your files on ACD.
## Böblinger-Strasse
curl -X POST "http://www.eco-public.com/ParcPublic/CounterData?table=ecobdd.%60Z_100034894%60&idOrganisme=607&idPdc=100034894&fin=09%2F06%2F2017&debut=01%2F01%2F2017&interval=4&pratiques=101034894%3B102034894%3B103034894%3B104034894"
## König-Karls-Brücke
curl -X POST "http://www.eco-public.com/ParcPublic/CounterData?table=ecobdd.%60Z_100037170%60&idOrganisme=607&idPdc=100037170&fin=09%2F06%2F2017&debut=01%2F01%2F2017&interval=4&pratiques="
@michael-k
michael-k / 01_postfix_installer.md
Created October 28, 2017 20:02 — forked from solusipse/01_postfix_installer.md
Postfix + Dovecot + Postgresql + Postfixadmin + Roundcube

Postfix Installer

Following script may be used for configuring complete and secure email server on fresh install of Debian 7. It will probably work on other distributions using apt-get. After minor changes you'll be able to use it on other Linux distros.

Usage

  1. Run postfix.sh script.
  2. Configure postgres to allow connections.
  3. Configure postfix admin. Remember to set these: