Skip to content

Instantly share code, notes, and snippets.

View perguth's full-sized avatar
💭
You are awesome, I would love to bandy some knowledge with you!

Per Guth perguth

💭
You are awesome, I would love to bandy some knowledge with you!
View GitHub Profile
@perguth
perguth / dev.nix
Last active January 6, 2025 09:15
Deno (Fresh) IDX starter, `.idx/dev.nix`
# To learn more about how to use Nix to configure your environment
# see: https://developers.google.com/idx/guides/customize-idx-env
{ pkgs, ... }: {
# Which nixpkgs channel to use.
channel = "stable-24.05"; # or "unstable"
# Use https://search.nixos.org/packages to find packages
packages = [
pkgs.nano
];
@perguth
perguth / keyboardLayout.json
Created October 29, 2024 07:26 — forked from tdegrunt/keyboardLayout.json
Visual Studio Code (vscode/code) Colemak keyboard layout
{
"layout": {
"id": "com.apple.keylayout.Colemak",
"localizedName": "Colemak",
"lang": "en"
},
"rawMapping": {
"KeyA": {
"value": "a",
"valueIsDeadKey": false,
@perguth
perguth / squid.conf
Created October 3, 2024 08:16
Minimal Squid Proxy Configuration File
# /etc/squid/squid.conf
https_port 3128 tls-cert=/etc/squid/combined.pem
auth_param basic program /usr/lib/squid/basic_ncsa_auth /etc/squid/users
auth_param basic realm proxy
acl auth proxy_auth REQUIRED
http_access allow auth
@perguth
perguth / sslh.cfg
Created April 19, 2024 11:46
sslh.cfg
# /etc/sslh/sslh.cfg or /etc/sslh.cfg
verbose: true;
foreground: true;
inetd: false;
numeric: true;
#transparent: true; # ygg stops working when enabled
timeout: 900; # TCP default
user: "sslh";
pidfile: "/var/run/sslh.pid";
#!/bin/bash
# Convert all JPGs and PNGs in a directory and its
# subdirectories into WEBP images.
# converting JPEG images
find $1 -type f -and \( -iname "*.jpg" -o -iname "*.jpeg" \) \
-exec bash -c '
webp_path=$(sed 's/\.[^.]*$/.webp/' <<< "$0");
if [ ! -f "$webp_path" ]; then
# https://rgxg.github.io/
$ rgxg cidr '200::/7'
0?[23][0-9A-Fa-f]{2}((:(:[0-9A-Fa-f]{1,4}){1,6}|::|:[0-9A-Fa-f]{1,4}(:(:[0-9A-Fa-f]{1,4}){1,5}|::|:[0-9A-Fa-f]{1,4}(:(:[0-9A-Fa-f]{1,4}){1,4}|::|:[0-9A-Fa-f]{1,4}(:(:[0-9A-Fa-f]{1,4}){1,3}|::|:[0-9A-Fa-f]{1,4}(:(:[0-9A-Fa-f]{1,4}){1,2}|::|:[0-9A-Fa-f]{1,4}(::[0-9A-Fa-f]{1,4}|::|:[0-9A-Fa-f]{1,4}(::|:[0-9A-Fa-f]{1,4})))))))|(:(:[0-9A-Fa-f]{1,4}){0,4}|:[0-9A-Fa-f]{1,4}(:(:[0-9A-Fa-f]{1,4}){0,3}|:[0-9A-Fa-f]{1,4}(:(:[0-9A-Fa-f]{1,4}){0,2}|:[0-9A-Fa-f]{1,4}(:(:[0-9A-Fa-f]{1,4})?|:[0-9A-Fa-f]{1,4}(:|:[0-9A-Fa-f]{1,4}))))):(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])(\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3})
### Keybase proof
I hereby claim:
* I am perguth on github.
* I am perguth (https://keybase.io/perguth) on keybase.
* I have a public key ASD3o_J-jMaLeKSggjQSgtldX8rQ6LSnINuqT-WFNriRcgo
To claim this, I am signing this object:
@perguth
perguth / sslh
Last active December 12, 2019 19:25
Configures the port multiplexer `sslh`.
# Configures the port multiplexer sslh
# https://github.com/yrutschle/sslh
# Place in /etc/defaults/sslh
RUN=no
DAEMON=/usr/sbin/sslh
DAEMON_OPTS="--user sslh --listen [201:6779:c497:82f:68fd:188d:4338:1234]:443 --listen 0.0.0.0:443 --tls 127.0.0.1:4443 --anyprot 127.0.0.1:44478 --pidfile /var/run/sslh/sslh.pid"
@perguth
perguth / shell
Created December 12, 2019 11:36
Shared terminal start script.
#!/bin/sh
# Place in `/usr/local/bin/shell`
# Starts a terminal session that is shared among endpoints.
/usr/bin/tmux new -A -s session1
@perguth
perguth / theia
Last active May 6, 2020 10:15
👩‍💻 Start Theia in the current directory and open browser window.
#!/bin/sh
# Start Theia in the current directory and open browser window.
# Theia configuration will be stored under ~/.theia
previousInstance=$(docker ps -q --filter ancestor=theiaide/theia:next --format="{{.ID}}")
if [ "$previousInstance" ]; then
docker kill $previousInstance > /dev/null
fi