2015-12-25

Dreamplug, IF IP GONE.

Create a network config file manually.
# vi /etc/network/interfaces
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
address 192.168.1.1
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255

auto eth1
iface eth1 inet static
address 192.168.2.1
netmask 255.255.255.0
network 192.168.2.0
broadcast 192.168.2.255

# /sbin/ifup -a
Note-01:
# ifup -h

BusyBox v1.16.1 (2015-12-03 19:06:58 CST) multi-call binary.

Usage: ifup [-ainmvf] IFACE...

Options:
        -a      De/configure all interfaces automatically
        -i FILE Use FILE for interface definitions
        -n      Print out what would happen, but don't do it
                (note: doesn't disable mappings)
        -m      Don't run any mappings
        -v      Print out what would happen before doing it
        -f      Force de/configuration

Note-02: When "ifup -a" and get below message, try this

ifup: interface lo already configured
ifup: interface eth0 already configured
ifup: interface eth1 already configured

# ifdown -a
# ifup -a

2015-12-23

Dreamplug, uDHCPd options

File: /etc/udhcpd.conf
# Sample udhcpd configuration file (/etc/udhcpd.conf)
# Values shown are defaults

# The start and end of the IP lease block
start  192.168.0.20
end  192.168.0.254

# The interface that udhcpd will use
interface eth0

Dreamplug, DHCP server



2015-08-17

TCL, MAC remove ":", and call back ":".

Example MAC is 001122998877
Change example MAC to 00:11:22:99:88:77

set macEth0 "001122998877"

for { set i 0 } {$i < 6 } { incr i } {
      set temp [format "%s" [string range $macEth0 [expr $i * 2] [expr $i * 2 + 1]]]
      append macEth0 "$temp"
      if { $i == 5 } { break }
      append macEth0 ":"
}

puts "Debug: macEth0 ==> $macEth0"


Remove MAC symbol ":"

set var_mac ""
set sfis_macEth1 ""

set var_mac [string map {: ""} $macEth0]
set sfis_macEth1 [string map {: ""} $macEth1]

puts "var_mac = $var_mac"
puts "sfis_macEth1 = $sfis_macEth1"

2015-05-08

SED

sed --> stream editor

原有文件: test.file
文件內容:
  • this is line 1 on original test.file!
  • this is line 2 on original test.file!!
  • this is line 3 on original test.file!!!
刪除第三行
    • # sed -i "3d' test.file
    • # cat test.file
      • this is line 1 on original test.file!
      • this is line 2 on original test.file!!
Parameter
  • d ==> 刪除指定行號
  • c\<字串> ==> 以 <字串> 取代指定的行號
  • a\<字串> ==> 在指定的行號後新增一行 <字串>
  • a lot of parameters.

2015-04-24

ECHO

  • Parameter
    • -n : 不要在最後自動換行
    • -e : 若字串中出現以下字元, 則特別加已處理, 而不將之當成一般文字輸出.
      • \a : 發出警告聲
      • \n : 刪除前一個字元
      • \c : 最後不加上換行符號
      • \f : 換行且游標停留在原來位置
      • \n : 換行且游標移至行首
      • \r : 游標移至行首, 但不換行
      • \t : 插入 tab
      • \v : 與 \f 相同
      • \\ : 插入 \ 字元
      • \nnn : 插入 nnn (八進位) 所代表的 ASCII字元
Example

2015-04-02

SVN, first try.


Installation & Setup
  • # yum install mod_dav_svn subversion
  • # vim /etc/httpd/conf.d/subversion.conf
    • make sure 2 lines upper this config file.
      • LoadModule dav_svn_module     modules/mod_dav_svn.so
      • LoadModule authz_svn_module   modules/mod_authz_svn.so
    • modify these
      • <Location /repos>                                  # root path for http connection on /svn
        • DAV svn                                      # svn = connection method
        • SVNPath /var/www/svn/repos     # local svn path
        • AuthType Basic                            # 
        • AuthName "Subversion repos"     # show login information
        • AuthUserFile /etc/svn-auth-conf   # account & password  located file
        • Require valid-user                          # svn login required password
        • #Satisfy Any                                   # svn login password no required
      • </Location>
Create first user
  • # htpasswd -cm /etc/svn-auth-conf yourusername
Create other users
  • # htpasswd -m /etc/svn-auth-conf anotherusername 
Establish version control area
  • # mkdir /var/www/svn
  • # cd /var/www/svn
  • # svnadmin create mts
  • # chown -R apache.apache mts
  • # service httpd restart

Apache, httpd start FAIL

When no idea for httpd start FAIL without any error message.

Fixed,
check log file on /var/log/httpd/*, and there was a error log related NSS [error].
removed this kind of log file on /var/log/httpd/nss_error_log, and then httpd WORK. MY GOD.

2015-03-25

TCL, TK

  • By default, the TK 8.4 doesn't support 
    • TTK (::ttk::), and so the package "tile" is required to support TTK.
      • install "teacup install tile"
      • code "package require tile"
    • Picture format of JPEG & PNG, and so the package "img" is required to support JPEG & PNG.
      • install "teacup install Img"
      • code "package require img::jpeg"
      • code "package require img::png"

2015-03-19

TestLink, Browser tab & report title changing.



Config file: %%56^560^56038526%%inc_head.tpl.php
Path: /var/www/html/testlink/gui/templates_c

2015-03-18

Allow TestLink to upload picture on Test Case.

TestLink version: 1.9.2

find - Linux command

Find specific string
  • # find ./directory -name “*.file extension” -exec grep -H “string” {} \;
Find specific filename
  • # find /directory -name filename

2015-03-17

Upgrade PHP5.4.0 from PHP5.2.10 on CentOS 5.5

5 Steps

1- Remove older version of PHP 5.2.10.
2- Add PHP 5.4
3- Check available PHP
4- Install new PHP
5- Finally

2015-03-05

byte & bit

1 byte = 8 bits = 0000 0000 (binary) = F F (Hex)

2015-02-25

Check JDK version within Win7

Command: javac -version


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

  • # 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)

  • # 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