Skip to content

说说 vpn

17-11-08

作者:wd 发表于:2008-11-17 19:38 最后更新于:2008-11-17 19:40
版权声明:可以任意转载,转载时请务必以超链接形式标明文章原始出处[http://wdicc.com/vpnc-howto/]和作者信息及本版权声明。

好久没更新了,最近改了改 vpnc 的设置,就发一个吧。

有些公司启用了 vpn 来让员工可以访问到公司内网的一些信息,或者让员工访问公司服务器的时候更加安全。一般可以用 cisco 的硬件 vpn 来搞定,也可以用 linux 下面的 openvpn 之类软件来构建一个 vpn server。

构建 vpn server 咱没搞过,我们公司用的是 cisco 的产品。连接 vpn server 的 client 有 vpnc 和 openvpn 什么的。

我使用的是 vpnc。networkmanager 还有他的插件(当然,也有 openvpn 的),就是说你可以做到点点鼠标就连接上你的 vpn。不过我这里没用他,因为他缺少一些 vpnc 配置文件支持的配置项,曾经还修改过 net-misc/networkmanager-vpnc 0.6.4 的源代码,来做到支持我的 vpn server,后来发现图形界面的不可靠,有时候连不上,一些错误信息还看不到。升级到了 0.7 之后,也一直懒得改源代码,字符界面的用起来也不错。图形界面一定要改,因为我不能让他记住密码我们的密码是一个 pin 码 + token 生成的,token 是变化的。而有个 group 密码是必须要记住的,因为这个又长又没有规律。图形界面没办法实现这个组合,只能修改源代码硬写到代码里面。

vpnc 的配置文件在 /etc/vpnc/ 下面。这里面有个 default.conf,当然你也可以写自己的 xxx.conf。如果执行 sudo vpnc xxx,那么用到的就是 xxx.conf,如果没有参数,那么使用 default.conf。

$ sudo cat default.conf
# example vpnc configuration file
# see vpnc --long-help for details
 
#Interface name tun0
#IKE DH Group dh2
#Perfect Forward Secrecy nopfs
 
# You may replace this script with something better
Script /etc/vpnc/custom-script
 
IPSec gateway vpn.xxx.com
IPSec ID General
IPSec secret xxxxxx
Xauth username wd
NAT Traversal Mode cisco-udp
#Xauth password

gateway 就是你的 vpn server 的地址,IPSec secret 就是我说的 group pwd,Xauth password 是你的密码。还可以加上 debug level xxx 来显示 debug 信息,xxx 是一个数字,越大信息越多。

注意里面有个 script 行,这个就是最近修改的一个参数。有时候使用 vpn 可能只是需要连接一下公司的服务器而已,我可不想让他作为我的默认路由,比如我在开 bt 下载的时候如果用了 vpn 作%

oracle 里面 kill session

07-10-08

作者:wd 发表于:2008-10-07 17:38
版权声明:可以任意转载,转载时请务必以超链接形式标明文章原始出处[http://wdicc.com/kill-session-in-oracle/]和作者信息及本版权声明。

eygle 有篇文章讲了这个,之前也看过。昨天实际操作了一下。

因为如 eygle 所讲,kill 了 session 之后,操作系统里面的进程资源有时候不一定会立即释放,所以最好在 kill 之前就找到系统的进程 id,这样,如果不释放的时候,可以直接kill。省的之后找起来麻烦。

昨天操作的时候有这么几个步骤

  1. select * from v$session where username like ‘UP’ –先找到这个用户的 session。
  2. select * from v$sql a, v$session b where b.username = ‘UP’ and a.sql_id = b.sql_id –找出来这个用户这些 session 对应的 sql 语句,好确认 session 的 id。
  3. select * from v$process a, v$session b where a.addr = b.paddr and b.username like ‘UP’ and b.sid = xxx –找出来他的系统进程id,就是那个 spid。
  4. ALTER SYSTEM KILL SESSION ’sid, serial#’ –可以实施kill了,可能会提示你marked for kill,有必要的话,在os级别kill前面找出来的 spid。

linux 下面同步 palm 手机

07-10-08

作者:wd 发表于:2008-10-07 17:20
版权声明:可以任意转载,转载时请务必以超链接形式标明文章原始出处[http://wdicc.com/palm-in-linux/]和作者信息及本版权声明。

plam 是万能的,呵呵。

主要参考了 gentoo wiki 上面的几篇文章。编译好内核,然后 modprobe visor ,接着按hotsync同步按钮。此时可以看到 dmesg 的输出。

visor 2-2:1.0: device disconnected
usb 2-2: new full speed USB device using uhci_hcd and address 6
usb 2-2: configuration #1 chosen from 1 choice
visor 2-2:1.0: Handspring Visor / Palm OS converter detected
usb 2-2: Handspring Visor / Palm OS converter now attached to ttyUSB0
usb 2-2: Handspring Visor / Palm OS converter now attached to ttyUSB1

然后还需要建立一个 udev 的 rule。

$ cat /etc/udev/rules.d/10-palm.rules 
# PalmOne Tungsten T3
BUS=="usb",SYSFS{serial}=="PalmSN12345678", KNERNEL="ttyUSB*",OWNER="root",GROUP="plugdev",MODE="0666",SYMLINK="pilot", RUN="/bin/su - wd -c '/usr/bin/jpilot -s'"
#BUS="usb", SYSFS{product}="Palm Handheld*", KERNEL="ttyUSB*", MODE="666", SYMLINK="pilot", RUN="/bin/su - wd -c '/usr/bin/jpilot -s'"

注意里面那个 serial,如果你不知道你的,或许可以用下面的那个 product。其实也可以查看 /proc/bus/usb/devices 来获取上面那些 serial 或者 product 信息的。仔细找找。另外还需要修改那个 wd 为你自己的用户名。

然后还需要装一个 jpilot 这个软件。需要先设置一下首选项,设置设备是 /dev/ttyUSB1 。以后同步的时候,只需要先启动 jpilot,然后按那个hotsync同步按钮就行了。还可以装软件,呵呵,不过似乎没办法选择装卡上还是手机上,估计都是手机上面了。

域名终于搞回来了

22-9-08

作者:wd 发表于:2008-09-22 17:05
版权声明:可以任意转载,转载时请务必以超链接形式标明文章原始出处[http://wdicc.com/wdicc-com-is-return/]和作者信息及本版权声明。

历经周折,总算把域名弄回来了。我还是喜欢 wdicc.com 多过 wdicc.cn。呵呵。顺便鄙视一下 xh 这头猪,差点把我的域名弄丢。

搜索引擎比较

19-9-08

作者:wd 发表于:2008-09-19 09:21 最后更新于:2008-09-19 09:29
版权声明:可以任意转载,转载时请务必以超链接形式标明文章原始出处[http://wdicc.com/compare-search-engines/]和作者信息及本版权声明。

前两天wii的放电视上面那个红外发射器的线断了,就搜索了一下看能不能修好。结果在 google.cn 搜到一条相关结果。今天看到 youdao.com 上线的消息,就兴起把各个搜索引擎都测试了一下。抓图如下。

百度的结果似乎和“断了”没有关系,这也敢号称最懂中文?三个关键字就sb了,垃圾一个。

yahoo.cn 的结果也不是我想要的,不过至少“断了”这个关键字出来了。。。

youdao 的结果比较来说好像是最好的了,里面我需要的不少。

google.cn 的结果第一条很符合我的要求,不过后面的。。怎么还出来psp了?。。。

不完全测试,仅作为消遣用,呵呵。

超强的rtorrent

13-9-08

作者:wd 发表于:2008-09-13 13:02 最后更新于:2008-09-16 11:33
版权声明:可以任意转载,转载时请务必以超链接形式标明文章原始出处[http://wdicc.com/supper-rtorrent/]和作者信息及本版权声明。

越狱又开始了,没周末总要下一个看看。之前用 delug,速度还行,用起来感觉不错。可是自从 1.0rc 的某个版本之后,下载的时候时不时出现 CPU 100% 的情况。就装了 transmisstion,他不支持 dht,国内的下载速度很慢,去下国外的好像还行。

今天又试了一下 rtorrent,之前也用过,不过速度总上不来让人很郁闷。rtorrent 从某个版本就开始支持 dht 了,我之前使用的时候不知道从哪里去看这个支持,速度很慢,基本就不用了。今天总算发现了问题在哪里。

rtorrent 的配置文件是 ~/.rtorrent.rc ,例如我的。

# This is an example resource file for rTorrent. Copy to
# ~/.rtorrent.rc and enable/modify the options as needed. Remember to
# uncomment the options you wish to enable.
 
# Maximum and minimum number of peers to connect to per torrent.
min_peers = 40
max_peers = 200
 
# Same as above but for seeding completed torrents (-1 = same as downloading)
#min_peers_seed = 10
#max_peers_seed = 50
 
# Maximum number of simultanious uploads per torrent.
#max_uploads = 15
 
# Global upload and download rate in KiB. "0" for unlimited.
#download_rate = 0
upload_rate = 30
 
# Default directory to save the downloaded torrents.
directory = /movie/download
 
# Default session directory. Make sure you don't run multiple instance
# of rtorrent using the same session directory. Perhaps using a
# relative path?
session = ./rtorrent-session
 
# Watch a directory for new torrents, and stop those that have been
# deleted.
#schedule = watch_directory,5,5,load_start=./watch/*.torrent
#schedule = untied_directory,5,5,stop_untied=
 
# Close torrents when diskspace is low.
#schedule = low_diskspace,5,60,close_low_diskspace=100M
 
# Stop torrents when reaching upload ratio in percent,
# when also reaching total upload in bytes, or when
# reaching final upload ratio in percent.
# example: stop at ratio 2.0 with at least 200 MB uploaded, or else ratio 20.0
#schedule = ratio,60,60,"stop_on_ratio=200,200M,2000"
 
# The ip address reported to the tracker.
#ip = 127.0.0.1
#ip = rakshasa.no
 
# The ip address the listening socket and outgoing connections is
# bound to.
#bind = 127.0.0.1
#bind = rakshasa.no
 
# Port range to use for listening.
port_range = 18204-19203
 
# Start opening ports at a random position within the port range.
#port_random = yes
 
# Check hash for finished torrents. Might be usefull until the bug is
# fixed that causes lack of diskspace not to be properly reported.
#check_hash = no
 
# Set whetever the client should try to connect to UDP trackers.
use_udp_trackers = yes
 
# Alternative calls to bind and ip that should handle dynamic ip's.
#schedule = ip_tick,0,1800,ip=rakshasa
#schedule = bind_tick,0,1800,bind=rakshasa
 
# Encryption options, set to none (default) or any combination of the following:
# allow_incoming, try_outgoing, require, require_RC4, enable_retry, prefer_plaintext
#
# The example value allows incoming encrypted connections, starts unencrypted
# outgoing connections but retries with encryption if they fail, preferring
# plaintext to RC4 encryption after the encrypted handshake
#
encryption = allow_incoming,enable_retry,prefer_plaintext
 
# Enable DHT support for trackerless torrents or when all trackers are down.
# May be set to "disable" (completely disable DHT), "off" (do not start DHT),
# "auto" (start and stop DHT as needed), or "on" (start DHT immediately).
# The default is "off". For DHT to work, a session directory must be defined.
#
dht = on
 
# UDP port to use for DHT.
#
dht_port = 18203
 
# Enable peer exchange (for torrents not marked private)
#
peer_exchange = yes
 
#
# Do not modify the following parameters unless you know what you're doing.
#
 
# Hash read-ahead controls how many MB to request the kernel to read
# ahead. If the value is too low the disk may not be fully utilized,
# while if too high the kernel might not be able to keep the read
# pages in memory thus end up trashing.
#hash_read_ahead = 10
 
# Interval between attempts to check the hash, in milliseconds.
#hash_interval = 100
 
# Number of attempts to check the hash while using the mincore status,
# before forcing. Overworked systems might need lower values to get a
# decent hash checking rate.
#hash_max_tries = 10
 
encoding_list = UTF-8

里面最主要的是 dht=on 和 session,这两个同时启用,才能让 dht 生效,因为 dht 需要保存 dht table 到这个路径下面。配置好之后,去 tracker list 里面看,应该多了一个 dht:// ,这就o了,还有些其他信息,可以自己琢磨琢磨。

ATI 显卡双头显示配置

08-9-08

作者:wd 发表于:2008-09-08 15:03 最后更新于:2008-09-16 11:35
版权声明:可以任意转载,转载时请务必以超链接形式标明文章原始出处[http://wdicc.com/ati-dual-head/]和作者信息及本版权声明。

参考自这里

双头就是接第二个显示器,或者接投影仪什么的,ati 里面叫做 bigdesktop,nvidia 叫做 twinview ,intel 的不太清楚,我记得好像也有个自己的名字。

Nvidia 的官方驱动有 twinview 的支持,图形界面下面配置起来似乎也不是很难。 ATI 的官方驱动支持的是 bigdesktop ,也有图形界面,不过那个界面很恶心,经常出现问题,不过可以试着删除 /etc/ati/amdpcsdb 文件试试看。

下面是一个 bigdesktop 的 xorg.conf 文件。

Section "ServerLayout"
	Identifier     "Default Layout"
	Screen         "Default Screen" 0 0
	InputDevice    "Generic Keyboard"
	InputDevice    "Configured Mouse"
	InputDevice    "Synaptics Touchpad"
EndSection
 
Section "ServerFlags"
	Option	    "AIGLX" "off"
	#Option	    "AIGLX" "true"
EndSection
 
Section "Module"
	load "dbe"
EndSection
 
Section "InputDevice"
	Identifier  "Generic Keyboard"
	Driver      "kbd"
	Option	    "CoreKeyboard"
	Option	    "XkbRules" "xorg"
	Option	    "XkbModel" "pc104"
	Option	    "XkbLayout" "us"
	#Option "XkbOptions" "ctrl:nocaps"
EndSection
 
Section "InputDevice"
	Identifier  "Configured Mouse"
	Driver      "mouse"
	Option	    "CorePointer"
	Option	    "Device" "/dev/input/mice"
	Option	    "Protocol" "ImPS/2"
	Option	    "Emulate3Buttons" "true"
EndSection
 
Section "InputDevice"
	Identifier  "Synaptics Touchpad"
	Driver      "synaptics"
	Option	    "SendCoreEvents" "true"
	Option	    "Device" "/dev/psaux"
#	Option	    "Protocol" "auto-dev"
	Option	    "HorizScrollDelta" "0"
EndSection
 
Section "Monitor"
	Identifier   "Generic Monitor"
	HorizSync    28.0 - 51.0
	VertRefresh  43.0 - 60.0
	Option	    "DPMS"
EndSection
 
Section "Device"
	Option	    "DesktopSetup" "horizontal" #Enable Big Desktop
	Option	    "Mode2" "1280x1024" #Resolution for second monitor
	Option	    "VideoOverlay" "on"
	Option	    "OpenGLOverlay" "off"
	Identifier  "Generic Video Card"
	Option "XAANoOffscreenPixmaps" "true"
	Driver      "fglrx"
	Option		"DRI" "true"
EndSection
 
Section "Screen"
	Identifier "Default Screen"
	Device     "Generic Video Card"
	Monitor    "Generic Monitor"
	DefaultDepth     24
	SubSection "Display"
		Modes    "1024x768"
	EndSubSection
EndSection
 
Section "Extensions"
	Option	    "Composite" "Disable"
	#Option	    "Composite" "enable"
EndSection
 
Section "DRI"
	Group 0
	Mode 0666
EndSection

比较简单,只需要在 device 里面设置好就行了。

用 ati 的开源驱动,也可以双头显示。用下面的 xorg.conf 。

Section "ServerLayout"
	Identifier     "Default Layout"
	Screen         "Default Screen"
	InputDevice    "Generic Keyboard"
	InputDevice    "Configured Mouse"
	InputDevice    "Synaptics Touchpad"
EndSection
 
Section "ServerFlags"
	Option	    "AIGLX" "off"
	#Option	    "AIGLX" "true"
EndSection
 
Section "Module"
	load "dbe"
EndSection
 
Section "InputDevice"
	Identifier  "Generic Keyboard"
	Driver      "kbd"
	Option	    "CoreKeyboard"
	Option	    "XkbRules" "xorg"
	Option	    "XkbModel" "pc104"
	Option	    "XkbLayout" "us"
	#Option "XkbOptions" "ctrl:nocaps"
EndSection
 
Section "InputDevice"
	Identifier  "Configured Mouse"
	Driver      "mouse"
	Option	    "CorePointer"
	Option	    "Device" "/dev/input/mice"
	Option	    "Protocol" "ImPS/2"
	Option	    "Emulate3Buttons" "true"
EndSection
 
Section "InputDevice"
	Identifier  "Synaptics Touchpad"
	Driver      "synaptics"
	Option	    "SendCoreEvents" "true"
	Option	    "Device" "/dev/psaux"
#	Option	    "Protocol" "auto-dev"
	Option	    "HorizScrollDelta" "0"
EndSection
 
Section "Monitor"
    	Identifier      "Integrated LCD"
	 Option      "DPMS"
EndSection
 
Section "Monitor"
	Identifier      "External VGA"
	Option "RightOf" "Integrated LCD"
	 Option      "DPMS"
EndSection
 
Section "Device"
	Identifier  "Generic Video Card"
	Driver		"radeon"
#	# accelration
	Option          "AGPMode" "4"
	Option          "EnablePageFlip" "on"
	Option          "RenderAccel" "on"
	Option          "AccelMethod"   "EXA" # or XXA
	Option          "DynamicClocks" "on"
	Option		"DRI" "true"
        # Color Tiling
        Option          "ColorTiling"   "on"
    Option          "Monitor-VGA-0" "External VGA"
    Option          "Monitor-LVDS"  "Integrated LCD"
    # Option "XAANoOffscreenPixmaps" "true" # for composit
EndSection
 
Section "Screen"
	Identifier "Default Screen"
	Device     "Generic Video Card"
	Monitor    "Integrated LCD"
	DefaultDepth     24
	SubSection "Display"
		Modes    "1280x1024" "1024x768"
		Virtual 2304 1024
	EndSubSection
EndSection
 
Section "Extensions"
	Option	    "Composite" "Disable"
	#Option	    "Composite" "enable"
EndSection
 
Section "DRI"
	Group 0
	Mode 0666
EndSection

可以看到改动也不是很大,主要增加了两个显示器,device里面增加了这两个显示器的设置。另外 screen 里面增加了那个 virtual,这个的参数就是将来两个显示器总共的屏幕大小,我的是 1024+1280 x 1024 ,横向相加,竖向的取最大的。

ok,这样就可以了。注意这里没有用到最上面那个链接里面说的 MergedFB。似乎最新的 xorg 用 xrandr 实现了这个,所以 MergedFB 就不需要了。这有个好处,可以随时调整分辨率什么的。例如 xrandr –output VGA –off ,去掉第二个显示器。 xrandr –output VGA –right-of LVDS ,设置 bigdesktop等等。

ORA-00257 和 ORA-19815

06-9-08

作者:wd 发表于:2008-09-06 18:12 最后更新于:2008-09-06 18:15
版权声明:可以任意转载,转载时请务必以超链接形式标明文章原始出处[http://wdicc.com/ora-00257-and-ora-19815/]和作者信息及本版权声明。

这几天遇到了这两个错误,记录一下。

使用 perl 的 DBI 连接的时候,会提示 ora-00257 错误,这个用 三qlplus 估计也是一样的错误,注意时远程连接才出错。

DBI connect('host=db8.xxx;sid=nirv3','sirenmon',...) failed: ORA-00257: archiver error. Connect internal only, until freed. (DBD ERROR: OCISessionBegin) at ./check_sdsdb line 26
CRITICAL : Can't connect "db8.sds.cnb.yahoo.com"

同时,数据库的alert 里面有下面的信息

Errors in file /home/oracle/app/diag/rdbms/nirv/nirv3/trace/nirv3_arc1_9507.trc:
ORA-19815: WARNING: db_recovery_file_dest_size of 268435456000 bytes is 100.00% used, and has 0 remaining bytes available.
************************************************************************
You have following choices to free up space from flash recovery area:
1. Consider changing RMAN RETENTION POLICY. If you are using Data Guard,
   then consider changing RMAN ARCHIVELOG DELETION POLICY.
2. Back up files to tertiary device such as tape using RMAN
   BACKUP RECOVERY AREA command.
3. Add disk space and increase db_recovery_file_dest_size parameter to
   reflect the new space.
4. Delete unnecessary files using RMAN DELETE command. If an operating
   system command was used to delete files, then use RMAN CROSSCHECK and
   DELETE EXPIRED commands.
************************************************************************
ARCH: Archival stopped, error occurred. Will continue retrying
ORACLE Instance nirv3 - Archival Error

登陆上数据库看看

SQL> show parameter archive
 
NAME                                 TYPE                   VALUE
------------------------------------ ---------------------- ------------------------------
archive_lag_target                   integer                0
log_archive_config                   string                 dg_config=(stb1)
log_archive_dest                     string
log_archive_dest_1                   string                 location="USE_DB_RECOVERY_FILE
log_archive_dest_10                  string
log_archive_dest_2                   string
log_archive_dest_3                   string
log_archive_dest_4                   string
log_archive_dest_5                   string
log_archive_dest_6                   string
log_archive_dest_7                   string
 
NAME                                 TYPE                   VALUE
------------------------------------ ---------------------- ------------------------------
log_archive_dest_8                   string
log_archive_dest_9                   string
log_archive_dest_state_1             string                 ENABLE
log_archive_dest_state_10            string                 enable
log_archive_dest_state_2             string                 ENABLE
log_archive_dest_state_3             string                 enable
log_archive_dest_state_4             string                 enable
log_archive_dest_state_5             string                 enable
log_archive_dest_state_6             string                 enable
log_archive_dest_state_7             string                 enable
log_archive_dest_state_8             string                 enable
 
NAME                                 TYPE                   VALUE
------------------------------------ ---------------------- ------------------------------
log_archive_dest_state_9             string                 enable
log_archive_duplex_dest              string
log_archive_format                   string                 %s_%t_%r_%a.arc
log_archive_local_first              boolean                TRUE
log_archive_max_processes            integer                4
log_archive_min_succeed_dest         integer                1
log_archive_start                    boolean                FALSE
log_archive_trace                    integer                0
standby_archive_dest                 string                 ?/dbs/arch
 
SQL> select * from v$log;
 
    GROUP#    THREAD#  SEQUENCE#      BYTES    MEMBERS ARCHIV STATUS                           FIRST_CHANGE# FIRST_TIME
---------- ---------- ---------- ---------- ---------- ------ -------------------------------- ------------- ------------
         1          1     221250   52428800          1 YES    INACTIVE                            5082709437 05-SEP-08
         2          1     221252   52428800          1 NO     INACTIVE                            5082713458 05-SEP-08
         3          2     270972   52428800          1 YES    INACTIVE                            5082699510 05-SEP-08
         4          2     270975   52428800          1 NO     CURRENT                             5082713581 05-SEP-08
         9          1     221251   52428800          1 NO     INACTIVE                            5082712943 05-SEP-08
        10          2     270973   52428800          1 YES    INACTIVE                            5082705151 05-SEP-08
        11          1     221253   52428800          1 NO     CURRENT                             5082713765 05-SEP-08
        12          2     270974   52428800          1 NO     INACTIVE                            5082711887 05-SEP-08
        13          3     275581   52428800          1 NO     INACTIVE                            5082712519 05-SEP-08
        14          3     275582   52428800          1 NO     CURRENT                             5082713078 05-SEP-08
        15          3     275579   52428800          1 NO     INACTIVE                            5082710114 05-SEP-08
 
    GROUP#    THREAD#  SEQUENCE#      BYTES    MEMBERS ARCHIV STATUS                           FIRST_CHANGE# FIRST_TIME
---------- ---------- ---------- ---------- ---------- ------ -------------------------------- ------------- ------------
        16          3     275580   52428800          1 NO     INACTIVE                            5082711321 05-SEP-08
 
12 rows selected.
 
SQL> ????select value from v$diag_info where name ='Diag Trace';
 
VALUE
------------------------------------------------------------------------------------------------------------------------------------------------------
/home/oracle/app/diag/rdbms/nirv/nirv3/trace
 
SQL> select * from V$FLASH_RECOVERY_AREA_USAGE;
 
FILE_TYPE                                PERCENT_SPACE_USED PERCENT_SPACE_RECLAIMABLE NUMBER_OF_FILES
---------------------------------------- ------------------ ------------------------- ---------------
CONTROL FILE                                              0                         0               0
REDO LOG                                                  0                         0               0
ARCHIVED LOG                                            100                         0           13109
BACKUP PIECE                                              0                         0               0
IMAGE COPY                                                0                         0               0
FLASHBACK LOG                                             0                         0               0
FOREIGN ARCHIVED LOG                                      0                         0               0
 
7 rows selected.
 
SQL> show parameter db_recovery_file_dest_size
 
NAME                                 TYPE                   VALUE
------------------------------------ ---------------------- ------------------------------
db_recovery_file_dest_size           big integer            250G
SQL> show parameter DB_RECOVERY_FILE_DEST
 
NAME                                 TYPE                   VALUE
------------------------------------ ---------------------- ------------------------------
db_recovery_file_dest                string                 /sds/oradata
db_recovery_file_dest_size           big integer            250G
SQL> alter system set db_recovery_file_dest_size=300G;  
 
System altered.
 
SQL> show parameter DB_RECOVERY_FILE_DEST
 
NAME                                 TYPE                   VALUE
------------------------------------ ---------------------- ------------------------------
db_recovery_file_dest                string                 /sds/oradata
db_recovery_file_dest_size           big integer            300G
SQL> select * from V$FLASH_RECOVERY_AREA_USAGE;
 
FILE_TYPE                                PERCENT_SPACE_USED PERCENT_SPACE_RECLAIMABLE NUMBER_OF_FILES
---------------------------------------- ------------------ ------------------------- ---------------
CONTROL FILE                                              0                         0               0
REDO LOG                                                  0                         0               0
ARCHIVED LOG                                          83.41                         0           13115
BACKUP PIECE                                              0                         0               0
IMAGE COPY                                                0                         0               0
FLASHBACK LOG                                             0                         0               0
FOREIGN ARCHIVED LOG                                      0                         0               0
 
7 rows selected.

可以看到空间是 83% 了,数据库应该就好了。不过这个是治标不治本的操作,需要把archive log删掉才行,具体怎么搞我也不会。。。汗。。

Apache优化之KeepAlive

05-9-08

作者:wd 发表于:2008-09-05 18:18
版权声明:可以任意转载,转载时请务必以超链接形式标明文章原始出处[http://wdicc.com/apache-keepalive/]和作者信息及本版权声明。

KeepAlive是在HTTP/1.1中定义的,用来保持客户机和服务器的长连接,执子之手与子偕老。通过减少建立TCP Session的次数来提高性能。常用的配置参数有{KeepAlive, KeepAliveTimeout, MaxKeepAliveRequests}。逐个说来:KeepAlive是决定开启KeepAlive支持;KeepAliveTimeout决定一 个KeepAlive的连接能保持多少时间,Timeout就尽快shutdown链接,若还有数据必须再建立新的连接 了;MaxKeepAliveRequests于KeepAliveTimeout相似,意思是服务多少个请求就shutdown连接。看个例子:

   KeepAlive On
   KeepAliveTimeout 5

意思是说,打开KeepAlive,每个连接只保持5秒就中断。

对于KeepAlive的配置需要慎重,错误的参数可能导致严重的性能问题。一个高负载的Server,如果建立的很多长连接将无法继续服 务新的连接。因此需要根据server的性质调整KeepAliveTimeout或是MaxKeepAliveRequests的值。

例如:你的网页上有三幅图画2个外部javascript,他们都存放在你自己的server上。因此将 MaxKeepAliveRequests设置为7比较合适。3幅图2个js各一个link,网页本身一个link,还有firefox传说中的 favicon.ico。当然还是要有KeepAliveTimeout的。如果客户机用了该死的IE并且设置了某个该死的选项,IE是不会向服务器发送 HEAD请求查看图片(或是其他资源)是否过期的,而是直接使用本地图片。这个时候服务器是不会计算Request的(因为压根就没有Request 嘛)。再如果只有MaxKeepAliveRequests参数,服务器会默认等待5秒才结束KeepAlive连接。通常这5秒可能玩死一个高负载的服 务器(所以说这个社会需要闪婚…)。因此打开Firefox,启动Firebug,看看你的站究竟需要多少次请求,再决定KeepAlive吧。

给超强二笔作的几个码表文件

04-9-08

作者:wd 发表于:2008-09-04 18:07 最后更新于:2008-09-04 18:09
版权声明:可以任意转载,转载时请务必以超链接形式标明文章原始出处[http://wdicc.com/cqeb-mb/]和作者信息及本版权声明。

最近被忽悠玩上了二笔输入法,弄了几个码表。

一个是给 palm treo 650 的掌易用的,下载地址在 这里

treo 650 上面少几个键,所以做了下面的合并。

;与k键合并
,与m键合并
.与v键合并
/与q键合并
另外一个是 scim 用的,下载地址在 这里

需要先安装 scim-tables ,直接复制到 /usr/share/scim/tables/ 下面就行。图标用了 scim-tables 里面的二笔的,名字叫 二笔*超强。