2009年4月12日星期日

LINUX:ARCHLINUX java 界面乱码

Java:

java -version
java version "1.6.0_0"
OpenJDK Runtime Environment (IcedTea6 1.5pre) (ArchLinux-1.5-0.1-i686)
OpenJDK Server VM (build 14.0-b10, mixed mode)


solution:


cd /usr/lib/jvm/java-1.6.0-openjdk/jre/lib/fonts
sudo mkdir fallback
cd fallback
sudo cp /usr/share/fonts/truetype/arphic/uming.ttc
/usr/lib/jvm/java-6-sun-1.6.0.10/jre/lib/fonts/fallback
sudo mkfontdir
sudo mkfontscale

2009年4月5日星期日

ISSUE:HP-UX vgdisplay error: Couldn't query volume group "vg00"

Issue:

# vgdisplay -v /dev/vg00
vgdisplay: Couldn't query volume group "/dev/vg00".
Possible error in the Volume Group minor number; Please check and make
sure the group minor number is unique.
vgdisplay: Cannot display volume group "/dev/vg00".

Debug:


# ll /dev/*/group
crw-r----- 1 root sys 64 0x000000 Sep 27 2006 /dev/vg00/group
cr--r--r-- 1 root sys 64 0x010000 Oct 11 2006 /dev/vg01/group
crw-r--r-- 1 root sys 64 0x020000 Mar 4 11:00 /dev/vg02/group
# ll /dev/slvmg
/dev/slvmg not found
# cd /dev
# find . -exec ll {} \; | grep 0x000000 | grep 64
crw-r----- 1 root sys 64 0x000000 Sep 27 2006 group
crw-r----- 1 root sys 64 0x000000 Sep 27 2006 ./vg00/group

Fixed:
# mv /etc/lvmtab /etc/lvmtab.save
# vgscan -v
# vgchange -a y vg00
# vgdisplay vg00

Relink Doc:
http://forums11.itrc.hp.com/service/forums/questionanswer.do?threadId=248847
key words:ULVMKBRC00008020

2009年4月4日星期六

电信商务领航定制终端 大亚 DB120-B1 配置方法

公司装宽带,电信送了个无线路由加猫的东东,叫电信商务领航定制终端,型号是大亚 DB120-B1 。
公司的技术员说无法自动拨号上网,所以没用。那好,我就看看,电信这会是黄鼠狼还是喜羊羊。

回家,接上自己家的ADSL,开始操作。

按说明书,一步一步的做

1.设置自己PC的IP为  192.168.1.2

2.用配的交叉线连路由的LAN1

3.输入   http://192.168.1.1  
(如果不行,试试https://192.168.1.1)
username :   telecomadmin
password:     nE7jA%5m

4.网络-宽带设置

连接名称: 新建一个连接
连接模式:Route
             选       pppoE
NAT : YES
VPI:8
VCI:35
服务类别:UBR WITHOUT PCR
启用VLAN: NO
VLAN ID:
封装:LLC/SNAP-BRIDGING
用户名:电信账户
密码:电信密码
服务名称:CHINATELLECOM
启用802.1优先级:YES
端口绑定:仅INTERNET
                端口全选


然后设置WLAN和DHCP,这些不详说,

设置后,一定要到  管理-设备管理-保存/重启  ,设置才会生效。


重启后,看看 状态-网络侧信息

如果出现 

8/35 Off PPPoE Up 219.137.210.254
这行,恭喜,成功了!

没有出现?也不用灰心,因为你和笔者不在同一个城市,GOOGLE一下你城市的VPI和VCI吧。我的技术员也就是填错了这里。


2009年4月2日星期四

LINUX:CENTOS How to modify Ip address

[oracle@server-centos01 ~]$ cat /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=server-centos01
GATEWAY=192.168.0.3

[oracle@server-centos01 ~]$ cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=dhcp
HWADDR=00:22:19:B0:9D:E6
ONBOOT=no
TYPE=Ethernet
DHCP_HOSTNAME=server-centos01
[oracle@server-centos01 ~]$ cat /etc/sysconfig/network-scripts/ifcfg-eth1
DEVICE=eth1
BOOTPROTO=static
BROADCAST=192.168.0.255
HWADDR=00:22:19:B0:9D:E8
IPADDR=192.168.0.22
NETMASK=255.255.255.0
NETWORK=192.168.0.0
ONBOOT=yes
TYPE=Ethernet

LINUX:CENTOS How to setup openvnc

It is very simple to config openvnc to work.

Step 1:

login with your account like myname
run vncserver
input your password

Step 2:

vi ~/.vnc/xstartup

remove with # mark

#xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
#twm &

add this line to enable use gnome to show x window in vnc client
gnome-session &


Step3:

vi /etc/sysconfig/vncservers

add these lines,notice that [youname] is your account name


VNCSERVERARGS[1]="-geometry 1024x768"
VNCSERVERS="1:youname"


Step 4:start service

sudo /sbin/service vncserver restart

Step 5:login with browser

in client PC,open your brower with

http://vnc-server-ip:5801/

2009年3月25日星期三

Linux:Centos 如何释放内存


     当在Linux下频繁存取文件后,物理内存会很快被用光,当程序结束后,内存不会被正常释放,而是一直作为caching。因此,在系统备份(tar) 后,用top看的时候内存使用会吓你一大跳,用光了?

    先用 free -m 看看系统内存情况:

[oracle@server-centos01 ~]$ free -m
             total       used       free     shared    buffers     cached
Mem:          4047       4012         35          0         68       2509
-/+ buffers/cache:       1434       2613                                
Swap:         1906          0       1906


    其他的先别管,留意  

-/+ buffers/cache:       1434       2613        

    2613才是真正可用的内存,而不是total - used =free。

    那么,有没有办法释放这些内存呢,答案是有的。先看看以下的介绍:

/proc/sys/vm/drop_caches (since Linux 2.6.16)
Writing to this file causes the kernel to drop clean caches,
dentries and inodes from memory, causing that memory to become
free.

To free pagecache, use echo 1 > /proc/sys/vm/drop_caches; to
free dentries and inodes, use echo 2 > /proc/sys/vm/drop_caches;
to free pagecache, dentries and inodes, use echo 3 >
/proc/sys/vm/drop_caches.

Because this is a non-destructive operation and dirty objects
are not freeable, the user should run sync first.


    释放的方法:
   
    1.    sync
    2.    echo 3 >/proc/sys/vm/drop_caches


    再用 free -m 去看:

[root@server-centos01 ~]# free -m                     
             total       used       free     shared    buffers     cached
Mem:          4047       1652       2394          0          0        234
-/+ buffers/cache:       1417       2629                                
Swap:         1906          0       1906


    其实,如果不是用于调试,这类手工释放的方法建议还是不要去用。
   

2009年3月6日星期五

xorg.conf for Archlinux KDE 4.2.1 in HP Compaq nx7400

xorg.conf for Archlinux KDE 4.2.1 in HP Compaq nx7400

# /.../
# SaX generated X11 config file
# Created on: 2008-08-19T16:21:40+0800.
#
# Version: 8.1
# Contact: Marcus Schaefer <sax@suse.de>, 2005
# Contact: SaX-User list
<https://lists.berlios.de/mailman/listinfo/sax-users>
#
# Automatically generated by [ISaX] (8.1)
# PLEASE DO NOT EDIT THIS FILE!
#

Section "Files"
# FontPath "/usr/share/fonts/misc:unscaled"
FontPath "/usr/share/fonts/local"
FontPath "/usr/share/fonts/75dpi:unscaled"
FontPath "/usr/share/fonts/100dpi:unscaled"
FontPath "/usr/share/fonts/URW"
FontPath "/usr/share/fonts/Speedo"
FontPath "/usr/share/fonts/PEX"
FontPath "/usr/share/fonts/cyrillic"
FontPath "/usr/share/fonts/latin2/misc:unscaled"
FontPath "/usr/share/fonts/latin2/75dpi:unscaled"
FontPath "/usr/share/fonts/latin2/100dpi:unscaled"
FontPath "/usr/share/fonts/latin2/Type1"
FontPath "/usr/share/fonts/latin7/75dpi:unscaled"
FontPath "/usr/share/fonts/baekmuk:unscaled"
FontPath "/usr/share/fonts/japanese:unscaled"
FontPath "/usr/share/fonts/kwintv"
FontPath "/usr/share/fonts/truetype"
FontPath "/usr/share/fonts/uni:unscaled"
FontPath "/usr/share/fonts/CID"
FontPath "/usr/share/fonts/ucs/misc:unscaled"
FontPath "/usr/share/fonts/ucs/75dpi:unscaled"
FontPath "/usr/share/fonts/ucs/100dpi:unscaled"
FontPath "/usr/share/fonts/hellas/misc:unscaled"
FontPath "/usr/share/fonts/hellas/75dpi:unscaled"
FontPath "/usr/share/fonts/hellas/100dpi:unscaled"
FontPath "/usr/share/fonts/hellas/Type1"
FontPath "/usr/share/fonts/misc/sgi:unscaled"
FontPath "/usr/share/fonts/xtest"
FontPath "/opt/kde3/share/fonts"
InputDevices "/dev/gpmdata"
InputDevices "/dev/input/mice"
EndSection

Section "ServerFlags"
Option "AIGLX" "on"
Option "AllowMouseOpenFail" "on"
Option "ZapWarning" "on"
EndSection

Section "Module"
Load "glx"
#Load "type1"
Load "extmod"
Load "dbe"
Load "freetype"
Load "dri"
Load "synaptics"
EndSection

Section "InputDevice"
Driver "kbd"
Identifier "Keyboard[0]"
#Option "Protocol" "Standard"
Option "XkbLayout" "us"
#Option "XkbModel" "microsoftpro"
Option "XkbModel" "pc104"
#Option "XkbRules" "xfree86"
EndSection


Section "InputDevice"
Driver "mouse"
Identifier "Mouse[1]"
Option "Buttons" "5"
Option "Device" "/dev/input/mice"
Option "Name" "Pixart Imaging USB OPTICAL MOUSE"
Option "Protocol" "explorerps/2"
Option "Vendor" "Sysp"
Option "ZAxisMapping" "4 5"
EndSection

Section "InputDevice"
Driver "synaptics"
Identifier "Mouse[3]"
Option "Buttons" "5"
Option "Device" "/dev/input/mice"
Option "Emulate3Buttons" "on"
Option "HorizScrollDelta" "0"
Option "InputFashion" "Mouse"
Option "Name" "Synaptics;Touchpad"
Option "Protocol" "explorerps/2"
Option "SHMConfig" "on"
Option "Vendor" "Sysp"
Option "ZAxisMapping" "4 5"
EndSection


Section "Monitor"
DisplaySize 305 230
HorizSync 30-82
Identifier "Monitor[0]"
ModelName "1280X1024@60HZ"
Option "DPMS"
#Option "PreferredMode" "1280x1024"
VendorName "--> LCD"
VertRefresh 50-60
UseModes "Modes[0]"
EndSection


Section "Modes"
Identifier "Modes[0]"
# 640x480 @ 60Hz (Industry standard) hsync: 31.5kHz
ModeLine "640x480" 25.2 640 656 752 800 480 490 492 525 -hsync -vsync
# # 640x480 @ 72Hz (VESA) hsync: 37.9kHz
ModeLine "640x480" 31.5 640 664 704 832 480 489 491 520 -hsync -vsync
# # 800x600 @ 56Hz (VESA) hsync: 35.2kHz
ModeLine "800x600" 36.0 800 824 896 1024 600 601 603 625 +hsync +vsync
# # 800x600 @ 60Hz (VESA) hsync: 37.9kHz
ModeLine "800x600" 40.0 800 840 968 1056 600 601 605 628 +hsync +vsync
# # 800x600 @ 72Hz (VESA) hsync: 48.1kHz
ModeLine "800x600" 50.0 800 856 976 1040 600 637 643 666 +hsync +vsync
# # 800x600 @ 75Hz (VESA) hsync: 46.9kHz
ModeLine "800x600" 49.5 800 816 896 1056 600 601 604 625 +hsync +vsync
# # 1024x768 @ 60Hz (VESA) hsync: 48.4kHz
ModeLine "1024x768" 65.0 1024 1048 1184 1344 768 771 777 806 -hsync -vsync
# # 1024x768 @ 70Hz (VESA) hsync: 56.5kHz
ModeLine "1024x768" 75.0 1024 1048 1184 1328 768 771 777 806 -hsync -vsync
# # 1024x768 @ 75Hz (VESA) hsync: 60.0kHz
ModeLine "1024x768" 78.8 1024 1040 1136 1312 768 769 772 800 +hsync +vsync
# # 1280x960 @ 60Hz (VESA) hsync: 60.0kHz
ModeLine "1280x960" 148.5 1280 1344 1504 1728 960 961 964 1011 +hsync
+vsync
# # 1280x1024 @ 60Hz (VESA) hsync: 64.0kHz
ModeLine "1280x1024" 108.0 1280 1328 1440 1688 1024 1025 1028 1066
+hsync +vsync
# # 1280x1024 @ 75Hz (VESA) hsync: 80.0kHz
ModeLine "1280x1024" 135.0 1280 1296 1440 1688 1024 1025 1028 1066
+hsync +vsync
# # 1600x1200 @ 60Hz (VESA) hsync: 75.0kHz
ModeLine "1600x1200" 162.0 1600 1664 1856 2160 1200 1201 1204 1250
+hsync +vsync
# # 1600x1200 @ 65Hz (VESA) hsync: 81.3kHz
ModeLine "1600x1200" 175.5 1600 1664 1856 2160 1200 1201 1204 1250
+hsync +vsync
# # 1600x1200 @ 70Hz (VESA) hsync: 87.5kHz
ModeLine "1600x1200" 189.0 1600 1664 1856 2160 1200 1201 1204 1250
+hsync +vsync
# # 1600x1200 @ 75Hz (VESA) hsync: 93.8kHz
ModeLine "1600x1200" 202.5 1600 1664 1856 2160 1200 1201 1204 1250
+hsync +vsync
EndSection


Section "Screen"
DefaultDepth 16
SubSection "Display"
Depth 15
Modes "1280x1024" "1280x960" "1280x800" "1152x864" "1280x768" "1280x720"
"1024x768" "1280x600" "1024x600" "800x600" "768x576" "640x480"
EndSubSection
SubSection "Display"
Depth 16
Modes "1280x1024" "1280x960" "1280x800" "1152x864" "1280x768" "1280x720"
"1024x768" "1280x600" "1024x600" "800x600" "768x576" "640x480"
EndSubSection
SubSection "Display"
Depth 24
Modes "1280x1024" "1280x960" "1280x800" "1152x864" "1280x768" "1280x720"
"1024x768" "1280x600" "1024x600" "800x600" "768x576" "640x480"
EndSubSection
SubSection "Display"
Depth 8
Modes "1280x1024" "1280x960" "1280x800" "1152x864" "1280x768" "1280x720"
"1024x768" "1280x600" "1024x600" "800x600" "768x576" "640x480"
EndSubSection
Device "Device[0]"
Identifier "Screen[0]"
Monitor "Monitor[0]"
EndSection


Section "Device"
BoardName "945 GM"
BusID "0:2:0"
Driver "intel"
Identifier "Device[0]"
Option "monitor-LVDS" "Monitor[0]"
Screen 0
VendorName "Intel"
#Option "AddARGBGLXVisuals" "True"
EndSection

Section "ServerLayout"
Identifier "Layout[all]"
InputDevice "Keyboard[0]" "CoreKeyboard"
InputDevice "Mouse[1]" "CorePointer"
InputDevice "Mouse[3]" "SendCoreEvents"
Option "Clone" "off"
Option "Xinerama" "off"
Screen "Screen[0]"
EndSection


Section "DRI"
Group "video"
Mode 0660
EndSection

Section "Extensions"
Option "Composite" "Enable"
EndSection