Skip to content

Instantly share code, notes, and snippets.

@nathanbw
nathanbw / diff_beginning_of_file.py
Created October 21, 2019 20:19
Quick n' Dirty diff in Python
file1 = 'yarn.lock'
file2 = 'yarn.lock'
block_size = 512
def compare_bytes(b1, b2):
i = 0
while i < len(b1):
if b1[i] != b2[i]:
return 0
i = i + 1
@nathanbw
nathanbw / LFS 7.7 Ubuntu 14.04 Notes.md
Last active April 19, 2018 08:20
LFS 7.7 Ubuntu 14.04 build notes

Building Linux From Scratch 7.7 (stable)

This document follows my journey into building Linux From Scratch 7.7, following the excellent Linux From Scratch book.

About the Author

I am Nathan Wallace, a Software Engineer who works for Pardot, a Salesforce company. None of the content of this document represents the opinion of my employer; this is a project I am undertaking on my own time for my own education. Salesforce is a great place to work, and aside from saying that, this document has nothing to do with Salesforce or Pardot. :-)

My experience with Linux started in 2002, when I first discovered Linux shortly after my family moved into the 21st century by subscribing to broadband internet service at our home in Oxford, Alabama. By 2004, I had downloaded and tried more than 30 different distributions, seeking to learn as much as I could about the system and how each distro was different.

I went to Auburn University, graduating with a B.S.

@nathanbw
nathanbw / Problem Description
Last active December 30, 2015 19:29
Having trouble getting Slackware Linux to boot with an initrd. See the file "Problem Description" below.
The kernel panics when it is unable to mount the initrd. See screenshot here: https://www.dropbox.com/s/v8ktk5yh0mtkfge/IMG_3804.JPG (Directly following that output was a stack trace from the kernel.)
I have lilo installed on the mbr of /dev/sda, and Slackware installed to /dev/sdb3.
I generated my initrd with:
mkinitrd -c -k 3.10.17-smp -f ext4 -r /dev/sdb3 -m usbhid:hid_generic:uhci-hcd:mbcache:jbd2:ext4 -u -o /boot/initrd.gz
(command generated from /usr/share/mkinitrd/mkinitrd_command_generator.sh)
Is this a limitation of lilo? (Being installed on the mbr of the first drive, while the rootfs and initrd are on a different physical drive?)
@nathanbw
nathanbw / Patch to Slackware's rc.S.md
Last active April 19, 2016 14:53
This patch to Slackware 14.1's init scripts improves its handling of /etc/crypttab

This patch to Slackware 14.1's init scripts improves its handling of /etc/crypttab crypttab now supports the 'discard' option, as well as handling the "none" password correctly for non-swap volumes.

The attached script and test-crypttab file represent a small test to see the script will behave with different crypttab lines.

Some notes on /etc/crypttab in Slackware: Only luks formatted volumes are supported (except for swap) crypttab follows the following format: <luks name> <device> <password> <options>

``: This is the name of your luks volume. For instance: crypt-home