Skip to content

Instantly share code, notes, and snippets.

View nklamann's full-sized avatar

Norbert Klamann nklamann

View GitHub Profile
@nklamann
nklamann / README.md
Last active November 18, 2024 09:53
Use the paperless ngx JSON-API to save data locally

This script is run at a client computer, developed under windows , but should run cross-platform. The local JSON files can be further analysed with tools like 'jq' and all kind of metainformation becomes accessible.

The script downloads data for every api endpoint.

If the variable GET_ALL_DATA in the source code is set to True, the script follows the next URL of the date recursively and collects the resutof all pages results into one result .

Speed and ressource utilization depend on a lot of foctars, subjectively I would call the thing fast.

The screen output of a test run looks like this

@nklamann
nklamann / ansible_facts.json
Last active October 16, 2025 07:41
ansible facts zum testen #ansible
[
{
"_ansible_facts_gathered": true,
"ansible_all_ipv4_addresses": [
"10.20.5.204"
],
"ansible_all_ipv6_addresses": [
"2a00:6020:41e1:fea0:a00:27ff:fee0:63ba",
"2a00:6020:41e1:fe85:5:f9db:2e3f:1e85",
"2a00:6020:41e1:fe85:a00:27ff:fee0:63ba",
@nklamann
nklamann / gist:16178cf26c90ad239ceefe984eb511f7
Last active October 16, 2025 07:39
ansible - duckdb #duckdb
WITH t AS (
SELECT j
FROM read_json('https://gist.githubusercontent.com/adityawarmanfw/3107de51d1901eb3b918bcc70a5ffb31/raw/d73e365a492f6ceb50ed25816b5a90fcf57b8eb6/ansible-test.json') AS j
), get_interface_name AS (
SELECT
j->> '$.ansible_hostname' AS hostname,
concat('ansible_', unnest(j->> '$.ansible_interfaces[*]')) AS interface_name
FROM t
)
SELECT
@nklamann
nklamann / README.md
Last active November 21, 2024 12:10
OMADA openapi calls demonstration

Motivation

This is a variation of this omada example, transcribed to the new openapi. The API documentation of the softwarecontroller is in https://<omadaserver>:8043/doc.html#/home.

Scope

I wnated to test and document the uage of the new API in itself, especially the handling of the Authorization. Working with specific endpoints is ut of scope here.

Result of omada.bash

I left a lot of echo and cat statements in the code to better see what is happening. Running this on my machine i get:

@nklamann
nklamann / JMESPath Query
Last active October 16, 2025 07:42
Hostvars #ansible #json #jemspath
*.{ host: inventory_hostname, data_group_handling: data_group_handling, backups_to_restic: backups_to_restic}