Assuming macOS and an SD card presented as /dev/rdisk3:
For ARMv7 (Pi 2):
diskutil unmountDisk disk3
xzcat ubuntu-18.04.2-preinstalled-server-armhf+raspi2.img.xz | sudo dd of=/dev/rdisk3 bs=32m
| ### | |
| ### [2023-06-19] UPDATE: Just tried to use my instructions again on a fresh install and it failed in a number of places. | |
| ###. Not sure if I'll update this gist (though I realise it seems to still have some traffic), but here's a list of | |
| ###. things to watch out for: | |
| ### - Check out the `nix-darwin` instructions, as they have changed. | |
| ### - There's a home manager gotcha https://github.com/nix-community/home-manager/issues/4026 | |
| ### | |
| # I found some good resources but they seem to do a bit too much (maybe from a time when there were more bugs). | |
| # So here's a minimal Gist which worked for me as an install on a new M1 Pro. |
Instructions to hack up WSL2 on Windows 10 Build 18917 to run k3s (Kubernetes) and rio
https://docs.microsoft.com/en-us/windows/wsl/wsl2-install
I already had Ubuntu-18.04 installed in wsl 1. So I just did wsl --set-version Ubuntu-18.04 2
Using Ubuntu 18.04 (I'm sure any distro will work), inside WSL2 download https://thirdpartysource.microsoft.com/download/Windows%20Subsystem%20for%20Linux%20v2/May%202019/WSLv2-Linux-Kernel-master.zip and extract to a folder. The latest version of the kernel source is available at (https://github.com/microsoft/WSL2-Linux-Kernel)
| # based on the "patch deployment" strategy in this comment: | |
| # https://github.com/kubernetes/kubernetes/issues/13488#issuecomment-372532659 | |
| # requires jq | |
| # $1 is a valid namespace | |
| function refresh-all-pods() { | |
| echo | |
| DEPLOYMENT_LIST=$(kubectl -n $1 get deployment -o json|jq -r .items[].metadata.name) | |
| echo "Refreshing pods in all Deployments" | |
| for deployment_name in $DEPLOYMENT_LIST ; do |
| #!/bin/bash | |
| # This script allows you to chroot ("work on") | |
| # the raspbian sd card as if it's the raspberry pi | |
| # on your Ubuntu desktop/laptop | |
| # just much faster and more convenient | |
| # credits: https://gist.github.com/jkullick/9b02c2061fbdf4a6c4e8a78f1312a689 | |
| # make sure you have issued |
# raspbian stretch lite on ubuntu
### You can write the raspbian image onto the sd card,
# boot the pi so it expands the fs, then plug back to your laptop/desktop
# and chroot to it with my script
# https://gist.github.com/htruong/7df502fb60268eeee5bca21ef3e436eb
# sudo ./chroot-to-pi.sh /dev/sdb
# I found it to be much less of a pain in the ass and more reliable
# than doing the kpartx thing| function ssh-fzf () { | |
| local selected_host=$(grep "Host " ~/.ssh/config | cut -b 6- | fzf --query "$LBUFFER") | |
| if [ -n "$selected_host" ]; then | |
| BUFFER="ssh ${selected_host}" | |
| zle accept-line | |
| fi | |
| zle reset-prompt | |
| } | |
| zle -N ssh-fzf | |
| bindkey '^\' ssh-fzf |