This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Digital Ocean stores the arch kernel outside of the VM's disk and the hypervisor boots the | |
# kernel directly. This hack allows you to boot any arch kernel version by using kexec to | |
# basically turn the DO-provided kernel into a bootloader. | |
# | |
# By default, the DO kernel is started with /sbin/init as its command line and /sbin/init | |
# is a symlink to /usr/lib/systemd/systemd. By replacing /sbin/init with this shell script | |
# which calls kexec, we can boot a kernel on the VM's disk. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Example code for resetting the USB port that a Teensy microcontroller is | |
attached to. There are a lot of situations where a Teensy or Arduino can | |
end up in a bad state and need resetting, this code is useful for | |
""" | |
import os | |
import fcntl | |
import subprocess |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Add grub to the EFI boot manager | |
efibootmgr -c -g -d /dev/sda -p 1 -w -L "Grub" -l /boot/efi/EFI/boot/bootx64.efi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Builds a 64-bit grub image in the default EFI bootloader location. | |
mkdir '/boot/efi/EFI/boot' | |
grub-mkimage --directory '/usr/lib/grub/x86_64-efi' --prefix '(hd0, gpt1)' --output '/boot/efi/EFI/boot/bootx64.efi' --format 'x86_64-efi' --compression 'auto' 'fat' 'part_gpt' 'ext2' |
NewerOlder