Skip to content

Instantly share code, notes, and snippets.

View drewdiver's full-sized avatar

tiredsince1985 drewdiver

View GitHub Profile
@drewdiver
drewdiver / json.awk
Created March 14, 2025 08:45 — forked from mohd-akram/json.awk
Extract a value from a JSON object or array in awk
#
# Extract a JSON value in an object:
#
# items = get_json_value(json, "payload.tree.items")
#
# Or in an array:
#
# while ((item = get_json_value(items, i++)))
# name = decode_json_string(get_json_value(item, "name"))
#
@drewdiver
drewdiver / free_ports.sh
Created May 25, 2023 13:51 — forked from hjbotha/free_ports.sh
Free ports 80 and 443 on Synology NAS
#! /bin/bash
# NEWLY ADDED BACKUP FUNCTIONALITY IS NOT FULLY TESTED YET, USE WITH CARE, ESPECIALLY DELETION
# Developed for DSM 6 - 7.0.1. Not tested on other versions.
# Steps to install
# Save this script in one of your shares
# Edit it according to your requirements
# Backup /usr/syno/share/nginx/ as follows:
# # cd /usr/syno/share/
# # tar cvf ~/nginx.tar nginx