Apr 22, 2015 | Nginx, Ubuntu 12.04 Server Management, Uncategorized
Redirect single domain with www to non-www. For example, redirecting of http://www.dennylabs.com to http://dennylabs.com. Why do we need to redirect www to non-www or vice versa? It all because of SEO purposes. Google treats your content as duplicate when they are crawl-able from both www and non-www. Nginx configuration for single domain redirection of www to non-www . server { server_name www.dennylabs.com; return 301 $scheme://dennylabs.com$request_uri; } Nginx configuration for multiple domains redirection of www to non-www. server { server_name "~^www\.(.*)$" ; return 301 $scheme://$1$request_uri;...
Mar 19, 2015 | Linux Shell Scripting, Ubuntu 12.04 Server Management
List the rules for a specific chain. Example below list the “fail2ban-ssh-ddos” chain. iptables -L fail2ban-ssh-ddos --line-numbers Example output: Chain fail2ban-ssh-ddos (2 references) num target prot opt source destination 1 REJECT all -- 192.0.0.8 anywhere reject-with icmp-port-unreachable 2 RETURN all -- anywhere anywhere Delete rule line number 1: iptables -D fail2ban-ssh-ddos...
Dec 26, 2014 | Uncategorized
openssl req -new -newkey rsa:2048 -nodes -keyout yourdomain.key -out yourdomain.csr
Apr 24, 2014 | Android Development, Uncategorized
Are you encountering the following errors with ADB? Windows Command Prompt c:androidsdkplatform-tools>adb devices adb server is out of date. killing... ADB server didn't ACK * failed to start daemon * error: unknown host service Solution: ADB server cannot start if port 5037 was occupied by other process hence we need to find and kill the process to release this port. c:androidsdkplatform-tools>netstat -aon|findstr 5037 TCP 127.0.0.1:5037 0.0.0.0:0 LISTENING 6889 TCP 127.0.0.1:5037 127.0.0.1:50506 TIME_WAIT 0 TCP 127.0.0.1:5037 127.0.0.1:50507 TIME_WAIT 0 PID 6889 is occupying port 5037. Find the process and kill it. 2. Start ADB server c:androidsdkplatform-tools>adb start-server * daemon not running. starting it now on port 5037 * * daemon started successfully...