Skip to content

Instantly share code, notes, and snippets.

@shurick81
Last active February 28, 2026 15:09
Show Gist options
  • Select an option

  • Save shurick81/aacc7f8b67005bbf76bd2958523ecc37 to your computer and use it in GitHub Desktop.

Select an option

Save shurick81/aacc7f8b67005bbf76bd2958523ecc37 to your computer and use it in GitHub Desktop.
Mac Provisioning
brew install --cask multipass
brew install ubuntu/microk8s/microk8s
multipass delete microk8s-vm
multipass purge
microk8s install --channel=1.33/stable --cpu 6 --mem 6
microk8s status --wait-ready
microk8s kubectl create deployment hello-web --image=nginx
microk8s kubectl expose deployment hello-web --type=NodePort --port=80
port=$(microk8s kubectl get svc hello-web -o jsonpath='{.spec.ports[0].nodePort}')
internal_ip=$(microk8s kubectl get nodes -o jsonpath="{.items[0].status.addresses[?(@.type=='InternalIP')].address}")
curl http://$internal_ip:$port
microk8s kubectl delete svc hello-web
microk8s kubectl delete deployment hello-web
multipass exec microk8s-vm -- sudo snap install juju --channel=3.6/stable
multipass exec microk8s-vm -- juju version
multipass exec microk8s-vm -- sudo usermod -a -G microk8s ubuntu
multipass exec microk8s-vm -- mkdir /home/ubuntu/.kube
multipass exec microk8s-vm -- sudo chown -R ubuntu /home/ubuntu/.kube
multipass stop microk8s-vm
multipass start microk8s-vm
microk8s enable hostpath-storage
multipass exec microk8s-vm -- sh -c 'microk8s config | juju add-k8s local-k8s --client'
multipass exec microk8s-vm -- juju clouds
multipass exec microk8s-vm -- juju bootstrap local-k8s
multipass exec microk8s-vm -- juju controllers
multipass exec microk8s-vm -- juju add-model kubeflow
multipass exec microk8s-vm -- sh -c 'cat <<EOF > arm-overlay.yaml
applications:
kubeflow-dashboard:
options:
node-selector: "kubernetes.io/arch=arm64"
EOF'
multipass exec microk8s-vm -- juju deploy kubeflow --channel=1.10/edge --overlay ./arm-overlay.yaml --trust
multipass exec microk8s-vm -- juju status --watch 5s
# xcode-select --install
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
cd /opt/homebrew/bin/
ls
PATH=$PATH:/opt/homebrew/bin
cd
touch .zshrc
echo export PATH=$PATH:/opt/homebrew/bin -> .zshrc
softwareupdate --install-rosetta --agree-to-license
brew doctor
brew install --cask keepassxc
brew install --cask cursor
brew install --cask visual-studio-code
brew install --cask drawio
brew install git
brew install --cask docker
#brew install docker
#brew install colima
#brew install qemu
#brew install lima-additional-guestagents
brew install docker-buildx
brew install kubectl
#brew install kustomize
#brew install --cask utm
#brew install --cask vagrant
#brew install cdrtools
brew install --cask telegram
#brew install --cask microsoft-remote-desktop
brew install --cask windows-app
#brew install --cask microsoft-onenote
#brew install --cask yubico-yubikey-manager
brew install --cask vlc
brew install --cask microsoft-teams
brew install --cask paintbrush
brew install --cask gimp
brew install --cask google-chrome
brew install --cask whatsapp
brew install --cask microsoft-outlook
brew install --cask microsoft-word
brew install --cask audacity
#brew install --cask steam
#brew install --cask battle-net
#brew install --cask logitech-g-hub
brew install --cask nx-studio
brew install --cask claude
#brew install --cask claude-code
#brew install --cask chatgpt
#brew install caddy
#brew install azure-cli
brew install --cask superwhisper
brew install --cask spotify
#brew install mist
brew install yq
brew install whois
brew install watch
brew install node
#poppler contains pdftotext
brew install poppler
brew install --cask balenaetcher #linux usb images
brew install --cask raspberry-pi-imager
brew install --cask obs
#vagrant plugin install vagrant-qemu
code --install-extension eamodio.gitlens
code --install-extension ms-azure-devops.azure-pipelines
code --install-extension HashiCorp.terraform
code --install-extension redhat.vscode-xml
code --install-extension bierner.markdown-mermaid
code --install-extension ms-vscode-remote.remote-containers
code --install-extension ms-azuretools.vscode-docker
code --install-extension GitHub.codespaces
code --install-extension ms-vscode.live-server
code --install-extension DotJoshJohnson.xml
code --install-extension ms-azuretools.vscode-bicep
#code --install-extension donjayamanne.githistory
code --install-extension hashicorp.hcl
code --install-extension GitHub.copilot
code --install-extension ms-python.python
code --install-extension anthropic.claude-code
mkdir ~/Desktop/Screenshots
defaults write com.apple.screencapture location ~/Desktop/Screenshots/
killall SystemUIServer
git config --global user.email "alexander@sapozhkov.net";
git config --global user.name "Aleksandr Sapozhkov";
ssh-keygen -t ed25519 -C "alexander@sapozhkov.net";
#ssh-keygen -m PEM -t rsa -b 4096 -f ~/.ssh/id_rsa.pem -C "alexander@sapozhkov.net";
cat > "$HOME/Library/Application Support/Claude/claude_desktop_config.json" <<EOF
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-filesystem",
"$HOME/Documents/shared"
]
}
}
}
EOF
colima start --runtime docker --arch x86_64
colima start --kubernetes --memory 4 --arch x86_64
cat > "$HOME/.docker/config.json" <<EOF
{
"auths": {},
"currentContext": "colima"
}
EOF
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
cd /opt/homebrew/bin/
ls
PATH=$PATH:/opt/homebrew/bin
cd
touch .zshrc
echo export PATH=$PATH:/opt/homebrew/bin -> .zshrc
brew install --cask cursor
brew install --cask visual-studio-code
brew install --cask drawio
brew install --cask docker
brew install --cask superwhisper
brew install azure-cli
brew install --cask claude-code
brew install argocd
brew install Azure/kubelogin/kubelogin
brew install --cask logi-options+ # for keyboard
brew install --cask logitech-g-hub # for web cam
brew install kubeconform
brew install --cask obs
code --install-extension eamodio.gitlens
code --install-extension ms-azure-devops.azure-pipelines
code --install-extension HashiCorp.terraform
code --install-extension bierner.markdown-mermaid
code --install-extension ms-vscode-remote.remote-containers
code --install-extension ms-azuretools.vscode-docker
code --install-extension GitHub.codespaces
code --install-extension DotJoshJohnson.xml
code --install-extension ms-azuretools.vscode-bicep
code --install-extension ms-azuretools.vscode-azurefunctions
code --install-extension HashiCorp.HCL
code --install-extension shardulm94.trailing-spaces
mkdir ~/Desktop/Screenshots
defaults write com.apple.screencapture location ~/Desktop/Screenshots/
killall SystemUIServer
ssh-keygen -t ed25519 -C "aleksandr.sapozhkov@rillion.com"
pkg_url=$(mist list installer 24F74 -o yaml -q | yq '.[].packages[] | select(.url | test("InstallAssistant.pkg")) | .url');
curl -L $pkg_url -o InstallAssistant.pkg
ipsw_url=$(mist list ipsw 24F74 -o yaml -q | yq '.[0].url');
filename=$(basename "$ipsw_url");
curl -L $ipsw_url -o $filename -C - --retry 5 --retry-all-errors;
vm_name="macOS-Sequoia"
vm_dir="~/Library/Containers/com.utmapp.UTM/Data/Documents/$vm_name.utm"
mkdir -p "$vm_dir/Images"
mkdir -p "$vm_dir/Data"
cat > "$vm_dir/config.plist" <<EOF
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>UTMConfigurationVersion</key>
<string>2.0</string>
<key>Virtualization</key>
<dict>
<key>Architecture</key>
<string>aarch64</string>
<key>CPUs</key>
<integer>4</integer>
<key>MemorySize</key>
<integer>8589934592</integer>
<key>DiskImages</key>
<array>
<dict>
<key>Path</key>
<string>Images/macOS.qcow2</string>
<key>Size</key>
<integer>68719476736</integer>
</dict>
</array>
<key>RestoreImage</key>
<string>$PWD/UniversalMac_15.5_24F74_Restore.ipsw</string>
</dict>
</dict>
</plist>
EOF
qemu-img create -f qcow2 "$vm_dir/Images/macOS.qcow2" 64G;
open -a UTM "~/Library/Containers/com.utmapp.UTM/Data/Documents/$vm_name.utm"
utmctl start "$vm_name";
curl -LO https://releases.ubuntu.com/noble/ubuntu-24.04.2-live-server-amd64.iso
VM_NAME="ubuntu-vm"
USERNAME="ubuntu"
PASSWORD="ubuntu"
SSH_KEY=$(cat ~/.ssh/id_ed25519.pub)
SEED_DIR="seed-config"
SEED_ISO="seed.iso"
mkdir -p "$SEED_DIR"
HASHED_PASSWORD=$(docker run --rm -it busybox sh -c "mkpasswd -m sha-512 '$PASSWORD'")
echo "Using hashed password: $HASHED_PASSWORD"
cd "$SEED_DIR"
cat > user-data <<EOF
#cloud-config
autoinstall:
version: 1
identity:
hostname: $VM_NAME
username: $USERNAME
password: "$HASHED_PASSWORD"
ssh:
install-server: true
authorized-keys:
- $SSH_KEY
storage:
layout:
name: direct
keyboard:
layout: us
locale: en_US
packages:
- docker.io
- kubeadm
- kubelet
- kubectl
late-commands:
- curtin in-target -- apt update
- curtin in-target -- apt upgrade -y
EOF
echo "Created user-data"
touch meta-data
echo "Created empty meta-data"
echo "Building $SEED_ISO ..."
mkisofs -output "../$SEED_ISO" -volid cidata -joliet -rock user-data meta-data
echo "Seed ISO created: ../$SEED_ISO"
cd ..
qemu-img create -f qcow2 ubuntu-disk.qcow2 64G
qemu-system-x86_64 \
-m 8192 -smp 4 \
-cpu Haswell \
-machine accel=tcg \
-hda ubuntu-disk.qcow2 \
-cdrom ~/Downloads/ubuntu-24.04.2-live-server-amd64.iso \
-drive file=seed.iso,format=raw \
-boot d \
-net nic -net user,hostfwd=tcp::2222-:22 \
-vga virtio
curl -LO https://cloud-images.ubuntu.com/jammy/current/jammy-server-cloudimg-amd64.img -C - --retry 5 --retry-all-errors;
VM_NAME="ubuntu-vm"
USERNAME="ubuntu"
PASSWORD="ubuntu"
SSH_KEY=$(cat ~/.ssh/id_ed25519.pub)
SEED_DIR="seed-config"
SEED_ISO="seed.iso"
mkdir -p "$SEED_DIR"
HASHED_PASSWORD=$(docker run --rm -it busybox sh -c "mkpasswd -m sha-512 '$PASSWORD'" | tr -cd '[:print:]')
echo "Using hashed password: $HASHED_PASSWORD"
cd "$SEED_DIR"
cat > user-data <<EOF
hostname: $VM_NAME
disable_root: false
users:
- name: $USERNAME
groups: sudo
shell: /bin/bash
sudo: ALL=(ALL) NOPASSWD:ALL
lock_passwd: false
passwd: "$HASHED_PASSWORD"
ssh_authorized_keys:
- $SSH_KEY
system_info:
default_user:
name: $USERNAME
lock_passwd: false
gecos: $USERNAME
shell: /bin/bash
sudo: ALL=(ALL) NOPASSWD:ALL
package_update: true
package_upgrade: true
packages:
- docker.io
- kubeadm
- kubelet
- kubectl
runcmd:
- systemctl enable docker
- systemctl start docker
EOF
touch meta-data
mkisofs -output "../$SEED_ISO" -volid cidata -joliet -rock user-data meta-data
cd ..
qemu-system-x86_64 \
-m 4096 -smp 2 \
-machine accel=tcg \
-drive file=jammy-server-cloudimg-amd64.img,format=qcow2 \
-drive file=seed.iso,format=raw,if=virtio \
-net nic -net user,hostfwd=tcp::2222-:22 \
-vga virtio
vagrant init bento/ubuntu-22.04 --box-version 202309.08.0;
vagrant up --provider qemu;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment