Skip to content

Instantly share code, notes, and snippets.

View midwire's full-sized avatar
🏠
Working from home

Chris Blackburn midwire

🏠
Working from home
View GitHub Profile
@midwire
midwire / tunnel.sh
Last active April 2, 2024 09:00
[SSH Personal Proxy] Setup an SSH proxy for SOCKS tunneling #bash #network #linux #command
ssh -D 8080 -CqTnN user@tunnelhost
-D - [bind_address:]port
-C - Request data compression
-q - Quiet mode
-T - Disable psuedo-terminal allocation
-N - Do not execute any remote commands
-n - Redirect stdin from /dev/null (actually, prevents reading from stdin)
Once you get the tunnel going, you can configure firefox to use a SOCKS proxy:
@midwire
midwire / appimage.desktop
Last active February 14, 2024 16:16
[Linux Desktop File] #appimage #linux
# Desktop files are located in ~/.local/share/applications
# Icons must be located in ~/.icons - and only use the base filename
# Command-line arguments can be used like this:
# Exec=sh -c "gourmet --gourmet-directory $HOME/my/custom/path/ %F"
[Desktop Entry]
Name=Lepton
GenericName=Gist Editor
Comment=Lepton Gist GUI
Exec=sh -c "$HOME/AppImage/Lepton-1.10.0.AppImage --in-process-gpu"
@midwire
midwire / sed.sh
Created February 8, 2021 23:27
[SED one-liners] Handy sed one-liners #sed #utils
Handy one-liners for SED
HANDY ONE-LINERS FOR SED (Unix stream editor) Mar. 23, 2001
compiled by Eric Pement <pemente@northpark.edu> version 5.1
Latest version of this file is usually at:
http://www.student.northpark.edu/pemente/sed/sed1line.txt
http://www.cornerstonemag.com/sed/sed1line.txt
This file is also available in Portuguese at:
http://www.lrv.ufsc.br/wmaker/sed_ptBR.html
@midwire
midwire / reset_routing_table.sh
Last active January 4, 2024 20:01
[Reset routing table on OSX] #osx #devops #networking
#!/usr/bin/env bash
# Reset routing table on OSX
# display current routing table
echo "********** BEFORE ****************************************"
netstat -r
echo "**********************************************************"
for i in {0..4}; do
sudo route -n flush # several times
@midwire
midwire / find_duplicate_movies.rb
Last active October 31, 2023 07:10
[Ruby script to find duplicate movies] Edit as necessary for your own needs. #ruby #utils
#!/usr/bin/env ruby
# Find duplicate movies with possible different extensions
require 'fileutils'
require 'colored'
include FileUtils
module FindDuplicateMovies
@midwire
midwire / go.md
Created August 29, 2023 14:40
[UDM with Pi-hole]

Configure UDM

  • Firewall & Security (side menu) - turn off Ad blocking. This is very important. If you don't do this you will get recursive DNS calls from the UDM router to your pi-hole
  • Internet (side menu) - click primary/default WAN interface. Set "Advanced" to Manual and configure primary DNS server with the static IP of your pi-hole
  • Networks (side menu) - for each network, drill down to DHCP settings under "Advanced". For DHCP Service Management click "Show Options". Turn off "Auto" for DHCP DNS Server and enter the IP of your Pi-hole. Do these steps for each network.

Configure Pi-hole

  • Configure according to your needs. The documentation is good
@midwire
midwire / sudo.sh
Last active July 13, 2023 15:07
[Make Sudo Recognize Aliases] #linux
alias sudo='sudo '
@midwire
midwire / wg.sh
Created March 29, 2023 16:53
[Autostart Wireguard VPN] #wireguard
sudo systemctl enable wg-quick@[WG_CONFIG_NAME].service
sudo systemctl daemon-reload
sudo systemctl start wg-quick@[WG_CONFIG_NAME]
systemctl status wg-quick@[WG_CONFIG_NAME]
# To Remove
sudo systemctl stop wg-quick@[WG_CONFIG_NAME]
sudo systemctl disable wg-quick@[WG_CONFIG_NAME].service
sudo rm -i /etc/systemd/system/wg-quick@[WG_CONFIG_NAME]
sudo systemctl daemon-reload
@midwire
midwire / asdf.sh
Created January 24, 2023 18:34
[List Actual DNS Servers in use] #linux
resolvectl status
# OR
systemd-resolve --status
@midwire
midwire / jquery.js
Created November 23, 2022 19:23
[Determine jQuery version in the browser]
// Paste this into the console
if (typeof jQuery != 'undefined') {
// jQuery is loaded => print the version
alert(jQuery.fn.jquery);
}