[Ubuntu] frequently used command and tools

My frequently used command. I don’t want to google them again and again. 🙂

ssh

ssh-copy-id username@server_host
ssh-keygen -t ed25519 -C "meow@gmail.com"
ssh-keygen -t rsa -b 4096 -C "meow@gmail.com"
cat ~/.ssh/id_ed25519.pub

cat ~/.ssh/id_rsa.pub

Git

reset file to a commit

git checkout HEAD -- my-file.txt

quick First commit

echo "# project" >> README.md
git init
git add README.md
git commit -m "first commit"
git branch -M main
git remote add origin git@github.com:kehanlu/project.git
git push -u origin main

Private fork

https://gist.github.com/0xjac/85097472043b697ab57ba1b1c7530274

Count number of directory

ls . | wc -l

ps

list username for pid

ps -u -p 1234

kill processes by grep search

kill $(ps aux | grep 'meow.py' | awk '{print $2}')

Watch nvidia-smi

  • -n seconds
watch -n 1 nvidia-smi

Sox

merge wav files

sox input1.wav input2.wav input3.wav output.wav