Skip to content

Instantly share code, notes, and snippets.

View jnsaff's full-sized avatar

Jaanus Torp jnsaff

View GitHub Profile
@RhetTbull
RhetTbull / tzname.py
Last active February 3, 2025 11:13
Get the named timezone for a given location in python using native macOS CoreLocation APIs
"""Get named timezone for a location on macOS using CoreLocation
To use this script, you need to have pyobjc-core and pyobjc-framework-CoreLocation installed:
pip install pyobjc-core pyobjc-framework-CoreLocation
This script uses CoreLocation to get the timezone for a given latitude and longitude
as well as the timezone offset for a given date.
It effectively does the same thing as python packages like [tzfpy](https://pypi.org/project/tzfpy/)
@joemiller
joemiller / raid_ephemeral.sh
Last active October 23, 2023 21:53
detect all ephemeral disks on EC2 then stripe together in a raid-0 vol mounted at /mnt
#!/bin/bash
#
# this script will attempt to detect any ephemeral drives on an EC2 node and create a RAID-0 stripe
# mounted at /mnt. It should be run early on the first boot of the system.
#
# Beware, This script is NOT fully idempotent.
#
METADATA_URL_BASE="http://169.254.169.254/2012-01-12"