Skip to content

Instantly share code, notes, and snippets.

View icaoberg's full-sized avatar

icaoberg icaoberg

View GitHub Profile
@icaoberg
icaoberg / gist:3434461
Created August 23, 2012 09:03
Git - Setup author and email address
git config --global user.name "Ivan E. Cao-Berg"
git config --global user.email "icaoberg@scs.cmu.edu"
@icaoberg
icaoberg / zipfolders.sh
Created August 23, 2012 09:35
Zip all folders in the current directory
#!/bin/bash
for FOLDER in *;
do
if [ -d "$FOLDER" ];
then
zip -r "$FOLDER".zip "$FOLDER"
fi
done
@icaoberg
icaoberg / zipsubfolders.sh
Created August 23, 2012 10:10
Zip all the subfolders of the folders in the current path
#!/bin/bash
for FOLDER in *;
do
if [ -d "$FOLDER" ];
then
echo $FOLDER
for SUBFOLDER in "$FOLDER"/*
do
@icaoberg
icaoberg / script.sh
Created August 27, 2012 18:42
Find and replace string across multiple files
#!/bin/bash
find . -name "*.m" -exec sed -i 's/\/home\/icaoberg\/cellorganizer-matlab-master/\/home\/icaoberg\/projects\/cellorganizer\/matlab/g' {} \;
@icaoberg
icaoberg / script.sh
Created August 27, 2012 18:58
Comment out email notification on all PBS scripts in the current path
#!/bin/bash
find . -name "*.sh" -exec sed -i 's/#PBS -M icaoberg@andrew.cmu.edu/##PBS -M icaoberg@andrew.cmu.edu/g' {} \;
@icaoberg
icaoberg / git.sh
Created September 28, 2012 17:45
Remove git tag both locally and remotely
TAG="v1.7.2"
git tag -d $TAG
git push origin :refs/tags/$TAG
@icaoberg
icaoberg / pyslid.prerequesites.sh
Created October 23, 2012 19:14
[OMERO.searcher] Prerequisite helper script for PySLID
#!/bin/bash
sudo apt-get update
sudo apt-get install setup-tools python-matplotlib
sudo easy_install pip
sudo pip install pyslic
@icaoberg
icaoberg / profile2web.sh
Created October 24, 2012 21:03
Change the results from profiler to web
cp /opt/matlab/amd64_f7/7.10/lib/matlab7/toolbox/matlab/codetools/private/*.gif .
sed -i 's/file:\/\/\/\/opt\/matlab\/amd64_f7\/7.10\/lib\/matlab7\/toolbox\/matlab\/codetools\/private\///g' *.html
sed -i 's/file:\/\/\/\/opt\/matlab\/7.13\/toolbox\/matlab\/codetools\/private\///g' *.html
sed -i 's/file0.html/index.html/g' *.html
mv file0.html index.html
@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 / script.sh
Created December 4, 2012 04:49
[BASH] Join avi files use mencoder
#!/bin/bash
mencoder -oac copy -ovc copy -idx -o output.avi input1.avi input2.avi input3.avi