There is a timezone configuration on PostgreSQL server. If you want to change the default globally, you can edit the postgresql.conf. On Ubuntu, it is located at
# - Locale and Formatting -
datestyle = 'iso, mdy'
#intervalstyle = 'postgres'
#timezone = 'Hongkong'
timezone = 'UTC'
We could also tweak the timezone only in your current PostgreSQL session.
1. Get the current timezone.
I tried to install Python using pyenv but came across the following error:
vagrant@vagrant-ubuntu-trusty-64:~$ pyenv install 2.7.8
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LC_CTYPE = "UTF-8",
LANG = "en_US.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
For those which are unset, set the environmental variables in .bashrc or .bash_profile.
Re-login and try again.
Reference: perl: warning: Please check that your locale settings ubuntu
It’s not easy to view the Git log in command line but most of the time is the most straight forward way or sometimes, the only way you could view the Git commit history.
Tig is a ncurses-based interface to view your Git repository.
Installation on OS X using Homebrew:
brew install tig
Installation on Ubuntu:
apt-get install tig
Monit is a opensource monitoring tool on Unix system. The simplest use case would be restarting your service if there is failure.
On Ubuntu, simply run apt-get to install Monit.
sudo apt-get install monit
The Monit folder is at /etc/monit. Before you can read anything from Monit, create the /etc/monit/conf.d/monit.conf in order to setup the Monit web interface.
set httpd port 2812 and
use address localhost
The Node Version Manager(nvm) could help you to manage multiple Node.js installations. The following steps are executed from root account.
1. Install the required packages.
apt-get install build-essential openssl libssl-dev curl
2. Create a new user group and add those users which are allowed to manage Node.js installation. The following command create a new group called dev.
1. Edit /etc/vsftpd.conf as follow.
2. Create the /etc/vsftpd.chroot_list and enter the usernames which you want to jail.
We can find the memory usage on a Ubuntu server using the following command
Previously i have setup a server with Nginx and MariaDB.
Run Drupal 7 in Nginx
But there is one problem in this setup. I cannot restart the MariaDB service. Whenever it is down, i have to restart the server instance.
At first, i thought the failure is caused by the modification of the /etc/mysql/my.cnf. So i try to restore the original my.cnf. The following solution helps you to restore the default package configuration file.
In Drupal, we can use a progress bar when uploading an image or file. But that needs a PHP PECL extension called uploadprogress. The following steps work for Ubuntu Precise (Ubuntu 12.04.1 LTS).
1. Install the php5-dev package.
We can install package easily in Ubuntu by the apt-get command. But sometimes we may want to find out what packages are available in the repositories as well as the package version.
To search a package, use the apt-cache search <name> command.
For example, apt-cache search nginx