Skip to content

Instantly share code, notes, and snippets.

View Sherex's full-sized avatar
:octocat:

Ingar Helgesen Sherex

:octocat:
View GitHub Profile
@Sherex
Sherex / Generic-snake_case-to-camelCase.ts
Last active December 19, 2021 14:22
A Typescript generic that converts properties (or just a string) from snake_case to camelCase
type SnakeToCamel<S extends string> =
S extends `${infer T}_${infer U}`
? `${T}${Capitalize<SnakeToCamel<U>>}`
: S
type ObjectSnakeToCamel<Type> = {
[Property in keyof Type as Property extends string ? SnakeToCamel<Property> : Property]: Type[Property]
}
const snakeObject = {
@Sherex
Sherex / README.md
Last active May 6, 2024 06:26
A script for the Wireguard config options PostUp/PostDown entries. It will allow peers to connect to the Wireguard interface and do IP forwarding (port forwarding will be added later)

IfScript

Hi, I made this for my use-case, but feel free to use it :)
This is currently only handling the NAT side of things, not PAT!
The from-to port options is just a placeholder it will use the first port specified.

route_port 80 80 tcp $vpn_ip $server_ip

How to use?

Download and make executable

@Sherex
Sherex / wikijs-keycloak-config-guide.md
Last active March 20, 2024 09:25
A guide for configuring Keycloak as a authentication provider in WikiJS | https://wiki.js.org | Feature request for adding this to the docs: https://requarks.canny.io/wiki/p/keycloak-auth-docs-proposal-for-a-guide-written
#!/bin/bash
# This was created to be used as a service overview in the motd on a Debian system.
# But use it as you like.
# Add service names in this array
services=( "videoserver" "hostapd" "isc-dhcp-server" )
echo " "
echo "SERVICES"