Skip to content

Instantly share code, notes, and snippets.

@talesa
talesa / various.sh
Last active January 9, 2020 00:15
Various useful bash commands
# lsf bkill all pending jobs
bkill `bjobs -p -o jobid | grep -v ^JOBID | tr '\n' ' '`
# lsf bkill jobs matching pattern
bkill `bjobs -w | grep MultipleGRUs2 | awk '{print $1}' | tr '\n' ' '`
# something to do with the largest snapshots in the directory
du -sh * | sort -rh | head -n 5 | awk '{print $2"/*.pt"}' | xargs -I@ sh -c 'ls @'
@talesa
talesa / average_bitrate.py
Created February 1, 2020 09:17
average_bitrate.py
import audioread as ar
import os
rootdir = '.'
audio_file_formats = ['wav', 'mp3', 'm4a']
for root, subdirs, files in os.walk(rootdir):
for filename in files:
if filename[-3:] in audio_file_formats:
filepath = os.path.join(root, filename)
@talesa
talesa / command.sh
Created October 28, 2020 12:04
playing with zizgpu slurm
sbatch --gres=gpu:1 --partition=ziz-gpu-small slurm.sh
@talesa
talesa / model.py
Created December 3, 2020 19:01
simple requeueable slurm job
import argparse
from pathlib import Path
import shutil
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import torch.utils.tensorboard
import torchvision