Skip to content

Instantly share code, notes, and snippets.

View nhibberd's full-sized avatar

Nick Hibberd nhibberd

  • Renterra
  • San Francisco
View GitHub Profile
@xirkus
xirkus / yubikey+gpupgp+ssh_howto.md
Last active September 19, 2024 14:54
Security Adventures 1. How to get yubikey+gpg+ssh+gitbhub working on MacOS

I've spent the day trying to get this setup working with GitHub and given the number of gotcha's I encountered, it seemed like a good idea to document how I finally got this working with as few hacks as possible. There's a lot of documentation out there (some of it old and misleading) and committing here for posterity will help me remember this when I inevitably need to do this again.

Rationale

Passwords are simply not enough these days. Regardless of the company, breaches (and the associated Personally Identifiable Information harvested) are a matter of not if, but when. There are a number of things you can do to protect yourself, but being on the tin-foil-hat side of paranoia, means there are a few Commandents that I adhere to (and recommend for other folks)[Insert link to Fight Club Rules for the Secure Internet].

That being said, if you use 2-factor authentication and have committed to using a hardware token such as the Yubikey, then you're already ahead of the curve. The problem is that wh

@prasanthj
prasanthj / ec2-nvme-count.txt
Created January 18, 2019 08:08
Mount NVMe SSDs in AWS EC2 instances
Mount Separately
----------------
# mount nvme SSDs to /dataN when available for specific instance types
# There are only 4 nvme slots in r5 instances. /dev/nvme0n1 is root EBS volume.
for i in $(seq 1 4); do
if [ -e "/dev/nvme${i}n1" ]
then
echo "Mounting /dev/nvme${i}n1 to /data${i}"
sudo mkfs.ext4 -E nodiscard /dev/nvme${i}n1
sudo mkdir -p /data${i}
@trongthanh
trongthanh / gist:2779392
Last active September 8, 2024 09:15
How to move a folder from one repo to another and keep its commit history
# source: http://st-on-it.blogspot.com/2010/01/how-to-move-folders-between-git.html
# First of all you need to have a clean clone of the source repository so we didn't screw the things up.
git clone git://server.com/my-repo1.git
# After that you need to do some preparations on the source repository, nuking all the entries except the folder you need to move. Use the following command
git filter-branch --subdirectory-filter your_dir -- -- all
# This will nuke all the other entries and their history, creating a clean git repository that contains only data and history from the directory you need. If you need to move several folders, you have to collect them in a single directory using the git mv command.