Skip to content

Instantly share code, notes, and snippets.

View coderofsalvation's full-sized avatar

Coder of Salvation / Leon van Kammen coderofsalvation

View GitHub Profile
@coderofsalvation
coderofsalvation / comingsoon.md
Last active October 29, 2022 03:27
wrk.ist coming back soon

db d8b db d8888b. db dD d888888b .d8888. d888888b 88 I8I 88 88 8D 88 ,8P' 88' 88' YP ~~88~~' 88 I8I 88 88oobY' 88,8P 88 8bo. 88
Y8 I8I 88 888b 888b 88 Y8b. 88 8b d8'8b d8' 88 88. 88 88. db .88. db 8D 88
8b8' 8d8' 88 YD YP YD VP Y888888P `8888Y' YP

@coderofsalvation
coderofsalvation / iptables-proxy-forward-and-ratelimit-ports.md
Last active April 3, 2023 14:04
using iptables to redirect low ports to high ports with rootless podman docker containers

IPTABLES

server $ cat proxy

proxyport(){
  iptables -t nat -A PREROUTING -p tcp --dport $1 -j REDIRECT --to-port $2
  iptables -t nat -I OUTPUT -p tcp -d $(curl -s https://checkip.amazonaws.com) --dport $1 -j REDIRECT --to-port $2 # reverse ip
}
@coderofsalvation
coderofsalvation / howto rootless podman container connecting to REST api docker.sock.md.md
Last active April 19, 2023 17:05
howto rootless podman container connecting to REST api /var/run/docker.sock

Ok I was struggling a bit finding info about this. In a nutshell:

  • /var/run/docker.sock only works for root(ful) containers
  • there's no rootless socket-file created by default (you need to run an API listener service)

STEP 1: run API listener service (to create socketfile)

# whoami
@coderofsalvation
coderofsalvation / AFRAME.utils.throttleTicks.js
Last active September 22, 2022 09:12
AFRAME.utils.throttleTicks() allows central (throttle)control of all AFRAME components-ticks (without having to patch community components)
/*
* Usage:
*
* AFRAME.utils.throttleTicks({
* 'aabb-collider':{ "*": 150 },
* 'texturescroll':{ "*": 50 },
* 'foo': { "*": AFRAME.utils.device.isMobile() ? 150 : 50 }
* }, true)
*
*/
@coderofsalvation
coderofsalvation / checksum.sh
Created September 12, 2022 11:57
generate checksum from directory tree (unix / shell)
find . -type f -printf "%p %s\n" | LC_ALL=C sort | md5sum
# output: a71e7b59041f2db45adb105596519167 -
@coderofsalvation
coderofsalvation / index.html
Created September 7, 2022 13:12
Metaradio.at
<nav class="navbar navbar-inverse navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<a class="navbar-brand" href="#">Metaradio</a>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li><a href="#link2" onclick="alert('todo')">About</a></li>
<li><a href="#link3" onclick="alert('todo')">Examples</a></li>
</ul>
@coderofsalvation
coderofsalvation / ASCIISTEP16.md
Last active September 24, 2024 21:43
ASCIISTEP16 - the pckeyboard standard of 16-step sequencers (RFC)

Version

v1.0

2022-08-01 draft (Leon van Kammen/coderofsalvation)
2022-09-01 ASCIISTEP16 implemented in milkytracker

What is ASCIISTEP16

@coderofsalvation
coderofsalvation / milkytracker-new-features.md
Last active August 30, 2022 09:40
new milkytracker features in the making

laptopfriendly instrument/sample/stepsize/orderlist keyboard navigation

(milkytracker keyboard layout)

extra pasting 'mix'-modes

@coderofsalvation
coderofsalvation / bundle.sh
Created August 23, 2022 16:33
simple sourcecode preprocessor-file-import-include bundler using awk
#!/bin/sh
awk '/^#include *".*"$/ {
i = index($0, "\"");
file = substr($0, i + 1, length() - i - 1);
while ((getline < file) == 1) print;
close(file);
next;
} 1' myfile.txt > myfile.bundled.txt
@coderofsalvation
coderofsalvation / wav2csound
Created July 27, 2022 07:49
convert wav 2 csound using awk
#!/bin/sh
# usage: ./wav2csound sample.wav >> mysong.csd
test -z $1 && {
echo "usage: wav2csound sample.wav";
echo " wav2csound sample.wav >> mysong.csd"
exit 0;
}
{