1:create the root qdisc and assign the default class
# $TC qdisc add dev eth0 root handle 1: htb default $D_CLASS
2:create the class you want to have
# $TC class add dev eth0 parent 1: classid 1:1 htb rate 10mbit
# $TC class add dev eth0 parent 1: classid 1:1000 htb rate 1000mbit
child class of 1:1000 -- 20mbit of 1000mbit
# $TC class add dev eth0 parent 1:1000 classid 1:20 htb rate 20mbit
3:speed control parameter in class creation -- rate for guarantee bandwidth and ceil for maximum bandwidth
4:define your rule.
U32="$TC filter add dev $IF protocol ip parent 1:0 prio 1 u32"
by IP
$U32 match ip dst xxx.xxx.xxx.xxx/32 flowid $CLASS
by port
$U32 match ip sport port_number 0xffff flowid $CLASS
Nested rule
$U32 match ip dport port_number 0xffff match ip dst xxx.xxx.xxx.xxx/32 flowid $CLASS
tc class|qdisc|filer add|change|replace dev $IF args
tc -s class|qdisc|filter ls dev eth0
tc filter del dev eth0 parent CLASS:CLASS prio 10 handle HANDLE::HANDLE u32
refer to http://blog.edseek.com/~jasonb/articles/traffic_shaping/classflows.html#iptu32
refer to http://www.gentoo-wiki.info/QoS
2010年5月5日 星期三
how to make a portable RRDTOOL
Download all required packages first:
RRDtool: http://oss.oetiker.ch/rrdtool/pub/?M=D
Dependent library http://oss.oetiker.ch/rrdtool/pub/libs/
1: install pixman ./configure --prefix=PREFIX --libdir=DIR --includedir=DIR && make && make install
2: setup environment variable PKG_CONFIG_PATH export PKG_CONFIG_PATH=libdir/pkgconfig/
3: install libpng ./configure --prefix=PREFIX --libdir=DIR --includedir=DIR && make && make install
4: install freetype ./configure --prefix=PREFIX --libdir=DIR --includedir=DIR && make && make install
5: install fontconfig ./configure --prefix=PREFIX --libdir=DIR --includedir=DIR && make && make install
6: Install pkg-config rpm2cpio pkgconfig-0.20-1.fc4.1.i386.rpm |cpio –idmv
update environment variable PATH export PATH=PATH_OF_pkg-config:$PATH
7: install cairo ./configure --prefix=PREFIX --libdir=DIR --includedir=DIR && make && make install
8: install glib ./configure --prefix=PREFIX --libdir=DIR --includedir=DIR && make && make install
9: install pango ./configure --prefix=PREFIX --libdir=DIR --includedir=DIR && make && make install
10: install intltool ./configure --prefix=PREFIX --libdir=DIR --includedir=DIR && make && make install
11: install rrdtool ./configure --prefix=PREFIX --libdir=DIR --includedir=DIR --bindir=DIR && make && make install
12: install spine --> issue# aclocal && libtoolize --force && autoconf && autoheader && automake && ./configure –prefix=PREFIX
13: dispath rrdtool to system revise /etc/ld.so.conf and run ldconfig
14: or set environment variable LD_LIBRARY_PATH=PATH_OF_UR_LIB
RRDtool: http://oss.oetiker.ch/rrdtool/pub/?M=D
Dependent library http://oss.oetiker.ch/rrdtool/pub/libs/
1: install pixman ./configure --prefix=PREFIX --libdir=DIR --includedir=DIR && make && make install
2: setup environment variable PKG_CONFIG_PATH export PKG_CONFIG_PATH=libdir/pkgconfig/
3: install libpng ./configure --prefix=PREFIX --libdir=DIR --includedir=DIR && make && make install
4: install freetype ./configure --prefix=PREFIX --libdir=DIR --includedir=DIR && make && make install
5: install fontconfig ./configure --prefix=PREFIX --libdir=DIR --includedir=DIR && make && make install
6: Install pkg-config rpm2cpio pkgconfig-0.20-1.fc4.1.i386.rpm |cpio –idmv
update environment variable PATH export PATH=PATH_OF_pkg-config:$PATH
7: install cairo ./configure --prefix=PREFIX --libdir=DIR --includedir=DIR && make && make install
8: install glib ./configure --prefix=PREFIX --libdir=DIR --includedir=DIR && make && make install
9: install pango ./configure --prefix=PREFIX --libdir=DIR --includedir=DIR && make && make install
10: install intltool ./configure --prefix=PREFIX --libdir=DIR --includedir=DIR && make && make install
11: install rrdtool ./configure --prefix=PREFIX --libdir=DIR --includedir=DIR --bindir=DIR && make && make install
12: install spine --> issue# aclocal && libtoolize --force && autoconf && autoheader && automake && ./configure –prefix=PREFIX
13: dispath rrdtool to system revise /etc/ld.so.conf and run ldconfig
14: or set environment variable LD_LIBRARY_PATH=PATH_OF_UR_LIB
2010年3月30日 星期二
NIS System trick
1: define the NIS domain name
issue # nisdomainname kido.idv.tw
2-1: initial NIS database
issue # /usr/lib[platform]/yp/ypinit -m
2-2: NIS database synchronization. Please note, when any new auto map is generated, and push feature is enabled on NIS master, you have to manually resync NIS database again.
issue # /usr/lib[platform]/yp/ypinit -s master
3: add nis server name and ip mapping to hosts file
4: join NIS domain
issue # authconfig
5: check init service
[NIS master server] ypserv, yppasswdd, ypxfrd
[NIS slave server] ypserv
[NIS client] NISDOMAIN need to be defined inside the /etc/sysconfig/network file
6: change the default database tree [defined inside /var/yp/Makefile]
please note, when user account database is moved to non-default folder you may need to redefine parameters inside /etc/sysconfig/yppasswdd file
issue # nisdomainname kido.idv.tw
2-1: initial NIS database
issue # /usr/lib[platform]/yp/ypinit -m
2-2: NIS database synchronization. Please note, when any new auto map is generated, and push feature is enabled on NIS master, you have to manually resync NIS database again.
issue # /usr/lib[platform]/yp/ypinit -s master
3: add nis server name and ip mapping to hosts file
4: join NIS domain
issue # authconfig
5: check init service
[NIS master server] ypserv, yppasswdd, ypxfrd
[NIS slave server] ypserv
[NIS client] NISDOMAIN need to be defined inside the /etc/sysconfig/network file
6: change the default database tree [defined inside /var/yp/Makefile]
please note, when user account database is moved to non-default folder you may need to redefine parameters inside /etc/sysconfig/yppasswdd file
2010年3月11日 星期四
fail to start adobe professional with users permission
When opening adobe professional with users permission, system complains about "An error has been detected with a required application library and the product can not continue. Please reinstall the application".
Root cause: VOL is required unless you need to grant administrator permission to users who you want to enable them to run adobe profession on RDP session.
Way to fix the issue.
1: logon with Administrator account
2: export registry underneath HKCU\software\adobe
http://forums.citrix.com/thread.jspa?threadID=60695
Root cause: VOL is required unless you need to grant administrator permission to users who you want to enable them to run adobe profession on RDP session.
Way to fix the issue.
1: logon with Administrator account
2: export registry underneath HKCU\software\adobe
http://forums.citrix.com/thread.jspa?threadID=60695
2010年1月6日 星期三
script to manage certificate
capicom.dll is required for managing certificate through script
set oCertStore = CreateObject ("CAPICOM.Store")
set oCert = CreateObject ("CAPICOM.Certificate")
'Param 1 is the Store to use (1 = local computer, 2 = current user)
'Param 2 is the location to use in the store "MY" "ROOT"
'Param 3 is the Read/Write mode. 0 = R, 1 = W, 2 = RW
oCertStore.Open 1, "ROOT", 2
oCert.Load "certnew.cer", , 1, 1
'rem Then, you just need to add the cert to the store
oCertStore.Add oCert
來源: 忘了
set oCertStore = CreateObject ("CAPICOM.Store")
set oCert = CreateObject ("CAPICOM.Certificate")
'Param 1 is the Store to use (1 = local computer, 2 = current user)
'Param 2 is the location to use in the store "MY" "ROOT"
'Param 3 is the Read/Write mode. 0 = R, 1 = W, 2 = RW
oCertStore.Open 1, "ROOT", 2
oCert.Load "certnew.cer", , 1, 1
'rem Then, you just need to add the cert to the store
oCertStore.Add oCert
來源: 忘了
how to change language for non-unicode program from registry
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Nls\CodePage
ACP 1252 for English ( United States )
MACCP 10000 for English ( United States )
OEMCP 437 for English ( United States )
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Nls\Language
Default 0409 for English ( United States )
Also you can export HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Nls\
from test computer to anothers after changing settings for non-unicode and
restart computer
來源: http://www.technewsgroups.net/group/microsoft.public.windowsxp.customize/topic41297.aspx
ACP 1252 for English ( United States )
MACCP 10000 for English ( United States )
OEMCP 437 for English ( United States )
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Nls\Language
Default 0409 for English ( United States )
Also you can export HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Nls\
from test computer to anothers after changing settings for non-unicode and
restart computer
來源: http://www.technewsgroups.net/group/microsoft.public.windowsxp.customize/topic41297.aspx
2009年9月16日 星期三
ssh host based authentication
Goal: 類rlogin方式,使用免密碼登入特定主機
1: ssh server : enable the HostbasedAuthentication feature on ssh server.
2: ssh client : enable the HostbasedAuthentication and EnableSSHKeysign feature on ssh client
3: add rsa fingerprint to /etc/ssh/ssh_known_hosts :
issue: ssh-keyscan -vt rsa remote_machine >> /etc/ssh/ssh_known_hosts
4: add hosts that are permitted to use the HostbasedAuthentication method to logon to/etc/ssh/shosts.equiv
issue: echo +@linuxbox > /etc/ssh/ssh_known_hosts
1: ssh server : enable the HostbasedAuthentication feature on ssh server.
2: ssh client : enable the HostbasedAuthentication and EnableSSHKeysign feature on ssh client
3: add rsa fingerprint to /etc/ssh/ssh_known_hosts :
issue: ssh-keyscan -vt rsa remote_machine >> /etc/ssh/ssh_known_hosts
4: add hosts that are permitted to use the HostbasedAuthentication method to logon to/etc/ssh/shosts.equiv
issue: echo +@linuxbox > /etc/ssh/ssh_known_hosts
訂閱:
文章 (Atom)