Showing posts with label linux. Show all posts
Showing posts with label linux. Show all posts

3/08/2015

Linux文件删除与恢复

使用 Linux 安全删除工具
http://www.ibm.com/developerworks/cn/linux/1311_caoyq_linuxdelete/index.html

使用 Linux 文件恢复工具
http://www.ibm.com/developerworks/cn/linux/1312_caoyq_linuxrestore/index.html

1/02/2015

update firefox to version 34

Failed to sync firefox31 info to firefox34.

Unlink the old device, then re-create a new account to sync the personal settings across different devices.

Two useful links:

http://www.libre-software.net/how-to-install-firefox-on-ubuntu-linux-mint

https://www.mozilla.org/en-US/firefox/all/

The new version is ready to run. No need to compile it. Very  convenient!

10/28/2014

wget --random-wait


 --random-wait

Some web sites may perform log analysis to identify retrieval programs such as Wget by looking for statistically significant similarities in the time between requests. This option causes the time between requests to vary between 0.5 and 1.5 * wait seconds, where wait was specified using the --wait option, in order to mask Wget’s presence from such analysis.

A 2001 article in a publication devoted to development on a popular consumer platform provided code to perform this analysis on the fly.  Its author suggested blocking at the class C address level to ensure automated retrieval programs were blocked despite changing DHCP-supplied addresses.

The --random-wait option was inspired by this ill-advised recommendation to block many unrelated users from a web site due to the actions of one.

9/24/2014

different ls output to terminal and pipe

Try these commands:

ls -1 | wc -l
ls | wc -l
ls | cat

We can use the first two commands to count the number of files. It is easy to understand the first one works. But the second command does not seem to work as expected at the first glance. However, you will find it really works the same way as the first one. The reason can be seen from the last command -- ls outputs the results to pipe in the same way as "ls -1" to terminal.

http://unix.stackexchange.com/questions/157285/why-does-ls-wc-l-show-the-correct-number-of-files-in-current-directory

http://git.savannah.gnu.org/cgit/coreutils.git/tree/src/ls.c

9/22/2014

Apache webserver & vsftpd


10/9/2014

Some updates about the apache settings. I have made it work now. Generally it is simple to use apache, but it bites at certain points. ---- it is not the problem of apache; instead, it is from the network environment.

As previously I modified the httpd.conf file and decided to use the default folders. When I test the syntax with "apachectl -t", it returned "Syntax OK". But I couldn't see the page from my Mac. When tried to visit the website from the server itself, it worked! That meant the service was Ok.

Then, I tested the website from Mac on the same LAN. But I failed. That meant the sever refused connection from other computers. I also get some error message from the firefox browser in which it's mentioned that the computer may be protected by firewall. Therefore I checked the /etc/sysconfig/iptables. I found port 80 was not open by default. Then I opened the port 80. Everything worked fine.

I collected some useful webpages, listed below for reference. These links are more helpful to me than previously collected ones.

Apache配置详解(最好的APACHE配置教程)
originally from: http://aiks.blog.com.cn/archives/2006/1748482.shtml  (invalid now)
a backup from: http://liudaoru.iteye.com/blog/336338

Apache详细配置
http://bbs.chinaunix.net/thread-1941372-1-1.html

linux下配置管理Apache服务器
http://jingyan.baidu.com/article/375c8e1977b50e25f2a229a6.html

今天各种坑 库连不上,apache装起来外面访问不了,fsockopen 权限不够
http://blog.csdn.net/pennyliang/article/details/7342042


9/22/2014

笨死了,今天是搞不定这个阿帕奇了。有空再折腾吧。。。。

收藏几个链接备用:

 http://www.faqs.org/docs/securing/chap29sec245.html


How To Setup Apache Virtual Host Configuration (With Examples)
http://www.thegeekstuff.com/2011/07/apache-virtual-host/

http://serverfault.com/questions/293866/apache-says-documentroot-doesnt-exist-when-it-does

http://httpd.apache.org/docs/2.2/

http://httpd.apache.org/docs/2.2/vhosts/name-based.html
http://httpd.apache.org/docs/2.2/invoking.html


也可以尝试一下使用ftp服务器:


Setup FTP Server step by step in CentOS / RHEL / Scientific Linux 6.3/6.4/6.5
http://ostechnix.wordpress.com/2013/12/15/setup-ftp-server-step-by-step-in-centos-6-x-rhel-6-x-scientific-linux-6-x/



 https://access.redhat.com/solutions/187873

Environment

  • Red Hat Enterprise Linux 6.3
  • Red Hat Subscription Manager (RHSM)

Resolution

  • Run the following commands to refresh certificates on the system with the problem and then try to run yum check-update
# subscription-manager refresh 
# yum check-update
  • If the issue persists then try following :
  • Run the command as mentioned below which removes all of the subscriptions and identity data from the local system, without affecting the consumer information in the subscription service.
# subscription-manager clean 
  • Now unregister your system with command:
# subscription-manager unregister
  • Go to Customer Portal search with hostname of the system in the System tab and note down the UUID
  • Register your system with following command(using the UUID noted from customer portal):
# subscription-manager register --consumerid=<system UUID>
You can also refer # man subscritption-manager for more information.

Root Cause

  • The system's local entitlement information was corrupted or lost somehow.

9/15/2014

Does Linux really eat much mem as displayed?

When we check the mem usage by the "top" command, probably we will see a low free mem as shown in the figure below. But is that the real case that only a small amount mem is left for applications?








That info is a bit cheating. We may have a large amount of mem ready for other programs. The major problem is that Linux defines used and free mem in a different way from our intuition. 



We can use "free" to see how much mem is available for new applications. The number in the "free" column and in the line of "-/+ buffers/cache" is the real mem available. Much larger than it appears, right?




To learn more about the Linux mem, please refer to the following links.

Linux ate my ram!
http://www.linuxatemyram.com/
 
http://www.linuxatemyram.com/play.html

http://www.binarytides.com/linux-command-check-memory-usage/