Skip to content

Instantly share code, notes, and snippets.

@rorycl
rorycl / list.go
Last active April 8, 2024 13:56
bubbletea/list first item padding issue
package main
import (
"fmt"
"os"
"github.com/charmbracelet/bubbles/list"
tea "github.com/charmbracelet/bubbletea"
"github.com/charmbracelet/lipgloss"
)
@rorycl
rorycl / tx.go
Created October 25, 2023 19:04
go database/sql tx example
package main
import (
"context"
"database/sql"
"fmt"
_ "github.com/lib/pq"
)
@rorycl
rorycl / agentcerts.go
Created March 7, 2023 11:15
list ssh agent certificates
/*
Check the certificates loaded into the specified ssh agent for imminent expiry
example output:
0 key ssh-ed25519 : is not a certificate
1 key [email protected]
comment: acmeinc_briony_from:2023-03-07T08:18_to:2023-03-07T11:18UTC
validity: 2023-03-07 08:37:23 GMT to 2023-03-07 11:37:23 GMT
expiring in 60m? true
@rorycl
rorycl / jwttest.go
Created June 5, 2021 21:59
Validate Header issue with ed25519 keys : github.com/gbrlsnchs/jwt
package main
import (
"crypto/ed25519"
"crypto/x509"
"fmt"
"time"
"encoding/pem"
@rorycl
rorycl / ed25519genandsave.go
Created June 5, 2021 16:14
Generate ed25519 keys in PEM format using Go
// RCL 05 June 2021
/*
verify with `openssl pkey -in <privatekey>` or `openssl pkey -in <privatekey> -pubout`
the latter should match the publickey
*/
package main
import (