Tips and tricks to maintain a development working environment for research.
- After upgrade or reinstall the MacOS, rerun following commands to install the command tools for xcode and others.
$ xcode-select --install
- Check port 3413 is used by which application
$ lsof -nP -i4TCP:3413 | grep LISTEN
- Find the current working directory of a process with a PID, say 1234
$ pwdx 1234
$ lsof -p 1234 | grep cwd
- Find processes using a name
- Count the lines of a input source
$ ps -ef | grep lyx | wc -l
Number of processes has keyword lyx (which happened to be my user name on the server)
A brief summary of all Nvidia devices
$ nvidia-smi -L
GPU 0: <information about gpu 0>
GPU 1: <information about gpu 1>
GPU 2: <information about gpu 2>
GPU 3: <information about gpu 3>
$ nvidia-smi stats -d gpuUtil
display the gpu usage (similar to CPU usage, in percentage) repeatedly for every device.