18 karma · joined February 15, 2021
Looks really nice btw. Hot resize mem/cpu would be nice. This could become a nice tech for a one-backend-per-customer infra orchestrator then.
lk() {
if [ $# -eq 0 ]; then
local output=$(sudo lsof -iTCP -sTCP:LISTEN -n -P)
elif [ $# -eq 1 ]; then
local output=$(sudo lsof -iTCP -sTCP:LISTEN -n -P | grep -i --color=always $1)
else
echo "find and kill processes listening on ports. Usage: lk [pattern]"
return 1
fi
if [ -z "$output" ]; then
echo "No listening processes found."
return 0
fi
# Show header + results
echo "$(sudo lsof -iTCP -sTCP:LISTEN -n -P | head -1)"
echo "$output"
echo ""
# Extract unique PIDs (skip the header row if no grep was applied)
local pids=($(echo "$output" | awk '{print $2}' | grep -E '^[0-9]+$' | sort -u))
if [ ${#pids[@]} -eq 0 ]; then
echo "No PIDs found."
return 0
fi
echo "PIDs to kill: ${pids[*]}"
echo -n "Kill these ${#pids[@]} process(es)? [y/N] "
read -r confirm
if [[ "$confirm" =~ ^[Yy]$ ]]; then
for pid in "${pids[@]}"; do
echo "Killing PID $pid..."
sudo kill -9 $pid
done
echo "Done."
else
echo "Aborted."
fi
}Would love to chat about details there
[1] https://flok.cc
You can pass the current file, or multiple files or your whole project as context to the models.
- raycast (window management, shortcuts, etc.)
- tailscale (private mesh vpn)
- linear (issue management)
But I would want to install that myself. I do everything in my house myself. Could I order a device from you and at the same time save the compensation that otherwise gets the installer?
If you host on Vercel you need a Postgress somewhere (aws, neon, Heroku, fly.io…)
If you host on own vps: use nosql and litestream for backup to s3(backplate b2) . Nosql is blazing fast on ssd vps