Skip to content

Instantly share code, notes, and snippets.

@YOU54F
YOU54F / README.md
Last active April 24, 2024 17:28
Apple Silicon and Virtual Machines: Beating the 2 VM Limit
@YOU54F
YOU54F / ruby_packagers.md
Last active December 18, 2023 20:22
State of Ruby packaging / executables - 2023

So you've got a cool app in Ruby, and you want to share it with your friends, but they don't love Ruby as much as you.

What do you do? Package it up along with the Ruby runtime and give it to them. Simple right? Maybe not so.

Thankfully smarter cookies than me, have tackled the problem, here is a map of the current state of play

  • Traveling-ruby
    • revisted for Ruby 2.6.10 -> 3.3.0-preview1 and arm64 MacOS/Windows in this fork
      • PR proposed upstream here
  • Rb2exe revisted to use the updated traveling-ruby releases in this fork
@YOU54F
YOU54F / install.sh
Last active October 4, 2023 19:55
Homebrew Installer allowing Linux Arm64
#!/bin/bash
# We don't need return codes for "$(command)", only stdout is needed.
# Allow `[[ -n "$(command)" ]]`, `func "$(command)"`, pipes, etc.
# shellcheck disable=SC2312
set -u
abort() {
printf "%s\n" "$@" >&2
@YOU54F
YOU54F / mact-tart
Last active October 4, 2023 17:03
Run GitHub Actions projects, locally, using on MacOS ARM64 Virtual Machines with Tart
#!/bin/bash
PROJECT=${PWD##*/}
PLATFORM=${PLATFORM:-macos-latest}
WORKFLOW=${WORKFLOW:-test.yml}
IMAGE=${IMAGE:-runner}
SSH_USER=${SSH_USER:-runner}
SSH_PASS=${SSH_PASS:-runner}
# IMAGE=${IMAGE:-ghcr.io/cirruslabs/macos-ventura-xcode:14.3.1}
@YOU54F
YOU54F / prlctlman
Created October 4, 2023 14:42
Parallels VM Manager - helps list, snapshot and show details about a machine
#!/bin/bash
name=$(basename $0)
prlctl list --info "${1}" > /dev/null
if [ "$?" -eq 0 ] ; then
os="$1"
id=$(prlctl snapshot-list "${os}" | grep -oE '\*{.*\}' | tr -d '*{}')
action="$2"
@YOU54F
YOU54F / mact-prl
Created October 4, 2023 14:40
Run GitHub Actions projects, locally, using on Parallels Virtual Machines
#!/bin/bash -l
# prlctl-ssh
# ==========
# Parallels Desktop command line utility for open a new SSH connection to a given virtual machine.
# If the virtual machine is stopped or suspended the utility will attempt to respawn it before it attemts to SSH into the machine.
# ## Preconditions
@YOU54F
YOU54F / vanilla-big-sur-11.0.1.pkr.hcl
Last active October 4, 2023 14:15
big sur packer template
packer {
required_plugins {
tart = {
version = ">= 1.2.0"
source = "github.com/cirruslabs/tart"
}
}
}
source "tart-cli" "tart" {
@YOU54F
YOU54F / release_getter.sh
Last active October 4, 2023 14:15
list github releases with github cli
gh release view --repo $REPO $tag --json assets | jq '[.[]|.[]|.name ]' |\
jq -r 'group_by((if contains("linux") then "linux" elif contains("osx") then "osx" elif contains("windows") then "windows" else null end),
(if contains("arm64") then "arm64" elif contains("x86_64") then "x86_64" elif contains("-x86.") then "x86" else null end)) | map({platform: .[0]|(if contains("linux") then "linux" elif contains("osx") or contains("darwin") or contains("apple") then "macos" elif contains("windows") then "windows" else null end), arch: .[0]|(if contains("arm64") then "arm64" elif contains("x86_64") then "x86_64" elif contains("-x86.") then "x86" else null end), names: map({name: .})})';
@YOU54F
YOU54F / .gitignore
Last active October 4, 2023 14:11
Pactflow & Pact Helper - Bash Script
pact
pactflow.cookie.json
tokens.response.json
.env
.vscode
@YOU54F
YOU54F / .gitignore
Last active October 4, 2023 14:10
Pactflow Login Helper - Demonstration of logging in with Cognito SRP
cookie.txt