Skip to content

Instantly share code, notes, and snippets.

View dragon788's full-sized avatar

dragon788 dragon788

View GitHub Profile
@dragon788
dragon788 / .crypt-fix.md
Last active May 26, 2026 18:35
Repair "ubuntu--vg-root" not found with LUKS and LVM encryption

Crypt-fix

Use this script via curl -L -O https://gist.github.com/dragon788/e777ba64d373210e4f6306ad40ee0e80/raw/a86f3d05fb56feb6ef01fc2d61a4feb2fd82b281/crypt-fix.sh and sudo bash ./crypt-fix.sh. You may need to edit the DEVICE variable to reflect your disk and partition layout (this was created on an EFI system using LUKS and LVM). It will prompt you for your disk password once to mount and discover the correct name for the encrypted volume mount and then prompt again to mount with the correct name so that the update-initramfs command succeeds with the appropriate mapping, if this wasn't done you would get a warning and your next boot would still fail.

@dragon788
dragon788 / !scdrand-yubikey-nitro-compile-and-installation.md
Last active May 11, 2026 09:11
Script to use scdrand to generate entropy from smartcard

Using scdrand to utilize a smartcard as a hardware RNG

Copy/download the quick build steps file and execute it with sh quick-build-steps.sh and if you are on Debian and have Docker it should fetch the Dockerfile here which when run with the docker build in the script clones scdtools and installs scdrand (and scdtotp) on your host system.

After you've installed it you can run sudo scdrand to get try and add some entropy to the kernel pool.

@dragon788
dragon788 / win10_binary_fission.md
Last active April 23, 2026 14:38
Making the Windows 10 "chubby" install.wim compatible with a FAT32 USB so a UEFI bootable USB can be created from Linux/macOS/ChromeOS

MAGIC aka Making Anything Gruelingly "Impossible" Coherent

Whatever operating system you are using to create the USB, you will need to have a Windows 10 ISO, either from Microsoft or your system manufacturer and have a USB drive 8GB or larger (or one with at least 5GB of free space and using the FAT32 filesystem, but using a fresh and empty one is best).

TL;DR

#macOS/Linux
# First try the `bootiso` program, it has options for splitting the WIM for you!
# https://jsamr.github.io/bootiso/
# You need to already have 7zip aka `p7zip` on macOS and Linux, and `wimlib` macOS via `brew` or `wimtools` on Linux
@dragon788
dragon788 / chromebox.md
Created August 26, 2017 00:47
Hacking an ASUS chromebox

ASUS makes a pretty handy Chromebox, and it's handy not just because it's running ChromeOS, it's handy because of everything you can do to the box itself.

The ASUS Chromebox is easily upgradeable, and capable of running just about any linux distribution.

The model I picked up, the M004U has the following specs:

  • Celeron 2955U (1.4GHz) 64 bit Dual core processor with 2MB L3 Cache
  • 2GB DDR3 1600 RAM with 2 slots
  • 16GB SSD HDD
  • 802.11 b/g/n dual-band wireless, Bluetooth 4.0, and gigabit ethernet
@dragon788
dragon788 / kill_me_now.md
Created November 6, 2019 17:23
Create Win10 bootable USB media from macOS without wanting to kill yourself and everyone around you

Kill Me NOW

Because Apple doesn't support NTFS but Linux does and Microsoft has gotten their WIM really fat in newer versions (but don't nicely split it into pieces for you to keep them under 4GB so they could fit on a FAT32 drive), we have do some fun crazy workarounds.

Both of these are close, one isn't optimal because it extracts from the iso rather than loop mounting. The other used to be valid but once the install.wim got over 4GB it started failing.

References

https://techbit.ca/2019/02/creating-a-bootable-windows-10-uefi-usb-drive-using-linux/ https://www.freecodecamp.org/news/how-make-a-windows-10-usb-using-your-mac-build-a-bootable-iso-from-your-macs-terminal/

@dragon788
dragon788 / README.md
Last active April 29, 2025 07:28 — forked from atenni/README.md
How to permalink to a gist's raw file

Problem: When linking to the raw version of a gist, the link changes with each revision.

Solution:

To return the first file from a gist: https://gist.github.com/[gist_user]/[gist_id]/raw/

To get a file from multi–file gist: https://gist.github.com/[gist_user]/[gist_id]/raw/[file_name]

@dragon788
dragon788 / shortcuts.md
Last active January 8, 2025 19:47
Git.io routes I use for easier curl/wget grabbing

Git.io routes I use for easier curl/wget grabbing

getcrouton https://github.com/dnschneid/crouton/raw/master/installer/crouton
crouton https://github.com/dnschneid/crouton
@dragon788
dragon788 / !notes.md
Created December 4, 2024 15:38
Xous Precursor Android or Debian bootstrap scripts and process documentation

I figured out a way to get the Precursor import/export working on Android, it wasn't that bad though it is fairly tightly coupled to a "feature flag" in the current ctaphid crate, so I might have to do some discovery work if the crates are upgraded in the future, right now it seems like the crates are all being held back by the highest common version across ALL apps within the workspace (aka repository), because each app isn't defined as a separate workspace which sort of makes sense, otherwise a few things would be able to float higher

also included just to impress/annoy bunnie:

a dump of the multiple step shell scripts that I have shoved into 3 separate default basis password credentials, I was rather amazed when it worked

@dragon788
dragon788 / longwindedname.md
Created November 25, 2016 23:39
Restore rEFInd as default boot manager from Windows after updates

After losing access to rEFInd yet again (Windows 10 Anniversary Edition), I was able to find the proper invocation of BCDEdit thanks to a helpful person on StackOverflow. None of the Microsoft documentation mentions this, but you NEED single quotes around {bootmgr} for sure if you are in the PowerShell shell, but possibly also if you are in the Command Prompt. This allowed me to add a new entry for rEFInd and I've had to do this multiple times so I know it works on Windows 10.

bcdedit /set {bootmgr} path \EFI\refind\refind_x64.efi 

becomes

bcdedit /set '{bootmgr}' path \EFI\refind\refind_x64.efi
sched.mem.pshare.enable = "FALSE"
mainMem.useNamedFile = "FALSE"
prefvmx.minVmMemPct = "100"
prefvmx.useRecommendedLockedMemSize = "TRUE"
mainMem.partialLazySave = "FALSE"
mainMem.partialLazyRestore = "FALSE"
priority.grabbed = "normal"
priority.ungrabbed = "normal"
#priority.grabbed = "high"