Skip to content

Instantly share code, notes, and snippets.

@suuhm
suuhm / setup_openwrt_lxc_container_proxmox.sh
Last active March 6, 2025 04:23
Setup OpenWrt 23.05 LXC Container in Proxmox - Updated Version: 2024
#!/bin/bash
# Setting Up OpenWRT on a Virtual Machine with Proxmox
# Based on: https://community.bigbeartechworld.com/t/setting-up-openwrt-on-a-virtual-machine-with-proxmox/257
# Set your wished version:
export VER="23.05"
export ARCH="amd64"
export INDEX_URL="https://images.linuxcontainers.org/images/openwrt/$VER/$ARCH/default"
#export BUILDDATE=$(date -d "yesterday" '+%Y%m%d')
@zajdee
zajdee / debian-initramfs-ipv6-hook-script
Last active August 11, 2024 15:23
Scripts to support IPv6 networking in Debian pre-boot (initramfs) environment
#!/bin/sh
# Script to be placed in /etc/initramfs-tools/hooks/ipv6
PREREQ=""
prereqs()
{
echo "$PREREQ"
}
@oleg-andreyev
oleg-andreyev / Improved Persistent Login Cookie Best Practice.md
Created January 10, 2019 20:44
Improved Persistent Login Cookie Best Practice
@kravietz
kravietz / nftables-host.conf
Last active March 3, 2025 18:40
Simple workstation nftables
#!/usr/sbin/nft -f
flush ruleset
table inet filter {
chain input {
type filter hook input priority 0; policy drop
iifname lo accept
ct state established,related accept
# allow any incoming ICMP and ICMPv6
"""
twisted async/await with asyncio reactor and uvloop
"""
import asyncio
import uvloop
from asyncio.tasks import ensure_future
try:
# as per github source the asyncio reactor is intended to be released in future version
@dwilliamson
dwilliamson / Triangle.cpp
Created August 22, 2014 13:26
Dumb but accurate triangle rasteriser with top-left fill
void RasteriseTriangle3(char* buffer, int width, int height, float2 v0, float2 v1, float2 v2)
{
// Sort vertices along the y-axis, lowest first
if (v1.y < v0.y)
std::swap(v0, v1);
if (v2.y < v1.y)
std::swap(v1, v2);
if (v1.y < v0.y)
std::swap(v0, v1);
@sphaero
sphaero / dyn_dns_app.py
Last active April 6, 2020 16:04
Simple DynDNS Service using (apache) webserver and DNSMasq
#!/usr/bin/env python
# Simple Dynamic DNS update script for use with DNSMasq
#
# Install this WSGI script on a (apache) webserver. Make sure
# DNSMasq runs as the same user as this script does on the webserver
# E.g: /etc/default/dnsmasq add: (Debian and deriatives)
# DNSMASQ_USER='wsgiuser'
#
# ### DNSMASQ.CONF ###
# domain-needed
@mikemilano
mikemilano / gist:6923819
Last active September 18, 2016 03:43
Python's Twisted framework watching a directory and broadcasting changes to zeromq.
from twisted.internet import inotify
from twisted.python import filepath
import zmq
from pprint import pprint
class FileSystemWatcher(object):
def __init__(self, path_to_watch):
self.path = path_to_watch
self.context = zmq.Context()
@endolith
endolith / LICENSE.txt
Last active September 19, 2024 10:24
Python implementation of "Cookbook formulae for audio EQ biquad filter coefficients"
MIT License
Copyright (c) 2019 endolith
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions: