Skip to content

Instantly share code, notes, and snippets.

View charlieporth1's full-sized avatar

Charles Porth charlieporth1

View GitHub Profile
@charlieporth1
charlieporth1 / etc_init.d_tailscaled
Last active May 24, 2024 16:46
Init.d file for tailscale (/etc/init.d/tailscaled)
#! /bin/bash
#
### BEGIN INIT INFO
# Provides: my-service-name
# Required-Start: $all
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: your description here
### END INIT INFO
server {
listen ctp-vpn.local:80;
listen ctp-vpn.local:3000;
listen ctp-vpn.local:443 ssl;
listen ctp-vpn.local:27443 quic reuseport;
listen [::]:80;
listen [::]:3000;
server {
listen ctp-vpn.local:80;
listen ctp-vpn.local:3000;
listen [::]:80;
listen [::]:3000;
server_name
http.charlesp.net
simple-http.charlesp.net
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Login Page</title>
</head>
<body>
<h1>Simple HTTP website</h1>
<p>Charles Porth created this website</p>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Login Page</title>
</head>
<body>
<h1>Manual Password Browser Saver</h1>
<p>Created for saving a username and password to a browser's autofill</p>
@charlieporth1
charlieporth1 / adlists.list
Last active November 1, 2023 15:48
Pi-Hole Adlist
blocklist.site/app/dl/ads
http://hostsfile.mine.nu/hosts0.txt
http://jasonhill.co.uk/pfsense/ytadblock.txt
http://malwaredomains.lehigh.edu/files/domains.txt
http://mirror1.malwaredomains.com/files/justdomains
http://pgl.yoyo.org/adservers/serverlist.php
http://pgl.yoyo.org/as/serverlist.php?hostformat=hosts;showintro=0
http://pilotfiber.dl.sourceforge.net/project/adzhosts/HOSTS.txt
http://private-lists.whisky.software/txt_lists/ctp-lists/china-blacklist.list
http://private-lists.whisky.software/txt_lists/ctp-lists/vulnerability-blacklist.list
#!/usr/bin/env bash
export DEBIAN_FRONTEND=noninteractive
export OS_ID=$(cat /etc/os-release | grep -E ^ID= | awk -F= '{print $2}' | awk '{print $1=$1}')
export VERSION_CODENAME=$(cat /etc/os-release | grep VERSION_CODENAME | awk -F= '{print $2}' | awk '{print $1=$1}')
dpkg --add-architecture i386
apt-get update
apt-get install -y ca-certificates apt-transport-https curl wget
#!/usr/bin/env bash
apt_out_file=/etc/apt/sources.list.d/apt-fast.list
export CPU_CORE_COUNT=`cat /proc/stat | grep cpu | grep -E 'cpu[0-9]+' | wc -l`
export DEBIAN_FRONTEND=noninteractive
export OS_ID=$(cat /etc/os-release | grep -E ^ID= | awk -F= '{print $2}' | awk '{print $1=$1}')
if [[ $OS_ID = ubuntu ]]; then
export VERSION_CODENAME=$(cat /etc/os-release | grep VERSION_CODENAME | awk -F= '{print $2}' | awk '{print $1=$1}')
else
export VERSION_CODENAME=focal
export OS_ID=ubuntu
@charlieporth1
charlieporth1 / NFTTables_or_IPTables_switcher_Ubuntu_and_Debian.sh
Last active March 26, 2024 02:02
NFTTables or IPTables switcher Ubuntu & Debian
#!/bin/bash
which_tables=$1
timeout_time=180
function set_iptables() {
arg=$1
table=$2
find -L /usr/sbin -name 'iptables*' -type l -exec rm -rf {} \;
find -L /usr/sbin -name 'ip6tables*' -type l -exec rm -rf {} \;
echo 0 | update-alternatives $arg iptables /usr/sbin/iptables-$table
@charlieporth1
charlieporth1 / WireGuard-site-to-site.md
Created December 19, 2021 14:30
Accessing a subnet that is behind a WireGuard client using a site-to-site setup

WireGuard Site-to-Site

Accessing a subnet that is behind a WireGuard client using a site-to-site setup

Problem Summary

We want to access a local subnet remotely, but it is behind a NAT firewall and we can't setup port forwarding. Outgoing connections work, but all incoming connections get DROPPED by the ISP's routing policy.

Solution Summary