Skip to content

Instantly share code, notes, and snippets.

View icaoberg's full-sized avatar

icaoberg icaoberg

View GitHub Profile
@icaoberg
icaoberg / killthemall.sh
Last active June 22, 2023 15:18
[PBS] Delete all of the jobs associated to a specific user
#!/bin/bash
USERNAME=icaoberg
#to kill all the jobs
qstat -u$USERNAME | grep "$USERNAME" | cut -d"." -f1 | xargs qdel
#to kill all the running jobs
qstat -u$USERNAME | grep "R" | cut -d"." -f1 | xargs qdel
@icaoberg
icaoberg / asana.py
Created May 12, 2023 15:12
Top 10 Asana Tasks
import os
import asana
from pathlib import Path
from tqdm import tqdm
import pandas as pd
import warnings
warnings.filterwarnings("ignore")
# @icaoberg Read secrets. assumes file exists in ~/.ASANA_SECRETS
@icaoberg
icaoberg / script.sh
Created December 4, 2012 04:26
[BASH] Remove substring from filename
#!/bin/bash
SUBSTRING='substring_to_remove'
for FILE in *
do
mv -v "$FILE" "${FILE/$SUBSTRING/}"
done
@icaoberg
icaoberg / sq.sh
Created December 16, 2022 01:59
A better version of squeue
alias sq='squeue -o "%.18i %.9P %.50j %.8u %.2t %.10M %.6D %R"'
@icaoberg
icaoberg / script.sh
Last active October 13, 2022 15:12
Extracts images from movie #macosx #ffmpeg
#this script extracts frames for all movies (.mov) in the current folder.
# one image per frame per second saved to disk
for MOVIE in *.mov
do
if [ -f "$MOVIE" ]; then
FILENAME="${MOVIE%.*}"
echo $FILENAME
if [ ! -d "$FILENAME" ]; then
mkdir "$FILENAME"
@icaoberg
icaoberg / rename.sh
Created July 16, 2013 04:30
[BASH] Rename all files in the current folder using a universally unique identifier (UUID)
#!/bin/bash
for FILE in *
do
if [ -f "$FILE" ];then
ID=`uuidgen`
EXTENSION=${FILE#*.}
mv -v "$FILE" "$ID"."$EXTENSION"
fi
done
@icaoberg
icaoberg / script.sh
Last active December 26, 2021 02:42
Fill metadata on mp3 files
for F in *.mp3
do
ALBUM='Room Service (Extended Version)'
ARTIST='Roxette'
SONG=$(basename $F .mp3 | cut -d'-' -f2-25 | xargs -0)
GENRE='Pop'
YEAR=2020
mid3v2 -a "$ARTIST" -A "$ALBUM" -t "$SONG" -g $GENRE -y $YEAR $F
done
@icaoberg
icaoberg / cellorganizer.m
Created June 24, 2014 17:48
Helper function that helps load CellOrganizer in Lane Cluster
function answer = cellorganizer( version )
% Ivan E. Cao-Berg
%
% Copyright (C) 2014 Murphy Lab
% Lane Center for Computational Biology
% School of Computer Science
% Carnegie Mellon University
%
% This program is free software; you can redistribute it and/or modify
@icaoberg
icaoberg / README.md
Created June 3, 2021 19:15
README.md template

singularity-PACKAGE

Singularity recipe for PACKAGE.

Installing the container on Bridges 2

Copy the

  • SIF file
  • and the PACKAGE script

to /opt/packages/PACKAGE/VERSION.

@icaoberg
icaoberg / Singularity
Created June 3, 2021 02:31
Singularity recipe for spellcheck
Bootstrap: docker
From: debian:latest
%labels
AUTHOR icaoberg
MAINTAINER icaoberg@psc.edu
WEBSITE https://www.andrew.cmu.edu/~icaoberg
VERSION 0.5.0
%post