Less > Tail

less -r +F logs/production.log -r to retain the colour +F to follow

April 1, 2015 · 1 min · Shern Shiou Tan

Logging query statement from Postgresql

At postgresql.conf, you can turn on logging for query. It is helpful if you are catching some query error. Lines to look for log_destination = 'stderr' logging_collector = on log_directory = '/var/log/postgresql' log_filename = 'postgresql-%Y-%m-%d_%H%M%S.log' log_file_mode = 0506 Be sure to turn it off because it dramatically reduce the performance of Postgresql.

April 23, 2014 · 1 min · Shern Shiou Tan

Upgrading from Postgresql 9.1 to 9.3

If you have just upgraded to the latest Ubuntu LTS 14.04 (Trusty Tahr), you might encountered a problem where Postgresql 9.3 is being installed along with your older version of Postgresql. It is recommended to upgrade your current setup to 9.3 and uninstall the older version. Before you use pg_upgrade, make sure you shut down all Postgresql instances with service postgresql stop You can use the script below: In the newer configuration file (postgresql....

April 23, 2014 · 1 min · Shern Shiou Tan

NGINX for Ghost Blog

Just wanna share the configuration for my NGINX that I used to front as proxy for this Ghost blog. As you can see I used pagespeed to increase the page performance and optimize the html pages. You may check on the configuration to replace Ubuntu NGINX with built in pagespeed at: http://blog.shernshiou.com/build-nginx/.

March 31, 2014 · 1 min · Shern Shiou Tan

Building NGINX

If you would like to replace the current default NGINX package for Ubuntu with the latest version from source. This is the configuration I tested and used.

October 17, 2013 · 1 min · Shern Shiou Tan