Sunday, June 1, 2008

Use Wget through a proxy

This worked really well:
http://blog.taragana.com/index.php/archive/how-to-use-wget-through-proxy/

Since I'm in tcsh, I just used
setenv http_proxy ......

I'll make sure when I get home that it doesn't screw things up when not using the proxy, in which case we have to remember to comment things out.

Monday, May 26, 2008

apply pixel mask

This is going to be an on-going post about making this piece of code run, . I'm just going to add to it bit-by-bit until I have something complete. Usually the first thing to check is:

setenv LD_LIBRARY_PATH /usr/local/lib/

in your .cshrc. There are other steps required, but on my current libraries, installed on a new machine, this is the thing I forget to add most often. /usr/local/lib is where I usually keep all the needed C/C++ libraries, but it certainly change if you move to other machines.

Sunday, January 27, 2008

IDL color tables

It often happens that when I go to a new computer and run IDL, the color tables don't work. The simplest fix to try is usually the following:

IDL> device,decomposed=0

Then loading the color table is as simple as:

IDL> loadct,1 ;; or no number will list the available color tables

Wednesday, September 26, 2007

Running after Logout

I've had different levels of success with this. If you just place a command in the background with bg, it will still die after logout. Sometimes 'nohup' works, but I'm not sure when or why. It probably has something to do with display type or somthing.

The reason I'm so interested in this is that I often issue 'wget' commands from my laptop that transfer large amounts of data between two remote computers. This was where I got most of my help.

I used "screen", but I didn't do everything smoothly, which probably isn't smart. Screen opened up a different looking terminal in the shell, from which I issued the command. I couldn't get out of the window, so I just clicked "close" on my laptop. After logging back in, I saw that the command continued to run. I'm sure there's a more graceful way to do this, using some screen commands, etc.

Saturday, September 1, 2007

Mplayer/Mencoder

I like movies and music a lot. Mplayer is my tool of choice here. It's open source, supports many video formats, and has an endless array of options for playback. It's pretty easy to install too. I don't remember if it was automatic the last time I did it, or if I had to resolve dependencies, etc. That's one reason why I started this blog, so I don't HAVE to remember.

Oh yeah, I used yum to get mplayer and mencoder. I think it went to the freshpms repository:
yum -install mplayer
I had to do mplayer and mencoder separately. I don't know if they are supposed to come bundled together, but they didn't this time.

Anyways, I'm using 'mencoder' to copy DVD with video in VOB format, whatever the hell that is. I started here and branched out. I have 4 files of about 1.08 GB each. I ran the following:

mencoder -oac pcm -ovc x264 VTS_01_1.VOB -o VTS_01_1.mpg
-o: output file name
-ovc: output video
-oac: output audio
I think it identifies the output time by the extension you give it.

Friday, August 3, 2007

Favorite Emacs Shortcuts

Note that many of these commands depend on your terminal type. Here's a nice Emacs link, and here is some stuff explaining shortcut keys. These the ones I always forget (and the list keeps growing)

Replace: shift-alt-% Prompts user for string to replace, and replacement string, queries user to verify each instance.
Replace (non-interactively): M-x replace string RET remove string RET replace string RET This replaces all instances with no prompting. Good for replacing commas with spaces. For me "M-x" is usually just "Alt-x".

Monday, July 16, 2007

SciPy

It turns out there are a lot of resources out there for scientific computing with Python. I'm exploring rewriting various bits of code I use in Python, particularly those that call Perl and Shell Scripts and are not self-contained. I like that Python is freely available, unlike IDL, and easy to program and use regularly, unlike IRAF. In fact, I think this is the motivation behind PyRAF.

SciPy is located here. I haven't explored the library much, but I bet it will be useful. The other important package, Numpy, is also here, but I acquired it from the STSci Institute. From STSci, I also got a key set of libraries called PyFITS, which allows FITS table and image handling. As of this writing, those couple of libraries were no larger than a few MB.

It looks like SciPy is a bit involved. It requires LAPACK libraries, which require the g77 FORTRAN compiler or something similar. I need to read up on this a bit more before I proceed. SciPy won't be as easy to install as I had hoped.

UPDATE:
I got lucky and found that binaries for FC6 have been created and are posted here, after you follow some links to this . Many thanks to this guy. He rightly advises not building LAPACK youself if you don't have to. I think you can set this up as a yum repo, but I just downloaded, rpm'ed:
1) rpm -ivh cushello
2) rpm -ivh refblas*.rpm
3) rpm -ivh lapack-*.rpm
4) rpm -ivh lapack3-*.rpm --replacefiles
5) rpm -ivh python-numpy
6) rpm -ivh python-scipy

Step 4 is a bit risky, but I forged ahead and have noticed no ill effects yet. If you don't RPM with this option, conflicts arise. I chose to brute force past the problem.