jq is useful to slice, filter, map and transform structured json data.
brew install jq
| [Unit] | |
| Description=Test NetworkNamespacePath with DynamicUser | |
| After=network-online.target | |
| Wants=network-online.target | |
| [Service] | |
| Type=simple | |
| # Use DynamicUser to create a temporary user for the service | |
| DynamicUser=true |
| blueprint: | |
| name: Low disk space detection & notification for all disks | |
| description: Regularly test all sensors with 'disk' device-class for crossing | |
| a certain disk level threshold and if so execute an action. | |
| domain: automation | |
| input: | |
| threshold: | |
| name: disk warning level threshold | |
| description: disk sensors above threshold are assumed to be low-disk (as | |
| well as binary disk sensors with value 'on'). |
| from collections import defaultdict | |
| def build_graph(edge_list): | |
| graph = defaultdict(list) | |
| seen_edges = defaultdict(int) | |
| for src, dst, weight in edge_list: | |
| seen_edges[(src, dst, weight)] += 1 | |
| if seen_edges[(src, dst, weight)] > 1: # checking for duplicated edge entries | |
| continue |
| #!/bin/bash | |
| # start openconnect tunnel and shell inside Linux network namespace | |
| # | |
| # this is a fork of schnouki's script, see original blog post | |
| # https://schnouki.net/posts/2014/12/12/openvpn-for-a-single-application-on-linux/ | |
| # | |
| # original script can be found here | |
| # https://gist.github.com/Schnouki/fd171bcb2d8c556e8fdf | |
| # ------------ adjust values below ------------ |
| # Install ARCH Linux with encrypted file-system and UEFI | |
| # The official installation guide (https://wiki.archlinux.org/index.php/Installation_Guide) contains a more verbose description. | |
| # Download the archiso image from https://www.archlinux.org/ | |
| # Copy to a usb-drive | |
| dd if=archlinux.img of=/dev/sdX bs=16M && sync # on linux | |
| # Boot from the usb. If the usb fails to boot, make sure that secure boot is disabled in the BIOS configuration. | |
| # Set swiss-french keymap |