Skip to content

Instantly share code, notes, and snippets.

@s8508235
s8508235 / setup.bat
Last active July 26, 2026 11:17
Run firefly-iii on windows
REM install node and npm
REM see https://github.com/coreybutler/nvm-windows
REM install php and composer
REM see https://www.php.net/ and https://getcomposer.org/download/ and setup env var
REM clone firefly-iii on github
composer install
composer update
php artisan firefly-iii:verify-database-connection
php artisan firefly-iii:upgrade-database
php artisan firefly-iii:correct-database
@s8508235
s8508235 / gracefully_shutdown_server.go
Last active May 24, 2026 14:07
gracefully shutdown go web server with error group
package main
import (
"context"
"fmt"
"net/http"
"os/signal"
"syscall"
"time"
@s8508235
s8508235 / tcplife.sh
Created March 18, 2021 09:05
tcplife a command
#! /bin/bash
# I don't know it's correct or not; at least it works for me.
{YOUR_COMMAND} & # make sure your command will end
pid=$!
kill -s STOP ${pid}
sudo stdbuf -oL tcplife -p ${pid} -s > otuput.csv &
tcplife_pid=$!
sleep 5
kill -s CONT ${pid}
wait ${pid}