Skip to content

Instantly share code, notes, and snippets.

Avatar
🛸

Thomas Jost Schnouki

🛸
View GitHub Profile
View goaccess.c.diff
diff --git src/goaccess.c src/goaccess.c
index 9cd14bb..1057acb 100644
--- src/goaccess.c
+++ src/goaccess.c
@@ -1262,36 +1262,45 @@ set_pipe_stdin (void)
{
char *term = NULL;
FILE *pipe = stdin;
- int fd1, fd2;
+ int term_fd = -1;
@Schnouki
Schnouki / start-gitlab-runner.service
Created Oct 25, 2018
Start and stop gitlab-runner with systemd timers
View start-gitlab-runner.service
[Unit]
Description=Start gitlab-runner every morning
[Service]
Type=oneshot
ExecStart=/usr/bin/systemctl start gitlab-runner.service
@Schnouki
Schnouki / middleware.py
Last active Feb 10, 2021
WhiteNoiseMiddleware that restrics access to sourcemaps to authorized users
View middleware.py
import fnmatch
from django.conf import settings
from django.http import HttpResponseForbidden
from whitenoise.middleware import WhiteNoiseMiddleware
class AuthenticatedWhiteNoiseMiddleware(WhiteNoiseMiddleware):
def __init__(self, *args, **kwargs):
@Schnouki
Schnouki / git-branch-last-commit.zsh
Created Jul 28, 2015
A script to show the last commit in each branch.
View git-branch-last-commit.zsh
#!/usr/bin/env zsh
git branch "$@" | grep --line-buffered -v '/HEAD' | while read branch; do
git log -n1 --format="format:%C(auto)%D%Creset - %s %Cgreen(%ar)%Creset %C(bold blue)<%an>%n" "${branch/* /}"
done
@Schnouki
Schnouki / popcorntime-vpn.sh
Last active Oct 2, 2022
OpenVPN for a single application using network namespaces -- helper scripts
View popcorntime-vpn.sh
#!/usr/bin/env zsh
# Initialize VPN
sudo vpnns up
sudo vpnns start_vpn
# Popcorn time!
sudo ip netns exec frootvpn sudo -u $USER popcorntime
# Cleanup
@Schnouki
Schnouki / comfy-auth.lua
Created Aug 13, 2014
SSL client certificate / HTTP basic auth -- dual-method authentication for lighttpd
View comfy-auth.lua
-- comfy-auth.lua
-- Copyright (c) 2014, Thomas Jost <schnouki@schnouki.net>
--
-- Permission to use, copy, modify, and/or distribute this software for any
-- purpose with or without fee is hereby granted, provided that the above
-- copyright notice and this permission notice appear in all copies.
--
-- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
-- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
View keybase.md

Keybase proof

I hereby claim:

  • I am schnouki on github.
  • I am schnouki (https://keybase.io/schnouki) on keybase.
  • I have a public key whose fingerprint is 0E06 6C82 4146 7232 6FB0 61CB 3E0B 0C49 C047 8597

To claim this, I am signing this object:

@Schnouki
Schnouki / movmd.py
Created Feb 25, 2013
.mov/.mp4 metadata (date/time) editor
View movmd.py
#!/usr/bin/env python3
# -*- mode: python -*-
# This program is free software. It comes without any warranty, to the extent
# permitted by applicable law. You can redistribute it and/or modify it under
# the terms of the Do What The Fuck You Want To Public License, Version 2, as
# published by Sam Hocevar. See http://sam.zoy.org/wtfpl/COPYING for more
# details.
# Some useful resources:
@Schnouki
Schnouki / bc-contributors-per-project.py
Created May 23, 2012
buddycloud contributors stats
View bc-contributors-per-project.py
#!/usr/bin/env python3
#%# family=contrib
#%# capabilities=autoconf
from urllib.request import urlopen
import json
import re
import sys
@Schnouki
Schnouki / iphone-tracker.py
Created Apr 21, 2011
iPhone tracking database to KML format converter
View iphone-tracker.py
#!/usr/bin/env python3
#
# Copyright (C) 2011 Thomas Jost
#
# This program is free software. It comes without any warranty, to
# the extent permitted by applicable law. You can redistribute it
# and/or modify it under the terms of the Do What The Fuck You Want
# To Public License, Version 2, as published by Sam Hocevar. See
# http://sam.zoy.org/wtfpl/COPYING for more details.