Command: javac -version
2015-02-25
2015-02-12
NFS Server & Client
On NFS server (IP: 192.168.0.103) shared a writable folder /nfsdata to everyone under IP subnet 192.168.0.0/24
Server
Server
- # mkdir /nfsdata
- # chmod 777 /nfsdata
- # vi /etc/exports
- /nfsdata 192.168.0.0/24(rw,sync)
- # service nfs restart
Client
- # showmount -e 192.168.0.103
- Export list for 192.168.0.103:
- /nfsdata 192.168.0.0/24
- # mkdir /mnt/nfs
- # mount 192.168.0.103:/nfsdata /mnt/nfs
- # cp /etc/passwd /mnt/nfs
An other way to auto connect with NFS server when Client boot up.
- # vi /etc/fstab
- 192.168.0.103:/nfsdata /mnt/nfs nfs default,soft,intr,timeo=1 0 0
- # mount /mnt/nfs
- # reboot
More message for Login.
For local login.
(Default content)
Welcome message after get success login.
(Default content)
- # vi /etc/issue
- Fedora Core release 4 (Stentz)
- Kernel \r on an \m
For remote login.
- # vi /etc/issue.net
Welcome message after get success login.
- # vi /etc/motd
Tune on [NumLock] by default.
Add following on bottom on file rc.sysinit, and reboot the Linux.
Step-1:
- # vi /etc/rc.d/rc.sysinit
Step-2:
- for tty in /dev/tty[1-9]*; do setleds -D +num < $tty
- done
Step-3:
- # reboot
2014-12-26
TCL, INFO exists
info exists 檢查變數是否存在.
例如 incr 指令的使用, 變數需先建立才能為變數進行加法運算. 此時可使用 info exists 先確認此變數是否存在, 再續程式.
例如 incr 指令的使用, 變數需先建立才能為變數進行加法運算. 此時可使用 info exists 先確認此變數是否存在, 再續程式.
if { ![ info exists counter ] } {
set counter 0
} else {
incr counter
}
TCL, File - Get file path
[Condition]
[Program Output]
- filename: test.tcl
- file path: C:/02-MTS/99-Trainning/12-info/
set appPath [ file normalize [ info script ] ]
if { [file type $appPath ] == "link" } {
set appPath [ file readlink $appPath ]
}
puts $appPath
[Program Output]
- C:/02-MTS/99-Trainning/12-info/test.tcl
2014-12-10
Disable daemon of Smartd to speed up boot process.
What is Smartd: Smartd does hard drive reliability monitoring.
Turn it to OFF
Example OS: CentOS 4.2 with Kernel 2.6.9-22 EL
- # chkconfig smartd --list
- smartd 0:off 1:off 2:on 3:on 4:on 5:on 6:off
- # chkconfig smartd off
- # chkconfig smartd --list
- smartd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
2014-11-27
2014-11-25
TCL, MAC address increment
set var_mac 001A6A00001F
set var_incr 000000000001
set var_mac2 [ format %X [ expr "0x$var_mac + 0x$var_incr" ] ]
puts $var_mac2
set mac_next "001A$var_mac2"
puts "Next MAC Address is $mac_next"
[OUTPUT]
Next MAC Address is 001A6A000020
[NOTE]
Line 1 to Line 4 產生的值為 Line 5 的 6A000020, 而不是 001A6A00001F, 少了 001A. 很奇怪, 所以才在 Line 7 補上 "001A", 有空再回頭瞭解.
Line 2 $var_incr 也可不用 000000000001, 可以是 1.
訂閱:
文章 (Atom)