Toolbox
Prompts, commands and other things worth keeping. 8 entries My configs →
Servers & SSH
Passwordless SSH login to a server
Log in with a key instead of typing the password every time.
1 Generate a key pair, once. Leave the passphrase empty, or it is asked at every login instead of the password:
ssh-keygen -t ed255192 Copy the public key to the server. It asks for the password one last time:
ssh-copy-id user@server3 Log in, with no password:
ssh user@server4 Optionally, give the server a short name, so that ssh myserver is enough. This adds it to your SSH config file:
cat >> ~/.ssh/config <<'EOF'
Host myserver
HostName server
User user
EOFCopy files to or from a server
Copies only what changed, compressed, and picks up where it stopped if the connection drops. The trailing / on src/ copies its contents; without it, the folder itself lands inside dst. On Windows, run it from WSL.
rsync -avzP src/ user@server:dst/Keep Claude Code running on a server with tmux
Claude runs inside a tmux session on the server, so it keeps working after you close the terminal or lose the connection. --remote-control also lets you follow and drive it from the Claude app, under the name you give it.
1 Connect and open a tmux session with a name of its own, so several Claude sessions can run side by side:
ssh user@servertmux new -s my_server2 Start Claude inside it:
claude --remote-control my_server3 Detach with Ctrl+B then D. Claude keeps running; you can close the terminal.
4 Later, reconnect and reattach:
ssh user@servertmux attach -t my_serverForgot the session’s name? List them:
tmux lsDone for good? Stop the session and Claude with it:
tmux kill-session -t my_serverRun a script that survives logging out
The light alternative to tmux: the script keeps running after you log out, and all you come back to is its log. Fine for a training run; for anything interactive, use tmux.
1 Start it in the background, output to the log:
nohup python -u train.py > train.log 2>&1 &2 Follow the log. Ctrl+C stops following, not the script:
tail -f train.logDownloads
Download a file from the web
Pulls a dataset or a checkpoint straight onto the machine it runs on. curl is installed everywhere; -L follows redirects and -C - resumes an interrupted download, so after a dropped connection just run it again. aria2 opens 16 connections at once, much faster for a big file from a server that throttles each one; install it first (apt install aria2, brew install aria2). For a download that takes hours, run it in tmux.
curl -L -C - -o file urlProcesses & disk
Find and kill a process
kill asks the process to stop and lets it clean up; force it with -9 only if it ignores that.
1 Find it; the PID is the second column:
ps aux | grep python2 Stop it:
kill PIDSize of each folder here
Find what is taking up the space. On Windows, run it from WSL.
du -h -d 1 2>/dev/null | grep -v '/\.'LaTeX
Compile LaTeX
latexmk runs LaTeX, BibTeX and the extra passes as many times as the document needs. In watch mode it recompiles on every save and refreshes the PDF viewer; Ctrl+C stops it. A build folder keeps the auxiliary files out of the project as you go; cleaning removes them once you are done.
latexmk -pdf main.texNothing matches that search.