SCP(Secure Copy)协议

scp 命令是 SSH 中最方便有用的命令了,试想,在两台服务器之间直接传送文件,仅仅用 scp 一个命令就完全解决了。你可以在一台服务器上以 root 身份运行 #scp servername:/home/ftp/pub/file1 ./ 这样就把另一台服务器上的文件 /home/ftp/pub/file1 直接传到本机器的当前目录下,当然你也可以用 #scp /tmp/file2 servername:/boot 把本机上的文件 /tmp/file2 送到另一台机器的 /boot 目录下。而且整个传送过程仍然是用 SSH 加密的。

scp就是secure copy,是用来进行远程文件拷贝的。数据传输使用 ssh,并且和ssh 使用相同的认证方式,提供相同的安全保证 。 与rcp 不同的是,scp 在需要进行验证时会要求你输入密码或口令。

 


linux下php扩展ssh2的安装

1. 安装OpenSSL
a. # yum install openssl
b. # yum install openssl-devel

2. 安装libssh2:
a.  # cd /usr/src
b.  # wget http://downloads.sourceforge.net/project/libssh2/libssh2/1.0/libssh2-1.0.tar.gz
c.  # tar -zxvf libssh2-1.1.tar.gz
d.  # cd libssh2-1.1
e.  # ./configure
f.  # make all install

3. link libssh & PHP together,using pecl:
a. #  pecl install -f ssh2
b. 确保生成的ssh2.so在php.ini制定的extension目录下
c. 修改php.ini,添加 extension=ssh2.so

4. Compiling libssh2 PHP Extension (代替上面第3步,貌似上面的是不稳定版本)
a.  # wget http://pecl.php.net/get/ssh2-0.11.0.tgz
b.  # tar -zxvf ssh2-0.11.0.tgz
c.  # cd ssh2-0.11.0
d. # phpize && ./configure –with-ssh2 && make « Generates ssh2.so, the compiled PHP extension.
e. # cp ./modules/ssh2.so /usr/lib/php/modules/ssh2.so
f.  修改php.ini,添加 extension=ssh2.so (echo “extension=ssh2.so” > /etc/php.d/ssh2.ini)

5.  重启lighttpd: service lighttpd restart (continue reading…)


linux下VSFTP的搭建及优化

首先安装Linux 企业版第一张光盘中的vsftpd-2.0.1-5.i386.rpm
#rpm –ivh
/media/cdrom/RedHat/RPMS/vsftpd-3.0.1-5.i386.rpm
启动vsftpd服务
#service vsftpd start
刷新防火墙
#iptables -F
这样一个简单linux下的FTP就已经搭建好了!
下面就来慢慢优化我们的FTP服务器: (continue reading…)


js取url参数

function getParameterByName(name){
  name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
  var regexS = "[\\?&]" + name + "=([^&#]*)";
  var regex = new RegExp(regexS);
  var results = regex.exec(window.location.href);
  if(results == null)
    return "";
  else
    return decodeURIComponent(results[1].replace(/\+/g, " "));
}

MySQL查询及删除重复记录的方法

查询及删除重复记录的方法
(一)
1、查找表中多余的重复记录,重复记录是根据单个字段(peopleId)来判断
select * from people
where peopleId in (select  peopleId  from  people  group  by  peopleId  having  count(peopleId) > 1) (continue reading…)

1 Comment more...

How to compile PHP-Qt?

error code:

cmake ..
-- Found Qt-Version 4.5.0
CMake Error at cmake/modules/FindPHP5.cmake:139 (LIST):
  list index: 0 out of range (-0, 18446744073709551615)
Call Stack (most recent call first):
  CMakeLists.txt:13 (include)

-- /main
CMake Error at CMakeLists.txt:16 (MESSAGE):
  PHP5 could not be found!

-- Configuring incomplete, errors occurred!

(continue reading…)


background black instead of white for EPS->JPG

Part of the problem here was that your command line order is not quite right.
See here: http://www.imagemagick.org/Usage/basics/#cmdline

When you’re using “convert -colorspace RGB input.tiff output.jpg”, then it will still work, as ImageMagick will use it like that: “convert input.tiff -colorspace RGB output.jpg” But it’s better to specify it like that (first the input image, then the options, then the output image) right at the start. (continue reading…)


psd,eps,tif to jpg

  • psd: “/usr/bin/convert test1.psd[0] -profile ISOcoated_v2_eci.icc -profile eciRGB_v2.icc -resize 1000×1000 -size 1000×1000 xc:white +swap -compose over -composite -trim -colorspace RGB -quality 100 test1.jpg”
  • psd: “$imagick_path test1.psd[0] -profile ISOcoated_v2_eci.icc -profile eciRGB_v2.icc -geometry 1000×1000 -flatten -colorspace RGB -quality 100 test1.jpg”
  • eps: “$imagick_path test1.eps[0]  -density 600 -colorspace RGB -quality 100 test1.jpg”
  • tif:  “$imagick_path test1.tif[0]  -profile ISOcoated_v2_eci.icc -profile eciRGB_v2.icc -colorspace RGB  -antialias -geometry 1000×1000 -quality 100 test1.jpg”

Linux文件查找命令find,xargs详述

由于find具有强大的功能,所以它的选项也很多,其中大部分选项都值得我们花时间来了解一下。即使系统中含有网络文件系统( NFS),find命令在该文件系统中同样有效,只你具有相应的权限。 (continue reading…)


Linux查看磁盘空间命令分享

在windows下可以很方便的查看磁盘空间的。但是到了Linux查看磁盘空间,你可能就有点摸不着头脑了,呵呵。不要急,我这就要给你解决这个问题。 (continue reading…)


Copyright © 1996-2010 Add Lives. All rights reserved.
iDream theme by Templates Next | Powered by WordPress