This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module sqlite-generated-columns | |
go 1.22.3 | |
require modernc.org/sqlite v1.29.9 | |
require ( | |
github.com/dustin/go-humanize v1.0.1 // indirect | |
github.com/google/uuid v1.6.0 // indirect | |
github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"io" | |
"log" | |
"os" | |
"golang.org/x/crypto/ssh/terminal" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
goos: darwin | |
goarch: arm64 | |
pkg: ids-rewrite-experiment | |
BenchmarkSometimes/ticker-8 387814022 2.915 ns/op | |
BenchmarkSometimes/sometimes-8 44387656 27.03 ns/op |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"crypto/tls" | |
"crypto/x509" | |
"log" | |
"net/rpc" | |
) | |
func main() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Description: Tailscale SSH sessions recorder | |
Parameters: | |
VPC: | |
Type: AWS::EC2::VPC::Id | |
Description: VPC ID | |
Subnets: | |
Type: List<AWS::EC2::Subnet::Id> | |
Description: VPC subnets |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ go test -bench . | |
PASS | |
Benchmark8 1000000 1093 ns/op 936.69 MB/s | |
Benchmark64 20000000 134 ns/op 7603.74 MB/s | |
ok _/private/tmp/x 3.944s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"bufio" | |
"bytes" | |
"flag" | |
"fmt" | |
"io" | |
"io/ioutil" | |
"log" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# put this to your $HOME/.bashrc | |
# so you can safely use screen or tmux while preserving ssh-agent forwarding features | |
# of your ssh sessions | |
test "${SSH_AUTH_SOCK:-}" && test $SSH_AUTH_SOCK != $HOME/.ssh_auth_sock && { | |
test -L $HOME/.ssh_auth_sock && \ | |
test "$(readlink $HOME/.ssh_auth_sock)" = $SSH_AUTH_SOCK || \ | |
ln -sf $SSH_AUTH_SOCK $HOME/.ssh_auth_sock | |
export SSH_AUTH_SOCK=$HOME/.ssh_auth_sock | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh -eu | |
usage () { printf "%s file [time-in-minutes]\n" ${0##*/} >&2 ; } | |
test $# -eq 0 && { usage ; exit 2 ; } | |
WHAT=$1 | |
test -e $WHAT || { echo "$WHAT not found" >&2 ; exit 2 ; } | |
MINUTES=${2:-30} | |
case ${0##*/} in | |
older*) | |
test $(($(date +%s)-$(stat --printf "%Y\n" "$WHAT"))) -gt $(($MINUTES*60)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
set -eu | |
LOCKFILE=/var/lock/${0##*/}.lock | |
fail () { echo "FAILED: $@" >&2 ; exit 1 ; } | |
exec 9>$LOCKFILE | |
flock -xn 9 || fail "Cannot acquire lock: $LOCKFILE" | |
trap 'rm -f $LOCKFILE' 0 |
NewerOlder