Monthly Archives: July 2007

Debian中proftpd+mysql+虚拟用户+匿名用户+磁盘限额的配置

 用惯了proftpd,本来打算用pureftpd的,后来想想算了。proftpd虚拟用户的配置其实很早就解决了,只是虚拟用户和本地用户同时登录,一直没有解决。于是趁这个机会仔细研究了下。依然是debian下面的配置。

参考站点:HowtoForge  上面有很多server的配置,各种平台下,从debian到redhat,以及suse,mandriva都有,非常详细。强烈推荐。

安装mysql和phpmyadmin,其中phpmyadmin不是必需的

apt-get install mysql-server mysql-client libmysqlclient15-dev phpmyadmin apache2

为mysql设置root密码

mysqladmin -u root password yourrootsqlpassword

如果需要其他人访问本机的mysql,同样需要设置密码

mysqladmin -h server1.example.com -u root password yourrootsqlpassword

安装带mysql支持的proftpd,注意选择proftpd工作在standalone模式

apt-get install proftpd-mysql

建立虚拟用户组,这个是为了把proftpd用户虚拟到本机的一个用户上。注意下面的2001修改为自定义的。

groupadd -g 2001 ftpgroup
useradd -u 2001 -s /bin/false -d /bin/null -c “proftpd user” -g ftpgroup ftpuser

Continue reading

全面技术解析:eMule电骡长时间下载到底伤不伤硬盘

转自http://www.cnbeta.com/articles/31924.htm

  eMule电驴(电骡)下载对硬盘有没有损害?如果您还在思考这个问题,请看网友相当全面的分析:
  先说一下现代硬盘的工作原理,现在的硬盘,无论是IDE还是SCSI,采用的都是“温彻思特”技术,都有以下特点:
1、磁头,盘片及运动机构密封.2、固定并高速旋转的镀磁盘片表面平整光滑.
3、磁头沿盘片径向移动.4、磁头对盘片接触式启停,但工作时呈飞行状态不与盘片直接接触.

Continue reading

debian上qlogic存储空间划分

 debian上挂载的存储,一共2快。大小分别为1T和2T。因为刚刚挂载,所以没有分区。下面是分区过程。同时发现debian下的图形化分区工具cfdisk,效果不错。只是似乎不能选择reserfs格式。但是对于其他应用非常不错

首先对2T空间sdd分区,首先还是建立分区

bt:/# fdisk /dev/sdd

The number of cylinders for this disk is set to 130541.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-130541, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-130541, default 130541):
Using default value 130541

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.

分配文件格式,为了提高效率,设置的reiserfs格式

bt:/# mkfs.reiserfs /dev/sdd1
mkfs.reiserfs 3.6.19 (2003 www.namesys.com)

A pair of credits:
Edward Shushkin wrote the encryption and compression  file plugins,  and the V3
journal relocation code.

The  Defense  Advanced  Research  Projects Agency (DARPA, www.darpa.mil) is the
primary sponsor of Reiser4.  DARPA  does  not  endorse  this project; it merely
sponsors it.

Guessing about desired format.. Kernel 2.6.18-4-686 is running.
Format 3.6 with standard journal
Count of blocks on the device: 262142624
Number of blocks consumed by mkreiserfs formatting process: 16211
Blocksize: 4096
Hash function used to sort names: “r5”
Journal Size 8193 blocks (first block 18)
Journal Max transaction length 1024
inode generation number: 0
UUID: afd18a2b-f8fd-448a-ac64-7886b53706bd
ATTENTION: YOU SHOULD REBOOT AFTER FDISK!
        ALL DATA WILL BE LOST ON ‘/dev/sdd1’!
Continue (y/n):y
Initializing journal – 0%….20%….40%….60%….80%….100%
Syncing..ok

Tell your friends to use a kernel based on 2.4.18 or later, and especially not a
kernel based on 2.4.9, when you use reiserFS. Have fun.

ReiserFS is successfully created on /dev/sdd1.

然后挂载分区

bt:/# mount -t reserfs /dev/sdc1 /var/ftp/

 

开机自动挂载,修改/etc/fstab就可以了

Technorati 标记: , , , ,

hp-unix安装Emulex HBA卡

首先下载相应版本的驱动,我的是

http://www-dl.emulex.com/support/hpux/53109/lpfc.depot-05_31_09-hpux11iv2_64_dlkm.z

然后上传到服务器

重命名

mv lpfc.depot-05_31_09-HPUX11iv2_64_dlkm.z lpfc.depot 05_31_09-HPUX11iv2_64_dlkm.Z

解压缩

uncompress lpfc.depot-05_31_09-HPUX11iv2_64_dlkm.Z

安装
swinstall -s `pwd`/lpfc.depot-t-05_31_09-HPUX11iv2_64_dlkm

似乎hp unix的彷图形界面有些不稳定,同样环境的2台机器,1台一次成功,1台安装总是失败,重新启动2次后安装成功。。

安装后查看是否安装成功

# kcmodule -v lpfc

 

Technorati 标记: , , , ,

Debia下安装Qlogic 2460 HBA卡

新到的存储,准备在Debian下使用,但是Qlogic官方没有提供for debian的驱动,只有for redhat ,SLSE的。在debian下需要自己安装下。

首先插上HBA卡,启动系统。从启动信息中发现似乎已经找到了。

进入系统,执行lsmod,发现模块已经加载了。

qla2xxx               126560  0
firmware_class          9600  1 qla2xxx
scsi_transport_fc      28544  1 qla2xxx

但是无法正常驱动,查看系统日志: more /var/log/systemlog

发现如下信息

QLogic Fibre Channel HBA Driver
qla2xxx 0000:02:01.0: Found an ISP2100, irq 10, iobase 0xf8826000
qla2xxx 0000:02:01.0: Configuring PCI space…
qla2xxx 0000:02:01.0: Configure NVRAM parameters…
qla2xxx 0000:02:01.0: Verifying loaded RISC code…
qla2xxx 0000:02:01.0: Firmware image unavailable.
qla2xxx 0000:02:01.0: Firmware images can be retrieved from: ftp://ftp.qlogic.com/outgoing/linux/firmware/.
qla2xxx 0000:02:01.0: Failed to initialize adapter

提示firmware有问题,到提示的地址下载,ftp://ftp.qlogic.com/outgoing/linux/firmware/.

结果网络实在是太慢。。。下载不到。。于是google了一下debian的deb包,发现确实有。

于是执行

wget ftp://ftp.debian.org/debian/pool/non-free/f/firmware-nonfree/firmware-qlogic_*

dpkg -i firmware-qlogic_*

update-initramfs -k all -u

然后执行

#find / -name *logic

/usr/src/qlogic
/usr/share/doc/firmware-qlogic
/usr/share/initramfs-tools/hooks/firmware_qlogic

然后执行

./usr/share/initramfs-tools/hooks/firmware_qlogic

重新执行

update-initramfs -k all -u

重新启动系统,然后查看系统日志,已经正确加载

QLogic Fibre Channel HBA Driver
PCI: Enabling device 0000:0f:03.0 (0150 -> 0153)
ACPI: PCI Interrupt 0000:0f:03.0[A] -> GSI 160 (level, low) -> IRQ 74
qla2xxx 0000:0f:03.0: Found an ISP2312, irq 74, iobase 0xf88f8000
qla2xxx 0000:0f:03.0: Configuring PCI space…
qla2xxx 0000:0f:03.0: Configure NVRAM parameters…
qla2xxx 0000:0f:03.0: Verifying loaded RISC code…
qla2xxx 0000:0f:03.0: Allocated (412 KB) for firmware dump…
qla2xxx 0000:0f:03.0: LIP reset occured (f8f7).
qla2xxx 0000:0f:03.0: Waiting for LIP to complete…
qla2xxx 0000:0f:03.0: LIP occured (f8f7).
qla2xxx 0000:0f:03.0: LOOP UP detected (2 Gbps).
qla2xxx 0000:0f:03.0: LIP reset occured (f7f7).
qla2xxx 0000:0f:03.0: LIP occured (f7f7).
qla2xxx 0000:0f:03.0: Topology – (Loop), Host Loop address 0x0

参考文章

http://john.parnefjord.se/node/8

http://blog.sina.com.cn/u/544465b00100067v

ruby和python的比较

在讨论当前opensource的cms的时候,偶然提到了http://radiantcms.org/

也就偶然看到ruby的网站,http://www.ruby-lang.org/en/

初步浏览了下,发现ruby和现在正在看的python非常相近,语法上太类似了。于是上网查找了下ruby和python的异同

官方的比较http://www.ruby-lang.org/en/documentation/ruby-from-other-languages/to-ruby-from-python/

下面是网上找到的异同

 

Continue reading