Skip to content

Instantly share code, notes, and snippets.

View brk3's full-sized avatar
😮‍💨

Paul Bourke brk3

😮‍💨
View GitHub Profile
@kconner
kconner / macOS Internals.md
Last active May 22, 2024 15:55
macOS Internals

macOS Internals

Understand your Mac and iPhone more deeply by tracing the evolution of Mac OS X from prelease to Swift. John Siracusa delivers the details.

Starting Points

How to use this gist

You've got two main options:

@brk3
brk3 / main.go
Created April 25, 2023 12:34
Azure AKS AAD auth
package main
import (
"context"
"fmt"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v2"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@brk3
brk3 / main.tf
Last active March 9, 2023 11:15
Terraform nested looping and grouping
terraform {}
variable "windows_web_apps" {
default = {
app1 = {
# ...
dynamic_app_settings = {
AZURE_CLIENT_ID = {
managed_identities = {
id_a = {
[sam@compy686 ~]$ cat t.sh
#!/bin/bash
# I normally set these options (with x being only sometimes)
# In this example,none of them are useful for catching your error
#set -euxo pipefail
badfunction() {
for i in $(find /error); do
echo $i
done
@seanw2020
seanw2020 / ssh-ca.md
Last active February 19, 2024 03:15
How to configure and visualize an SSH CA

How to configure an SSH CA, with visuals

ssh certificates

SSH CA

For details, see "Mastering SSH", Second Edition, Chapter 14: Certificate Authorities. Also see 'man ssh-keygen': "ssh-keygen supports signing of keys to produce certificates that may be used for user or host authentication. Certificates consist of a public key, some identity information, zero or more principal (user or host) names and a set of options that are signed by a Certification Authority (CA) key. Clients or servers may then trust only the CA key and verify its signature on a certificate rather than trusting many user/host keys. Note that OpenSSH certificates are a different, and much simpler, format to the X.509 certificates used in ssl(8).

Create two CAs

Choose a computer to act as the CA. We'll call this the CA computer (not CA host, since "host" is overloaded here). In this examp

data:text/html,<body style=margin:0><canvas id=c><script>var a,d=document,e=c.getContext("2d");c.width=innerWidth;c.height=innerHeight;e.lineWidth=9;e.lineJoin=e.lineCap="round";d.onmousedown=function(b){e.beginPath();a=!e.moveTo(b.clientX,b.clientY)};d.onmousemove=function(b){return a&&(e.lineTo(b.clientX,b.clientY),e.stroke())};d.onmouseup=function(){return a=0};d.onkeyup=function(b){switch(b.keyCode){case 32:e.strokeStyle=prompt("Enter new colour",e.strokeStyle);case 189:e.lineWidth--;break;case 187:e.lineWidth++}};</script>
Given:
J
/ \
B--------I---E---K master
/ /
/ B1 <--- last import replayed B
/ /
A---C---D---F---G---H upstream/master
@jmiserez
jmiserez / export_google_music.js
Last active December 20, 2023 01:45
(fixed/updated 2016-05-10) Export your Google Music Library and Playlists (Google Play Music All Access) (see http://webapps.stackexchange.com/questions/50311/print-playlist-from-google-play-music for more)
// Copyright 2016 Jeremie Miserez <jeremie@miserez.org>
//
// MIT License
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF O
#!/usr/bin/python
# -*- coding: utf-8 -*-
import subprocess
__all__ = ["transform"]
__version__ = '0.3'
__author__ = 'Christoph Burgmer <cburgmer@ira.uka.de>'
__url__ = 'http://github.com/cburgmer/upsidedown'
@shrikrishnaholla
shrikrishnaholla / Dockerfile
Last active January 3, 2016 02:09
Dockerfile to set up octopress. Once you spin up the container, you need to continue from http://octopress.org/docs/deploying/. You can either attach to the container, or ssh into it
FROM ubuntu
MAINTAINER shrikrishna <shrikrishna.holla@gmail.com>
# update OS
RUN echo "deb http://archive.ubuntu.com/ubuntu precise main universe" > /etc/apt/sources.list
RUN apt-get update
RUN apt-get upgrade -y
# Install depndencies
RUN apt-get install -y ruby1.9.1-dev build-essential git openssh-server vim