Skip to content

Instantly share code, notes, and snippets.

View charlieporth1's full-sized avatar

Charles Porth charlieporth1

View GitHub Profile
@charlieporth1
charlieporth1 / oneshot_setup.sh
Created August 30, 2024 02:26 — forked from oskar456/oneshot_setup.sh
Raspberry Pi Zero USB gadget mode with ethernet and serial
#!/bin/sh
# Enable gadget mode
echo "dtoverlay=dwc2,dr_mode=peripheral" >> /boot/config.txt
systemctl enable setupgadget.service
# alternatively: ln -s /etc/systemd/system/setupgadget.service /etc/systemd/system/basic.target.wants/setupgadget.service
# Enable getty on the virtual serial line
systemctl enable [email protected]
# alternatively: ln -s /lib/systemd/system/[email protected] /etc/systemd/system/getty.target.wants/[email protected]
@charlieporth1
charlieporth1 / etc_init.d_tailscaled
Last active November 5, 2024 03:41
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