This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
for f in *.JPG; do mv "$f" "`basename "$f" .JPG`.jpg"; done; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Credit: Taken from: http://stackoverflow.com/questions/1358003/tricks-to-manage-the-available-memory-in-an-r-session | |
# improved list of objects | |
.ls.objects <- function (pos = 1, pattern, order.by, | |
decreasing=FALSE, head=FALSE, n=5) { | |
napply <- function(names, fn) sapply(names, function(x) | |
fn(get(x, pos = pos))) | |
names <- ls(pos = pos, pattern = pattern) | |
obj.class <- napply(names, function(x) as.character(class(x))[1]) | |
obj.mode <- napply(names, mode) | |
obj.type <- ifelse(is.na(obj.class), obj.mode, obj.class) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
echo $(date +"%y-%m-%d-%H:%M:%S") $(free -m | sed -n '2p' | awk '{print $3}') MB >> mem.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Commands to flush swap. | |
# Don't try this if swap in use exceeds memory available. | |
sudo swapoff -a | |
sudo swapon -a | |
# sync writes things in memory to hard disk (kernel) for stability. | |
sync |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(Rmpi) | |
## load the packages we'll need | |
RLIBS="~/R/x86_64-redhat-linux-gnu-library/2.13" | |
.libPaths(c(RLIBS, .libPaths())) | |
### Direct RMPI way: | |
mpi.spawn.Rslaves(nslaves=15) | |
slavefn <- function() { print(paste("Hello from", foldNumber)) } | |
mpi.bcast.cmd(foldNumber <- mpi.comm.rank()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
## Use the current working directory | |
#$ -cwd | |
## use bash commands | |
#$ -S /bin/bash | |
## combine error and output files | |
#$ -j y | |
## Parallel for openmp: | |
#$ -pe threaded 16 | |
## Launch parallel mpi threads |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\documentclass{elsarticle} | |
%% Redefines the elsarticle footer | |
\makeatletter | |
\def\ps@pprintTitle{% | |
\let\@oddhead\@empty | |
\let\@evenhead\@empty | |
\def\@oddfoot{\it \hfill\today}% | |
\let\@evenfoot\@oddfoot} | |
\makeatother |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RSCRIPT = Rscript | |
pdfclean: | |
rm -f *.pdf | |
clean: | |
rm -f index.html | |
rm -f *.tex *.bbl *.blg *.aux *.out *.log *.spl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Makefile to use knitr in the vignette | |
RSCRIPT = Rscript | |
all: rfishbase.pdf | |
rfishbase.pdf: rfishbase/rfishbase.Rnw | |
cp -f rfishbase/rfishbase.Rnw . | |
$(RSCRIPT) --vanilla -e "require(knitr); knit( 'rfishbase.Rnw');" | |
#Compile in latex, but keep aux file till we make bibliography | |
$(RSCRIPT) -e "tools::texi2dvi( 'rfishbase.tex', pdf = TRUE, clean = FALSE )" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module swap pgi intel | |
module swap openmpi openmpi-intel | |
module load gsl | |
module load R/2.12.1 | |
rm wrightscape/config* | |
cp wrightscape/src/nersc_makevars wrightscape/src/Makevars | |
R CMD INSTALL wrightscape |