Skip to content

Instantly share code, notes, and snippets.

View dhaavi's full-sized avatar

Daniel Hååvi dhaavi

View GitHub Profile
@dhaavi
dhaavi / config.go
Created October 30, 2019 13:49
Demo files for Talk at Go Meetup in Vienna in Oct. 2019
package main
import (
"fmt"
"github.com/safing/portbase/config"
)
// Config
// - simple, fast and easy configuration
time="2018-03-31T02:33:38.863806041+02:00" level=error msg="fatal task error" error="task: non-zero exit (1)" module="node/agent/taskmanager" node.id=9b86viugse9yh6v2zxemg1cqq service.id=x3ap89sl25payazto5pqe1gtu task.id=w25v4hvjgo4bd844qxgqimmk7
fatal error: concurrent map iteration and map write
goroutine 71835668 [running]:
runtime.throw(0x561fd25ae7bf, 0x26)
/usr/lib/go/src/runtime/panic.go:596 +0x97 fp=0xc4272e7110 sp=0xc4272e70f0
runtime.mapiternext(0xc4272e7480)
/usr/lib/go/src/runtime/hashmap.go:737 +0x7f0 fp=0xc4272e71c0 sp=0xc4272e7110
runtime.mapiterinit(0x561fd2bb2140, 0xc44003ba10, 0xc4272e7480)
/usr/lib/go/src/runtime/hashmap.go:727 +0x2b5 fp=0xc4272e7218 sp=0xc4272e71c0
@dhaavi
dhaavi / investigate-django-dump.py
Created September 29, 2017 12:47
Small script for investigating and extracting parts of a django dumpdata json dump
#!/usr/bin/env python
# usage:
#
# print single record:
# ./investigate-django-dump.py [file] print 1
#
# extract chosen records by [app_label].[model] prefix:
# ./investigate-django-dump.py [file] extract contenttypes.
# ./investigate-django-dump.py [file] extract auth.