1. Deactivate the virtualenv if there is.
pyenv deactivate
2. Install the required libraries.
sudo apt-get install libpq-dev python-dev
3. Install PostgreSQL.
sudo apt-get install postgresql postgresql-contrib
1. Deactivate the virtualenv if there is.
pyenv deactivate
2. Install the required libraries.
sudo apt-get install libpq-dev python-dev
3. Install PostgreSQL.
sudo apt-get install postgresql postgresql-contrib
Previous: Install Graphite under pyenv virtualenv on Ubuntu
Compared to Graphite, installing StatsD server is just a piece of cake.
1. Install Node.js. For better management on Node.js, you could consider using nvm.
2. Checkout the StatsD project on GitHub.
git clone https://github.com/etsy/statsd.git
3. Copy the exampleConfig.js and name it to whatever you like and edit it as follow.
ex. statsdConfig.js.
{ graphitePort: 2003 , graphiteHost: "<graphite host>" , port: 8125 , backends: [ "./backends/graphite", "./backends/console" ] // console is for debug , debug: true // For debug , graphite: { legacyNamespace: false } // Better group all collected metrics under stats }
Continue reading StatsD – Installation and integration with Graphite
It took me one and an half day to get the Graphite working…
1. Make sure you have pyenv and pyenv-virtualenv installed.
2. Install the following packages.
sudo apt-get install python-dev pkg-config libcairo2-dev memcached
3. Install Python 2.7 with enable-shared.
env PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install 2.7.8
Continue reading Install Graphite under pyenv virtualenv on Ubuntu
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.
SELECT current_setting('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.
export LANGUAGE=en_US.UTF-8 export LC_ALL=en_US.UTF-8
Re-login and try again.
Done =)
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 allow 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.
groupadd dev
Continue reading Ubuntu – Install Node Version Manager globally for all users
1. Edit /etc/vsftpd.conf as follow.
/etc/vsftpd.conf
chroot_local_user=NO chroot_list_enable=YES chroot_list_file=/etc/vsftpd.chroot_list
2. Create the /etc/vsftpd.chroot_list and enter the usernames which you want to jail.
/etc/vsftpd.chroot_list
userA userB userC ...
Continue reading Ubuntu – Setup Jailed FTP user account in vsftpd
We can find the memory usage on a Ubuntu server using the following command
free -m