Tuesday, August 16, 2016

How to analyze AWS RDS Slow Query

Amazon RDS has the feature in which we can log the slow queries and than analyze them to find the queries which are making our Database slow.
There are few prerequisites to this:
1. Slow log query should be enabled in RDS.
2. AWS RDS CLI should be present.
3. Percona Toolkit should be present.

Once you have all the prerequisites than following script will help us in rest.
[root@ip-10-0-1-220 ravi]# cat rds-slowlog.sh 
#!/bin/bash
#Script to Analyze AWS RDS MySQL logs via Percona Toolkit
#By Ravi Gadgil

#To get list of all slow logs available.
/opt/aws/apitools/rds/bin/rds-describe-db-log-files --db-instance-identifier teamie-production --aws-credential-file /opt/aws/apitools/rds/credential | awk '{print $2 }' | grep slow > /home/ravi/slowlog.txt

logfile=$(echo -e "slowlog-`date +%F-%H-%M`")
resultfile=$(echo -e "resultlog-`date +%F-%H-%M`")

for i in `cat /home/ravi/slowlog.txt` ; do

#To download Slow Log files and add them to single file.
/opt/aws/apitools/rds/bin/rds-download-db-logfile teamie-production --log-file-name $i --debug --connection-timeout 3600 --aws-credential-file /opt/aws/apitools/rds/credential >> /data/rds-logs/$logfile

done

#To run analysis on slowlog file.

pt-query-digest /data/rds-logs/$logfile > /data/rds-logs/$resultfile

rm -rf /data/rds-logs/$logfile

Note: I have not set the system environment paths for RDS commands and credentials file so using the whole relative path in command, If you have set system environment variable than whole relative path is not needed.





How to install Percona MySQL tools

Persona has lots of tools to analyses MySQL data and very useful information can be extracted from them.

Installing via Yum:
[root@ip-10-0-1-220 ravi]# yum install http://www.percona.com/downloads/percona-release/redhat/0.1-3/percona-release-0.1-3.noarch.rpm
Retrieving http://www.percona.com/downloads/percona-release/redhat/0.1-3/percona-release-0.1-3.noarch.rpm
Preparing...                ########################################### [100%]
   1:percona-release        ########################################### [100%]
[root@ip-10-0-1-220 ravi]# yum install percona-toolkit
Loaded plugins: auto-update-debuginfo, priorities, update-motd, upgrade-helper
1123 packages excluded due to repository priority protections
Resolving Dependencies
--> Running transaction check
---> Package percona-toolkit.noarch 0:2.2.18-1 will be installed
--> Processing Dependency: perl(DBD::mysql) >= 1.0 for package: percona-toolkit-2.2.18-1.noarch
--> Processing Dependency: perl(DBI) >= 1.13 for package: percona-toolkit-2.2.18-1.noarch
--> Running transaction check
---> Package perl-DBD-MySQL55.x86_64 0:4.023-5.23.amzn1 will be installed
---> Package perl-DBI.x86_64 0:1.627-4.8.amzn1 will be installed
--> Processing Dependency: perl(RPC::PlClient) >= 0.2000 for package: perl-DBI-1.627-4.8.amzn1.x86_64
--> Processing Dependency: perl(RPC::PlServer) >= 0.2001 for package: perl-DBI-1.627-4.8.amzn1.x86_64
--> Running transaction check
---> Package perl-PlRPC.noarch 0:0.2020-14.7.amzn1 will be installed
--> Processing Dependency: perl(Net::Daemon) >= 0.13 for package: perl-PlRPC-0.2020-14.7.amzn1.noarch
--> Processing Dependency: perl(Net::Daemon::Test) for package: perl-PlRPC-0.2020-14.7.amzn1.noarch
--> Processing Dependency: perl(Net::Daemon::Log) for package: perl-PlRPC-0.2020-14.7.amzn1.noarch
--> Running transaction check
---> Package perl-Net-Daemon.noarch 0:0.48-5.5.amzn1 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

==============================================================================================
 Package               Arch        Version                  Repository                   Size
==============================================================================================
Installing:
 percona-toolkit       noarch      2.2.18-1                 percona-release-noarch      1.7 M
Installing for dependencies:
 perl-DBD-MySQL55      x86_64      4.023-5.23.amzn1         amzn-main                   149 k
 perl-DBI              x86_64      1.627-4.8.amzn1          amzn-main                   855 k
 perl-Net-Daemon       noarch      0.48-5.5.amzn1           amzn-main                    58 k
 perl-PlRPC            noarch      0.2020-14.7.amzn1        amzn-main                    39 k

Transaction Summary
==============================================================================================
Install  1 Package (+4 Dependent packages)

Total download size: 2.7 M
Installed size: 4.1 M
Is this ok [y/d/N]: y
Downloading packages:
warning: /var/cache/yum/x86_64/latest/percona-release-noarch/packages/percona-toolkit-2.2.18-1.noarch.rpm: Header V4 DSA/SHA1 Signature, key ID cd2efd2a: NOKEY
Public key for percona-toolkit-2.2.18-1.noarch.rpm is not installed
(1/5): percona-toolkit-2.2.18-1.noarch.rpm                             | 1.7 MB     00:01     
(2/5): perl-DBD-MySQL55-4.023-5.23.amzn1.x86_64.rpm                    | 149 kB     00:00     
(3/5): perl-DBI-1.627-4.8.amzn1.x86_64.rpm                             | 855 kB     00:00     
(4/5): perl-Net-Daemon-0.48-5.5.amzn1.noarch.rpm                       |  58 kB     00:00     
(5/5): perl-PlRPC-0.2020-14.7.amzn1.noarch.rpm                         |  39 kB     00:00     
----------------------------------------------------------------------------------------------
Total                                                         1.3 MB/s | 2.7 MB  00:00:02     
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Percona
Importing GPG key 0xCD2EFD2A:
 Userid     : "Percona MySQL Development Team <mysql-dev@percona.com>"
 Fingerprint: 430b df5c 56e7 c94e 848e e60c 1c4c bdcd cd2e fd2a
 Package    : percona-release-0.1-3.noarch (@/percona-release-0.1-3.noarch)
 From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-Percona
Is this ok [y/N]: y
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : perl-Net-Daemon-0.48-5.5.amzn1.noarch                                      1/5 
  Installing : perl-PlRPC-0.2020-14.7.amzn1.noarch                                        2/5 
  Installing : perl-DBI-1.627-4.8.amzn1.x86_64                                            3/5 
  Installing : perl-DBD-MySQL55-4.023-5.23.amzn1.x86_64                                   4/5 
  Installing : percona-toolkit-2.2.18-1.noarch                                            5/5 
  Verifying  : percona-toolkit-2.2.18-1.noarch                                            1/5 
  Verifying  : perl-DBD-MySQL55-4.023-5.23.amzn1.x86_64                                   2/5 
  Verifying  : perl-PlRPC-0.2020-14.7.amzn1.noarch                                        3/5 
  Verifying  : perl-Net-Daemon-0.48-5.5.amzn1.noarch                                      4/5 
  Verifying  : perl-DBI-1.627-4.8.amzn1.x86_64                                            5/5 

Installed:
  percona-toolkit.noarch 0:2.2.18-1                                                           

Dependency Installed:
  perl-DBD-MySQL55.x86_64 0:4.023-5.23.amzn1       perl-DBI.x86_64 0:1.627-4.8.amzn1          
  perl-Net-Daemon.noarch 0:0.48-5.5.amzn1          perl-PlRPC.noarch 0:0.2020-14.7.amzn1      

Complete!

If you want to install via RPM go to following link and download the latest version  and install via rpm -ivh package name.

How to setup AWS RDS CLI

AWS provides the its CLI tools but few of RDS functionalities don't work on them so in order to make them work AWS RDS CLI is very helpful.

Download the RDS CLI:
[root@server downloads]# wget http://s3.amazonaws.com/rds-downloads/RDSCli.zip

Unzip the downloaded file and copy it in desired location:
[root@server downloads]# unzip RDSCli.zip
[root@server downloads]# cp -r RDSCli-1.19.004 /opt/aws/apitools/rds
[root@server downloads]# cd /opt/aws/apitools/rds/bin

Check RDS CLI version:
[root@server bin]# ./rds-version 
Relational Database Service CLI version 1.19.004 (API 2014-10-31)

These commands can be added in system environment so you can run them from anywhere:
[root@server bin]# export PATH=/sbin:/bin:/usr/sbin:/usr/bin:/opt/aws/apitools/rds/bin:/usr/local/bin

The credential file is also need to be created so that these commands can be run taking permissions in to consideration from that file and file can be added in system environment so we don't need to pass every time in command.
[root@server  rds]# cat credential
AWSAccessKeyId=AKIXXXXXXXXXXXXXXXSYA
AWSSecretKey=FeIXXXXXXXXXXXXXXXXXXXXXXXX06BB
[root@server  rds]# export AWS_CREDENTIAL_FILE=/opt/aws/apitools/rds/credential

If you don't want to add credentials in environment variable than can be passed in command it self with following parameter followed by the path of credentials file: --aws-credential-file.

Wednesday, August 10, 2016

Script to add logs in Logentires in case of Shared hosting Web Server.

Logentries is a very good tool to store and analyze logs in central location but when we are storing logs from a  Nginx/Apache shared hosting environment it gets complex as we need to tag each log to which host it belong. I am using rsyslog to forward to send my logs to Logentries as it gives me more flexibility as all rsyslog functionality works.

First need to create a main configuration file which we will use to create corresponding rsyslog files. It will have your Logentries secret key to whom log need to be followed.

For access log:
[root@ip-10-0-1-220 ravi]# cat access-vanila 
$Modload imfile

$InputFileName access-log-location
$InputFileTag access-tag
$InputFileStateFile filestate-tag
$InputFileSeverity info
$InputFileFacility local7
$InputRunFileMonitor

# Only entered once in case of following multiple files
$InputFilePollInterval 1

$template filestate-tag,"6fb8xxxxxxxxxxxxxxxxxxxxxxe8ed %HOSTNAME% %syslogtag% %msg%\n"
if $programname == 'access-tag' then @@data.logentries.com:10000;filestate-tag
& ~

For error log:
[root@ip-10-0-1-220 ravi]# cat error-vanila 
$Modload imfile

$InputFileName error-log-location
$InputFileTag error-tag
$InputFileStateFile filestate-tag
$InputFileSeverity info
$InputFileFacility local7
$InputRunFileMonitor

# Only entered once in case of following multiple files
$InputFilePollInterval 1

$template filestate-tag,"4f71xxxxxxxxxxxxxxxxxxxxxxx138 %HOSTNAME% %syslogtag% %msg%\n"
if $programname == 'error-tag' then @@data.logentries.com:10000;filestate-tag
& ~

Now use the following script to create rsyslog configurations to send logs to Logentries.
[root@ip-10-0-1-220 ravi]# cat logscript.sh 
#!/bin/bash
#Script to add hosts to Logentries
#By Ravi Gadgil

#Path where nginx hosts configurations are placed /etc/nginx/sites-enabled/sites/
for j in `ls /etc/nginx/sites-enabled/sites/`; do cat /etc/nginx/sites-enabled/sites/$j | grep -m 1 access; cat /etc/nginx/sites-enabled/sites/$j | grep -m 1 error ; done | uniq  | grep 'teamieapp\|theteamie' > /home/ravi/data.txt

#Creating files having entries of access and error log, if want to avoid any log place instead of avoid in grep command.
cat data.txt | grep access.log | grep -v 'avoid' | awk '{ print $2 }' | cut -d';' -f1 > /home/ravi/accessfiles.txt
cat data.txt | grep error.log | grep -v 'avoid' | awk '{ print $2 }' | cut -d';' -f1 > /home/ravi/errorfiles.txt

#To create unique Filestate Tag in rsyslog.
COUNTER=50

#To create access log entries.
for i in `cat /home/ravi/accessfiles.txt`
do
logfileaccess=$( echo -e "$i" )
echo -e "Access Log file is : $logfileaccess"

accesstag=$(echo -e $logfileaccess | cut -d'/' -f5 | sed 's/.log//g' | sed "s/_/-/g" | sed "s/\./-/g")
echo -e "Access Tag is : $accesstag"

COUNTER=$[$COUNTER +1]

filestate=$(echo -e "nginx$COUNTER")
echo -e "File state is : $filestate"

cp /home/ravi/access-vanila /home/ravi/tempconf
sed -i "s#access-log-location#$logfileaccess#g" /home/ravi/tempconf
sed -i "s/access-tag/$accesstag/g" /home/ravi/tempconf
sed -i "s/filestate-tag/$filestate/g" /home/ravi/tempconf
mv /home/ravi/tempconf /home/ravi/conf/$accesstag.conf

done

#To create error log entries.
for i in `cat /home/ravi/errorfiles.txt`
do

logfileerror=$( echo -e "$i" )
echo -e "Error Log file is : $logfileerror"

errortag=$(echo -e $logfileerror | cut -d'/' -f5 | sed 's/.log//g' | sed "s/_/-/g" | sed "s/\./-/g")
echo -e "Error Tag is : $errortag"

COUNTER=$[$COUNTER +1]

filestate=$(echo -e "nginx$COUNTER")
echo -e "File state is : $filestate"

cp /home/ravi/error-vanila /home/ravi/tempconf
sed -i "s#error-log-location#$logfileerror#g" /home/ravi/tempconf
sed -i "s/error-tag/$errortag/g" /home/ravi/tempconf
sed -i "s/filestate-tag/$filestate/g" /home/ravi/tempconf
mv /home/ravi/tempconf /home/ravi/conf/$errortag.conf

done

Note:
1. Your log format should be in site_access.log and site_error.log if not in this format do adjust in script.
2. Script was working in /home/ravi directory so adjust script according to your paths.
3. Once all configurations are created add them to your rsyslog directory and restart service.
4. Rsyslog can only forward 100 files so do keep that in mind and check /var/log/messages for
 any errors if any.


Friday, May 27, 2016

How to install python2.7 with pip2.7

Python is one of the most famous and powerful languages used so in order to install or update it to 2.7 version following steps can be used.


Installing the Python2.7.
[root@ip-10-0-1-55 ~]# yum install python27 python27-devel
[root@ip-10-0-1-55 ~]# python --version
Python 2.7.10

If its still showing older version add the new version as default.
[root@ip-10-0-1-55 ~]# alternatives --config python

There are 2 programs which provide 'python'.
 + 1           /usr/bin/python2.6
*  2           /usr/bin/python2.7

Enter to keep the current selection[+], or type selection number: 2
[root@ip-10-0-1-55 ~]# python --version
Python 2.7.10

Installing the pip2.7.
[root@ip-10-0-1-55 ~]# wget https://bootstrap.pypa.io/get-pip.py
--2016-05-26 11:10:33--  https://bootstrap.pypa.io/get-pip.py
Resolving bootstrap.pypa.io (bootstrap.pypa.io)... 103.245.222.175
Connecting to bootstrap.pypa.io (bootstrap.pypa.io)|103.245.222.175|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1524722 (1.5M) [text/x-python]
Saving to: ‘get-pip.py’

100%[=====================================================================>] 1,524,722   --.-K/s   in 0.09s   

2016-05-26 11:10:33 (16.2 MB/s) - ‘get-pip.py’ saved [1524722/1524722]
[root@ip-10-0-1-55 ~]# python2.7 get-pip.py
Collecting pip
  Downloading pip-8.1.2-py2.py3-none-any.whl (1.2MB)
    100% |████████████████████████████████| 1.2MB 675kB/s 
Collecting wheel
  Downloading wheel-0.29.0-py2.py3-none-any.whl (66kB)
    100% |████████████████████████████████| 71kB 7.1MB/s 
Installing collected packages: pip, wheel
Successfully installed pip-8.1.2 wheel-0.29.0

[root@ip-10-0-1-55 dist-packages]# which pip2.7
/usr/bin/pip2.7

Installing dependencies or packages from pip2.7.
[root@ip-10-0-1-55 ~]# pip2.7 install asciitree
Collecting asciitree
  Downloading asciitree-0.3.1.tar.gz
Building wheels for collected packages: asciitree
  Running setup.py bdist_wheel for asciitree ... done
  Stored in directory: /root/.cache/pip/wheels/10/14/df/88531e6ba23be75397d69921e580464f2850b6f45e982ac644
Successfully built asciitree
Installing collected packages: asciitree
Successfully installed asciitree-0.3.1


How to create and remove swap partition in Linux

If our server is having memory issues and we want to increase it without updating the physical RAM than Swap is a very good option. It's slower than the physical RAM but can do the tasks also if created on faster hard disks the results are good.

Create a Swap partition in place where you wanna create it. I am creating it in /swap with 2GB of size.
[root@ip-10-0-1-38 /]# dd if=/dev/zero of=/swap bs=1M count=2048
2048+0 records in
2048+0 records out
2147483648 bytes (2.1 GB) copied, 54.8004 s, 39.2 MB/s

Update the permissions of /swap partition to 600.
[root@ip-10-0-1-38 /]# swapon /swap 
swapon: /swap: insecure permissions 0644, 0600 suggested.
[root@ip-10-0-1-38 /]# chmod 600 /swap 

Start the Swap on /swap partition.
[root@ip-10-0-1-38 /]# swapon /swap 

To check if swap has started or not.
[root@ip-10-0-1-38 /]# swapon -s
Filename                                Type            Size    Used    Priority
/swap                                   file    2097148 0       -1

[root@ip-10-0-1-38 /]# free -m
             total       used       free     shared    buffers     cached
Mem:          3752       2353       1399          0         39       2184
-/+ buffers/cache:        128       3624
Swap:         2047          0       2047

Add the entry in /etc/fstab so that swap can start on server boot.
/swap swap swap defaults 0 0

If in case you face following error stop and start of swap can solve the issue.
[root@ip-10-0-1-38 /]# swapon /swap 
swapon: /swap: swapon failed: Device or resource busy

[root@ip-10-0-1-38 /]# swapoff /swap 
[root@ip-10-0-1-38 /]# swapon /swap
[root@ip-10-0-1-38 /]# free -m
             total       used       free     shared    buffers     cached
Mem:          3752       2353       1399          0         39       2184
-/+ buffers/cache:        128       3624
Swap:         2047          0       2047

In order to remove swap partition following steps can be used.
[root@ip-10-0-1-38 ec2-user]# swapoff /swap
[root@ip-10-0-1-38 ec2-user]# rm -rf /swap 


Thursday, May 26, 2016

How to install SyntaxNet in Linux

SyntaxNet is an open-source neural network framework for TensorFlow that provides a foundation for Natural Language Understanding (NLU) systems.
In order to install it in Linux servers following steps can be used..

It requires Python 2.7 so if you don't have that install the same.
[root@ip-10-0-1-55 ~]# yum install python27 python27-devel
[root@ip-10-0-1-55 ~]# python --version
Python 2.7.10

If its still showing older version add the new version as default.
[root@ip-10-0-1-55 ~]# alternatives --config python

There are 2 programs which provide 'python'.
 + 1           /usr/bin/python2.6
*  2           /usr/bin/python2.7

Enter to keep the current selection[+], or type selection number: 2
[root@ip-10-0-1-55 ~]# python --version
Python 2.7.10

Install the java1.8 version.
[root@ip-10-0-1-55 ~]# yum install java-1.8.0-openjdk*

If old java version is showing up update it via following command.
[root@ip-10-0-1-55 ~]# alternatives --config java

Make sure that your java home is pointing to java directory where javac is placed else it will show the java not found error. In my case it was placed in /usr/lib/jvm/java-1.8.0-openjdk.x86_64/ so updated it to that location.
[root@ip-10-0-1-55 ~]# export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk.x86_64/[root@ip-10-0-1-55 ~]# echo $JAVA_HOME/usr/lib/jvm/java-1.8.0-openjdk.x86_64/
[root@ip-10-0-1-55 ~]# java -version
openjdk version "1.8.0_91"
OpenJDK Runtime Environment (build 1.8.0_91-b14)
OpenJDK 64-Bit Server VM (build 25.91-b14, mixed mode)

Installing the bazel. As I am installing the Linux version so taking the executable from here.
[root@ip-10-0-1-55 ~]# wget https://github.com/bazelbuild/bazel/releases/download/0.2.2b/bazel-0.2.2b-installer-linux-x86_64.sh
[root@ip-10-0-1-55 ~]# chmod +x bazel-0.2.2b-installer-linux-x86_64.sh [root@ip-10-0-1-55 ~]# ./bazel-0.2.2b-installer-linux-x86_64.sh 

Installing the swig package.
[root@ip-10-0-1-55 ~]# yum install swig

If your using the python2.7 than you need to install python packages using the pip2.7 as well so first we need to add that. If your not using python2.7 normal pip install will work fine.
[root@ip-10-0-1-55 ~]# wget https://bootstrap.pypa.io/get-pip.py
--2016-05-26 11:10:33--  https://bootstrap.pypa.io/get-pip.py
Resolving bootstrap.pypa.io (bootstrap.pypa.io)... 103.245.222.175
Connecting to bootstrap.pypa.io (bootstrap.pypa.io)|103.245.222.175|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1524722 (1.5M) [text/x-python]
Saving to: ‘get-pip.py’

100%[=====================================================================>] 1,524,722   --.-K/s   in 0.09s   

2016-05-26 11:10:33 (16.2 MB/s) - ‘get-pip.py’ saved [1524722/1524722]
[root@ip-10-0-1-55 ~]# python2.7 get-pip.py
Collecting pip
  Downloading pip-8.1.2-py2.py3-none-any.whl (1.2MB)
    100% |████████████████████████████████| 1.2MB 675kB/s 
Collecting wheel
  Downloading wheel-0.29.0-py2.py3-none-any.whl (66kB)
    100% |████████████████████████████████| 71kB 7.1MB/s 
Installing collected packages: pip, wheel
Successfully installed pip-8.1.2 wheel-0.29.0

[root@ip-10-0-1-55 dist-packages]# which pip2.7
/usr/bin/pip2.7

Install the required packages protobuf, asciitree, numpy.
[root@ip-10-0-1-55 ~]# pip2.7 install -U protobuf==3.0.0b2
Collecting protobuf==3.0.0b2
  Downloading protobuf-3.0.0b2-py2.py3-none-any.whl (326kB)
    100% |████████████████████████████████| 327kB 2.2MB/s 
Collecting six>=1.9 (from protobuf==3.0.0b2)
  Downloading six-1.10.0-py2.py3-none-any.whl
Collecting setuptools (from protobuf==3.0.0b2)
  Downloading setuptools-21.2.1-py2.py3-none-any.whl (509kB)
    100% |████████████████████████████████| 512kB 1.6MB/s 
Installing collected packages: six, setuptools, protobuf
  Found existing installation: six 1.8.0
    Uninstalling six-1.8.0:
      Successfully uninstalled six-1.8.0
  Found existing installation: setuptools 12.2
    Uninstalling setuptools-12.2:
      Successfully uninstalled setuptools-12.2
Successfully installed protobuf-3.0.0b2 setuptools-21.2.1 six-1.10.0
[root@ip-10-0-1-55 ~]# pip2.7 install asciitree
Collecting asciitree
  Downloading asciitree-0.3.1.tar.gz
Building wheels for collected packages: asciitree
  Running setup.py bdist_wheel for asciitree ... done
  Stored in directory: /root/.cache/pip/wheels/10/14/df/88531e6ba23be75397d69921e580464f2850b6f45e982ac644
Successfully built asciitree
Installing collected packages: asciitree
Successfully installed asciitree-0.3.1
[root@ip-10-0-1-55 ~]# pip2.7 install numpy
Collecting numpy
  Downloading numpy-1.11.0-cp27-cp27mu-manylinux1_x86_64.whl (15.3MB)
    100% |████████████████████████████████| 15.3MB 48kB/s 
Installing collected packages: numpy
Successfully installed numpy-1.11.0
[root@ip-10-0-1-55 ~]# pip freeze | grep protobuf
protobuf==3.0.0b2
[root@ip-10-0-1-55 ~]# pip freeze | grep numpy
numpy==1.11.0
[root@ip-10-0-1-55 ~]# pip freeze | grep asciitree
asciitree==0.3.1



Building the SyntaxNet from Git.
[root@ip-10-0-1-55 ~]# git clone --recursive https://github.com/tensorflow/models.git 
[root@ip-10-0-1-55 ~]# cd models/syntaxnet/tensorflow 
[root@ip-10-0-1-55 ~]# ./configure 
[root@ip-10-0-1-55 ~]# cd .. 
[root@ip-10-0-1-55 ~]# bazel test syntaxnet/... util/utf8/...

Testing the installation.
[root@ip-10-0-1-55 ~]# echo 'Ravi' | syntaxnet/demo.sh