Skip to content

Instantly share code, notes, and snippets.

View Tundra-bit's full-sized avatar

Tundra_Bit Tundra-bit

View GitHub Profile
@Tundra-bit
Tundra-bit / nginx-location.md
Created February 7, 2024 01:34 — forked from ebta/nginx-location.md
Nginx Location block Tutorial

Nginx location:

Nginx location block section have a search order, a modifier, an implicit match type and an implicit switch to whether stop the search on match or not. the following array describe it for regex.


# --------------------------------------------------------------------------------------------------------------------------------------------
# Search-Order       Modifier       Description                                                        Match-Type        Stops-search-on-match
# --------------------------------------------------------------------------------------------------------------------------------------------
#     1st               =           The URI must match the specified pattern exactly                  Simple-string              Yes
@genesysflow
genesysflow / .md
Last active April 19, 2024 17:55
ufw ports for mailcow

ports for mailcow

ufw allow 25/tcp
ufw allow 465/tcp
ufw allow 587/tcp
ufw allow 143/tcp
ufw allow 993/tcp
ufw allow 110/tcp
ufw allow 995/tcp
ufw allow 4190/tcp
@justinmarwad
justinmarwad / Install-Wazuh.ps1
Last active May 20, 2023 04:31
Powershell Script To Install/Uninstall/Setup A Wazuh Client on Windows
# Made by Justin Marwad 2022
# Install ex: ./Install-Wazuh.ps1 -server [wazuh_ip] -name [name_wazuh_sees] -install
# Update cert ex: ./Install-Wazuh.ps1 -server [wazuh_ip] -name [name_wazuh_sees]
# Restart ex: ./Install-Wazuh.ps1 -restart
# Uninstall ex: ./Install-Wazuh.ps1 uninstall
param (
[string]$server = $null,
[string]$name = [System.Net.Dns]::GetHostName(),
@wardpieters
wardpieters / cloudflare_tlsa_mailcow.sh
Last active January 14, 2024 10:50
Cloudflare TLSA update script for mailcow
#!/bin/bash
zone=domain.nl
dnsrecord=some-server.domain.nl
## Cloudflare authentication details
## keep these private
cloudflare_token="XXXXXX"
# get certificate hash
@johnnypea
johnnypea / useful-one-liners.sh
Last active April 22, 2024 14:56
Useful one liners
# Run the last command as root
sudo !!
# Serve current directory tree at http://$HOSTNAME:8000/
python -m SimpleHTTPServer
# Save a file you edited in vim without the needed permissions
:w !sudo tee %
# change to the previous working directory
cd -
# Runs previous command but replacing
^foo^bar
@PiDroid-B
PiDroid-B / actions_blacklist-update.conf
Last active May 2, 2024 23:54
OPNsense Custom script and Cron (example : an Alias Table URL with high frequency refresh)
[reload]
command:/usr/local/bin/flock -n -E 0 -o /tmp/filter_update_tables_blk.lock /usr/home/blacklist-update.sh
parameter:
type:script_output
message:IP Blacklist Update
description:Centralized Blacklist IP Update from my own service
@goll
goll / README.md
Last active May 15, 2024 09:40
Docker nftables configuration for Debian 10
@vasyakrg
vasyakrg / gist:899607b4739bacb8801f3fd6951e5c83
Last active March 30, 2023 16:45
nginx load balance for proxmox
upstream proxmox {
server pve1:8006;
server pve2:8006;
server pve3:8006;
}
server {
listen 80 default_server;
rewrite ^(.*) https://$host$1 permanent;
}
@Waltibaba
Waltibaba / lxc_mount_block_device
Last active April 26, 2024 04:13
Mount a block device like HDD inside an LXC container (specifically in proxmox 4)
Mounting block device in lxc (specifically Proxmox 4)
1. Find devices' major & minor ID (need both dev + partition for HDD)
# ls -al /dev/sda
brw-rw---- 1 root disk 8, 0 Dec 19 11:16 /dev/sda1
# ls -al /dev/sda1
brw-rw---- 1 root disk 8, 1 Dec 19 11:16 /dev/sda1
That's 8,0 for sda and 8,1 for sda1