Sunday, April 27, 2014

Auto-Code Deployment on Production Servers Using GIT

sudo apt-get install git

git --git-dir=/home/ubuntu/git/oneworldbox-stb-api/.git --work-tree=/var/www/ init

git --git-dir=/home/ubuntu/git/oneworldbox-stb-api/.git clean -df & git checkout .

git --git-dir=/home/ubuntu/git/oneworldbox-stb-api/.git pull

pulls the contents in the current directory in  which you are.

git --git-dir=/home/ubuntu/git/oneworldbox-stb-api/.git --work-tree=/var/www/ pull

code is pulled in the --work-tree directory. But there is still one issue, it asks for username and password which is entered manually.

git --git-dir=/home/ubuntu/git/oneworldbox-stb-api/.git config credential.helper store

To store credentials in a file on disk, by default stored at ~/.git-credentials

We can set credentials file path by following
git --git-dir=/home/ubuntu/git/oneworldbox-stb-api/.git config credential.helper store=<path>

git remote set-url origin http://username:password@gitlab.jemtv.com/oneworldbox-stb-api.git

I hope it helped. Feel free to comment...

Tuesday, April 8, 2014

ab - staging

 $ ab -n 1000 -c 5 http://baseurl/qa.php/2_4/gxml/tier1/2/0/0/cc/device_id
Where,
  • -n 1000: ab will send 1000 number of requests to server 202.54.200.1 in order to perform for the benchmarking session
  • -c 5 : 5 is concurrency number i.e. ab will send 5 number of multiple requests to perform at a time to server 202.54.200.1
----------------------
staging
-----------------------
[Tue Apr 08 15:12:29 2014] [info] server seems busy, (you may need to increase StartServers, or Min/MaxSpareServers), spawning 32 children, there are 1 idle, and 205 total children

------------------------
HA-Proxy
------------------------
Apr  8 14:45:55 ip-10-11-144-86 rsyslogd-2177: imuxsock begins to drop messages from pid 19954 due to rate-limiting

I hope it helped. Feel free to comment...

Friday, February 28, 2014

Create a ppk file from a pem file


1) Download and Install PuTTY. Run PuTTYgen;

 2) Import the .pem file into the PuTTYgen from Conversions->Import Key menu.

3) Change the key-comments. [These key comments appear when we connect to instance using .ppk.]

4) Create a pass-phrase if you want an additional level of security. This is asked when you connect to the instance.

5) Click on Save Private Key.

 6) Use the key to connect to the instance now.



I hope it helped. Feel free to comment...