Tuesday, October 10, 2017

e-Commerce using woocommerce integration with master card or paypal

What makes an e-commerce platform?
While you can sell items through some integrations online with payment processing services, the ability to take a credit card and provide a transaction doesn’t mean that the solution is an e-commerce solution. E-commerce solutions have the following key features:
·       Product pages that provide multiple views and levels of product specifications, along with dynamic pricing capabilities and quantity adjustments.
·       Shopping cart — a page or object that contains all of the items added during the shopping session. Users can update quantities or delete items.
·       Checkout page — a conversion point where users can provide payment information and submit an order for fulfillment.
·       Account pages — the ability for a customer to set up an account, view orders, and manage pertinent contact, delivery and payment information.
·       Payment integration — the ability to accept and process credit card data, or integrate with a system like PayPal, Amazon Payments or Stripe that provides that service.
The WooCommerce eCommerce plugin for WordPress is an excellent choice for anyone who wants to build an online store with minimal effort and expense. The plugin makes setting up and managing an online store with WordPress much less daunting than you might imagine, and includes many great features to make your life easier.

PayPal Advanced

The PayPal Advanced extension adds a seamless integration with this payment gateway to your website, allowing your customers to enter their payment details right on your site, without leaving our store. 
This creates a much more professional impression for your online store as opposed to sending them offsite to enter their details. Customers don’t need a PayPal account to make a payment via this option.
You will need a PayPal Advanced Payments account and an SSL certificate to make the most of the features of this extension, but it will simplify PCI compliance, and allow your visitors to stay on site during the check out. 
Setting up the extension is pretty straightforward and can be done using the familiar WordPress and WooCommerce user interface.
Thankfully, WooCommerce also supports many other payment gateways, which means your eCommerce store can make use of the other options already out there. Also, while WooCommerce does support PayPal standard payments out of the box, this does involve sending the customer to the PayPal website to enter their payment details. 


Singleton Programming Design Pattern

What is the Singleton design pattern?

The concpet of restricting the instantiation of the a class to only and only to one object is called Singleton. As name suggests, it will restrict to create only one instance of a class. The calss will have a logic in place which will deny if the application will ask for more than one instance.

 

Code Lines

Let’s try to understand with an example:
We have an application which will bring the pay stub of an employee for current month. In a standarad system, there will be only one active salary account for the employee with the company. Because of this fact, we should only create one object of the employee’s salary account. In program, we are creating this object in a loop. So, what happens if we don’t have a design pattern which will restrict it to create more than one object. Application will create, rather overwrite an instance of the class.


Advantages


Accessibility


The most obvious advantage of the singleton pattern is accessibility. Consider the UIApplication class as an example. By importing the UIKit framework, the UIApplication singleton is accessible from anywhere in your project. Take a look at the following example of a UIViewController subclass.

Disadvantages


Global State


By creating a singleton, you're essentially creating global state. It's important that you're aware of this. A few years ago, Miško Hevery wrote a great article about the singleton pattern in which he explains why the pattern should be avoided. Miško emphasizes that global state is the main reason why singletons are harmful.

Dealing With Multithreading 

In the Android system, you can spin off multiple threads to perform different tasks. These threads can end up executing the same code block simultaneously. In the case of the Singleton class above, this could lead to the creation of multiple object instances, which violates the contract of a Singleton. So our Singleton code snippet method getInstance() is not thread safe. We'll now look at ways to make it thread safe.

A Singleton is an elegant way of maintaining global state, but we should always question whether we need global state. Singleton pattern offers several advantages over global variables because it does the following:

1.    Enforces that only one instance of the class can be instantiated.

2.    Allows control over the allocation and destruction of the object.

3.    Provides thread-safe access to the object's global state.

4.    Prevents the global namespace from being polluting.


Friday, October 6, 2017

Blue Whale Game

The Blue Whale Challenge and what it means
In this age of online gaming, it is not always possible to understand the implications of a
particular game when you begin to play it. We have always been aware of the dangers
inherent in online games, but so far, they have been restricted to possibilities of imbibing
violent behavior and warped understanding of reality. Today, however, things have changed
a lot; we have been exposed to implications that are greater and far more dangerous than
anything we have known or seen so far. The world has come to be aware of the Blue Whale
Challenge, an online ‘game’ that is being linked to deaths by suicide of scores of teenagers
and young adults around the world.

What is the Challenge?
The Blue Whale Challenge is reportedly an online ‘game’ that requires its players to perform
certain tasks, many of which involve self-mutilation and other dangerous activities. The final
task of this challenge requires committing suicide. Needless to say, this game has attracted
the attention of authorities across the globe, as almost twenty countries have been affected
by the same. The game attract mostly teenagers and young adults, people who are more
susceptible to online influences, and attempts to create an air of unworthiness and
uselessness around them. Some reports have surfaced that claims the game requires the
player to submit sensitive data before commencing, which the administrators then use to
blackmail the players in case they try to back out of the game. The veracity of this claim has
not yet been confirmed, but it has also given rise to the rumor that downloading the fame
injects malware into the system that infects files and steals sensitive data.

Budeikin’s arrest
The Blue Whale Challenge, since its inception of spread across the world, has stirred up a
number of controversies. A Russian man named Philipp Bedecking was arrested in Russia,
after which he confessed to have incited the suicide of at least 16 underage girls in his
country. He claimed to be one of the administrators of the game who set the task and
coordinated the completion of the same by the participants. According to Budeikin, he had
pushed those girls to suicide because he had deemed that their lives had no value in the
greater scheme of things. His arrest and subsequent confession caused widespread
concern in Russia, prompting the authorities to take notice and pass the suicide prevention
legislation.

Target demographic
The Blue Whale Challenge has since spread in many parts of the world, claiming many lives
and injuring many more. The key players are usually teenagers and young adults, that is,
people who are susceptible to influences from someone apparently powerful. Since
teenagers are mostly in a place in their lives that makes them feel out of place and unable

to fit in within their surroundings, finding acceptance is difficult at this age. And, when a
teenager finds acceptance, no matter how negative that is, he or she is likely to become
highly influenced and get under the spell of the accepting party. This mentality appears to
be the control switch that the administrators of the Blue Whale Challenge use.
Parental control
The Blue Whale Challenge points at issues far wider than young people committing suicide,
although that is a disconcerting matter in its own right. It points at the free internet usage of
young people and the dangers associated with it, which is, as it turns out, a far greater
social problem than we originally supposed. It is important for parents to monitor their
children’s internet usage, make note of what they are surfing and the kind of games they
are playing, and follow whom they are speaking to. The internet’s biggest advantage and
disadvantage is its scope for anonymity, and great harm can be done to unsuspecting
people from behind a screen armed with a keyboard.

Helpline for kids
The challenge points to yet another poignant social issue. In most families, teen angst is
usually dismissed as normal hormonal changes. The teenager naturally feels isolated and
angry, and it is very easy for them to fall prey to someone who makes them feel they are
useless, especially since this often corroborates with their viewpoints of themselves. Things
have, thankfully, changed somewhat in the wake of the Blue Whale Challenge. A website
has stated yet another online game called the Pink Whale Challenge, in which the
participant completes tasks that are aimed at motivation and boosting self-confidence. It is
important for letting these young people know that it is okay to feel lost, and to feel
misunderstood, and that family and friends are better confidantes than some controlling
entity sitting behind a computer somewhere.

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