Skip to content

Instantly share code, notes, and snippets.

View nzbr's full-sized avatar
💾

nzbr

💾
View GitHub Profile

Keybase proof

I hereby claim:

  • I am nzbr on github.
  • I am nzbr (https://keybase.io/nzbr) on keybase.
  • I have a public key ASBZNwbiiv-Mh-abrQESwxiWRqq7RZW__FvMk0cnBgqD0Ao

To claim this, I am signing this object:

@nzbr
nzbr / flatpak-update.hook
Created January 21, 2019 14:51
Pacman Hook for Installing Flatpak Updates on Package Upgrades
[Trigger]
Operation = Upgrade
Type = Package
Target = *
[Action]
Depends = flatpak
When = PostTransaction
Exec = /usr/bin/flatpak update -y
@nzbr
nzbr / pymake.mk
Last active May 15, 2019 00:34
Makefile that creates precompiled python bytecode (.pyc) and bundles it in an exectable zipfile
## Options
PY=python3
ZIP=zip -0 -q
PYLINT=pylint -E
PYC=$(PY) -c "from py_compile import compile; from sys import argv; compile(argv[1], cfile=argv[1]+'c', doraise=True, optimize=2)"
PREFIX=/usr/bin
##Default uses direcory name, replace if neccessary
NAME=$(shell basename $$PWD)
@nzbr
nzbr / pass-export.py
Created July 21, 2019 19:34
Creates a CSV export from a pass password-store (can be imported as a LastPass export, for example in Bitwarden)
#!/usr/bin/python3
import os
from sys import stdout, stderr
from subprocess import Popen, PIPE, DEVNULL
def eprint(text: str) -> None:
stderr.write(text+"\n")
stderr.flush()
@nzbr
nzbr / wghosts.py
Created July 23, 2019 19:29
Creates hosts-file entries from a wireguard config
#!/usr/bin/python3
import sys
import os
if len(sys.argv) != 2:
print("Usage:\twghosts.py <interface>")
sys.exit(1)
interface = sys.argv[1]
conffile = "/etc/wireguard/%s.conf" % interface
@nzbr
nzbr / vlang.mk
Last active October 11, 2019 11:00
Makefile that compiles .v and .c files into a single binary
V=v
CC=gcc
LD=gcc
LINKFLAGS=-lm -lpthread -ldl
BINARY=program.elf
OBJECTS=_vcode.o $(patsubst %.c,%.o,$(wildcard *.c))
all : $(BINARY)
@nzbr
nzbr / smile_amazon_de.user.js
Last active November 16, 2019 13:32 — forked from orderthruchaos/smile_amazon_com.user.js
Greasemonkey User Script: ensure that you are on smile.amazon.com. (Fork for amazon.de)
// ==UserScript==
// @name smile_amazon_de
// @namespace http://orderthruchaos.bitbucket.org/
// @copyright 2015+, Brett DiFrischia
// @license
// @description Always remember to smile!
// @grant GM_log
// @require https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js
// @include http://www.amazon.de/*
// @include https://www.amazon.de/*
@nzbr
nzbr / traefik-auto-yaml.user.js
Created January 28, 2020 15:51
Automatically switch configuration examples to YAML in the traefic-docs
// ==UserScript==
// @name Traefik auto-yaml
// @version 1
// @grant none
// @include https://docs.traefik.io/*
// ==/UserScript==
Array.from(document.getElementsByTagName("label")).forEach((elem) => {
if (elem.innerHTML === "File (YAML)") {
elem.click();
@nzbr
nzbr / zoomvm.nix
Last active January 29, 2024 00:42
NixOS Configuration for Running Zoom in a VM, where it belongs, because you have to...
# INSTRUCTIONS:
# 1. Follow the installation instructions at
# https://nixos.org/nixos/manual/index.html until
# /mnt/etc/nixos/configuration.nix is edited
# 2. Replace that file with this one:
# -> curl -L -o /mnt/etc/nixos/configuration.nix https://go.nzbr.de/zoomvm
# 3. You will need to edit this configuration if you want a locale other than
# german (i18n and xserver.locale) or not use UEFI (boot.loader)
# 4. Run `nix-env -i git` to install git on the live system (may take some time)
# 5. Run nixos-install
@nzbr
nzbr / UDP.cs
Last active May 26, 2021 21:21
UDP Device Script for Aurora
using Aurora;
using Aurora.Devices;
using Aurora.Settings;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Net.Sockets;
using System.Threading.Tasks;
using System.Diagnostics;