Skip to content

Instantly share code, notes, and snippets.

Avatar

Jon Colverson JJC1138

View GitHub Profile
@JJC1138
JJC1138 / list-ec2-nvme-instance-storage-devices.sh
Created Apr 22, 2019
Shell script to list all NVMe Instance Storage Devices on an EC2 instance
View list-ec2-nvme-instance-storage-devices.sh
#!/bin/bash -e
for nvme_device_name in `lsblk | cut --delimiter=" " --fields=1 | grep ^nvme | sort -n`; do
nvme_device="/dev/${nvme_device_name}"
if ( nvme id-ctrl "${nvme_device}" | grep --quiet "^mn\\s*:\\s*Amazon EC2 NVMe Instance Storage\\s*$" ); then
echo "${nvme_device}"
fi
done
View FilterIntoTrueAndFalse.swift
fileprivate extension Array {
func filterIntoTrueAndFalse(_ shouldBeIncludedInFirstResult: (Element) throws -> Bool) rethrows -> ([Element], [Element]) {
var trueResults = [Element]()
var falseResults = [Element]()
for i in self {
if try shouldBeIncludedInFirstResult(i) {
trueResults.append(i)
} else {
falseResults.append(i)
View keybase.md

Keybase proof

I hereby claim:

  • I am jjc1138 on github.
  • I am jjc1138 (https://keybase.io/jjc1138) on keybase.
  • I have a public key whose fingerprint is 04F1 3A87 F4B0 1A4A 614D E539 7287 96CB FA8A 09DB

To claim this, I am signing this object:

You can’t perform that action at this time.