Skip to content

Instantly share code, notes, and snippets.

@micahyoung
micahyoung / cutframes.sh
Last active June 5, 2022 21:55
iMovie cut frames
#!/bin/bash
set -o errexit -o pipefail -o nounset
# usage ./cutframes.sh "2000-01-01" "second line" "third line" prefix-
line1=$1
line2=$2
line3=$3
prefix=$4
size=1920x1080
@micahyoung
micahyoung / MINECRAFT_BEDROCK_RPI_DOCKER.md
Last active December 26, 2021 23:09
WIP: Run Minecraft Bedrock server in Docker on Rasberry Pi 64bit
@micahyoung
micahyoung / run.sh
Created September 24, 2021 17:13
rsync remote shell using docker run to sync remote volumes
docker build --tag rsync -f <(echo "FROM alpine\nRUN apk update && apk add rsync") /var/empty
rsync -vv -e 'docker run -v foo:/foo -i' -a rsync:/foo
@micahyoung
micahyoung / pack with containerized daemon.md
Last active March 4, 2021 12:43
Run pack against containerized rootless docker and podman

Pre-reqs

Download pack with build --docker-host support

As of 2021-03-04, you'll need to download a pre-release build:

  • Visit latest builds from main
  • Click the top-most green result
  • Click pack-macos (or whatever OS you're using)
  • Download and extract
  • Open terminal in directory containing pack
@micahyoung
micahyoung / README.md
Last active January 25, 2021 19:08
pack using samples on Apple Silicon M1

Pre-requisites

  • Docker Desktop preview
  • Golang, coreutils (from homebrew)
  • Git, make (from Command Line Tools (CLT) for Xcode: xcode-select --install)

Steps

  1. Clone pack, build arm binary, put on PATH

    git clone https://github.com/buildpacks/pack
    
@micahyoung
micahyoung / kp-config-configmap.yaml
Created January 14, 2021 11:10
kp-config for kpack
apiVersion: v1
kind: ConfigMap
metadata:
name: kp-config
data:
canonical.repository: micahyoung
canonical.repository.serviceaccount: tutorial-registry-credentials
@micahyoung
micahyoung / go.mod
Last active March 19, 2024 20:47
Example of os.Chown-equivalent for Golang Windows
module go-windows-chown
go 1.15
require golang.org/x/sys v0.0.0-20210110051926-789bb1bd4061
@micahyoung
micahyoung / set-localhost-listener.ps1
Last active October 12, 2020 12:16
Set Docker Windows Server localhost listener with powershell
$config=@{}
if (Test-Path C:\ProgramData\docker\config\daemon.json) {
$config=(Get-Content C:\ProgramData\docker\config\daemon.json | ConvertFrom-json)
}
Add-Member -InputObject $config -NotePropertyName "hosts" -NotePropertyValue @("npipe://", "tcp://127.0.0.1:2375")
ConvertTo-json $config | Out-File -Encoding ASCII C:\ProgramData\docker\config\daemon.json
Restart-Service docker
@micahyoung
micahyoung / Fix-AuthKeysPerms.ps1
Last active September 1, 2020 21:57
Fix Windows OpenSSH administrator authorized key file key permissions
$sshPubKey="ssh-rsa AAAA..."
echo $sshPubKey | out-file -Encoding ascii -Append C:\ProgramData\ssh\administrators_authorized_keys
$acl = Get-Acl C:\ProgramData\ssh\administrators_authorized_keys
$acl.SetSecurityDescriptorSddlForm("O:BAG:BAD:PAI(A;;FA;;;SY)(A;;FA;;;BA)")
$acl | Set-Acl
@micahyoung
micahyoung / README.md
Created August 1, 2020 17:03
Rsync-equivalent for Windows using minio

Requirements

  • MacOS/Linux/Windows workstation
  • Windows machine where source needs to be executed/built/etc
  • Trusted network access between both (VPN or LAN only)

On Windows Machine

  • Download minio executable
    choco install minio-server