Skip to content

Instantly share code, notes, and snippets.

@stianl
stianl / keynote_export.applescript
Last active October 18, 2022 14:01 — forked from kenjisato/keynote_export.applescript
Script to Export Keynote Presentation Files to PDF or JPEG
on sansExt(theFileName)
do shell script "file=" & theFileName & ";" & "echo ${file%.*}"
end sansExt
on run argv
set keynote_path to (item 1 of argv)
set out_path to (item 2 of argv)
set extension to (item 3 of argv)
set basename to sansExt(out_path)
@stianl
stianl / zt.sh
Created May 10, 2025 12:50
Show nodes and IP's of ZeroTier network
#!/bin/sh
# Get the network id of the first network from the service API
ZT_NWID=$(curl -s -H "X-ZT1-Auth: $(cat /var/lib/zerotier-one/authtoken.secret)" http://localhost:9993/network | jq -r '.[0].nwid')
# Get the network members of that network - output the names
MEMBERS=$(curl -s -H "Accept: application/json" -H "Authorization: token $ZT_CENTRAL_API_TOKEN" "https://api.zerotier.com/api/v1/network/$ZT_NWID/member")
# Get the name and ips of all members
NAME_IPS=$(echo $MEMBERS | jq '.[]|{name: .name, ips: .config.ipAssignments}'