Skip to content

Instantly share code, notes, and snippets.

View nwillems's full-sized avatar

Nicolai Willems nwillems

View GitHub Profile
@nwillems
nwillems / 00-readme.md
Last active June 3, 2021 06:35
A small utility to read parquet files

Parquet Browser

this small utility allows you to view the schema of a file and browse the data. thats it. then theres a small exploratory script.

@nwillems
nwillems / pipeline.py
Created November 24, 2020 13:33
Python Async Pipelined functions
import functools
import inspect
def asynchronize(fn):
if inspect.iscoroutinefunction(fn):
return fn
@functools.wraps(fn)
async def _wrapper(*args, **kwargs):
return fn(*args, **kwargs)
@nwillems
nwillems / README.md
Last active September 7, 2020 13:19
encode/databases inflater thingamajig

Run using ipython:

$ poetry run ipython
Python 3.8.2 (default, Jul 16 2020, 14:00:26)
Type 'copyright', 'credits' or 'license' for more information
IPython 7.18.1 -- An enhanced Interactive Python. Type '?' for help.

In [1]: import index
@nwillems
nwillems / README.md
Last active July 25, 2019 14:15
Terraform wrapper script to run inside of a docker container

Run terraform in a container!

This file should just be in your path and your terraform codebase located in a folder called terraform. Then just run it like this:

terraformw init
terraformw plan -out plan.tfplan
terraformw apply plan.tfplan
@nwillems
nwillems / Dockerfile
Last active June 5, 2018 08:10
cali-example
FROM scratch
COPY cali-example /tool
ENTRYPOINT ["/tool"]
@nwillems
nwillems / caconfig.cnf
Last active January 1, 2016 16:49
Procedure to make ca/server/client certificates for a MiG development setup
[ ca ]
default_ca = CA_default
[ CA_default ]
dir = /home/mig/certs
serial = $dir/serial
database = $dir/index.txt
new_certs_dir = $dir/certs
certificate = $dir/cacert.crt
private_key = $dir/cacert.key
default_days = 365
@nwillems
nwillems / readme.md
Last active December 22, 2015 23:39
Little script to provide link for the currently playing song on Berri radio(http://m.fatberris.com/)

When on http://m.fatberris.com press the F12-button and go to the console-tab. Copy and paste the below script into the console and press enter, skip a song, and the link appears together with remaining time.

# LOTS OF COMMENTS REMOVED FROM TOP
# DO NOT DISABLE!
# If you change this first entry you will need to make sure that the
# database superuser can access the database using some other method.
# Noninteractive access to all databases is required during automatic
# maintenance (custom daily cronjobs, replication, and similar tasks).
#
# Database administrative login by Unix domain socket
local all postgres peer
@nwillems
nwillems / nrpe.cfg
Created November 15, 2012 14:52
Nagios remote client configuration
#############################################################################
# Sample NRPE Config File
# Written by: Ethan Galstad (nagios@nagios.org)
#
# Last Modified: 11-23-2007
#
# NOTES:
# This is a sample configuration file for the NRPE daemon. It needs to be
# located on the remote host that is running the NRPE daemon, not the host
# from which the check_nrpe client is being executed.
@nwillems
nwillems / util.js
Last active August 29, 2015 14:23
Javascript Clone array
// Fire away with comments - I'd like to know faster or more compact
// or what-ever-measure-you-like solutions
function clone(a){
return Array.apply(null, a);
}
// NOTE-to-Self: DONT EVER DO "arr.length--" it WILL mutate array!