Skip to content

Instantly share code, notes, and snippets.

View kurtmc's full-sized avatar

Kurt McAlpine kurtmc

  • New Zealand
  • 17:05 (UTC +12:00)
View GitHub Profile
https://zvaipxwgextqfjwrcuio7rfxti0pqsxe.lambda-url.ap-southeast-2.on.aws/index.html
@kurtmc
kurtmc / vim-cheat-sheet.md
Created February 8, 2024 00:47
VIM cheat sheet

variable case

The Abolish plugin by Tim Pope MixedCase

Typing crc [mnemonic: CoeRce to Camelcase] would give you:

mixedCase

Typing crs [mnemonic: CoeRce to Snake_case] would give you:

@kurtmc
kurtmc / aws_config_from_sso.js
Last active August 2, 2022 00:56
Create AWS CLI configuration from entries in AWS SSO webpage
document.querySelector('portal-application').click()
// roles listed by highest privilege
const roles = ['AdministratorAccess', 'SystemAdministrator', 'PowerUserAccess', 'ReadOnly', 'ViewOnlyAccess']
// expand all accounts
document.querySelectorAll('div .instance-section').forEach(function (el) {
el.click()
})
This file has been truncated, but you can view the full file.
{
"swagger": "2.0",
"basePath": "/nms/api/v2.1",
"info": {
"title": "UISP API",
"version": "1.0.0",
"description": "You can authorize calls with x-auth-token by clicking the button on the right.\n You can get this token on endpoint /user/login"
},
"tags": [
{
We can't make this file beautiful and searchable because it's too large.
"_messagetimems","_messagetime","message"
"1613339830494","15/02/2021 10:57:10.494 +1300","stack_1 | #3487 1 is eui-00800000a0003582"
"1613339835995","15/02/2021 10:57:15.995 +1300","stack_1 | #3487 1 ScheduleAt: no absolute gateway time"
"1613339835995","15/02/2021 10:57:15.995 +1300","stack_1 | #3487 1 ScheduleAt: too few round trip times: 0 < 5"
"1613339836746","15/02/2021 10:57:16.746 +1300","stack_1 | #3487 1 ScheduleAt: relative time downlink"
"1613339836746","15/02/2021 10:57:16.746 +1300","stack_1 | #3487 1 ScheduleAt: scheduled"
"1613339836746","15/02/2021 10:57:16.746 +1300","stack_1 | #3487 1 ScheduleAt: too few round trip times: 0 < 5"
"1613339841025","15/02/2021 10:57:21.025 +1300","stack_1 | #3487 Record: 31.673282ms at 2021-02-14 21:57:20.434993217 +0000 UTC m=+11.154743636"
"1613339841497","15/02/2021 10:57:21.497 +1300","stack_1 | #3487 1 ScheduleAt: relative time downlink"
"1613339841497","15/02/2021 10:57:21.497 +1300","stack_1 | #3487 1 ScheduleAt: scheduled"
"_messagetimems","_messagetime","message"
"1612406589058","04/02/2021 15:43:09.058 +1300","stack_1 | #3487 ScheduleAt: too few round trip times: 0 < 5"
"1612406592059","04/02/2021 15:43:12.059 +1300","stack_1 | #3487 ScheduleAt: too few round trip times: 0 < 5"
"1612406592309","04/02/2021 15:43:12.309 +1300","stack_1 | #3487 ScheduleAt: too few round trip times: 0 < 5"
"1612406592810","04/02/2021 15:43:12.810 +1300","stack_1 | #3487 Record: 31.34648ms at 2021-02-04 02:43:12.562370048 +0000 UTC m=+57.847403685"
"1612406595811","04/02/2021 15:43:15.811 +1300","stack_1 | #3487 Record: 30.628225ms at 2021-02-04 02:43:15.632100855 +0000 UTC m=+60.917134476"
"1612406596061","04/02/2021 15:43:16.061 +1300","stack_1 | #3487 Record: 30.45958ms at 2021-02-04 02:43:15.891507164 +0000 UTC m=+61.176540780"
"1612406597061","04/02/2021 15:43:17.061 +1300","stack_1 | #3487 ScheduleAt: too few round trip times: 3 < 5"
"1612406597061","04/02/2021 15:43:17.061 +1300","stack_1 | #3487 Stats: sorted items: [{30459580 {138
#!/bin/bash
for f in arch.conf arch-lts.conf; do
sed -i 's#options cryptdevice=PARTUUID=\([a-z0-9-]\+\):cryptroot root=/dev/mapper/cryptroot#options cryptdevice=PARTUUID=\1:cryptroot:allow-discards root=/dev/mapper/cryptroot#g' /boot/loader/entries/$f
done
sed -i 's#UUID=\([a-z0-9-]\+\) / ext4 rw,relatime 0 1#UUID=\1 / ext4 rw,relatime,discard 0 1#g' /etc/fstab
sed -i 's#cryptdevice=PARTUUID=\([a-z0-9-]\+\):cryptroot #cryptdevice=PARTUUID=\1:cryptroot:allow-discards #g' /boot/refind_linux.conf

Keybase proof

I hereby claim:

  • I am kurtmc on github.
  • I am kurtmc (https://keybase.io/kurtmc) on keybase.
  • I have a public key whose fingerprint is 5A02 528E 4F01 522A 7300 DE70 4C3E 64BE 5059 C30B

To claim this, I am signing this object:

@kurtmc
kurtmc / arch-install.sh
Last active February 1, 2024 21:22
Script to install Archlinux with full disk encryption
#!/bin/bash
set -euo pipefail
if [ ! -d "/sys/firmware/efi/efivars" ]; then
echo "not booted in efi mode"
exit 1
fi
while true; do