Skip to content

Instantly share code, notes, and snippets.

View rwenz3l's full-sized avatar
🔨
Building new Things.

Robin Wenzel rwenz3l

🔨
Building new Things.
View GitHub Profile
@rwenz3l
rwenz3l / nats-test-add-remove-nodes.md
Created September 18, 2020 09:39
Documentation of my testing on the NATS Streaming Server PR1090 that adds the option to add and remove cluster nodes.

NATS Streaming Server - Test Add/Remove Peers

For the nats-streaming-server PR to allow for the addition and removal of nodes while the cluster is running,

we prepared a small testing environment to verify it's behaviour.

Setup

@rwenz3l
rwenz3l / file2jsql.sh
Created November 7, 2019 15:46
Convert golang `db:"field"` comments into a sql-query for json objects..
#!/bin/sh
file2jsql(){
# $1=file, $2=table_name
keyval=$(cat "${1}" | perl -n -e '/`db:"(.*)"\ / && printf(qq{"%s", %s,\n},$1,$1);')
keyval=${keyval%?}
echo "SELECT JSON_OBJECT("
echo "$keyval"
echo ") FROM ${2};"
}

Keybase proof

I hereby claim:

  • I am rwenz3l on github.
  • I am rwenz3l (https://keybase.io/rwenz3l) on keybase.
  • I have a public key ASA3-J6KLz8z8LFqC32iUxLegBr5QC8UIoFGlM94zUBEAwo

To claim this, I am signing this object:

@rwenz3l
rwenz3l / proxmox_lxc_nfs_server.md
Last active April 12, 2024 19:49
Install a NFS Server inside a LXC Container on Proxmox 5.1

Installing NFS inside LXC Container on Proxmox 5.1

Host Setup:

Create LXC Container as usual, but do not start it yet.

# Install NFS-Kernel on Host
apt install nfs-kernel-server
@rwenz3l
rwenz3l / centos7-btsync.sh
Created November 23, 2017 09:35
Install BTSync on CentOS7
yum update
cat > /etc/yum.repos.d/resilio-sync.repo <<'EOF'
[resilio-sync]
name=Resilio Sync $basearch
baseurl=http://linux-packages.resilio.com/resilio-sync/rpm/$basearch
enabled=1
gpgcheck=1
EOF
# Snippets for fun and learning more about git (automation)
function abandon-git {
rescue_branch="Rescue-Branch-$(date +"%Y-%m-%d-%H-%M-%S")"
git checkout -b "${rescue_branch}"
git add --ignore-removal .
git commit -a -m 'This is a Rescue Commit - saves progress and pushes to new banch'
git push --set-upstream origin Rescue-Branch-2017-09-20-15-54-40
}
function restore-git {
@rwenz3l
rwenz3l / repairPermissions_Sierra.sh
Created September 17, 2017 21:46
repair Disk Permissions on ElCapitan / Sierra when System Integrity Protection (SIP) is off
sudo chown root:admin /Applications; sudo chmod 0775 /Applications
sudo chown root:wheel /Library; sudo chmod 0755 /Library
sudo chown root:admin /Library/Application\ Support; sudo chmod 0755 /Library/Application\ Support
sudo chown root:admin /Users; sudo chmod 0755 /Users
sudo chown root:wheel /usr; sudo chmod 0755 /usr
sudo chown root:wheel /usr; sudo chmod 0755 /usr/bin
@rwenz3l
rwenz3l / audioReport.py
Created September 13, 2017 06:36
A Small Script to read Library Tags and Report Quality and Stuff
import sys, os, re
import xml.etree.ElementTree as ET
from mutagen.mp3 import MP3
'''
@param Uebergeben wird: "HostName" "/path/to/movies" "path/to/txt"
# HostName XServe = "XServe"
# Input XServe = "/Volumes/AUDIO"
# Output XServe = "/opt/syncthing/Repository/media"
@rwenz3l
rwenz3l / hetzner-proxmox-docker.sh
Created September 2, 2017 15:29
Hetzner Dedicated with Debian 9 (Stretch) and Proxmox 5 (LXC) + Docker-CE + Portainer [NAT]
#############################################
### Proxmox V & Docker-CE + Portainer #
#############################################
## Rescue System
# Erase other disks
dd if=/dev/zero of=/dev/sda bs=1M count=100
dd if=/dev/zero of=/dev/sdb bs=1M count=100
# You can install debian 9 via the guide:
@rwenz3l
rwenz3l / verify_flac.sh
Last active July 23, 2017 19:32
Verify a FLAC Folder ripped with XLD
# crc32 <(flac --decode --stdout --force-raw-format --endian=little --sign=signed /path/to/file.flac)
function veriflac() {
NC='\033[0m'
Red='\033[0;31m'
Green='\033[0;32m'
if [ $# -eq 0 ]
then
echo -e "${Red}Usage:"
echo -e " veriflac /path/to/folder${NC}";