Saturday, March 7, 2020

rsync -rv uploads_old/ uploads

rsync -rv uploads_old/ uploads


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

Saturday, January 18, 2020

Display Center | Start your fashion business | Apna Fashion ka Karobar S...





Be your own boss. Apna fashion ka karobar shroo krain. Display center pr display area book krain pooray mahiny k liye sirf 2000 se 15000 mai. KHAS, Opposite Soldier Plaza, Civil Lines, Jhelum.
http://www.displaycenter.pk/
http://www.displaycenter.pk/pdf/Displ...

Sell with minimum Risk and maximum Growth
Zero Commission and Total Control
Every rupee you earn is yours




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

Friday, January 22, 2016

Vagrant for the beginners ... Tutorial.



Vagrant is a higher level wrapper around different virtualization and configuration management software.

Virtualization Software:
  1. VirtualBox, 
  2. VMware, 
  3. KVM and 
  4. Linux Containers (LXC)
Configuration Management Software:
  1. Ansible, 
  2. Chef, 
  3. Salt, and 
  4. Puppet.

Deploy your uniform environment on any virtual platform. For example, you may deploy with vagrant on Amazon Cloud or Virtual Box  with same environment without any hassle. As a best practice, push vagrant file in the version control repository so that others can benefit without any upfront work.

vagrant init

vagrant box add hashicorp/precise64
 
 

The box add command creates a box from the image "hashicorp/precise64". The box name consists of 2 parts;  is username and  is box name.


Vagrant.configure("2") do |config|
  config.vm.box = "hashicorp/precise64"
end 
 
 
vagrant up
 
 


We see there is an error in mounting and syncing the directories. The issue is fixed by upgrading to virtual box 5.0.14

We will not be able to see anything since Vagrant runs VM without any user-interface. To check if its running, we can SSH it.

vagrant ssh




SSH failed since SSH client is not installed. We will use Putty to SSH the virtual machine. Import the private key to puttygen and save .ppk file.

Now we can connect to box using putty.

vagrant reload --provision

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

Monday, September 21, 2015

Automating Build and Deployment of PHP Applications



Download Jenkins for Windows from http://jenkins-ci.org/;

Unzip the Jenkins.zip file in to setup files.

Install Jenkins.

Run command line.

Make sure that java is installed and its path is set.

To start Jenkins, please run this command.

java -jar jenkins.war
https://wiki.jenkins-ci.org/display/JENKINS/Starting+and+Accessing+Jenkins
 
Open in browser, using the following URL.
 
http://localhost:8080/ 




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

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...

Wednesday, November 6, 2013

netmon

netmon

/etc/init.d/mysql restart

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

Monday, September 16, 2013

Setting UP Apache2, MySQL and PHP5 machine on Google Compute Engine

In my case, i am using f1-micro Debian instance.  

First download gcutil

then use this link to install the servers.
https://www.digitalocean.com/community/articles/how-to-install-linux-apache-mysql-php-lamp-stack-on-debian

then create a rule in firewall using gcutil
gcutil addfirewall http2 --description="Incoming http allowed." --allowed="tcp:http"
https://developers.google.com/compute/docs/quickstart

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

Friday, September 13, 2013

Apache Bechmarking (ab)

I am using Ubuntu 12.04. First, install ab
sudo apt-get install apache2-utils



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

Friday, July 26, 2013

Some useful php scripts

Some useful php scripts
https://github.com/lornajane/PHP-Web-Services
I hope it helped. Feel free to comment...

Thursday, July 4, 2013

Extract .tar unbuntu/linux terminal

tar -xvf filename.tar

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

Tuesday, June 18, 2013

Import / Export MySQL Database using Ubuntu terminal

To import .sql file into MySQL database
mysql -u mysql_user -p dabase_name < /path/import_file_name.sql
It will ask for the password, enter the mysql password and your sql script will be executed.

To export a database and gzip it, use
mysqldump -h localhost -u mysql_user -pMysql_password database_name | gzip > /path/export_file_name_$(date +%m-%d-%Y).sql.gz
$(date +%m-%d-%Y) is optional. It inserts today's date in the file name. You can also use this export command without   $(date +%m-%d-%Y)

 mysqldump -h localhost -u mysql_user -pMysql_password database_name | gzip > /path/export_file_name_$(date +%m-%d-%Y).sql.gz

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

Friday, June 7, 2013

check memory ubuntu terminal

 egrep --color 'Mem|Cache|Swap' /proc/meminfo

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

Thursday, June 6, 2013

Extract sql.gz file from ubuntu terminal


 gzip -d file.sql.gz

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

Tuesday, June 4, 2013

Linux useful 20 tools

http://www.cyberciti.biz/tips/top-linux-monitoring-tools.html

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

Tuesday, May 28, 2013

Download a file using terminal in Linux

 wget "http://downloads.bitnami.com/files/stacks/lampstack/5.3.25-0/bitnami-lampstack-5.3.25-0-linux-x64-installer.run"

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

Monday, December 17, 2012

Installing OpenSSH Server on Ubuntu 12.04


sudo apt-get install openssh-server

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