Skip to content

Instantly share code, notes, and snippets.

Avatar

Antoine Aflalo Belphemur

View GitHub Profile
@Belphemur
Belphemur / generate-client.sh
Last active Jun 12, 2021
Generate a new client configuration for WireGuard
View generate-client.sh
#!/usr/bin/env bash
if [ -z "$1" ]
then
echo "$0 client-name"
exit 1
fi
@Belphemur
Belphemur / bridge-conf
Last active Jun 5, 2021
Configuration and scripts for OpenVPN in Bridged Mode. Script to generate new client (with their keys and configuration file for OpenVPN). Script to manage the bridge. Configuration for systemd to start/stop the OpenVPN with Brige.
View bridge-conf
#!/bin/bash
# Define physical ethernet interface to be bridged
# with TAP interface(s) above.
eth="eth0"
eth_ip="192.168.42.2"
eth_netmask="255.255.255.0"
eth_broadcast="192.168.42.255"
eth_gateway="192.168.42.1"
eth_mac="XX:XX:XX:XX:XX:XX"
@Belphemur
Belphemur / iptables-tarpit.conf
Last active Apr 14, 2021
Tarpit Action for Fail2ban with rate limit
View iptables-tarpit.conf
# Fail2Ban configuration file
#
# Author: Cyril Jaquier
# Modified: Yaroslav O. Halchenko <debian@onerussian.com>
# made active on all ports from original iptables.conf
# Modified: Antoine Aflalo <antoine@aaflalo.me>
# Used the iptables-allports.conf as base for TARPIT.
#
#
@Belphemur
Belphemur / sandbox-winget.ps1
Last active Apr 9, 2021
Use Windows Sandboxing to be able to install your WinGet manifest. Source: https://megamorf.gitlab.io/2020/07/19/automating-the-windows-sandbox/
View sandbox-winget.ps1
# Parse Arguments
Param(
[Parameter(Mandatory, HelpMessage = "The path for the Manifest.")]
[String] $Manifest
)
if (-not (Test-Path -Path $Manifest -PathType Leaf)) {
throw 'The Manifest file does not exist.'
}
View Node-RED.service
# This script work on any system using systemd as the init process.
# It works on Debian/Raspbian Jessie.
# If you have Debian/Rapbian Wheezy and want to use this script with systemd
# follow the information here : https://wiki.debian.org/systemd
# To easily download, install and set at startup:
# wget -O /tmp/download https://gist.github.com/Belphemur/3f6d3bf211b0e8a18d93/download && sudo tar -zxf /tmp/download --strip-components 1 -C /etc/systemd/system/ && sudo systemctl --reload-daemon && sudo systemctl enable Node-RED
# To consult the log : journalctl -u Node-RED
[Unit]
View 10-nextdns-catchall.sh
#!/bin/sh
SERVICE_FILE=nextdns-catchall.service
SOURCE_FILE_PATH=/data/${SERVICE_FILE}
SYSTEMD_FILE_PATH=/etc/systemd/system/${SERVICE_FILE}
if [ ! -f $SOURCE_FILE_PATH ];
then
echo "Can't find service file"
exit 1
fi
@Belphemur
Belphemur / nginx-proxy.conf
Last active Mar 6, 2021 — forked from ivanionut/nginx-proxy.conf
Proxy nginx to use Google Tag Manager
View nginx-proxy.conf
# Google Analytics Bypassing Adblockers
## Client
change www.googletagmanager.com => your.domain.com
```
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://your.domain.com/gtag/js?id=UA-123456789-1"></script>
```
@Belphemur
Belphemur / transmission-ssl
Last active Feb 20, 2021
Configuration to use nginx as reverse proxy for Transmission BT with SSL/HTTP2 protected with auth
View transmission-ssl
upstream transmission {
server 127.0.0.1:9091; #Transmission
}
server {
listen 443 ssl http2;
server_name example.com;
auth_basic "Server Restricted";
auth_basic_user_file /var/www/myWebSite/web/.htpasswd;
# Path to the root of your installation
@Belphemur
Belphemur / DeepDotKey.ts
Last active Oct 30, 2020
Deep generate dot notation in TypeScript with example
View DeepDotKey.ts
interface Hello {
foo : World;
bar: Number;
array: World[]
}
interface World {
greeting: string;
}
@Belphemur
Belphemur / build_nginx.sh
Last active Jul 29, 2020 — forked from MattWilcox/build_nginx.sh
Compiling Nginx with LibreSSL (and http2)
View build_nginx.sh
#!/usr/bin/env bash
# names of latest versions of each package
export NGINX_VERSION=1.15.5
export VERSION_NGINX=nginx-$NGINX_VERSION
export VERSION_LIBRESSL=libressl-2.8.1
export VERSION_PCRE=pcre-8.42
#export NPS_VERSION=1.9.32.10
#export VERSION_PAGESPEED=v${NPS_VERSION}-beta