Friday, October 22, 2010

RedHat Enterprise 5 and Python

Update:

I found it difficult to make Python 2.6 the default distribution for RHEL. It jacks up YUM when you do it. So I'm abandoning that approach altogether. The following notes were taken before I decided to take a different approach.



Python 2.4 is the python that ships with RedHat Enterprise Linux 5. This will never do.

I didn't remove 2.4 because some suggested against it, saying that RedHat needs to keep this version around.

Suppose you want to go to version 2.6. Here's what to do: either install from repo (yum install python26), which requires that you enable EPEL, or build from Python from source. It will install along side 2.4. When you next run Python you will find that the OS is still defaulting to 2.4. To fix this run update-alternatives.


update-alternatives --config python


Run Python again and your system wide default should now be the latest version you installed.

Alert: After building my own 2.6 and following the process above, I discovered that I had inadvertently screwed up YUM. Beware this process until I post final comments.

Shrink PDF file on linux (command line)

gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/screen -dNOPAUSE -dQUIET -sPAPERSIZE=a4 -dBATCH -sOutputFile=output.pdf input.pdf

Thursday, October 14, 2010

Convert 32 to 16 bit WAV (Linux) recipe

Check file info:



devin@studio:~/Music/samples$ sndinfo funky.wav
virtual_keyboard real time MIDI plugin for Csound
PortMIDI real time MIDI plugin for Csound
PortAudio real-time audio module for Csound
util sndinfo:
funky.wav:
srate 44100, stereo, 32 bit WAV, 9.835 seconds
(433737 sample frames)


Convert to 16 bit:

sox funky.wav -b 16 funky16.wav