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 / 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 / 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 / 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);
}
@midwire
midwire / flash_all.sh
Last active November 17, 2022 17:41 — forked from willwm/flash_all.sh
[Flash complete stock ROM for OnePlus 8T] fastboot: Flash All Partitions (OnePlus 8T)
fastboot flash product product.img
fastboot flash abl abl.img
fastboot flash aop aop.img
fastboot flash bluetooth bluetooth.img
fastboot flash boot boot.img
fastboot flash cmnlib cmnlib.img
fastboot flash cmnlib64 cmnlib64.img
fastboot flash devcfg devcfg.img
fastboot flash dsp dsp.img
fastboot flash dtbo dtbo.img
@midwire
midwire / remove_residual_config.sh
Created September 23, 2022 15:25
[Remove all residual configs in Ubuntu] One-liner to remov all residual config packages in Ubuntu #ubuntu #apt
# Remove all the packages with residual configuration.
# http://stuzhao.blogspot.com/2012/07/removing-all-residual-config-packages.html
sudo apt-get remove --purge `dpkg -l | grep '^rc' | awk '{print $2}'`
@midwire
midwire / handlers.rb
Created September 16, 2022 19:31
[Rails renderer formats and handlers] list of rendering formats and handlers for Rails #ruby #rails
# You can pass these to `render`
formats: [
:atom,
:bmp,
:css,
:csv,
:doc,
:doc,
:docx,
:docx,
@midwire
midwire / git-branch-sync.sh
Created August 26, 2022 13:40
[Git - sync local branches with remote] Remove local branches if they don't exist on the remote #git
# Use git branch -D to remove branches even if they are not fully merged
git fetch -p ; git branch -r | awk '{print $1}' | egrep -v -f /dev/fd/0 <(git branch -vv | grep origin) | awk '{print $1}' | xargs git branch -d