Thursday, September 22, 2011

Resize images on a console

sips --resampleWidth 2400 IMG_0062.JPG --out test.jpg
(double dash) resampleWidth and (double dash) out

This Mac command does a fantastic job of resizing large images in to more manageable file sizes.

Edit: A width of 2400 is too large. Use 1600 or lower instead.

Tuesday, September 13, 2011

Wildcards in Tcl/Tk

http://phaseit.net/claird/comp.lang.tcl/fmm.html

Very useful link on wildcards in Tcl Tk. This line solved my problem;
mol new [glob fitted*.pdb rev*.pdb]

A little background would help greatly. I had a set of directories each of which had either a fittedxxx.pdb or revxxx.pdb file. I wanted a single tcl script that would go into these directories and read the fitted/rev file and perform calculations. Since the name of the file in each directory was different, I needed a way to select whatever was available. glob does exactly that. 

Wednesday, September 7, 2011

Install packages in R

R CMD INSTALL mypkg -l /my/own/R-packages/

install.packages("mypkg", lib="/my/own/R-packages/")

Friday, September 2, 2011

ssh-keygen

To reset IP and known_host keys, use the following command:

ssh-keygen -R moldyn.ornl.gov -f /home/pkc/.ssh/known_hosts
RSA host key for moldyn.ornl.gov has changed and you have requested strict checking.