Skip to content

Instantly share code, notes, and snippets.

View mwoolweaver's full-sized avatar
🎯
collecting stuuf

Michael Woolweaver mwoolweaver

🎯
collecting stuuf
View GitHub Profile
#!/usr/bin/env bash
echo "${SUDO_USER}"
@mwoolweaver
mwoolweaver / index.html
Last active March 9, 2025 04:52
simple website to enable bookmarking a simple disable site for Pi-hole
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link
rel="apple-touch-icon"
href="/admin/img/favicons/apple-touch-icon.png"
sizes="180x180"
/>
@mwoolweaver
mwoolweaver / ssh_config
Last active February 19, 2025 01:06
deploy script and ssh_config to allow pushing certbot certs to webservers on local network and Pi-hole using ssh-keys instead of password login
# this file goes on the host that is pushing the certs to the hosts listed below
# fill in the corresponding info and place in /etc/ssh/
Host blockbuster
HostName 10.0.0.xxx
Port 22
User blockbuster
AddKeysToAgent yes
PreferredAuthentications publickey
IdentityFile /home/blockbuster/.ssh/key.pub
@mwoolweaver
mwoolweaver / ports.ubuntu.mirrors.list.txt
Last active January 27, 2025 18:01 — forked from swetoast/gist:32d382fc714f1bda0850bfe09d0cb09e
List of Mirrors for ports.ubuntu.com
https://ftp.tu-chemnitz.de/pub/linux/ubuntu-ports/
https://mirror.kumi.systems/ubuntu-ports/
https://mirrors.aliyun.com/ubuntu-ports/
https://mirrors.mit.edu/ubuntu-ports/
https://ftp.ubuntu-tw.org/mirror/ubuntu-ports/
https://mirror.yandex.ru/ubuntu-ports/
https://mirrors.ustc.edu.cn/ubuntu-ports/
https://mirror.csclub.uwaterloo.ca/ubuntu-ports/
https://files.openstack.org/mirror/ubuntu-ports/
https://mirror.ossplanet.net/ubuntu-ports/
@mwoolweaver
mwoolweaver / ubuntu.plucky.sources
Last active January 18, 2025 04:58
default Ubuntu 25.04 (Plucky Puffin) .sources file
## See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to newer versions of the distribution.
##
## Ubuntu distribution repository
##
## The following settings can be adjusted to configure which packages to use from Ubuntu.
## Mirror your choices (except for URIs and Suites) in the security section below to
## ensure timely security updates.
##
## Types: Append deb-src to enable the fetching of source package.
##
@mwoolweaver
mwoolweaver / 98-reboot-required.sh
Created July 29, 2024 03:31
check if reboot required and if reboot is scheduled
#!/bin/bash
if [ -f /run/systemd/shutdown/scheduled ] || [ -f /var/run/reboot-required ]; then
echo " *** System restart scheduled for $(date -d "@$( awk -F '=' '/USEC/{ $2=substr($2,1,10); print $2 }' /run/systemd/shutdown/scheduled )") ***"
fi
@mwoolweaver
mwoolweaver / groups.tsv
Last active January 29, 2021 05:21
whitelists
enabled name description comment file
1 anudeepND/whitelist https://github.com/anudeepND/whitelist qjz9zk https://gist.githubusercontent.com/mwoolweaver/574d3a0f712d96a152938645f4b7e919/raw/5519cd832fc7fa6ebd8cf04f7df43634a65ba4b0/whitelist.tsv
1 anudeepND/optionals https://github.com/anudeepND/whitelist qjz5zk https://gist.githubusercontent.com/mwoolweaver/574d3a0f712d96a152938645f4b7e919/raw/5519cd832fc7fa6ebd8cf04f7df43634a65ba4b0/optionals.tsv
1 anudeepND/referrals https://github.com/anudeepND/whitelist qjz7zk https://gist.githubusercontent.com/mwoolweaver/574d3a0f712d96a152938645f4b7e919/raw/5519cd832fc7fa6ebd8cf04f7df43634a65ba4b0/referrals.tsv
@mwoolweaver
mwoolweaver / .bashrc
Last active July 26, 2020 04:58 — forked from marioBonales/.bashrc
Default .bashrc for ubuntu
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
# don't put duplicate lines in the history. See bash(1) for more options
# ... or force ignoredups and ignorespace
HISTCONTROL=ignoredups:ignorespace
@mwoolweaver
mwoolweaver / readme.md
Last active January 10, 2025 03:10
Make all network traffic for a specific user use a specific network interface

this was found here --> https://www.niftiestsoftware.com/2011/08/28/making-all-network-traffic-for-a-linux-user-use-a-specific-network-interface <-- by accedent and worked very nicely for me so I saved it here to find easier next time.

I’ve recently been testing out a VPN service, and normally while running the VPN, all internet traffic goes over the VPN interface. This isn’t really ideal, as I only want traffic from a specific application (qBittorrent) to use the VPN. IPTables doesn’t seem to have the option to filter specific processes, but it can filter based on a specific user account.

IPTables itself doesn’t really deal with routing packets to interfaces, so we can’t use it to directly route packets. We can however mark packets from the user so they can be routed by the ip routing table. I’ve created a script to flush and apply firewall rules, which does what we need ( obviously set the variables at the beginning of the script to match your details ):

#! /bin/bash
@mwoolweaver
mwoolweaver / README
Created April 25, 2020 20:34 — forked from radfish/README
Route only Transmission through a VPN connection using your own VPN server
# The approach is to mark packets from a specific user,
# create a dedicated routing table with a default route
# through the VPN, and force all marked packets to be
# routed using that table.
#
# Sources:
# https://www.niftiestsoftware.com/2011/08/28/making-all-network-traffic-for-a-linux-user-use-a-specific-network-interface/
# http://freeaqingme.tweakblogs.net/blog/9340/netflix-using-a-vpn-for-just-one-application.html
# In this guide