To help debug certain cuda errors, set this flag More discussion at link
export CUDA_LAUNCH_BLOCKING=1
sshfs -o IdentityFile=$PATHTOSSH/.ssh/id_rsa $REMOTEUSER@$REMOTEHOST:$REMOTEPATH $LOCALPATH
sshfs -o IdentityFile=/home/bob/.ssh/id_rsa bobby@blahblah.website.com:/datasets/imagenet /home/bob/imagenet
ps | grep python3 | awk '{print $1}' | xargs kill
find . -type f -name "*.png" | wc -l
- Copy window to clipboard
ctrl+alt+printscreen
- Copy selection to clipboard
ctrl+shift+printscreen
function tarc {
tar czf - $1 -P | pv -s $(du -sb $1 | cut -f 1) > $1.tar.gz
}
function tarx {
pv $1 | tar -xz
}
rsync -avz --info=progress2 $SRC $DST
- Delete from suggestion bar
ctrl+shift+delete
{
"version": "0.2.0",
"configurations": [
{
"name": "Python: Current File",
"type": "python",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal",
"cwd": "/PATH/TO/WORK_DIR",
"justMyCode": false,
"env": {
"FOO": "BAR",
},
"args": [
"foo", "bar",
]
}
]
}
NB: can set "program"
to your file name to avoid running config on random other file (e.g. model.py)
ssh -XC USER@hHOST -t 'tmux new-session -A -s TMUX_ID'
conda create --name NAME python=3.9
conda env create --name NAME --file=environments.yml
conda env export --no-builds | grep -v "prefix" > environment.yml
conda env export --name NAME --no-builds | grep -v "prefix" > environment.yml
conda env update --file environment.yml --prune
conda env update --name NAME --file environment.yml --prune
ln -s SRC DST
gdown --id ID
If it has too much traffic, try https://stackoverflow.com/questions/65312867/how-to-download-large-file-from-google-drive-from-terminal-gdown-doesnt-work
wget --user-agent TryToStopMeFromUsingWgetNow https://arxiv.org/pdf/1606.09549.pdf
import GPUtil
if not any(x in os.environ for x in ['CUDA_VISIBLE_DEVICES', 'SLURM_STEP_GPUS', '_CONDOR_AssignedGPUs']):
gpu = [str(g) for g in GPUtil.getAvailable(maxMemory=0.2)]
assert len(gpu) > 0, f'No available GPUs, {GPUtil.showUtilization()}'
print('Using GPU', ','.join(gpu))
os.environ['CUDA_VISIBLE_DEVICES'] = ','.join(gpu)
sacct -u jozhang --starttime 2014-07-01 --format=User,JobID,Jobname,partition,state,time,start,end,nodelist
srun --jobid=$your_job_id --pty /bin/bash
squeue -all
squeue -O "jobid:8,username:10,mincpus:9,minmemory:11,gres:7,numtasks:6,state:9,timeused:12,nodelist:10"
/lusr/opt/slurm/bin/slurm-usage
sreport user TopUsage Account=cs
sinfo -O NodeList,CPUsState,AllocMem,FreeMem,Memory,Gres
condor_submit JOB_NAME.submit
condor_q -nobatch
condor_q -held
condor_q -analyze JOB_ID
condor_q -better-analyze
condor_status -constrain 'Eldar'
condor_rm jozhang -constraint 'JobStatus == 2'
pgrep -u jozhang python | xargs kill # xargs pipes previous into kill
set keybinds for
- Focus last editor group
- Focus call stack
- Focus debug console
- Focus terminal
- breakpoints
vim
``: jump back
ma: set mark a at current line
`a: goto mark
- Easy Matplotlib subplots with subplot mosaic
- Camera transforms in OpenGL by songho