Skip to content

Instantly share code, notes, and snippets.

View hrnn's full-sized avatar

Hernan Payrumani hrnn

View GitHub Profile
@hrnn
hrnn / install-r-osx.md
Last active August 29, 2015 14:10
Install R in OSX

hombrew is required

brew install caskroom/cask/brew-cask
brew cask install xquartz

type your password

brew tap homebrew/science
brew install gcc

brew install r

@hrnn
hrnn / randon.sh
Created September 18, 2011 19:08
prints a ramdon line from a file
#!/bin/bash
if [ $# -ne 1 ]
then
echo "Syntax: $0 FILE"
echo $0 - display a random line from FILE.
exit 1
fi
RAND=`od -d -N2 -An /dev/urandom`
LINES=`cat "$1" | wc -l`
LINE=$(( RAND % LINES + 1 ))