Skip to content

Instantly share code, notes, and snippets.

@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 October 19, 2024 01:01
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 May 28, 2025 12:56
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 November 25, 2025 00:07
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 April 22, 2025 17:08
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;
}
@nijave
nijave / metered.ps1
Created June 23, 2019 14:56
Powershell check if on metered network
[void][Windows.Networking.Connectivity.NetworkInformation, Windows, ContentType = WindowsRuntime]
$cost = [Windows.Networking.Connectivity.NetworkInformation]::GetInternetConnectionProfile().GetConnectionCost()
$cost.ApproachingDataLimit -or $cost.OverDataLimit -or $cost.Roaming -or $cost.BackgroundDataUsageRestricted -or ($cost.NetworkCostType -ne "Unrestricted")
@indented-automation
indented-automation / Get-InstalledSoftware.ps1
Last active November 19, 2025 16:23
Get-InstalledSoftware
function Get-InstalledSoftware {
<#
.SYNOPSIS
Get all installed from the Uninstall keys in the registry.
.DESCRIPTION
Read a list of installed software from each Uninstall key.
This function provides an alternative to using Win32_Product.
.EXAMPLE
Get-InstalledSoftware