Skip to content

Instantly share code, notes, and snippets.

OpenWrt sysupgrade Helper

This script will do the following:

  • Gather list of installed packages that does not exist in the ROM
  • Create a script to reinstall the packages
  • Add the newly created script to /etc/rc.local

Run this script before the sysupgrade process. Once flashing has started, wait for the router to reboot two times. The script will remove itself after successful execution.

@whiskerz007
whiskerz007 / gist:fdf49bf09666610f7dae2553771f7b64
Last active July 5, 2024 12:12
Fedora 40 setup ZFS support from live ISO
source /etc/os-release
rpm -e --nodeps zfs-fuse
dnf install --setopt=fastestmirror=1 --disablerepo=updates -y \
--repofrompath zfsonlinux,http://download.zfsonlinux.org/fedora/${VERSION_ID}/x86_64 \
--setopt=zfsonlinux.gpgkey=https://raw.githubusercontent.com/zfsonlinux/zfsonlinux.github.com/master/zfs-release/RPM-GPG-KEY-openzfs-key2 \
https://dl.fedoraproject.org/pub/fedora/linux/releases/${VERSION_ID}/Everything/x86_64/os/Packages/k/kernel-devel-$(uname -r).rpm \
zfs
modprobe zfs
@whiskerz007
whiskerz007 / gist:9d146fcb99e6db1cfb9d21bd7287f5ed
Created August 7, 2019 10:12
Create a Windows Scheduled Task to synchronize the clock when the internet is established
C:\WINDOWS\System32\schtasks.exe /CREATE /RU "NT AUTHORITY\LOCAL SERVICE" /SC ONEVENT /EC "Microsoft-Windows-NetworkProfile/Operational" /MO "*[System[Provider[@Name='Microsoft-Windows-NetworkProfile'] and EventID=10000]]" /TN "Update Time When Connected to Internet" /TR "C:\WINDOWS\System32\w32tm.exe /resync /force"
@whiskerz007
whiskerz007 / gist:e007f90fa05b8dc1fa6d69251b531070
Created May 31, 2019 15:28
WireGuard interface from IPv6 network
1. Goto https://simpledns.com/private-ipv6
2. Use the 'Combined/CID' for the WireGuard settings (everything before the '/64' starting with 'fd' and ending with '::')
3. Example WireGuard 'server' settings (replace all sections that begin with '<' and end with '>')
[Interface]
ListenPort = 51820
PrivateKey = <SERVER_PRIVATE_KEY>
Address = 192.168.99.1/24, <IPV6_CID>1/64
[Peer]
@whiskerz007
whiskerz007 / gist:4e1c7204241b8a4dc7392c1e798c82db
Created March 1, 2019 03:08
Remove orphaned objects from cgroups in Proxmox
find /sys/fs/cgroup -depth -name ${OBJECT}* -type d -print -exec bash -c "cd {}/.. ; mkdir -p {}/bar ; find $(basename {}) -depth -type d -exec rmdir \{\} \;" \;
@whiskerz007
whiskerz007 / gist:53c6aa5d624154bacbbc54880e1e3b2a
Last active November 10, 2024 02:39
How to setup a community version of Proxmox VE 5.x-6.x
# Disable Commercial Repo
sed -i "s/^deb/\#deb/" /etc/apt/sources.list.d/pve-enterprise.list
apt-get update
# Add PVE Community Repo
echo "deb http://download.proxmox.com/debian/pve $(grep "VERSION=" /etc/os-release | sed -n 's/.*(\(.*\)).*/\1/p') pve-no-subscription" > /etc/apt/sources.list.d/pve-no-enterprise.list
apt-get update
# Remove nag
echo "DPkg::Post-Invoke { \"dpkg -V proxmox-widget-toolkit | grep -q '/proxmoxlib\.js$'; if [ \$? -eq 1 ]; then { echo 'Removing subscription nag from UI...'; sed -i '/data.status/{s/\!//;s/Active/NoMoreNagging/}' /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js; }; fi\"; };" > /etc/apt/apt.conf.d/no-nag-script
@whiskerz007
whiskerz007 / google.sh
Last active February 27, 2019 10:24
Script to update EdgeOS firewall group with Google's IP addresses
#!/bin/vbash
# Update the network groups for Google
PROGNAME=$(basename $0)
HOST=$(which host)
DNS_RECORD="_spf.google.com"
DNS_RESOLVER="8.8.8.8"
SED=$(which sed)
SED_SCRIPT_HOSTS='$!d;s/[^"]*"v=spf1 \([^"]*\)~all".*/\1/'
SED_SCRIPT_LOOKUPS="${SED_SCRIPT_HOSTS};s/[^ ]*include:\([^ ]\+\)[$]*/\1/g"
@whiskerz007
whiskerz007 / Minecraft_Launcher.ps1
Last active August 5, 2018 21:15
Temporarily change displayName in Minecraft Launcher profile
$MCNewDisplayName = Read-Host -Prompt 'Enter the displayName you want to use with Minecraft'
$MCLauncherPath = "${env:APPDATA}\.minecraft\launcher_profiles.json"
function Out-MCLauncherProfiles ([string]$displayName)
{
$MCProfiles.authenticationDatabase.$MCUser.displayName = $displayName
$MCProfiles | ConvertTo-Json | Out-File $MCLauncherPath -Encoding ascii
}
function Start-MCLauncher
{
Start-Process ${env:ProgramFiles(x86)}\Minecraft\MinecraftLauncher.exe -Wait True