Skip to content

Instantly share code, notes, and snippets.

View nigelhp's full-sized avatar

Nigel Perkins nigelhp

View GitHub Profile
@nigelhp
nigelhp / retain-crlf-in-git-file.md
Created May 1, 2016 20:17
Retain CRLFs in a specific file in a git repository

As a Linux (or OSX) user, you have correctly set the git core.autocrlf config variable to input as described here.

You need to add a text test data file to your project that originates from a Windows system. Attempting to add the file to the index results in the message:

fatal: CRLF would be replaced by LF in <test-data-file>.

It is important to maintain the CRLFs in the file in order to maintain the

@nigelhp
nigelhp / using-efibootmgr-to-create-boot-option.md
Last active June 14, 2017 21:48
Using efibootmgr to create boot option

Installing Ubuntu to an external USB drive resulted in /boot being created on the external drive as expected, but grub being installed into the existing efi partition on the internal drive rather than the target efi partition on the external drive.

/boot/EFI on the internal drive was then mounted into Ubuntu's /boot at /boot/efi.

% tree /boot/EFI
/boot/EFI

├── arch_grub

@nigelhp
nigelhp / using-efibootmgr-to-update-boot-order.md
Created April 24, 2016 15:16
Using efibootmgr to update boot order

Installing Ubuntu to an external USB drive resulted in /boot being created on the external drive as expected, but grub being installed into the existing efi partition on the internal drive rather than the target efi partition on the external drive.

/boot/EFI on the internal drive was then mounted into Ubuntu's /boot at /boot/efi.

% tree /boot/EFI
/boot/EFI

├── arch_grub

@nigelhp
nigelhp / rewrite-commit-author-email.md
Created April 24, 2016 15:13
Rewrite Git Commit Author Email

I had unfortunately made commits to personal projects from a shell in which GIT_AUTHOR_EMAIL was set to a work address.

To list authors, along with their email addresses (ranked by number of commits):

git shortlog -n -e -s

To list the abbreviated commit hash followed by the author email:

git log --format="%h %ae"