Skip to content

Instantly share code, notes, and snippets.

prereqs

  • need to be a global admin to create service principal accounts when actually spinning up a cluster
  • create an SSH key and add to your OS keychain (e.g. ssh-add ...)

Issues you may run into!

  • "Insufficient privileges to complete the operation" during cluster creation

Your Azure account needs to be a Global Administrator so you can create service principal access.

@jamesmartin
jamesmartin / bt.swift
Created March 31, 2017 01:53
Swift example of iterating over all known Bluetooth devices on macOS
import IOBluetooth
// See https://developer.apple.com/reference/iobluetooth/iobluetoothdevice
// for API details.
class BluetoothDevices {
func pairedDevices() {
print("Bluetooth devices:")
guard let devices = IOBluetoothDevice.pairedDevices() else {
print("No devices")
return
@swillits
swillits / Keycodes.swift
Last active July 15, 2025 04:47
Swift Keyboard Keycodes
struct Keycode {
// Layout-independent Keys
// eg.These key codes are always the same key on all layouts.
static let returnKey : UInt16 = 0x24
static let enter : UInt16 = 0x4C
static let tab : UInt16 = 0x30
static let space : UInt16 = 0x31
static let delete : UInt16 = 0x33
static let escape : UInt16 = 0x35
@g0t4
g0t4 / _README.md
Created November 30, 2016 03:46
Setting up a Docker Hub registry mirror on a Synology NAS

Instructions

  • Save the docker-compose.yml and config.yml in the same directory on one of your volumes on the NAS.
  • SSH in and use docker-compose up -d
  • Test the mirror with curl --head http://NAS-IP:55000
  • Start up docker daemons with the following option or put this in the daemon config file or copy into Docker for Mac/Windows settings. --registry-mirror=http://NAS-IP:55000
  • Pull an image and then check that it is cached in your mirror with curl http://NAS-IP:55000/v2/_catalog
    • or check that a large image isn't slow after the first pull :)

Notes

@softinio
softinio / README.md
Created November 8, 2016 22:28 — forked from brianknight10/README.md
Vagrant setup for Docker development

#Base Docker Development VM

Provisions an Ubuntu server with Docker Compose.

  • Creates an Ubuntu VM running Docker
  • Allows for configuration using a docker-compose.yml file

##How do i use it?

Step 1. Install vagrant

@mcxiaoke
mcxiaoke / app.swift
Created May 24, 2016 04:13 — forked from lmrco/app.swift
swift osx application without nib
import Cocoa
class AppDelegate: NSObject, NSApplicationDelegate {
let app: NSApplication
let controller: NSWindowController
init(app: NSApplication) {
self.app = app
self.controller = NiblessWindowController()
def orchestrate(name, saltenv=None, test=None, exclude=None, pillar=None):
'''
Execute a state.orchestrate call and report success.
.. versionadded:: 2015.8.4
name
Name of the orchestration state to run.
Examples:
@JALsnipe
JALsnipe / BatteryInfo.swift
Last active November 5, 2021 13:47
Script to get iOS device battery info from the BatteryCenter private framework
import Foundation
guard case let batteryCenterHandle = dlopen("/System/Library/PrivateFrameworks/BatteryCenter.framework/BatteryCenter", RTLD_LAZY) where batteryCenterHandle != nil else {
fatalError("BatteryCenter not found")
}
guard let c = NSClassFromString("BCBatteryDeviceController") as? NSObjectProtocol else {
fatalError("BCBatteryDeviceController not found")
}
@superjamie
superjamie / raspberry-pi-vpn-router.md
Last active December 29, 2024 07:04
Raspberry Pi VPN Router

Raspberry Pi VPN Router

This is a quick-and-dirty guide to setting up a Raspberry Pi as a "router on a stick" to PrivateInternetAccess VPN.

Requirements

Install Raspbian Jessie (2016-05-27-raspbian-jessie.img) to your Pi's sdcard.

Use the Raspberry Pi Configuration tool or sudo raspi-config to: