July 2015

httpd, nginx, Python, Tips & Guides, Web Server

Python code: List most popular URL from Apache/NGINX ‘access.log’ file

Found a great Python code snippet for listing the most popular URL from Apache / NGINX ‘access.log’ file. Very practical! import collections logfile = open(“access.log”, “r”) clean_log=[] for line in logfile: try: # copy the URLS to an empty list. # We get the part between GET and HTTP clean_log.append(line[line.index(“GET”)+4:line.index(“HTTP”)]) except: pass counter = collections.Counter(clean_log) […]

Internet Stuff

Using a new Google API or Service? It might not last long…

I read an interesting analysis on the lifespan of some of the Google service and API that has been cancelled: http://www.theguardian.com/technology/2013/mar/22/google-keep-services-closed Based on the analysis at the time of the writing, Google service has a mean lifespan of 1,459 days. An interesting point to ponder, especially if your applications/services depends on one or more Google […]

Funny Stuff, Internet Stuff

What ever happened to 1Malaysia Email – Tricubes, Pemandu, anyone??

What ever happened to 1Malaysia email, a project that said to be valued at 5.3 milions (MAVcap funding) ? Source: The Star Official email account for each Malaysian adult Pemandu: Communications Content & Infrastructure The Next Web: Malaysia’s new “official” email address for each citizen will also offer biometric USB device The 1Malaysia email is […]

httpd, nginx, Server, Ubuntu/Debian

How to test if PageSpeed module is running (on NGINX)

You can run a simple test using curl to verify whether the PageSpeed module is running or not on NGINX. curl -I -X GET {ip addresss | web address} curl -I -X GET 192.168.1.47 The output would come out something like this… You will see “X-Page-Speed” header with its version (in my case its “1.9.32.4-7251“) […]

httpd, nginx, Open Source, Server, Tips & Guides, Ubuntu/Debian

How to install NGINX with PageSpeed module in Ubuntu LTS / Debian

UPDATE: You can now install NGINX with PageSpeed in Ubuntu LTS with deb package: https://blog.mypapit.net/2015/08/install-nginx-with-pagespeed-using-deb-for-ubuntu-lts-amd64.html INSTALLING NGINX USING UBUNTU APT-GET SOURCE PageSpeed modules are open source modules developed by Google Inc that can perform website optimization to ensure faster site delivery, automatically. PageSpeed module is not included in NGINX installation in Ubuntu or Debian. So […]

Personal Life, Tips & Guides

Check public IP address with checkip.mypapit.net

You can now check your public IP Address by visiting checkip.mypapit.net. The website will display your public IP Address (or your anonymous proxy IP Address). As usual, this service is provided without any warranty. Additionally, you can also check IP Address from bash command line using this curl/wget trick. wget -qO – checkip.mypapit.net curl -o […]

GNU/Linux, Server, SSH, Ubuntu/Debian

How to change timezone in Ubuntu / Debian from command-line

This guide assumes that you use Ubuntu or Debian-based GNU/Linux distro. There are two ways to change timezone from bash command line. sudo dpkg-reconfigure tzdata or, sudo ln -sf /usr/share/zoneinfo/Asia/Kuala_Lumpur /etc/localtime You can also specify other timezone in the second method, for example: sudo ln -sf /usr/share/zoneinfo/GMT /etc/localtime or for Eastern Standard Time (US) sudo […]

Wordpress

How to remove WordPress version number from header, css files and feeds

Here’s how to remove WordPress version number from HTML header and feeds. Include this at the end of your themes ‘function.php’ files, which you can edit in “Appearance->Editor” section in WordPress Admin. function my_remove_version_info() { return ”; } add_filter(‘the_generator’, ‘my_remove_version_info’); You can also remove WordPress version number from the included css and javascript. To do […]

security, SSH

Simple SSH Tunnelling tips

SSH tunelling is usually used to avoid firewall restriction or to ensure point-to-point encrypted communication. For example, if you want to send email to smtp server “smtp.yourserver.com” on port 587, but your organization currently blocking smtp port 25 and 587, then you can benefit from SSH tunelling to avoid from being blocked. To get around […]

security, Server

IPdeny.com – Download collections of Country IP Addresses

IPdeny.com is a service which offers a free collection of Regional and Country IP address blocks list. The IP address blocks is useful for application developer and system administrator to enhance their system. For example, application developer can use the information redirect users from certain countries to regional websites or pages, or a system administrator […]

httpd, nginx, Server, Ubuntu/Debian

How to Optimize and speed up PHP with OPCache

PHP 5.5 and 5.6 comes with OPCache. OPCache speeds up PHP execution by storing precompile bytecode of PHP in shared memory. Taking advantage of fast memory operations compared to hard disk operation, OPCache eliminates the process of having to read PHP scripts from the disk each time whenever a script must be executed. In short, […]

Scroll to Top