Linux

S3cmd – Sync Files Between S3 bucket and Local Directory

1. Syncing Files from Local => S3 Bucket For example I want to sync my local directory /root/mydir/ to S3 bucket directory s3://tecadmin/mydir/ where tecadmin is bucket name. I have created some new files in /root/mydir/ and sync to s3 bucket using following command. Note: Do not forgot to add trailing slash (/) in local directory path when specifying s3 bucket with full directory path. To keep preserve file attributes like date/time etc use -p or –preserve parameter like below ...

How to disable SSH timeout

Inactive or idle SSH connections are normally disconnected by the server after a certain period of time. This depends on how the SSH server is configured, and upon disconnection the SSH client will be prompted with a message similar to the following; This could be avoided by changing the SSH server's configuration, or tricking the server from the client's end. SSH Client This is probably the easiest method as it doesn't require root or administrator access to the server and it cou...

Simplest solution to fix ssh host key has changed

Here is the simplest solution to fix this issue. This will update the offending of your host from the known_hosts.

Linux系统下PHP发送邮件失败的解决办法

是否安装Sendmail 检查下php.ini设置是否正确 cat /etc/php.ini | grep sendmail_path 正确的结果应该类似这样 sendmail_path = sendmail -t -i 检查下sendmail是否安装 which sendmail 正常的结果应该类似这样 /usr/sbin/sendmail 如果上面的路径没有找到sendmail 检查下是否安装了包 yum list installed | grep sendmail 这时的情况又分为二种: 如果安装了这个包,就给卸载了重新装一遍。 如果没装,直接装上。 sendmail---stat=Service unavailable 今天尝试着想要在linux终端上直接用mail命令(e.g: echo "hello" | mail -s "hello test" xxx@139.com)给我139.com的邮箱发邮件时,139.com邮箱根本收不到,但是总是可以在/var/mail/root下面找到我刚才发的邮件,其实这是因为发送失败了,从而被sen...

Install FFmpeg Mencoder on CentOS 5.10 64-bit

Install FFmpeg & Mencoder on CentOS 6 would be easy job. It cost me 2 days to install them and make script running on a client server which is CentOS 5.10 64-bit. If you have to install FFmpeg & Mencoder on a CentOS 5 like me, i hope this article can save you some time. Install FFmpeg You can follow those two links to prepare system, install codecs and ffmpeg: http://cumulusclips.org/docs/install-ffmpeg-x264-on-centos/ http://trac.ffmpeg.org/wiki/CentosCompilationGuide Err...

Linux命令之make, clean建立和删除文件夹技巧

makefile定义了一系列的规则来指定,哪些文件需要先编译,哪些文件需要后编译,哪些文件需要重新编译,甚至于进行更复杂的功能操作,因为 makefile就像一个Shell脚本一样,其中也可以执行操作系统的命令。 makefile带来的好处就是–“自动化编译”,一旦写好,只需要一个make命令,整个工程完全自动编译,极大的提高了软件开发的效率。make是 一个命令工具,是一个解释makefile中指令的命令工具,一般来说,大多数的IDE都有这个命令,比如:Delphi的make,Visual C++的nmake,Linux下GNU的make.可见,makefile都成为了一种在工程方面的编译方法。 make 根据Makefile文件编译源代码、连接、生成目标文件、可执行文件。 make clean 清除上次的make命令所产生的object文件(后缀为“.o”的文件)及可执行文件。 make install 将编译成功的可执行文件安装到系统目录中,一般为/usr/local/bin目录。 make dist 产生发布软件包文件(即distribut...

Linux下动态库查找路径的问题

学习到了一个阶段之后,就需要不断的总结、沉淀、清零,然后才能继续“上路”。回想起自己当年刚接触Linux时,不管是用源码包编译程序,还是程序运行时出现的和动态库的各种恩恩怨怨,心里那真叫一个难受。那时候脑袋里曾经也犯过嘀咕,为啥Linux不弄成windows那样呢,装个软件那个麻烦不说,连运行软件都这么恼火呢?如果那样的话就不叫Linux了。借用小米公司CEO雷军一句话:小米,为发烧而生。我认为:Linux,为真理而在。特别是为那些喜欢折腾,热衷技术背后原理和实现细节的人们而生。 说到和动态库查找路径相关的问题,总体上可以分为两类: 第一类:通过源代码编译程序时出现的找不到某个依赖包的问题,而如果此时你恰好已经按照它的要求确确实实、千真万确、天地良心地把依赖库给装好了,它还给你耍混、犯二,有一股折腾不死人不偿命的劲儿,那让人真是气儿不打一处来,如果Linux此时有头有脸,你是不是特想抽它丫两大嘴巴; 第二类:就是在运行程序的时候,明明把那个程序需要的依赖包都已经安装的妥妥的了,可运行的时候人家就告诉你说“error while loading shared libra...

How to find spam sending php script on server

This article can help you to track down outgoing spam using PHP. From php version 5.3.0 we can use the directive mail.log to log who’s calling the function mail(). When someone calls the function mail() from a php script we can get some info about the sender in log. PHP mail.log entries include the full path of the script, line number, To address and headers. 1. Check email log 2. Edit php.ini 3. To enable mail.log, add following line in php.ini under 4. Create lo...

Install PhoneGap on Fedora 17

Download and Install Eclipse IDE Android offers a custom plugin for the Eclipse IDE, called Android Development Tools (ADT). Following steps in link to install ADT Plugin into Eclipse ** If you can not find Android SDK Manager in Window --> Android SDK Manager, go to Window --> Customize Perspective --> Tool Bar Visibility. Enable options in Android SDK and AVD Manager. Install NodeJS on Fedora NodeJS is currently not part of the standard repo's, you can not install dire...

How to install Wkhtmltopdf in Fedora 17

wkhtmltopdf is an excellent opensource tool for converting html to PDF or an Image like JPEG, PNG etc.. It is available under GNU/GPL and written in C++ programming language. It can convert any HTML web page to PDF with Options to add Header and Footer. Also with Table of Content writing Option. It is available for both 32 and 64 bit Linux systems. For dowloading 32bit tool use the below command. For downloading 64bit tool use the below command. Extract the Files: Install...