Skip to content

Instantly share code, notes, and snippets.

View robstradling's full-sized avatar

Rob Stradling robstradling

View GitHub Profile
@robstradling
robstradling / postgresql_ctfe.sh
Created November 12, 2024 14:58
Duplicate MySQL IssuanceChainStorage implementation, then search'n'replace a bunch of stuff
#!/bin/bash
git checkout -b duplicate_mysql_to_postgresql
# Duplicate the MySQL "Extra Data Issuance Chain Deduplication" storage layer files into new PostgreSQL directories, preserving git line history.
# (h/t https://devblogs.microsoft.com/oldnewthing/20190919-00/?p=102904)
mkdir trillian/ctfe/storage/postgresql
git mv trillian/ctfe/storage/mysql/mysql.go trillian/ctfe/storage/postgresql/postgresql.go
git mv trillian/ctfe/storage/mysql/mysql_test.go trillian/ctfe/storage/postgresql/postgresql_test.go
git mv trillian/ctfe/storage/mysql/schema.sql trillian/ctfe/storage/postgresql/schema.sql
@robstradling
robstradling / postgresql_trillian.sh
Last active November 7, 2024 21:58
Duplicate MySQL backend, then search'n'replace a bunch of stuff
#!/bin/bash
git checkout -b duplicate_mysql_to_postgresql
# Duplicate the MySQL quota.Manager and storage layer files into new PostgreSQL directories, preserving git line history.
# (h/t https://devblogs.microsoft.com/oldnewthing/20190919-00/?p=102904)
mkdir quota/postgresqlqm
git mv quota/mysqlqm/mysql_quota.go quota/postgresqlqm/postgresql_quota.go
git mv quota/mysqlqm/mysql_quota_test.go quota/postgresqlqm/postgresql_quota_test.go
git mv quota/mysqlqm/quota_provider.go quota/postgresqlqm
@robstradling
robstradling / check_extension_criticality.go
Last active April 9, 2024 11:35
TLSBRv2 §7.1.2.7.6 Subscriber Certificate Extensions: Survey of critical flag non-compliance
package main
import (
"context"
"flag"
"fmt"
"math"
"os/signal"
"syscall"
"time"
@robstradling
robstradling / go.mod
Last active February 16, 2024 11:16
go-ora integer precision
module gist.github.com/robstradling/363b54e979b879e0450cfa36e238cca6
go 1.21.6
require github.com/sijms/go-ora/v2 v2.8.9
@robstradling
robstradling / cant_assign_value.go
Last active February 16, 2024 09:23
go-ora: Regression since v2.8.7 for simple SELECTs into integer and floating point variables
package main
import (
"context"
"database/sql"
"flag"
"fmt"
"os"
go_ora "github.com/sijms/go-ora/v2"
@robstradling
robstradling / dequeue_array.go
Last active December 11, 2023 20:11
go-ora: Regression since v2.7.23 when using DBMS_AQ.DEQUEUE_ARRAY
package main
import (
"database/sql"
"flag"
"fmt"
"os"
"time"
go_ora "github.com/sijms/go-ora/v2"
@robstradling
robstradling / query.sql
Last active February 20, 2024 14:31
2023-10-27: CA Owner "?" on https://crt.sh/cert-populations
WITH cas AS (
SELECT cac.CA_ID
FROM ccadb_certificate cc
JOIN ca_certificate cac ON cc.CERTIFICATE_ID = cac.CERTIFICATE_ID
WHERE cc.INCLUDED_CERTIFICATE_OWNER IS NULL
EXCEPT
SELECT cac.CA_ID
FROM ccadb_certificate cc
JOIN ca_certificate cac ON cc.CERTIFICATE_ID = cac.CERTIFICATE_ID
GROUP BY cac.CA_ID
@robstradling
robstradling / main.go
Created September 6, 2023 13:52
Demonstrate some go-ora regressions since v2.7.14
package main
module gist.github.com/robstradling/f8f8c04b73af72e7f137c1eedb523d15
go 1.20
require github.com/sijms/go-ora/v2 v2.7.21
@robstradling
robstradling / finalTBSCertificateFromPrecertificate.go
Created June 16, 2023 13:12
Produce final certificate from precertificate
package main
import (
"crypto/x509/pkix"
"encoding/asn1"
"encoding/base64"
"encoding/pem"
"fmt"
"math/big"
"time"