调整CHM字体大小

调整CHM字体大小

document.body.oncopy = function () {
if (window.clipboardData) {
setTimeout(function () {
var text = clipboardData.getData("text");
if (text && text.length > 300) {
text = text + "rnn本文来自CSDN博客,转载请标明出处:" + location.href;
clipboardData.setData("text", text);
}
}, 100);
}
}

function StorePage() { d = document; t = d.selection ? (d.selection.type != 'None' ? d.selection.createRange().text : '') : (d.getSelection ? d.getSelection() : ''); void (keyit = window.open('http://www.365key.com/storeit.aspx?t=' + escape(d.title) + '&u=' + escape(d.location.href) + '&c=' + escape(t), 'keyit', 'scrollbars=no,width=475,height=575,left=75,top=20,status=no,resizable=yes')); keyit.focus(); }

Windows Registry Editor Version 5.00
 
[HKEY_CURRENT_USERSoftwareMicrosoftInternet ExplorerInternationalScripts3]
"IEFontSize"=hex:02,00,00,00


这里面 IEFontSize 第一位可以取 00、01、02、03 和 04,分别对应 CHM 里面的最小到最大五个层次,02 就是正常尺寸了。
找到键值就好办,上面这段保存成 .reg 文件(注意换行),下次遇到问题导入一下再重开 CHM 字体就正常了。


设置到3就差不多了,4就有字体加粗的感觉了

Posted in 未分类 | Leave a comment

solaris10 如何让用户不能TELNET,但可以FTP,且只能登陆指定目录


直接把登录shell改成别的怪东西,会导致ftp失败。你需要把那东西加进/etc/shells。Solaris 10缺省没有这个文件,你需要自己创建一个/etc/shells。
比如:

bash-3.00# cat /etc/shells
/sbin/nologin


你还需要把/sbin/sh, /usr/bin/sh, /usr/bin/bash之类的也加入/etc/shells. 否则,正常用户无法ftp。
-bash-3.00# cat /etc/shells
/sbin/nologin
/bin/bash
/sbin/sh


bash-3.00# grep user1 /etc/passwd
user1 :x :60005:1::/export/home/user1:/sbin/nologin
这样该用户就可以ftp,但不可以有shell会话了。

如果你要限制用户ftp后只能在指定目录活动,则修改/etc/ftpd/ftpaccess
加上 (例子):
guestuser user1
guest-root /aaa/tmp user1           (我自己测试,没有加这行也是生效的,估计是因为passwd里指定目录了)

这样,user1用户ftp登陆后,就进到了/aaa/tmp下,但随后就被chroot了,即根目录变成了/tmp。这样用户就不能到其它地方活动了。


另外,还需要执行,ftpconfig -d /aaa/tmp 以安装一些必要的文件,否则ftp退出时,/var/adm/messages会报错: stat(/usr/lib/security/pam_unix_session.so.1) failed: No such file or directory
(因为,已经被chroot了,所以找不到)        

错误信息如下:
Jul 29 16:08:23 aa ftpd[7405]: [ID 776383 auth.error] open_module: stat(/usr/lib/security/pam_unix_session.so.1) failed: No such file or directory
Jul 29 16:08:23 aa ftpd[7405]: [ID 487707 auth.error] load_modules: can not open module /usr/lib/security/pam_unix_session.so.1

Posted in 未分类 | Leave a comment

Understanding Disk Device Files

出自:http://www.idevelopment.info/data/Unix/Solaris/SOLARIS_UnderstandingDiskDeviceFiles.shtml


Understanding Disk Device Files (i.e. breaking down c0t2d0s7)

by Jeff Hunter, Sr. Database Administrator

Overview


Under Solaris, one of the most involved UNIX devices to understand is the disk device file. Here are several key points that may help:



  • In many cases, a disk device file (i.e. /dev/dsk/c0t2d0s7) refers to a particular partition (aka "slice") of a disk, and not the entire physical device. There are several device files which refer to the entire physical device, but are rarely used.

  • For every disk device, there are usually two device files - the block device and the character ("raw") device. In general:

    • block devices are generally stored under /dev/dsk and used for filesystem type access (e.g mount)
    • character devices are generally stored under /dev/rdsk used for everything else (e.g. fsck, newfs, etc..)


  • Discs are generally attached to a controller (or a bus) which can handle multiple devices. IDE and SCSI are both common attach methods. This tends to make disk device filename more complex than other types of devices.

/etc/vfstab


To see the difference between the block device and character device for a device, consider the following. The /etc/vfstab contains entries for a single filesystem on a Solaris server:
/dev/dsk/c0t2d0s7 /dev/rdsk/c0t2d0s7 /opt ufs 3 yes - 
The first 2 fields in the above entry, list the same disk device as both a block device ("dsk") and character device ("rdsk"). The block device is used by mount when mounting the filesystem while the character device is used by fsck when checking the filesystem and newfs when creating the filesystem.. Both fields must be present in /etc/vfstab.

Breaking Down c0t2d0s7


This section breaks down the different components of a disk device file. In this example, I will be using the disk device file: c0t2d0s7. The four components of the disk device file are: controller, target, LUN and slice/partition and further defined in the following table:















c0 This device is attached to controller #0. On a SPARCstation this is usually the on-board SCSI or IDE controller. If this is a PC it usually refers to the first IDE controller on the motherboard.
t2 The device is target #2 - (i.e. the second device on this controller.) On a SCSI controller this is the SCSI target ID and is usually set via a switch on any external enclosure or by jumpers on the disk itself. On an IDE controller target #2 refers to the second IDE disk. With IDE this is generally determined by the device's position on the IDE cable.
d0 The device is Logical Unit / "LUN" #0 (the first) on this target. Under SCSI a single target can support up-to eight devices. This is rarely seen in practice, but some hardware raid controllers use LUNs.
s7 Slice or Partition number 7. Under Solaris, this relates to the partition number as set when using the format command.


Posted in 未分类 | Leave a comment

解决xmanager不能远程登录Solaris10主机的问题

默认情况下.Solaris10安装完成后.启动是cde界面.但有时用xmanager登录时始终无法建立连接. 如果确认不是防火墙等方面的原因.可以用如下方法解决
      
      1. 关闭默认的cde服务
          svcadm disable cde-login
          用ps-ef|grep dtlogin 应该看不到dtlogin进程了
      2. 进入/etc/X11/gdm
          编辑gdm.conf文件 编辑如下2个地方
         
         找到[xdmcp]字段.
         将Enable=flase改为true
         将Port=177前的注释取消
         
         然后保存退出.
       3.ps-ef|grep gdm 确认目前没有gdm进程.如有杀之
       4. 启动gdm服务

       # svcs -a|grep gdm
disabled       Aug_07   svc:/application/gdm2-login:default
# svcadm enable svc:/application/gdm2-login:default

然后在xmanager里建立新连接. 这样就可以登录了. 在登录界面的左上角选择cde.熟悉的cde界面就又回来了

Posted in 未分类 | Leave a comment

solaris:unable to qualify my own domain name解决

# Oct 6 14:11:06 nibappsun08 sendmail[9825]: [ID 702911 mail.alert] unable to q
ualify my own domain name (nibappsun0 8) -- using short name







If DNS is not configured on your server, then I'll make the assumption that sendmail is not needed at all.
Therefore, to disable the sendmail service in Solaris 10;

1) Check that SendMail is under SMF control (older Solaris 10 releases didn't have SMF, if I recall correctly)
root@blade ~# svcs -l svc:/network/smtp:sendmail
fmri svc:/network/smtp:sendmail
name sendmail SMTP mail transfer agent
enabled true
state online
next_state none
state_time Fri Jun 06 01:15:58 2008
logfile /var/svc/log/network-smtp:sendmail.log
restarter svc:/system/svc/restarter:default
contract_id 142
dependency require_all/refresh file://localhost/etc/mail/sendmail.cf (online)
dependency require_all/refresh file://localhost/etc/nsswitch.conf (online)
dependency optional_all/none svc:/system/filesystem/autofs (online)
dependency require_all/none svc:/system/filesystem/local (online)
dependency require_all/none svc:/network/service (online)
dependency require_all/refresh svc:/milestone/name-services (online)
dependency optional_all/refresh svc:/system/identity:domain (online)
dependency optional_all/none svc:/system/system-log (online)
root@blade ~ #


2) Disable the SendMail service;
root@blade ~ # ps -ef|grep sendmail
root 2669 1 0 01:16:59 ? 0:00 /usr/lib/sendmail -bd -q15m -C /etc/mail/local.cf
smmsp 2667 1 0 01:16:59 ? 0:00 /usr/lib/sendmail -Ac -q15m
root 2950 2788 0 01:56:18 pts/1 0:00 grep sendmail
root@blade ~ # svcadm disable svc:/network/smtp:sendmail
root@blade ~ # ps -ef | grep sendmail
root@blade ~ #


However, if your interested in stopping the error without disabling SendMail, you can attempt a few things;

1) Set the hostname to the desired FQDN;
root@blade ~ # hostname
blade
root@blade ~ # hostname blade.example.com
root@blade ~ # hostname
blade.example.com
root@blade ~ #


2) Set the default domain name;
root@blade ~ # echo "example.com" > /etc/defaultdomain
root@blade ~ # cat /etc/defaultdomain
example.com
root@blade ~ #


3) Use the "domainname" command to set the default domain
root@blade ~ # domainname example.com
root@blade ~ # domainname
example.com
root@blade ~ #

Note: Just using the "domainname" command is not persistent across reboots, the /etc/defaultdomain file is read by the system at boot up, and it should contain just the desired domain ("example.com"). Doing a "domainname" after a reboot when the /etc/defaultdomain file is set will return the domain name.

4) Check the entry in /etc/hosts;
A fresh install of Solaris 10 (Update 5) left me with the following (even though I setup DNS during the OS install);
#
# Internet host table
#
::1 localhost
127.0.0.1 localhost
192.168.1.200 blade loghost

What fixed the SendMail error for me was changing it to the following;
#
# Internet host table
#
::1 localhost
127.0.0.1 localhost
192.168.1.200 blade.example.com blade loghost


I hope this helps!
Posted in 未分类 | Leave a comment

GENERATING AND USING SSH KEYS

GENERATING AND USING SSH KEYS
       1 Generate keys
           Type:


              ssh-keygen -t rsa


           And do not enter a passphrase unless you wanted to be prompted for one during file copying.


           Here is what you will see:


              $ ssh-keygen -t rsa
              Generating public/private rsa key pair.
              Enter file in which to save the key (/home/User/.ssh/id_rsa):
              Enter passphrase (empty for no passphrase):


              Enter same passphrase again:


              Your identification has been saved in /home/User/.ssh/id_rsa.
              Your public key has been saved in /home/User/.ssh/id_rsa.pub.
              The key fingerprint is:
              5a:cd:2b:0a:cd:d9:15:85:26:79:40:0c:55:2a:f4:23 User@JEFF-CPU


       2 Copy public to machines you want to upload to
           "id_rsa.pub" is your public key. Copy it to "~/.ssh" on target machine.


           Put a copy of the public key file on each machine you want to log into.  Name the copy "authorized_keys" (some imple-
           mentations name this file "authorized_keys2")


           Then type:


                chmod 600 authorized_keys


           Then make sure your home dir on the remote machine is not group or world writeable.

Posted in 未分类 | Leave a comment

安装rrdtool



在安装rrdtool这个画图工具的时候经常报错,安装官方的libs搞半天有时候还过不去!


下面介绍两种方法,可以搞定.我是用第二中方法安装成功的。


第一种方法:
1.通过yum源自动安装rrdtool
# vi /etc/yum.repos.d/dag.repo
[dag]
name=Dag RPM Repository for Red Hat Enterprise Linux
baseurl=http://apt.sw.be/redhat/el$releasever/en/$basearch/dag
gpgcheck=1
gpgkey=http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt
enabled=1
#rpm --import
http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt


搞定后,直接yum安装如下:
#yum install rrdtool
即可安装成功.


第二种方法:
2.通过编译安装rrdtool
先通过yum安装基本的包和库文件:
# yum install cairo-devel libxml2-devel pango-devel pango libpng-devel freetype freetype-devel libart_lgpl-devel
# wget
http://oss.oetiker.ch/rrdtool/pub/rrdtool-1.3.1.tar.gz
# tar -zxvf rrdtool-1.3.1.tar.gz


configure && make &&make install





#!/usr/bin/perl -w
# This script fetches data from target.rrd, creates a graph of memory
# consumption on the target (Dual P3 Processor 1 GHz, 656 MB RAM)

# call the RRD perl module
use lib qw( /usr/local/rrdtool-1.0.41/lib/perl ../lib/perl );
use RRDs;

Posted in 未分类 | Leave a comment

write-cache mode :Write back VS Write through

Understanding write-cache mode for logical drive :
http://publib.boulder.ibm.com/infocenter/eserver/v1r2/index.jsp?topic=/diricinfo/fqy0_cwrcache.html



Understanding write-cache mode for logical drives



When using the write-cache-mode option, you can choose from two available settings.



Write back


For the write-back setting, the operating system sends data to the controller to write to a storage device. Subsequently, the controller sends a confirmation to the operating system before actually writing the data to the storage device. Doing so increases performance, but also contains an element of risk. For example, if there is a power failure, the data currently in the controller cache is lost. This is no risk when using a controller with a battery-backup cache. The battery preserves the data in the controller cache in the event of a power failure.


Attention:

  1. It is possible to lose data if a power outage occurs while using the write back setting without a battery-backup cache device. If your controller does not have a battery-backup cache installed and enabled, consider carefully whether to enable write back on a logical drive. Depending on how you use the system, write back might be undesirable.
  2. If you do not have a battery-backup cache installed and enabled and you set this feature to write back, wait at least 10 seconds after your last operation before you turn off your system. Failure to follow this practice might result in lost data.


Write through


For the write-through setting, the operating system sends data to the controller to write to a storage device. Subsequently, the controller writes the data to the storage device; then, sends a confirmation to the operating system. This setting can decrease performance, but contains no risk of losing data.










Querying for the Write Cache Property
http://msdn.microsoft.com/en-us/library/aa508863.aspx



Windows Driver Kit: Storage Devices

Querying for the Write Cache Property



Storage devices often buffer data in a write cache before writing the data to nonvolatile media, such as a disk platter. This type of buffer improves device performance but it also also decreases data integrity. If the write cache does not have a battery backup, a power failure can cause the loss of cached data.


One remedy for the problem of data loss is to flush the write cache (with a SCSI SYNCHRONIZE CACHE command on SCSI devices). However, flushing the write cache is an expensive operation, and, if done frequently, it can significantly degrade performance. Instead of flushing the write cache, many storage devices allow write-through requests. A write-through request bypasses the write cache and sends data directly to the media.


For example, database applications can use write-through requests to ensure that transaction logs reach the media, and file system drivers can use write-through requests to ensure that file system metadata reaches the media.


However, not all storage devices that have write caches support write-through requests or SYNCHRONIZE CACHE; and some devices do not need to bypass or flush cached data as a precaution because they have battery backup systems that prevent data corruption during power failures. Applications and drivers must have information about the properties of a device's write cache before they can make effective use of it.


In Windows Vista, you can use the IOCTL_STORAGE_QUERY_PROPERTY request with a StorageDeviceWriteCacheProperty property identifier to query the storage class driver for a write cache property that specifies the characteristics of the device's write cache. The write cache property includes the following information about the caching capabilities of the device:



  • Presence of a write cache. The write cache property specifies whether the device has a write cache.
  • Type of write cache. There are two main types of write cache: write back and write through. With a write-back cache, the device does not copy cache data to nonvolatile media until absolutely necessary. This operation improves the performance of write operations. With a write-through cache, the device writes data to the cache and the media in parallel. This does not improve write performance, but it makes subsequent read operations faster.

    Do not confuse a write-through cache with a write-through request. A write-through request can be used with any kind of cache, including a write-back cache, if the device supports write-through requests. For example, suppose that the target is a SCSI device with a write-back cache. If the device supports write-through requests, the initiator can bypass the write cache by setting the force unit access (FUA) bit in the command descriptor block (CDB) of the write command.


  • Sync cache support. The write cache property indicates whether the device supports the SCSI SYNC CACHE command, or an equivalent command on other buses.
  • Battery backup. The write cache property indicates whether the device has a battery backup that will protect the integrity of cache data during power failures.

For a complete description of the information that the write cache property reports, see STORAGE_WRITE_CACHE_PROPERTY.


Without the write cache property mechanism (that is, using the IOCTL_STORAGE_QUERY_PROPERTY request and the StorageDeviceWriteCacheProperty property identifier), applications and drivers must query for a device's write cache characteristics with a different sequence of commands for every bus. For example, if the target device is attached to an IEEE 1394 bus and uses the Reduced Block Command (RBC) protocol, the initiator must retrieve page 6 of the device's mode data to determine if the write cache is enabled. But if the target device is SCSI-compliant, the initiator must retrieve page 8 of the mode data. The write-cache property mechanism hides the details of these operations from the initiator and provides a technique to query for the characteristics of a storage device's write cache that is the same across different buses.


The write cache property mechanism is not supported for RAID devices (because there is no standard technique for querying these devices) or for flash memory devices.


The write cache property is supported on the 64-bit versions of Windows.




Send feedback on this topic
Built on November 19, 2009

Posted in 未分类 | Leave a comment

Oracle数据库文件快速转移的方法


Oracle数据库在使用过程中,随着数据的增加数据库文件也逐渐增加,在达到一定大小后有可能会造成硬盘空间不足;那么这时我们可以把数据库文件移动到另一个大的硬盘分区中。下面我就以Oracle for Windows版本中把C盘的数据库文件移动到D盘为例介绍Oracle数据库文件移动的方法和步骤。


 


1.在sqlplus中连接到要移动文件的Oracle数据库,然后执行如下SQL语句查看Oracle数据库文件位置:


 


SQL> select file_name from sys.dba_data_files;
FILE_NAME -------------------------------------------------------------- C:ORA 8O RADATAORACLEUSERS01.DBF C:ORA 8O RADATAORACLEDR01.DBF C:ORA 8O RADATAORACLETOOLS01.DBF C:ORA 8O RADATAORACLEINDX01.DBF C:ORA 8O RADATAORACLERBS01.DBF C:ORA 8O RADATAORACLETEMP01.DBF C:ORA 8O RADATAORACLESYSTEM01.DBF


 


查询到7记录.


 


记录要移动的文件的位置和名称。


 


2.下面我们以把文件“C:ORA 8O RADATAORACLEUSERS01.DBF”移动到“D:ORADATAUSERS01.DBF”为例介绍,要移动其它文件,请安相同的方法(根据实际情况修改文件路径和名称)操作即可。


 


<1> 首先让所有的用户停止连接该数据库,关闭数据库。在命令行窗口中输入:


 


C:svrmgrl(回车) SVRMGR>connect internal(回车) SVRMGR>shutdown immediate(回车) #等待数据库提示关闭 SVRMGR>exit


 


<2> 从“C:ORA 8O RADATAORACLE”目录下找到文件“USERS01.DBF”,然后复制到目录“D:ORADATA”下面。假如移动多个文件,重复该步骤。


 


<3> 进入命令窗口,按以下内容输入:


 


C:svrmgrl(回车)


 


SVRMGR>connect internal(回车)


 


SVRMGR>startup mount(回车)


 


#等待数据库提示装载成功


 


SVRMGR>alter database rename file 'C:ORA 8O RADATAORACLEUSERS01.DBF' to 'D:ORADATAUSERS01.DBF';


 


#提示语句已处理后,假如要移动多个文件,修改文件路径和名称后重复执行上面的语句。完成后打开数据库。


 


SVRMGR>alter database open;


 


SVRMGR>exit


 


数据库文件移动成功。

Posted in 未分类 | Leave a comment

如何递归删除NRU上的文件

#!/usr/bin/perl -w


use strict;
use IO: :D ir;
use File: :P ath;


my $dir="/home/g/e/dfsdfs/test";
my $dir_fh=IO: :D ir->new($dir);
while (defined(my $file=$dir_fh->read)) {
        my $dir_f=IO: :D ir->new("$dir/$file");
        while (defined(my $fil=$dir_f->read)) {
                rmtree ("$dir/$file/$fil",{ verbose => 1 }) if $fil=~/2009/;
        }
}




,{ verbose => 1 } 可删除







增加目录:



#!/usr/bin/perl -w


use strict;


my @list = (1 .. 9);
my @FA=("1".."2000");
sub mk_fa {
        my ($f) = @_;
        foreach my $p (@list) {
               mkdir "/savedata/data0$p/NRU/$f",0755 or warn "mkdir /savedata/data0$p/NRU/$f err:$!";
               symlink "/savedata/data0$p/NRU/$f","/usr/local/Titan/NRU/$f" or warn "symlink /data$p/NRU/$f err:$!";
               shift @list;
               last;
        }
}
foreach my $fa (@FA) {
       @list=1..9 unless @list;
       $mk_fa($fa);
}

Posted in 未分类 | Leave a comment