Skip to content

Instantly share code, notes, and snippets.

View dragon788's full-sized avatar

dragon788 dragon788

View GitHub Profile
@dragon788
dragon788 / win10_binary_fission.md
Last active April 19, 2024 09:26
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 / README.md
Last active March 24, 2024 07:57 — 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 / .crypt-fix.md
Last active March 13, 2024 09:52
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.

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"
@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
@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 / guix-on-chromeos-notes.md
Created October 16, 2021 01:03
Guix on ChromeOS to avoid Chromebrew and enable Homebrew?

If you are installing Guix as an unprivileged user, it is still possible to run guix-daemon provided you pass --disable-chroot. However, build processes will not be isolated from one another, and not from the rest of the system.

@dragon788
dragon788 / gist:b255a12f019ffc4274ff1f1c64861a81
Created February 9, 2020 21:03
TFTP boot for openwrt / GLiNet / LEDE and Clear Linux
tee -a /etc/dnsmasq.conf << EOF
dhcp-match=set:ipxeclient,60,IPXEClient*
dhcp-match=set:bios,60,PXEClient:Arch:00000
dhcp-boot=tag:bios,netboot.xyz.kpxe,,192.168.8.1
dhcp-match=set:efi32,60,PXEClient:Arch:00002
dhcp-boot=tag:efi32,netboot.xyz.efi,,192.168.8.1
dhcp-match=set:efi32-1,60,PXEClient:Arch:00006
dhcp-boot=tag:efi32-1,netboot.xyz.efi,,192.168.8.1
dhcp-match=set:efi64,60,PXEClient:Arch:00007
dhcp-boot=tag:efi64,netboot.xyz.efi,,192.168.8.1
@dragon788
dragon788 / gist:68e6e4192fbf8bc5f4aa2eef0c8eb783
Last active February 1, 2022 22:54
Te-Smart TESmart Shell Script CLI interface
#!/bin/bash
echo_docs() {
cat <<'EOD'
EOD
}
# use case to echo `network` `port` `autoselect` or `LED` sections or if no arg output all of them
set_network () {
@dragon788
dragon788 / gitlab-local.sh
Last active October 15, 2021 14:11
Updated gitlab-runner supporting docker in docker
#!/usr/bin/env bash
set -euo pipefail
usage () {
echo "Usage: $(basename $0) {up|down|[job stage]}"
echo "[job stage] - defaults to "build" and supports multiple comma delimited jobs"
echo "$(basename $0) test,build"
}