Monday, February 23, 2015

Check endianity

echo -n I | od -to2 | awk '{ print substr($2,6,1); exit}'
or 
echo -n I | hexdump -o | awk '{ print substr($2,6,1); exit}'

will give 1 for little endian

http://serverfault.com/questions/163487/linux-how-to-tell-if-system-is-big-endian-or-little-endian

Saturday, July 19, 2014

Check WPA settings

http://techchannel.radioshack.com/wpa-key-wireless-network-1503.html

Monday, January 6, 2014

IDL codes

http://www.astro.washington.edu/users/yoachim/code.php

Saturday, March 2, 2013

guvciew

install guvcview
open a terminal type dmesg click enter
after it stops type lsusb click enter
try the cam in guvcview

Saturday, August 25, 2012

Plot 3D in IDL

http://www.idlcoyote.com/tip_examples/plots3d.pro

http://idlastro.gsfc.nasa.gov/idl_html_help/PLOTS.html

Wednesday, July 4, 2012

ps2pdf with bounding box

To convert ps file to pdf using non-standard file size (default is A4) first read off the bounding box from the ps file :
%%BoundingBox: 0 0 1275 236

Then :
ps2pdf -dDEVICEWIDTHPOINTS=1275 -dDEVICEHEIGHTPOINTS=236 file.ps file.pdf


For ps files with offset or in general easier method:

ps2pdf file1.ps file2.pdf (give device width and height with added space if needed)
pdfcrop file2.pdf file3.pdf


For color images, default setting is to resort to lossy JPEG compression. To set to lossless compression for better images set options:
 -dAutoFilterColorImages=false  -dColorImageFilter=/FlateEncode

Expanded options list:
ps2pdf -sPAPERSIZE=a4  -dCompatibilityLevel=1.3  \
 -dEmbedAllFonts=true  -dSubsetFonts=true  -dMaxSubsetPct=100  \
 -dAutoFilterColorImages=false  -dColorImageFilter=/FlateEncode  \
 -dAutoFilterGrayImages=false  -dGrayImageFilter=/FlateEncode  \
 -dAutoFilterMonoImages=false  -dMonoImageFilter=/CCITTFaxEncode  \
 document.ps  document.pdf

The important thing for the image quality is AutoFilter...Images=false and ...ImageFilter=/FlateEncode. The first disables the automatic determination by Ghostscript of the "best" compression format, which tends to favour /DCTEncode, lossy JPEG encoding. The second set of options manually set the compression method to the lossless (de)flate encoding for colour and greyscale images and to CCITT encoding for monochrome images.



Tuesday, May 22, 2012

FFT

FFT in IDL vs Fortran

http://www.ssec.wisc.edu/~paulv/fft/fft_comparison.html