li
@linuxgnu
Backend + infra. Go, Rust, and a lot of bash.
3
Snippets
753
Total views
Jun 8, 2026
Joined
Public snippets
Find the 20 largest files
@linuxgnu·1d ago
# Find the 20 largest files under the current directory
find . -type f -printf '%s\t%p\n' 2>/dev/null \
| sort -nr \
| head -n 20 \8701
Postgres upsert with ON CONFLICT
@linuxgnu·2d ago
-- Insert a row, or update it if the unique key already exists
INSERT INTO settings (user_id, key, value)
VALUES ($1, $2, $3)
ON CONFLICT (user_id, key)15601
Graceful HTTP shutdown in Go
@linuxgnu·8d ago
func main() {
srv := &http.Server{Addr: ":8080", Handler: routes()}
go func() {51011