Skip to content

Instantly share code, notes, and snippets.

#!/bin/sh
#
# Backup the users and groups from your AWS IAM Identity
# Center (successor to AWS SSO) identity store.
#
# I wrote this because I initially modeled permission sets
# in Pulumi, before the AWS SSO API existed. This script
# is a handy way to grab a backup before doing potentially
# dangerous operations until I import users/groups into Pulumi.
#
@DanielRussell
DanielRussell / nginx.conf
Created June 2, 2022 21:53
A good starting point for a JSON log format for nginx
log_format json
'{'
' "path":"/var/log/nginx/access_log.json","type":"http",'
' "clientip":"$remote_addr","ident":"-","auth":"$remote_user",'
' "timestamp":"$time_local","verb":"$request_method",'
' "request":"$request_uri","request_path":"$uri",'
' "http_version":"$server_protocol","response":"$status",'
' "bytes":"$body_bytes_sent",'
' "referrer":"$http_referer","agent":"$http_user_agent",'
' "xff":"$http_x_forwarded_for","request_time":"$request_time",'
@DanielRussell
DanielRussell / Speakers.scpt
Last active September 25, 2015 14:56
Set Sound Output
-- Set sound output, adapted from https://discussions.apple.com/message/20676485
--
-- Run as:
-- osascript Speakers.scpt -- Default to "Internal Speakers"
-- osascript Speakers.scpt "DELL P2715Q" -- Anything listed in System Preferences,
-- -- e.g. Monitor connected via HDMI
on run argv
set asrc to "Internal Speakers"
if (count of argv) > 0 then
set asrc to item 1 of argv