Skip to content

Instantly share code, notes, and snippets.

@levid0s
levid0s / proxmox_nag_patch.sh
Last active April 13, 2024 10:48
Proxmox Subscription Nag Disable
# Disable Subscription Nag Dialog
ts=$(date +%Y%m%d-%H%M%S) && \
pushd /usr/share/javascript/proxmox-widget-toolkit && \
sed -z "-i.bak.$ts" 's/Ext.Msg.show({\n\s*title: gettext(\x27No valid subscription\x27),/void({ title: gettext(\x27No valid subscription\x27),/g' proxmoxlib.js && \
! grep -q 'No valid subscription' proxmoxlib.js && \
SYSTEMD_LOG_LEVEL=debug systemctl restart pveproxy.service 2>&1|egrep "Got result .* for job|Failed" && \
echo "Success!" || echo "Error!"
# Switch apt to No-Subscription
sed -i 's&^deb https://enterprise.proxmox.com/debian/&# deb https://enterprise.proxmox.com/debian/&g' /etc/apt/sources.list.d/pve-enterprise.list
@levid0s
levid0s / plugins.yaml
Created March 26, 2024 11:04
K9S Certinfo Plugin
plugins:
certinfo:
shortCut: Shift-I
confirm: false
description: Get TLS Cert Info
scopes:
- secret
command: sh
background: false
args:
@levid0s
levid0s / openwrt_ddns_porkbun_updater.sh
Last active April 23, 2024 14:51
OpenWRT DDNS Porkbun Updater
set -e
set -u
__usage="
$0
OpenWRT DDNS updater ('ddns-scripts') script for the Porkbun API.
The script has been extended to support running it directly (eg. via cron) without having to install the \`ddns-scripts\` opkg package.
Suggested script path: /usr/bin/ddns-update-porkbun.sh
# https://forums.plex.tv/t/custom-domain-certificate-not-used/855774/15
openssl pkcs12 -export -certfile fullchain1.pem -in cert1.pem -inkey privkey1.pem -out plex_new.pfx -name plex.domain.com -certpbe AES-256-CBC -keypbe AES-256-CBC -macalg SHA256
@levid0s
levid0s / ssh_to_router.txt
Last active December 23, 2023 20:56
SSH: Unable to negotiate, no matching key exchange method found
$ ssh root@192.168.1.1
Unable to negotiate with 192.168.1.1 port 22: no matching key exchange method found. Their offer: diffie-hellman-group14-sha1,diffie-hellman-group1-sha1,kexguess2@matt.ucc.asn.au
$ ssh -oKexAlgorithms=+diffie-hellman-group1-sha1 -o PubkeyAuthentication=no -o PreferredAuthentications=password -o HostKeyAlgorithms=+ssh-rsa root@192.168.1.1
BusyBox v1.23.2 (2019-02-19 01:57:00 UTC) built-in shell (ash)
# sources:
# https://unix.stackexchange.com/questions/15138/how-to-force-ssh-client-to-use-only-password-auth
# https://unix.stackexchange.com/questions/340844/how-to-enable-diffie-hellman-group1-sha1-key-exchange-on-debian-8-0
@levid0s
levid0s / raspi_static_ip.sh
Created December 23, 2023 18:56
Raspberry Pi Set Static IP
# No DHCP Server
vim /etc/network/interfaces.d/eth0-static.conf
auto eth0
iface eth0 inet static
address 22.100.0.2
gateway 22.100.0.1
netmask 24
+ reboot
# Have DHCP Server on the network
@levid0s
levid0s / etc_config_acme
Last active December 23, 2023 05:17
OpenWRT Let's Encrypt
root@router:~# opkg list-installed | grep acme
acme-acmesh - 3.0.7-1
acme-acmesh-dnsapi - 3.0.7-1
acme-common - 1.0.3
# vim /etc/config/acme
config acme
option state_dir '/etc/acme'
option account_email 'xxxx@mail.com'
option debug '1'
@levid0s
levid0s / openwrt_dns_force_redirect.conf
Created December 23, 2023 04:27
OpenWRT Force DNS via Adguard
root@router:~# uci show | grep redirect
firewall.@redirect[0]=redirect
firewall.@redirect[0].dest='lan'
firewall.@redirect[0].target='DNAT'
firewall.@redirect[0].name='Force DNS via Adguard'
firewall.@redirect[0].src='lan'
firewall.@redirect[0].src_ip='!192.168.4.2'
firewall.@redirect[0].src_dport='53'
firewall.@redirect[0].dest_ip='192.168.4.1'
firewall.@redirect[0].dest_port='53'
@levid0s
levid0s / proxmox_extend_disk.sh
Last active April 13, 2024 10:39
Proxmox Extend Host Disk
###
### Extend Host Disk Partition
###
# https://command-not-found.com/growpart
# https://forum.proxmox.com/threads/change-host-disks-how-resize-partition.90729/
apt-get install cloud-utils
growpart /dev/sda 3
pvresize /dev/sda3
@levid0s
levid0s / proxmox_crash_fix.sh
Created December 18, 2023 15:05
Dell Wyse 5070 Promox Nic Crash
# https://forum.proxmox.com/threads/system-hanging-after-upgrade-nic-driver.129366/page-2
echo "deb http://download.proxmox.com/debian/pve bookworm pvetest" | sudo tee -a /etc/apt/sources.list
apt update
apt install proxmox-kernel-6.2.16-18-pve
apt install proxmox-headers-6.2.16-18-pve
proxmox-boot-tool kernel unpin
reboot