Skip to content

Instantly share code, notes, and snippets.

View m0zgen's full-sized avatar

/:) m0zgen

View GitHub Profile
@nitred
nitred / optimal_mtu.md
Last active November 13, 2024 12:36
Wireguard Optimal MTU

About

  • I faced bandwidth issues between a WG Peer and a WG server. Download bandwidth when downloading from WG Server to WG peer was reduced significantly and upload bandwidth was practically non existent.
  • I found a few reddit posts that said that we need to choose the right MTU. So I wrote a script to find an optimal MTU.
  • Ideally I would have liked to have run all possible MTU configurations for both WG Server and WG Peer but for simplicity I choose to fix the WG Server to the original 1420 MTU and tried all MTUs from 1280 to 1500 for the WG Peer.

Testing

  • On WG server, I started an iperf3 server
  • On WG peer, I wrote a script that does the following:
    • wg-quick down wg0
  • Edit MTU in the /etc/wireguard/wg0.conf file
@FedericoTartarini
FedericoTartarini / commands_docusaurus_translation.md
Created March 28, 2021 06:10
Source code for the YouTube video - Translate a Docusaurus website in multiple languages with its internationalization (i18n) support.

Initialize a new site

with npx @docusaurus/init@latest init website classic

Configure your site

i18n: {
    defaultLocale: 'en',
    locales: ['en', 'it'],
    localeConfigs: {
      en: {
@kwilczynski
kwilczynski / script.sh
Created March 23, 2021 10:35
Dump ad list (ad blocking list), whitelist and blacklist from Sqlite database on Pi Hole
sqlite3 gravity.db.backup -header -csv 'select * from adlist' > adlist.csv
sqlite3 gravity.db.backup -header -csv 'select * from vw_whitelist' > whitelist.csv
sqlite3 gravity.db.backup -header -csv 'select * from vw_blacklist' > blacklist.csv
@rojenzaman
rojenzaman / update-cdn.sh
Created September 6, 2020 14:21
firewalld rules for cloudflare cdn IPs (Red Hat, CentOS, Fedora)
#!/bin/bash
curl https://www.cloudflare.com/ips-v4 > .ips-v4
curl https://www.cloudflare.com/ips-v6 > .ips-v6
firewall-cmd --new-zone=cloudflare --permanent
firewall-cmd --reload
for i in `<.ips-v4`; do firewall-cmd --zone=cloudflare --add-source=$i; done
for i in `<.ips-v6`; do firewall-cmd --zone=cloudflare --add-source=$i; done
@guycalledseven
guycalledseven / manual-uninstall-parallels.sh
Last active November 4, 2024 19:56
Manually remove Parallels Desktop v15 leftovers MacOS
# used different forum posts/guides to figure this out like:
# The uninstall script is located at /Library/Parallels/Parallels Service.app/Contents/Resources
# https://github.com/danijeljw/remparallels/blob/master/remprls.sh
# https://kb.parallels.com/122461
# sudo find / -iname "*parallels*"
# sudo find / -iname "*prl*"
#before uninstalling deactivate your licencse - this won't be possible after uninstall
prlsrvctl deactivate-license
@zoonderkins
zoonderkins / dnsdist-config.md
Created April 14, 2019 09:07
dnsdist config
-- listen for console connection with the given secret key
-- controlSocket("0.0.0.0")
-- setKey(please generate a fresh private key with makeKey())

-- start the web server on port 8083, using password 'set a random password here'
-- webserver("0.0.0.0:8083", "set a random password here")

-- accept DNS queries on UDP/5200 and TCP/5200
@dale3h
dale3h / jail.local
Created June 29, 2018 15:47
[fail2ban] Improved nginx-badbots
# Add to file: /etc/fail2ban/jail.local
[nginx-badbots]
enabled = true
port = http,https
filter = nginx-badbots
logpath = %(nginx_access_log)s
maxretry = 1
findtime = 604800
bantime = 604800
@anujsinghwd
anujsinghwd / main.go
Created March 16, 2018 10:47
Upload File - golang
package main
import (
"crypto/md5"
"fmt"
"io"
"net/http"
"os"
"strconv"
"text/template"
@frcolumba
frcolumba / gist:5a2518684ed4e2b18a386fa3647d5629
Created February 6, 2018 20:36
Windows Defender ASR in OSSEC
If you don't have an E5 subscription, run 1709 in your environment, and use OSSEC, you can quickly add the new ASR features
to your alerting and reports since you don't have access to the Defender console thingy.
The event reference is here: https://docs.microsoft.com/en-us/windows/threat-protection/windows-defender-exploit-guard/event-views-exploit-guard#list-of-all-windows-defender-exploit-guard-events
All your need to do is add:
<localfile>
<location>Microsoft-Windows-Windows Defender/Operational</location>
<log_format>eventchannel</log_format>
@Neo23x0
Neo23x0 / audit.rules
Last active September 16, 2024 14:59
Linux Auditd Best Practice Configuration
# IMPORTANT!
# This gist has been transformed into a github repo
# You can find the most recent version there:
# https://github.com/Neo23x0/auditd
# ___ ___ __ __
# / | __ ______/ (_) /_____/ /
# / /| |/ / / / __ / / __/ __ /
# / ___ / /_/ / /_/ / / /_/ /_/ /
# /_/ |_\__,_/\__,_/_/\__/\__,_/