Skip to content

Instantly share code, notes, and snippets.

@lunitrixx
lunitrixx / nginx-matomo-directives.conf
Created February 6, 2024 20:18
ISPConfig 3 nginx directives for Matomo Analytics
add_header Referrer-Policy origin always; # make sure outgoing links don't show the URL to the Matomo instance
add_header X-Content-Type-Options "nosniff" always;
add_header X-XSS-Protection "1; mode=block" always;
location ~ \.php$ { ##delete##
}
## only allow accessing the following php files
location ~ ^/(index|matomo|piwik|js/index|plugins/HeatmapSessionRecording/configs)\.php$ {
try_files /e1fe7cea61d2bd1bde9a19b6a2993a8f.htm @php;
@lunitrixx
lunitrixx / nginx-tuning.md
Created February 7, 2024 17:46 — forked from denji/nginx-tuning.md
NGINX tuning for best performance

NGINX Tuning For Best Performance

For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.

Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.

You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.

@lunitrixx
lunitrixx / header_filter_by_lua_example.md
Created February 10, 2024 11:03 — forked from ejlp12/header_filter_by_lua_example.md
nginx, openresty, transform/modify response body, header_filter_by_lua
@lunitrixx
lunitrixx / agressive-url-encode.md
Created February 10, 2024 23:00 — forked from Paradoxis/agressive-url-encode.md
Agressive URL encode

Agressive URL encode

Python based CLI tool to agressively url-encode strings, rather than just encoding non-url characters this tool will encode every character in the URL.

Usage:

Firstly make a function in your .bash_profile to call the script

function url-encode()
{
 python ~//url_encode.py $@
@lunitrixx
lunitrixx / docker-swarm-architecture.md
Created February 26, 2024 12:25 — forked from scyto/docker-swarm-architecture.md
My Docker Swarm Architecture

Proxmox VE Installation on Hetzner Server via Rescue System

Follow these steps to install Proxmox VE on a Hetzner server via the Rescue System. The Rescue System is a Linux-based environment that can be booted into to perform system recovery tasks. We'll be using it to install Proxmox VE.

In order to complete the process, it is indeed necessary to first boot into the Rescue System and then connect to it via SSH. This will allow you to run the commands for installing Proxmox VE. Here are the steps:

Starting the Rescue System

  1. Log into the Hetzner Robot.
  2. Under "Main Functions; Server" select the desired server and then open the tab "Rescue".
@lunitrixx
lunitrixx / proxmox-backup.md
Created May 17, 2024 13:53 — forked from scyto/proxmox-backup.md
setup promox backup server and synology as data store over SMB

Proxmox Backup

At this time proxmox backup only backs up VM and Containers - ths guide covers that.

What i didn't realize is the backup job is still defined on the cluster and PBS provides a new storage type that dedupes and managed all the vzdump files created - which is cool.

I decided to run proxmox backup on my Synology NAS where it has more reliable connection to the NAS (i.e. via memory) for doing deduple, garbage collection, prune, verification etc. However the steps here generally remain true.

Once again i used one of Derek Seaman's Awesome Blogs for the basis of this - but with my own tweaks (like using SMB instead of CIFS. As of 9/21 my tweaks are signifcnant, in the original blog it is missing steps to enable encoding acceleration in CTs and VMs.

this gist is part of this series

@lunitrixx
lunitrixx / zfs_cleanup.sh
Created May 19, 2024 19:52 — forked from jstutters/zfs_cleanup.sh
Find and delete multiple ZFS snapshots
zfs list -t snapshot -H -o name | grep "201509[0-9].*" | xargs -n1 echo
# zfs list -t snapshot -H -o name | grep "201509[0-9].*" | xargs -n1 zfs destroy
@lunitrixx
lunitrixx / macos-bitwarden-cli-ssh.md
Created July 11, 2024 05:41 — forked from mietzen/macos-bitwarden-cli-ssh.md
How to use use Bitwarden CLI for SSH-Keys in macOS

How to use use Bitwarden CLI for SSH-Keys in macOS

If you want to use Touch ID have a look at: How to use use Bitwarden CLI with macOS Touch ID

Wirtten and tested on macOS Ventura

Add SSH-Keys to Bitwarden

Before you can use Bitwarden CLI for your SSH private keys you have to add them to your Bitwarden account. Just create a normal login. The name, username and URI fields doesn't matter for my functions.

@lunitrixx
lunitrixx / docker-compose.yml
Created July 12, 2024 05:36 — forked from benoitpetit/docker-compose.yml
complete Gitlab installation and a runner with docker
version: '4.5'
services:
# GITLAB
gitlab-web:
image: 'gitlab/gitlab-ce:latest'
restart: always
container_name: gitlab-web
hostname: '192.168.0.14'
environment: