Monday, 28 February 2011

Dropbox setup for work and home

I instinctively created two Dropbox accounts, but soon found that Dropbox expects you only to have one Dropbox account per user account.

Googling revealed this setup for work and personal Dropbox files from Samuel D. :
My solution is to have a paid personal account with all the storage I need, and a free work account. The entire contents of my work account are shared with the personal account. I just have my work account set up on my work computer, and my personal one on my personal computer.

This means I can
- Access all my work and personal files on my personal computer
- Access ONLY my work files on my work computer, and even if the system admin figured out the password they would only have access to my work data, not my personal stuff.

Everything syncs fluidly between both computers, I don't have to unlink and relink Dropbox as I only have one account set up with each computer. This works very well.
looks like this is the way to go.

Wednesday, 23 February 2011

Window 7 Setup

A new Windows 7 machine is setup by work admin team to have Endnote, VPN and Anti-Virus installed. Oh and Microsoft Visual Studio 2005.

Installation list

The following are my list of initial installs.

Firefox
Chrome
VirtualBox

Cygwin

zip
unzip
CVS
git
git-completion
git-gui
gitk
make
ocaml*
svn
emacs
nano
vim
graphicsmagick
imagemagick
clisp
python
ruby
openssl
openssh
rsynch
perl
lyx
tetex
chere
catdoc
lynx
wget

java - set JAVA_HOME
jEdit
quassel
maven - set M2_HOME
WinMerge
IntelliJ
checkout all projects
Eclipse
Spotify
Dropbox
Visual Studio 2010 Professional
7-zip
git
R
TortoiseSVN
Skype

TODO

SPSS
Stata
StatTransfer
Talend

Thursday, 17 February 2011

rrun - a bash R wrapper

rrun - A script to wrap around R, passing some variables.

First some motivation, what is the problem?

The default command line interface for R is a bit idiosyncratic, and there are no defaults:

~$ R
Fatal error: you must specify '--save', '--no-save' or '-vanilla'


someone went out of their way to deliberately make it behave that way! This is a language which is taking no prisoners.


~/r$ r --help
Usage: C:\Program Files\R\R-2.12.1\bin\r.exe [command args]

where 'command args' can be

  --arch n   for n=i386, x64, 32 or 64
  any other arguments listed by C:\Program Files\R\R-2.12.1\bin\r.exe --arch i386 --help

Its rude to point and stare!

~$ r --arch i386 --help
Usage: Rterm [options] [< infile] [> outfile] [EnvVars]

Start R, a system for statistical computation and graphics, with the
specified options

EnvVars: Environmental variables can be set by NAME=value strings

Options:
  -h, --help            Print usage message and exit
  --version             Print version info and exit
  --encoding=enc        Specify encoding to be used for stdin
  --encoding enc        ditto
  --save                Do save workspace at the end of the session
  --no-save             Don't save it
  --no-environ          Don't read the site and user environment files
  --no-site-file        Don't read the site-wide Rprofile
  --no-init-file        Don't read the .Rprofile or ~/.Rprofile files
  --restore             Do restore previously saved objects at startup
  --no-restore-data     Don't restore previously saved objects
  --no-restore-history  Don't restore the R history file
  --no-restore          Don't restore anything
  --vanilla             Combine --no-save, --no-restore, --no-site-file,
                          --no-init-file and --no-environ
  --min-vsize=N         Set vector heap min to N bytes; '4M' = 4 MegaB
  --max-vsize=N         Set vector heap max to N bytes;
  --min-nsize=N         Set min number of cons cells to N
  --max-nsize=N         Set max number of cons cells to N
  --max-mem-size=N      Set limit for memory to be used by R
  --max-ppsize=N        Set max size of protect stack to N
  -q, --quiet           Don't print startup message
  --silent              Same as --quiet
  --slave               Make R run as quietly as possible
  --verbose             Print more information about progress
  --internet2           Use Internet Explorer for proxies etc.
  --args                Skip the rest of the command line
  --ess                 Don't use getline for command-line editing
                          and assert interactive use
  -f file               Take input from 'file'
  --file=file           ditto
  -e expression         Use 'expression' as input

One or more -e options can be used, but not together with -f or --file

An argument ending in .RData (in any case) is taken as the path
to the workspace to be restored (and implies --restore)



Or: R CMD command args

where 'command' is one of:
  INSTALL  Install add-on packages
  REMOVE   Remove add-on packages
  SHLIB    Make a DLL for use with dynload
  BATCH    Run R in batch mode
  build    Build add-on packages
  check    Check add-on packages
  Rprof    Post process R profiling files
  Rdconv   Convert Rd format to various other formats
  Rdiff    difference R output files
  Rd2dvi   Convert Rd format to DVI
  Rd2pdf   Convert Rd format to PDF
  Rd2txt   Convert Rd format to pretty text
  Sd2Rd    Convert S documentation to Rd format
  Stangle  Extract S/R code from Sweave documentation
  Sweave   Process Sweave documentation
  config   Obtain configuration information about R
  open     Open a file via Windows file associations
  texify   Process a latex file

Use
  R CMD command --help
for usage information for each command.

I think we may need some help here.

A simple interface

rrun is intended to simplify the above, or at least be a handy place for my defaults and to enable me to pass parameters to R in addition to an input file of R commands.

sorry about the escaping

rrun s=\"nice\" f=1 s.R


Where s.R contains

print(s)
print(f)

The result:

~/r$ rrun s=\"nice\" f=1 ls.R
> # Temporary file generated by rrun
> # Date: Thu Feb 17 21:11:26 GMTST 2011
> # Command: rrun s="nice" f=1 ls.R
> #
> s="nice"
> f=1
> print(s)
[1] "nice"
> print(f)
[1] 1
> warnings()
NULL
>
~/r$

Wednesday, 16 February 2011

Gygwin setup for Debianistas

An on-going log of the tweeks needed to make Cygwin more intuitive to those of use who use Debian based systems when given a choice.

cygwin is not Ubuntu, you may have noticed :)

Allow customisation

To end of /etc/profile add

. $HOME/.bashrc


A little welcome

Add to your .bashrc

if [[ $(uname -o) == Cygwin ]]
then
echo "Usable Windows"
echo `uname -a`
fi


Simplicity rules

To the Cygwin specific block created above add

alias more=less