Skip to content

Instantly share code, notes, and snippets.

Zyxel GS1900 certificate installer

A simple script to install a certificate (specifically PKCS#12) for the Zyxel GS1900 switch using the v2.80V2.80(AAHK.0) | 10/16/2023 firmware.
Firmware release notes can be found here: https://download.zyxel.com/GS1900-24E/firmware/GS1900-24E_2.80(AAHK.0)C0_2.pdf

The idea for it is to allow us to update the certificate automatically when needed (hands-free) with for example certbot.

After some investigation I found that the switch was very stubborn about how it wants the request sent.
In short:

@husjon
husjon / get-humble-bundle-library-keys.js
Created December 21, 2023 23:19 — forked from jonathonlui/get-humble-bundle-library-keys.js
Get list of keys from Humble Bundle Library page
/*
* Run on https://www.humblebundle.com/home/library
* Global variable `gamekeys` is available on the Library page
*
*/
Promise.all(gamekeys.map(key => {
return new Promise((resolve, reject) => {
$.ajax({
url: `https://www.humblebundle.com/api/v1/order/${key}?all_tpkds=true`
}).done(data => resolve(data))
@husjon
husjon / aoc-01-input.txt
Last active December 3, 2023 16:48
advent of code inputs
gtlbhbjgkrb5sixfivefivetwosix
ninesixrgxccvrqscbskgzxh6cpvpxsqnb6
dxxzrlzkksfsffp4
sbzvmddhnjtwollnjv33d2lbcscstqt
88xpnfpb
ninevct4cpdvqfxmspbz9xrvxfvbpzthreesfnncrqn
mqsxzsglbtmsbltrbzkbrt23
seven16ninefc
8jdddctvxs3
fivennhhdfpmrnpjhdm2sixkrsgdt
@husjon
husjon / binds_on_mount.sh
Created June 8, 2023 17:52 — forked from alexandrusavin/binds_on_mount.sh
Add letsencrypt certificate to dd-wrt web interface
#!/bin/sh
if [ `nvram get https_enable` -gt 0 ] ; then
# get the absolute directory of the executable
SELF_PATH=$(cd -P "$(dirname "$0")" && pwd -P)
echo SELF_PATH: ${SELF_PATH}
# extract the mount path
@husjon
husjon / Notes.md
Last active March 14, 2024 01:52
Script for publishing notes from Obsidian to Quartz
@husjon
husjon / FTBA_unix_202211021238-4322c4d8d1-release.sh.patch
Last active November 8, 2022 22:40
FTB Launcher patch for Linux
596c596,597
< app_java_home=`pwd`
---
> java_binary_path="$(find -name 'java' | sed 's/\/bin\/java//')"
> app_java_home="$(realpath "${java_binary_path}")"
@husjon
husjon / list_packages.sh
Created July 15, 2021 18:59
Synology list packages that has dependencies
#/bin/bash
for pkg in $(synopkg list --name); do
for dep_pkg in $(synopkg list --depend-on $pkg --name); do
echo "$pkg -> $dep_pkg";
done
done | sort
#!/bin/bash
swap() {
tmux swap-pane -s $1 -t $2
tmux select-pane -t $1
}
get_id() {
echo $(tmux run "echo #{pane_id}")
}
swap_vert() {
@husjon
husjon / gist:ae88c6e8a94b9aea4b4bb7633d5c135f
Last active September 28, 2020 09:28
`docker_container` published_ports revokal output
╭─ husjon in /tmp/testing
╰─(ノ˚Д˚)ノ ansible-playbook -i hosts playbook.yaml -vvvv
ansible-playbook 2.9.13
config file = /etc/ansible/ansible.cfg
configured module search path = ['/home/husjon/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /usr/lib/python3.8/site-packages/ansible
executable location = /usr/bin/ansible-playbook
python version = 3.8.5 (default, Sep 5 2020, 10:50:12) [GCC 10.2.0]
Using /etc/ansible/ansible.cfg as config file
setting up inventory plugins