Linux's tag archives

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...

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...

用.htaccess设置禁止显示Apache目录列表

注意:使用此方法不当时,设置的.htaccess文件会引起403 Forbidden 禁止访问的问题 如何禁止 Apache 显示目录列表呢? 缺省情况下如果你在浏览器输入地址:http://localhost:8080/ 并且你将你的目录索引文件设置为 index.html,且你的文件根目录里有 index.html,浏览器就会显示 index.html的内容,如果没有 index.html,浏览器就会显示文件根目录的目录列表,目录列表包括文件根目录下的文件和子目录。(注:索引文件的设置:)#在这里,你可以设置某个目录被请求时,首先执行的文件 同样你输入一个虚拟目录的地址:http://localhost:8080/b/ 如果该虚拟目录下没有 index.html,浏览器也会显示该虚拟目录的目录结构,列出该虚拟目录下的文件和子目录。 如何禁止 Apache 显示目录列表呢? 在 httpd.conf文件里找到类似这样指令: 将指令作这样的修改: 方法一:在Options Indexes FollowSymLinks在Indexes前面加...

How to flush the local DNS cache in Fedora?

You can flush your local DNS cache in Linux by following these easy steps: 1. Open your terminal to use the command line. 2. Log in as root using the su command: user@host:~$ su Password: root@host: 3. Restart the name service cache daemon: root@host: /etc/init.d/nscd restart Please note that the name service cache deamon (nscd) may not be installed by default on your Linux distribution. You should be able to install it through the package manager of your distribution – yum f...

How to use the W3C Geolocation API

Introduction Imagine visiting a city for the first time. You're hungry, but don't know where the nearest restaurants are and which of them are any good. Wouldn't it be nice if some app could detect your location and provide you with a list of restaurants closest to you, along with reviews and ratings for each one? And this is not the only consideration — could it detect your location accurately, keeping in mind your privacy as well? This is where the W3C Geolocation API comes in, suppo...

Search for text in vi or vim

vi and vim have powerful searching capabilities because they bring to bear the richness of regular expressions. To search for the next occurence of the text ‘maybe’ from the current cursor position, type: Search backward from the current position by using ? instead of / in the command. Once you have searched for something, you can find the next occurrence by pressing n or the previous occurrence with N. Searching in vi/vim is enhanced with regular expressions. For example, ...

How to excluding directories when zip files on Linux

All you needs is use the -x switch and list the files and directories to be excluded, separated by spaces. For example: