Skip to content

Instantly share code, notes, and snippets.

@nk23x
nk23x / add_user.sh
Created January 31, 2023 23:58 — forked from nsabine/add_user.sh
Shell script to add a user to LDAP. Based on OpenLDAP and RFC 2307 memberuid group attributes.
#!/bin/bash
#
# add_user.sh: Add user to LDAP
# Author: Nick Sabine
#
# Defaults
LDAP_BASE="dc=ORG,dc=local"
LDAP_ACCOUNTS_DN="ou=people,${LDAP_BASE}"
LDAP_USER_GROUP="cn=user_group,ou=groups,${LDAP_BASE}"
@nk23x
nk23x / pine64_pinephone_installation_instructions.md
Last active March 9, 2023 14:41
pine64 pinephone beta essential setup steps - https://is.gd/pine64setup

do not buy pinephone pine64!

WARNING: if you have not done it, already: do not buy that crappy pinephone pine64. despite the hardware related limitations, you will hardly find any linux distribution that fits. the pine keyboard needs additional driver and setup before you can use it, otherwse it's not possible to find the "-" key for example.

HANDS OFF!

see also: https://news.itsfoss.com/pinephone-review/

pine64 setup

@nk23x
nk23x / .twmrc
Created July 28, 2022 13:26
my current .twmrc
## ~/.twmrc
# NoGrabServer
RestartPreviousState
DecorateTransients
NoRaiseOnMove
NoRaiseOnResize
Zoom 2
DontMoveOff
NoMenuShadows
@nk23x
nk23x / docker-cleanup-resources.md
Created July 28, 2022 08:18 — forked from bastman/docker-cleanup-resources.md
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

@nk23x
nk23x / icecast2_complete_setup.md
Last active October 6, 2022 23:44
run icecast2 on vps instance (example!)

vps icecast2 setup

required software

on localhost

  • youtube-dl
  • detox
  • ffmpeg
  • rsync
@nk23x
nk23x / reverse-urlrewrite.haproxy.cfg
Created July 19, 2022 00:23 — forked from ferdinandosimonetti/reverse-urlrewrite.haproxy.cfg
HAProxy reverse proxy configuration with URL rewriting for two backends
global
log 127.0.0.1 local2
maxconn 2048
tune.ssl.default-dh-param 2048
defaults
mode http
log global
option httplog
option dontlognull
@nk23x
nk23x / haproxy-portknock.cfg
Created July 15, 2022 23:15 — forked from daniel-corbett/haproxy-portknock.cfg
HAProxy Port Knocking
# Listens on 6000-9000 for a sequence of port knocks.
# Requires an explicit order of port access before opening
# Current defined order is 6001,7001,8001,9000
# If another port is accessed during the sequence it must be started from the beginning
listen portknock
mode tcp
bind *:6000-9000
stick-table type ip size 1m expire 24h store conn_cnt,gpt0
tcp-request connection track-sc0 src
tcp-request connection sc-set-gpt0(0) 1 if { dst_port 6001 } { sc_get_gpt0(0) -m int lt 4 }
@nk23x
nk23x / haproxy_rate_limiting.md
Created July 15, 2022 23:15 — forked from procrastinatio/haproxy_rate_limiting.md
Rate limiting with HAproxy

Introduction

So HAProxy is primalery a load balancer an proxy for TCP and HTTP. But it may act as a traffic regulator. It may also be used as a protection against DDoS and service abuse, by maintening a wide variety of statistics (IP, URL, cookie) and when abuse is happening, action as denying, redirecting to other backend may undertaken ([haproxy ddos config], [haproxy ddos])

@nk23x
nk23x / haproxy.cfg
Created July 15, 2022 23:13 — forked from PokeGuys/haproxy.cfg
SYN Flood filter, Accept PROXY protocol. Rewrite source IP to real client IP in TCP.
global
log /dev/log local0
log /dev/log local1 notice
chroot /var/lib/haproxy
stats socket /run/haproxy/admin.sock mode 660 level admin
stats timeout 30s
daemon
defaults
log global
# Ansible managed
global
# Remote syslog servers
log 10.0.102.102:514 local0
#log-send-hostname
daemon
chroot /var/lib/haproxy
group haproxy
maxconn 40000