Skip to content

Instantly share code, notes, and snippets.

View OneCDOnly's full-sized avatar
🕶️
just geekin' out

OneCD OneCDOnly

🕶️
just geekin' out
  • ... there, behind that sofa!
  • 14:42 (UTC +10:00)
View GitHub Profile
@OneCDOnly
OneCDOnly / mod-qpkg-db.sh
Last active January 29, 2023 07:14
allow an unsigned QPKG to be installed and run in QTS while QTS is configured to disallow this
#!/usr/bin/env bash
# Copyright (C) 2023 OneCD - one.cd.only@gmail.com
# This script was written on 2023-01-29. It is intended as a proof-of-concept, rather than a hack.
# Modify the QTS App Center certificate dB, and add an unsigned QPKG as-if it were signed. It adds a QNAP generated certificate and digital signature to the database for the unsigned QPKG.
# Running the code below makes the target QPKG effectively "signed", and allows user to install and run this QPKG with the 'Allow installation of applications without a valid digital signature' App Center option unticked.
@OneCDOnly
OneCDOnly / gist:2ddf36908b17097e670c36367a68015a
Created November 27, 2021 02:01
notes regarding package signing in QTS 5
It turns out, to get rid of the "There is no digital signature" message in App Center, one only has to add a new entry to [/etc/config/nas_sign_qpkg.db] in the 'Certificate' table. Create a new record, with a "qpkg" 'Type', and 'QpkgName' as the internal QPKG name. Reload App Center. Done. No more warning. The QPKG is still not digitally signed but will also not display an error message in App Center.
@OneCDOnly
OneCDOnly / gist:c6faa21b3f5ad53b43f16ac425b0f0e6
Created August 19, 2021 05:32
make all backup NZBs zero bytes
find /media/downloads/sabnzbd/nzb/backup/ -type f -name "*.nzb.*" ! -size 0 -print0 | xargs -0 truncate -s 0
@ishad0w
ishad0w / sources.list
Last active March 17, 2024 02:06
Debian 11 (Bullseye) -- Full sources.list
deb http://deb.debian.org/debian bullseye main contrib non-free
deb-src http://deb.debian.org/debian bullseye main contrib non-free
deb http://deb.debian.org/debian bullseye-updates main contrib non-free
deb-src http://deb.debian.org/debian bullseye-updates main contrib non-free
deb http://deb.debian.org/debian bullseye-backports main contrib non-free
deb-src http://deb.debian.org/debian bullseye-backports main contrib non-free
deb http://security.debian.org/debian-security/ bullseye-security main contrib non-free
@OneCDOnly
OneCDOnly / gist:947404ecd6efe48d763bf5c4b3761665
Created January 3, 2021 03:09
Kate highlighted keywords
# These demonstrate available words for syntax highlighting on Kate (makes it easier to pick a word that stands-out):
# ALERT ATTENTION DANGER HACK SECURITY
# BUG FIXME DEPRECATED TASK TODO TBD WARNING CAUTION NOLINT
# ### NOTE NOTICE TEST TESTING
@OneCDOnly
OneCDOnly / gist:cfbe704cad21f9185417f0d877dc4ddb
Created December 30, 2020 07:13
observational notes regarding 'Operating_Status' field values in [/etc/config/qpkg.conf]
QTS 4.5.1.1495
Example looks like:
"Operating_Status = 4:0:41309:0"
first field: 4 if QPKG has been stopped (using the qpkg_service utility) and 3 if started
second field: always 0
third field: NAS uptime in seconds when this entry was last updated
fourth field: always 0
@mob-sakai
mob-sakai / _README.md
Last active February 20, 2024 00:29
Run shell script on gist

Run shell script on gist

Shells that support process substitution such as bash and zsh allow to run shell script on gist as follows.

# With curl:
bash <(curl -sL ${GIST_URL}) args...

# With wget:
@OneCDOnly
OneCDOnly / gist:f0a756e33d82ede0f2f7de1b0ecdb511
Created October 9, 2020 03:45
find unused BASH functions in script
#!/usr/bin/env bash
target_pathfile="$1"
target_func=''
for target_func in $(grep '()$' "$target_pathfile" | grep -v '=\|\$' | sed 's|()||g'); do
[[ $(grep -ow "$target_func" < "$target_pathfile" | wc -l) -eq 1 ]] && echo "$target_func()"
done
@OneCDOnly
OneCDOnly / gist:648b77db6e54bdde4cdb9de4484d3ded
Last active September 14, 2020 22:29
build all QPKGs in current directory
for d in $(ls -d */); do cd $d; qbuild; cd ..; done;
@OneCDOnly
OneCDOnly / gist:13b1f85e4c23c65f5fc5fe7228e6e2b6
Created October 12, 2019 07:01
disable all installed QPKGs in QTS
packages=($(grep '^\[.*\]$' /etc/config/qpkg.conf | sed 's|[][]||g'))
for package in ${packages[*]}; do setcfg $package Enable FALSE -f /etc/config/qpkg.conf; done