Skip to content

Instantly share code, notes, and snippets.

@Kranzes
Kranzes / guide.md
Last active September 17, 2024 17:42
SSH Resident Key Guide

Initial checks

Start by checking that there aren't any previous ssh keys inside the FIDO2 authenticator of your YubiKey. You can check if they exist by running the command below:

nix shell nixpkgs#yubikey-manager -c ykman fido credentials list

If the command above outputs a string mentioning "ssh" or "openssh", then you have already got a key generated and store on your YubiKey.

Evaluating additional authentication factors

Before generating a new ssh key to store on your YubiKey you must consider which additional required authentication factors you want to use. Below you can see a table with the available factors and their corresponding command:

@rhaleblian
rhaleblian / vmware-fusion-tech-preview-bad-kernel-week-install.md
Last active December 18, 2023 23:26
Installing Ubuntu Server in VMware Fusion Tech Preview during Bad Kernel Week
@memoryleak
memoryleak / create-monterey-iso.sh
Last active May 1, 2024 12:38
Create a Mac OS Monterey ISO file from the official installation DMG file
#!/usr/bin/env bash
sudo hdiutil create -o /tmp/Monterey -size 16g -volname Monterey -layout SPUD -fs HFS+J
sudo hdiutil attach /tmp/Monterey.dmg -noverify -mountpoint /Volumes/Monterey
sudo /Applications/Install\ macOS\ Monterey.app/Contents/Resources/createinstallmedia --volume /Volumes/Monterey --nointeraction
hdiutil eject -force /Volumes/Install\ macOS\ Monterey
hdiutil convert /tmp/Monterey.dmg -format UDTO -o ~/Downloads/Monterey
mv -v ~/Downloads/Monterey.cdr ~/Downloads/Monterey.iso
sudo rm -fv /tmp/Monterey.dmg
@superjamie
superjamie / install-ubuntu-luks-lvm.md
Last active July 7, 2024 06:57
How to install Ubuntu with LUKS Encryption on LVM

How to install Ubuntu with LUKS Encryption on LVM

My work requires us to have full-disk encryption, so these are the steps I use.

The basic idea is to create a LUKS-encrypted partition which is used as an LVM Physical Volume.

The GRUB boot partition isn't encrypted, but everything else is.

These steps tested and working on 22.04 (jammy) and 20.04 (focal).

We can't make this file beautiful and searchable because it's too large.
CLSID,ClassName
{0000031A-0000-0000-C000-000000000046},CLSID
{0000002F-0000-0000-C000-000000000046},CLSID CLSID_RecordInfo
{00000100-0000-0010-8000-00AA006D2EA4},CLSID DAO.DBEngine.36
{00000101-0000-0010-8000-00AA006D2EA4},CLSID DAO.PrivateDBEngine.36
{00000103-0000-0010-8000-00AA006D2EA4},CLSID DAO.TableDef.36
{00000104-0000-0010-8000-00AA006D2EA4},CLSID DAO.Field.36
{00000105-0000-0010-8000-00AA006D2EA4},CLSID DAO.Index.36
{00000106-0000-0010-8000-00AA006D2EA4},CLSID DAO.Group.36
{00000107-0000-0010-8000-00AA006D2EA4},CLSID DAO.User.36
@sm-Fifteen
sm-Fifteen / whats_a_yubikey.md
Last active September 16, 2024 19:49
"What the heck is a Yubikey and why did I buy one?": A user guide

"What the heck is a Yubikey and why did I buy one?": A user guide

(EDIT: Besides Reddit, I've also put this up on Github Gist)

So while looking for information on security keys before getting one myself, I got very confused reading about all the different modes and advertised features of Yubikeys and other similar dongles. The official documentation tends to be surprisingly convoluted at times, weirdly organized and oddly shy about a few of the limitations of these keys (which I'm making a point of putting front and center). Now that I have one, I decided to write down everything I figured out in order to help myself (and hopefully some other people reading this) make sense of all this.

Since I'm partly writing these notes for myself, there might be some back and forth between "exp

@synthetic-intelligence
synthetic-intelligence / More Helpful Commands
Last active September 1, 2024 19:28
Smart Card Config MacOS
# MacOS smartcard
List tokens available in the system
pluginkit -m -p com.apple.ctk-tokens
ex: com.apple.CryptoTokenKit.setoken(1.0)
com.apple.CryptoTokenKit.pivtoken(1.0)
@startergo
startergo / How to Download Full MacOS Installers
Last active June 12, 2024 23:01
How to Download Full MacOS Installer from Mac Command Line
// Mac OS Big Sur 11.2.3:
http://swcdn.apple.com/content/downloads/12/32/071-14766-A_Q2H6ELXGVG/zx8saim8tei7fezrmvu4vuab80m0e8a5ll/InstallAssistant.pkg
// Mac OS Catalina 10.15:
https://itunes.apple.com/us/app/macos-catalina/id1466841314?ls=1&mt=12
// Mac OS Mojave 10.14:
https://itunes.apple.com/us/app/macos-mojave/id1398502828?ls=1&mt=12
// Mac OS High Sierra 10.13:
@declon
declon / domain-join.sh
Last active September 1, 2023 03:11
AWS - Ubuntu 18.04 - Join Self Hosted Active Directory
DOMAIN_USR=domainjoinusername
DOMAIN_PWD=domainjoinpassword
# get instance ID
ID=$(curl http://169.254.169.254/latest/meta-data/instance-id)
# install deps
DEBIAN_FRONTEND=noninteractive apt-get -y install sssd heimdal-clients msktutil
# set hostname
@vadim-kovalyov
vadim-kovalyov / bootstrap-ubuntu.sh
Last active August 22, 2024 20:50
Dev box setup for Ubuntu 20.04
sudo apt update
sudo apt install -y build-essential curl make git vim hub libssl-dev graphviz jq cmake clang pkg-config p7zip terminator gnome-tweaks fonts-firacode protobuf-compiler
# intune
sudo apt install libpam-pwquality
sudo nano /etc/pam.d/common-password
# password requisite pam_pwquality.so retry=3 dcredit=-1 ocredit=-1 ucredit=-1 lcredit=-1 minlen=12
curl -sSl https://packages.microsoft.com/keys/microsoft.asc | sudo tee /etc/apt/trusted.gpg.d/microsoft.asc
wget https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb