Skip to content

Instantly share code, notes, and snippets.

View MxBlu's full-sized avatar
🐢

Jumail Mundekkat MxBlu

🐢
  • Revolution Software Services
  • Sydney, Australia
View GitHub Profile
@MxBlu
MxBlu / timer.ts
Created July 3, 2021 07:21
High resolution timer implementation in TS
import { Logger } from "./logger.js";
// Time delta to trigger tasks on (in ms)
// Any task with a delta under this
const TRIGGER_RESOLUTION = 500;
export class TimerTask {
// Unique (relatively) identifier
id: string;
// Time to trigger task
@MxBlu
MxBlu / netconf.sh
Created July 9, 2020 02:36
Set up port forwarding inside Linux, primarily made for use for a server with a Wireguard connection to a backend on a dynamic IP or something of the like.
#!/bin/bash
set -x
ACTION=$1
PRIV_IFACE=$2
# IP of private interface
# PostDown obviously doesn't get the IP, which means unportforward won't work... hardcoding
# INTERFACE_IP=$(/sbin/ifconfig $INTERFACE | grep -i mask | awk '{print $2}'| cut -f2 -d:)
PRIV_IFACE_IP=10.0.4.1