This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/sbin/nft -f | |
# see also: | |
# https://wiki.nftables.org/wiki-nftables/index.php/Netfilter_hooks | |
# https://docs.kernel.org/networking/tproxy.html | |
# https://powerdns.org/tproxydoc/tproxy.md.html | |
# http://git.netfilter.org/nftables/commit/?id=2be1d52644cf77bb2634fb504a265da480c5e901 | |
# http://wiki.squid-cache.org/Features/Tproxy4 | |
# https://serverfault.com/questions/1052717/how-to-translate-ip-route-add-local-0-0-0-0-0-dev-lo-table-100-to-systemd-netw | |
# https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/net/netfilter/nft_tproxy.c |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# target: squid-openssl 4.13 with listener "http_port 127.0.0.1:3129 tproxy" | |
# see also: | |
# https://docs.kernel.org/networking/tproxy.html | |
# https://blog.cloudflare.com/mmproxy-creative-way-of-preserving-client-ips-in-spectrum/ | |
# https://latest.gost.run/en/tutorials/redirect/#forwarding-chain_1 | |
# you might need to enable some iptables/nftables kernel modules: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -euo pipefail | |
PROJECT_NAME='test' | |
# inside '/scripts/' directory | |
# change to directory from where we can run 'go build' | |
cd "$(dirname "$0")/../main" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# tested for downloading golang binaries | |
set -euo pipefail | |
GH_USER='superstes' | |
GH_REPO='geoip-lookup-service' | |
FILTER='' | |
FILTER_EXCLUDE='$%&' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### BASIC ### | |
GEN KEYS: wg genkey | tee privatekey | wg pubkey > publickey | |
ADD CONFIG: /etc/wireguard/<CONFIG>.conf | |
ADD SERVICE: systemctl start wg-quick@<CONFIG>.service | |
EN SERVICE: systemctl enable wg-quick@<CONFIG>.service | |
### SERVER ### | |
[Interface] | |
Address = 10.0.1.1/24 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// NOTE: this can be used to create a minimalistic version of these: | |
// https://github.com/tigrr/circle-progress | |
/* HTML | |
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Circular Progress</title> | |
<link rel="stylesheet" type="text/css" href="prog.css"> | |
</head> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
NOTES: | |
basic source: https://discourse.threejs.org/t/detect-if-target-is-behind-the-camera-bis/219/2 | |
you could also use a frustum: https://threejs.org/docs/index.html#api/en/math/Frustum.containsPoint | |
we assume the InFrontOfCamera will be called many times each frame - so we want to prepare the camera values it uses to lower processing cost | |
*/ | |
const CAM_FOV = 60; | |
const CAM_FOV2 = (Math.PI / 360) * (360 - CAM_FOV); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
NOTES: | |
basic source: https://codepen.io/lamb_1128/pen/xxQogxj | |
this functionality can be compared to the annotations seen at: https://modelviewer.dev/examples/annotations/index.html | |
but this has a very minimalistic approach | |
*/ | |
/* css | |
.annotation { | |
position: absolute; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -eo pipefail | |
# NOTES: | |
# to use on backup files created by Google Takeout: https://support.google.com/accounts/answer/3024190?hl=en | |
# creates lists of top N mail senders & distribution-lists @ /tmp | |
# can be used to create Google Vault retentions to clean-up old mails or spam: https://support.google.com/vault/answer/2990828?hl=en | |
if [-z "$1" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -euo pipefail | |
# NOTES: | |
# as Apple is not able to provide any good option to force updates on managed clients - you might want to notify users to install them | |
# will be silent if no updates are available | |
# see also: https://ss64.com/osx/softwareupdate.html |
OlderNewer