收藏_FTP参数解释

CWD – change working directory 更改目录
DELE – delete a remote file 删除文件
LIST – list remote files 列目录
MKD – make a remote directory 新建文件夹
NLST – name list of remote directory
PWD – print working directory 显示当前工作目录
RETR – retrieve a remote file 下载文件
RMD – remove a remote directory 删除目录
RNFR – rename from 重命名
RNTO – rename to 重命名
STOR – store a file on the remote host 上传文件
ABOR – abort a file transfer 取消文件传输
CWD – change working directory 更改目录
DELE – delete a remote file 删除文件
LIST – list remote files 列目录
MDTM – return the modification time of a file 返回文件的更新时间
MKD – make a remote directory 新建文件夹
NLST – name list of remote directory
PASS – send password
PASV – enter passive mode
PORT – open a data port 打开一个传输端口
PWD – print working directory 显示当前工作目录
QUIT – terminate the connection 退出
RETR – retrieve a remote file 下载文件
RMD – remove a remote directory
RNFR – rename from # RNTO – rename to
SITE – site-specific commands
SIZE – return the size of a file 返回文件大小
STOR – store a file on the remote host 上传文件
TYPE – set transfer type 设置传输类型
USER – send username 发送用户名

Directadmin到期 更换license的步骤

  1. cd /usr/local/directadmin/scripts
  2. ./getLicense.sh 你的client_ID 新的DA_LicenseIP
  3. service directadmin restart

for english people:
how to fix the expired issue for directadmin,
when you trying to log into your DA control panel and it showing:
License has expired, it means you need to start a new subscription.
log into your DA server by ssh,
cd in your DA path ( default is /usr/local/directadmin/scripts)
run the getLicense.sh with your client id and new license , new IP address.
Eg, ./getLicense.sh Your_Client_ID Your_new_DA_Licnese NewIP
./getLicense.sh 112233 123456 1.2.3.4
finally,just type command to restart the DA service,
service directadmin restart

perl模块_List::Util

1加2加3加4 … 加到100,试了一下还是perl最快
需要用到perl的List::Util模块.

  1. [root@centos perl]# more plus.pl
  2. #!/usr/bin/perl -w
  3. use strict;
  4. use List::Util qw[sum];
  5. my $t = sum(1..100);
  6. print "$t\n";
  7. [root@centos perl]# perl plus.pl
  8. 5050

shell取巧的方法也很简单,利用seq与sed和bc
seq生成数字,sed将空格替换为加号,通过管道传递给bc进行加法运算.

  1. [root@centos perl]# seq -s " " 100|sed 's/ /+/g'|bc
  2. 5050

centos配置vpn 基于pptpd

centos上配置vpn并指定出口IP

  1. 添加centos的源
  2. /etc/yum.repos.d/CentOS-Base.repo 
  3.  
  4. [doylenet]
  5. name=Doylenet custom repository for CentOS
  6. baseurl=http://files.doylenet.net/linux/yum/centos/5/i386/doylenet/
  7. gpgcheck=1
  8. gpgkey=http://files.doylenet.net/linux/yum/centos/RPM-GPG-KEY-rdoyle
  9. enabled=1
  10.  
  11. yum install ppp pptpd.i386 -y
  12.  
  13. echo 1 > /proc/sys/net/ipv4/ip_forward 
  14. sysctl -p
  15.  
  16. 修改 /etc/pptpd.conf
  17. 注释掉logwtmp
  18. 并添加IP范围
  19. localip 10.0.0.1
  20. remoteip 10.0.0.2-254
  21.  
  22. 修改 /etc/ppp/options.pptpd
  23. 添加DNS
  24. ms-dns 8.8.8.8
  25. ms-dns 8.8.4.4
  26.  
  27. 添加用户名密码
  28. /etc/ppp/chap-secrets 
  29.  
  30. iptables -t nat -A POSTROUTING -s 10.0.0.0/24 -j SNAT --to-source YourIPs
  31. iptables -t nat -A POSTROUTING -s 10.0.0.0/24 -j MASQUERADE #或者轮询

centos5更新kernel

centos5 更新kernel

yum list kernel*

yum install kernel-PAE.i686 -y
# PAE为支持大内存的版本

reboot 后就可以

#查看32位或64位系统
file /sbin/init

未更新前: 2.6.18-164.el5PAE
更新后: 2.6.18-194.8.1.el5PAE