Wednesday, September 20, 2017

VPS Dedicated Server Configuration

Server configuration is not an easy task. If anyone want to research or use any VPS dedicated server management for their internal or remote company, they need to learn LINUX commands or server management shell commands.

sudo su
sudo rm -rf tv_bn_site_production
sudo chown -R sysadm:sysadm tv_bn_site
sudo chown sysadm:sysadm php.ini
sudo chown www-data:www-data bplpoint.txt

ssh root@23.92.73.121
ssh -p 10222 sysadm@109.16.74.114

There are some database related command which may help anyone interested based on there need.
mysql -u root -pS@r85#a9vw
SHOW DATABASES;
show processlist;
sudo service apache2 stop;
sudo service mysql stop;
TRUNCATE TABLE news_hits_counter;

create database tvonline_jobs;
grant all privileges on tvonline_jobs.* to 'tvjobs'@'localhost' identified by "Zero2017Cool";
flush privileges;

grant insert, update, select on tvonline_jobs.* to 'tvjobs'@'10.243.205.35' identified by "Zero2017Cool";
grant insert, update, select on tvonline_jobs.* to 'tvjobs'@'10.243.205.34' identified by "Zero2017Cool";
flush privileges;

/etc/apache2/sites-available
ls -l

Here is some import and export related issue to solve the needs.
gzip -dc < /var/www/tvdocs/databases/tvonline_en_video_production.gz | mysql -u tvonline -pZero705001Cool tvonline_en_video

mysql -u root -p tvonline_website < D:\nayeem\DatabaseBackupMay2016\tvonline_website_production.sql

There is a technique for tracing the error log by using the following command:
sudo tail -f /var/log/mysql/mysql-slow.log

Source Code versioning Control using Git command for repository

Source code versioning is important feature for developing big project. There are some technique to run the git commands.
git initial access for the new developer to access the remote repository
===============================
git config --global user.name "Khurshed Alam Nayeem"
git config --global user.email "csenayeem025@gmail.com"
git config --global core.editor "'C:/Program Files (x86)/Notepad++/notepad++.exe' -multiInst -nosession"
git config user.name
git config user.email
git clone https://username:password@github.com/evigtsaf/fast-give.git/ fastgive
===============================
Using git, add remote repository in the local operating system by following the commands.
===============================
git remote -v
git remote rm origin
git remote add staging https://username:password@github.com/tvbd/tv_bn_web_staging.git tv_bn_web_staging
git fetch staging master
git pull staging master
===============================
git remote add production https://username:password@github.com/tvbd/tv_bn_web_production.git tv_bn_web_production
git fetch production master
git pull production master
Working in the different brunch by following git commands
===============================
git checkout -b nayeem    //create brunch
git checkout -b development origin/development
git branch -a // list of all branch
git checkout newconversica
git branch nayeem
git checkout master
git merge nayeem
git push origin master
==============================
git status
git pull production master
git stash/pull/stash pop
git add .
git add -A
git commit -m 'fixed some code'
git push production master
==============================
git reset --hard
==============================
ctrl+O-------ctrl+C----------ctrl+X
==============================
/*======working in master=========*/
git stash  // save local copy
git pull origin master
git stash pop            // merge local & server
git add .
git commit -m 'initial project version'
git push origin master
=======Before BDCOM========
git init
git add .
git commit -m "Initial commit"
git remote add origin https://username:password@github.com/tvbd/tv_bn_site_production.git
git push origin master
==================================
git push origin master --force
rm -f ./.git/index.lock
git --version
git push -f origin master:master

Design Pattern and Opject Oriented Programming

Design pattern is the methodology or technique for Object oriented programming. There are more then 20 methods of design pattern.

There are thousands of programmer in the word who are research on design pattern techniques. University researcher also learn about the design pattern and object oriented programming. Design pattern makes the life easy and robust the code for the programmers. We should follow the rules and technique to use in the projects.

Singleton is one of the technique which is more usable for good developers. Like singleton, there are more rule in object oriented programming. Today's world, there are lot of CMS (Content Management System) or framework for build a projects. Different CMS use different design pattern technique based on their requirements or need.

A good developer should know about the design pattern techniques. Like Magento CMS, there are used more then 15 design pattern techniques. One call can return whole object for reuse the data following design pattern and OOP concepts. It reduce the query to build the structural code base CMS.

So, following the OOP concept one can reduce the lines of code to become smaller in size of code. Another way of reducing the complexity to follow the structural way of contents or folders. Because structural code can reduce the complexity to other for understand the developed application.

Core Features of Object Oriented Programming

Encapsulation:

* It links code and data together.
* It provides information hiding
* It is achieved through object that contains same data and the functions to manipulate them
* It provides certain level of security to the data

Inheritance:

* It supports the concept of reuse-ability
* Using inheritance we can create a general class that defines common properties. This class may be then inherited by other more specific classes each adding only those things that are unique to the inheriting class
* A class that is inherited is known as base class/supper class
* A class that does inheriting is known as derived class/sub class

Polymorphysm:

* It is a mechanism that allows one interface to be used implement a number of task.
* The specific action is determine by exact nature of the situation by the compiler