March 27, 2015 0 Comments

How to run nodejs from background. Here is an easy way $ nohup node app.js & Howevery, the forever will do more things, such like export log files, js api... $ sudo npm

February 25, 2015 0 Comments

List all rules with line number: iptables -nL --line-numbers Block all access from 46.151.0.0/16 range at line 12: iptables -I INPUT 12 -s 46.151.0.0/16 -j DROP delete rules based on their number and

February 5, 2014 1 Comment

1.Install fail2ban Because fail2ban is not available from CentOS, we should start by downloading the EPEL repository: rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm Follow up by installing fail2ban: yum install fail2ban 2 Copy the Configuration File

January 28, 2014 0 Comments

here is easy way to remove iptables rules iptables -L INPUT --line-numbers output: num target prot opt source destination 1 fail2ban-SSH tcp -- anywhere anywhere tcp dpt:ssh remove rule by num iptables -D

January 23, 2014 0 Comments

under the sub vcl_rev add this code if (req.http.User-Agent ~ "(?i)ip(hone|od)") { set req.http.X-Device = "mobile-iphone"; } elsif (req.http.User-Agent ~ "(?i)ipad") { set req.http.X-Device = "tablet-ipad"; } elsif (req.http.User-Agent ~ "(?i)android.*(mobile|mini)") { set

January 17, 2014 0 Comments

I did some research about MySQL’s query cache. Some people said it will speed up page load times by 5-15%. Query cache is used to cache SELECT results and later return them without

January 16, 2014 0 Comments

beresp.ttl set beresp.ttl = 1d; cache the file 1 day req.grace set req.grace = 6h; after 1 day, if Apache Goes Down, still cache another 6 hours

January 2, 2014 0 Comments

This is a short article that explains how you change the default MySQL data directory and adjust SELinux to account for the changes. The article assumes that you’re running either RHEL, CentOS, Scientific

November 14, 2013 0 Comments

sudo cp -rp folder1 folder2 help -p same as --preserve=mode,ownership,timestamps --preserve[=ATTR_LIST] preserve the specified attributes (default: mode,ownership,timestamps), if possible additional attributes: context, links, xattr, all

November 5, 2013 4 Comments

Step 1: Enabling Google’s mod_pagespeed Repository Create a file called /etc/yum.repos.d/mod-pagespeed.repo with the help of your favourite editor and add the following lines of code to it based on your OS bit. RHEL/CentOS/Fedora