Skip to content

Instantly share code, notes, and snippets.

View Schnouki's full-sized avatar
🖖

Thomas Jost Schnouki

🖖
View GitHub Profile
@Schnouki
Schnouki / popcorntime-vpn.sh
Last active January 20, 2024 12:07
OpenVPN for a single application using network namespaces -- helper scripts
#!/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 / check.py
Created April 26, 2023 12:47
sqs-worker-pool healthcheck test scripts
#!/usr/bin/env python
import socket
import sys
def main():
socket_path = sys.argv[1]
with socket.socket(socket.AF_UNIX) as s:
s.connect(socket_path)
@Schnouki
Schnouki / comfy-auth.lua
Created August 13, 2014 07:20
SSL client certificate / HTTP basic auth -- dual-method authentication for lighttpd
-- 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,
@Schnouki
Schnouki / movmd.py
Created January 12, 2011 00:57
A small metadata parser for MP4 containers, designed to edit dates saved by digital cameras on .mov videos.
#!/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 / movmd.py
Created February 25, 2013 08:20
.mov/.mp4 metadata (date/time) editor
#!/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 / tedcast
Created May 29, 2009 12:30
Python script to download podcast from TED and convert videos to audio-only .ogg files
#! /usr/bin/env python
#
# Copyright (c) 2009, Thomas Jost <thomas.jost@gmail.com>
#
# 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
@Schnouki
Schnouki / middleware.py
Last active February 10, 2021 02:39
WhiteNoiseMiddleware that restrics access to sourcemaps to authorized users
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 / .Xdefaults
Created May 20, 2010 17:13
Tango theme for urxvt
/* Couleurs Tango */
URxvt.foreground: #C8C8C8
URxvt.background: #323232
URxvt.color0: #2E3436
URxvt.color1: #CC0000
URxvt.color2: #4E9A06
URxvt.color3: #C4A000
URxvt.color4: #3465A4
URxvt.color5: #75507B
URxvt.color6: #06989A
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 / seb.py
Created February 11, 2011 00:09
Simple encrypted backup (designed for a bunch of small files, like mails in the Maildir format). More details on http://schnouki.net/2011/02/11/secure-remote-backup-for-my-mail-folder/
#!/usr/bin/env python3
#
# Simple encrypted backup
#
# Copyright 2011 Thomas Jost
#
# This program is free software: you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
# Foundation, either version 3 of the License, or (at your option) any later
# version.