linux

linux删除三天前文件

find . -mtime +3 -exec rm {} \;
find $dir_you_want -ctime +3 -type f | xargs rm -rf


wget忽略证书

wget https://demo.de/index.php?id=1234 -O demo.txt –no-check-certificate


Debian 4.0 apache2安装ssl及配置

安装apache,这个非常方便,输入apt-get install apache2即可。
安装ssl:apt-get install ssl-cert。 (continue reading…)


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…)


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

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


Linux查看磁盘空间命令分享

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


anytopdf

anytopdf is a perl script that converts OpenOffice.org, Microsoft Office (Word DOC, Excel XLS), RTF, HTML, and other openoffice.org readable file formats to the PDF format. It will automatically install the supporting ‘AnyToPDF’ OpenOffice.org Basic macro library in the current user’s OpenOffice.org configuration if it’s not already present. (continue reading…)


using openoffice headless ( macro, shell, php )

here is a very simple script to run openoffice headless.
it works on a debian sarge, you have to do this before :
# apt-get update && apt-get install xvfb
(continue reading…)


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