Sunday, November 11, 2007

Symbolic link

ln -s [target] [from]

Example:
You don't have simulation folder in your home directory yet now. But you DO have a simulaion directory in another hard drive/ partition. You want to set up a link in your home folder ( /home/joying/simulaion) to a different partition/hard drive ( /media/_home/simulation).
SO the command would be:
ln -s /media/_home/simulation /home/joying/simulation

If you want to remove the link,
cd /home/joying
unlink simulation


########################################

When using the rm or unlink command to remove a symbolic link to a directory, make sure you don’t end the target with a ‘/’ character because it will create an error. Example:

$ mkdir dirfoo
$ ln -s dirfoo lnfoo
$ rm lnfoo/
rm cannot remove directory ‘lnfoo/’ : Is a directory
$ unlink lnfoo/
unlink: cannot unlink ‘lnfoo/’: Not a directory
$ unlink lnfoo
$

Notice how one complains it “Is a directory”, but the other complains it is “Not a directory”, which I found confusing. This is a problem if you have a tendency to use tab completion a lot, because it will stick a ‘/’ at the end.

Sunday, October 21, 2007

how to transfer data using scp

scp from to
scp data.tgz username@server:~/
-------- -----------------------
from to

Tuesday, September 18, 2007

Change tty terminal font size

sudo vim /boot/grub/grub.conf

add 'vga=796' at the end of kenel line
for instance:
kernel /boot/vmlinuz-2.6.22.5-76.fc7 ro root=LABEL=/1 rhgb quiet vga=796

what number should you use instead of 796? Check this page out:
http://en.wikipedia.org/wiki/VESA_BIOS_Extensions
or google VESA BIOS :-)

OK, some people, like me, don't use vesa driver. So what number should we use? check the following link out:
http://www.linuxquestions.org/questions/linux-hardware-18/terminal-window-resolution-better-than-80x24-63927/

Linux video mode numbers

The Linux kernel allows user configuration of VESA modes at boot time using the 'vga' kernel parameter. This parameter does not directly accept VESA video mode numbers; instead, a Linux video mode number must be calculated using the VESA number.








1024×640 1024×768 1152×720 1280×1024 1440×900 1600×1200
16 color palette






772
774

256 color palette





874 773 869 775 864 796
15-bit (5:5:5)





875 790 870 793 865 797
16-bit (5:6:5)





876 791 871 794 866 798
24-bit (8:8:8)





877 792 872 795 867 799
32-bit (8:8:8)1





878 824 873 829 868 834

1: 32-bit is really (8:8:8:8), but the final 8-bit number is an "empty" alpha channel. It is otherwise equal to 24-bit color.

Tuesday, September 11, 2007

What is laser mode?

I posted this question some time ago. It might be a good time to answer this before questions pile up.

There are basically 'two kinds of laser modes': transverse mode and longitudinal mode. Sometimes, transverse modes are labeled as TEM modes, such as TEM00, TEM01, TEM11. Longitudinal modes are also called cavity modes or axial modes. TBC

Tuesday, September 4, 2007

awk 'last pass power'

awk '$1~/300/{print $1,$2}' output.* | tee -a /dev/tty lastpass.txt