9 月 092008
 

access.log,件在 WEB 服务器运行一段时间之后会达到几十兆甚至上百兆,如果Apache运行有错误,error.log也会增大到几十兆,我们知道系统读写一个大的文本文件是非常耗内存的,因此限定日志文件大小十分必要。

通常我们是在{$apache}/conf/httpd.conf中设置Apache的参数,然而我们并没有发现可以设置日志文件大小的配置指令,通过参考http://httpd.apache.org/docs/2.0/programs/rotatelogs.html,可以用apache 自己的程序 rotatelogs.exe(位于 {$apache}/bin/目录下),来限制日志文件的大小。

Usage: rotatelogs [-l] [offset minutes from UTC] or

Add this:
TransferLog “|rotatelogs /some/where 86400”  
or
TransferLog “|rotatelogs /some/where 5M”
to httpd.conf. The generated name will be /some/where.nnnn where nnnn is the system time at which the log nominally starts (N.B. if using a rotation time, the time will always be a multiple of the rotation time, so you can synchronizecron scripts with it). At the end of each rotation time or when the file size is reached a new log is started.

在 Windows 下的设置例子如下: Continue reading »

3 月 282008
 

— by Will Andrews 19 August 2002

The Story

I needed more disk space on my vinum volume, which I created about 18 months ago using 2 IBM DeskStar 30GXP 30GB ATA100 drives. Originally, I created a RAID 0 (stripe) filesystem on top of these drives using vinum. But now I needed more disk space for various processes that I was running on the machine. So I got a new IBM DeskStar 80GB ATA100 drive.

Just like the FreeBSD diary article on vinum, I had an /etc/vinum.conf. Its contents were: Continue reading »

3 月 282008
 

FreeBSD 提供了 growfs( 命令。这使得能够实时地调整文件系统的大小, 因而不再受其限制。
http://www.freebsd.org/doc/zh_CN.GB2312/books/handbook/disk-organization.html

growfs 的使用还是受很多限制吧。仔细规划分区的大小,不要把希望寄托在 growfs 上面。

Growing FreeBSD's filesystems with growfs(8)

Introduction

During installation it is important to size filesystems so that we won't be forced to resize them later. However, it often appears with time that one of the partitions is too small. Until today it was impossible to expand the size of a filesystem. FreeBSD 4.4-RELEASE comes with a new utility: growfs(8). This program permits us to enlarge, in certains conditions, the size of an existing ufs filesystem. Continue reading »

2 月 262008
 

色标法是指不同颜色表示元件不同参数的方法。图(1) 在电阻上,不同的颜色代表不同的标称值和偏差色标法可以分为:色环法和色点法。其中,最常用的是色环法。色环电阻中,根据色环的环数多少,又分为四色环表示法和五色环表示法。

四色环

图(a)是用四色环表示标称阻值和允许偏差,其中,前三条色环表示此电阻的标称阻值,最后一条表示它的偏差。

图(b)中色环颜色依次黄、紫、橙、金,则此电阻标称阻值为 47*10^3=47kΩ,。

图(c)电阻的色环颜色依次为:蓝、灰、金、无色(即只有三条色环),则电阻标称阻值为68×0.1=6.8Ω±20%。

五色环

图(a)是五色环表示法,精密电阻器是用五条色环表示标称阻值和允许偏差,通常五色环电阻识别方法与四色环电阻一样,只是比四色环电阻器多一位有效数字。

色标的口诀是:
棕1红2橙是3,4黄5绿6是蓝,7紫8灰9雪白,黑色是零须牢记 Continue reading »

6 月 292007
 

VMware虚拟磁盘管理工具是VMware Workstation软件包里的一个软件,它让你用命令行或通过脚本来创建管理修改虚拟磁盘文件。它的一个重要的特性是能够增大虚拟磁盘大小,使虚拟磁 盘的最大尺寸比刚创建时(定义的)更大。它是这样一种方法,如果你需要更多的磁盘空间在已经定义的虚拟机中,而你又不想添加另外一块硬盘或者用Ghost 软件来传递虚拟磁盘上的数据到另外一块更大的虚拟磁盘上去时,你可以用改变虚拟磁盘最大尺寸方法来做。不过你可不能用这种方法对你的物理硬盘实施。 Continue reading »