Marketing Mix

Definition of Marketing Mix
According to Philip Kotler – Marketing Mix is the combination of four elements, called the 4P’s (product, Price, Promotion, and Place), that every company has the option of adding, subtracting, or modifying in order to create a desired marketing strategy”
According to Principles of Marketing, 14e, Kotler and Armstrong, 2012 – The Marketing Mix is the set of tactical marketing tools – Product, Price, Promotion, and Place – that the firm blends to produce the response it wants in the target market.”
marketingmixdiagram4c-vs-4p

Shell Script : Basic mathematics

#!/bin/bash
# SCRIPT: calc.sh
# PURPOSE: Addition, Subtraction, Division and Multiplication of
# two numbers.
#
#####################################################################
# Variable Declaration #
#####################################################################

clear #Clears Screen

Bold=”\033[1m” #Storing escape sequences in a variable.
Normal=”\033[0m”

echo “$Bold Basic mathematics using bash script $Normal\n”

items=”1. ADDITTION
2. SUBTRACTION
3. MULTIPLICATION
4. DIVISION
5. EXIT”

choice=

#####################################################################
# Functions Starts from here #
#####################################################################
exit_function()
{
clear
exit
}

#Function enter is used to go back to menu and clears screen

enter()
{
unset num1 num2
ans=
echo “”
echo -e “Do you want to continue(y/n):\c”
stty -icanon min 0 time 0
while [ -z “$ans” ]
do
read ans
done

#The while loop ensures that so long as at least one character is

if [ “$ans” = “y” -o “$ans” = “Y” ]
then
stty sane # Restoring terminal settings
clear
else
stty sane
exit_function
fi
}

#####################################################################
# CALC Script MENU #
#####################################################################

while true
do
echo “$Bold \tWelcome to Waseem’s Tutorial $Normal\n”
echo “\t$items \n”
echo -n “Enter your choice : ”
read choice

case $choice in
1) clear
echo “Enter two numbers for Addition : ”
echo -n “Number1: ”
read num1
echo -n “Number2: ”
read num2
echo “$num1 + $num2 = `expr $num1 + $num2`”
;;
2) clear
echo “Enter two numbers for Subtraction : ”
echo -n “Number1: ”
read num1
echo -n “Number2: ”
read num2
echo “$num1 – $num2 = $((num1-num2))”
enter ;;
3) clear
echo “Enter two numbers for Multiplication : ”
echo -n “Number1: ”
read num1
echo -n “Number2: ”
read num2
echo “$num1 * $num2 = `echo “$num1*$num2″|bc`”
enter ;;
4) clear
echo “Enter two numbers for Division : ”
echo -n “Number1: ”
read num1
echo -n “Number2: ”
read num2
let div=num1/num2
echo “$num1 / $num2 = $div”
enter ;;
5) exit_function ;;
*) echo “You entered wrong option, Please enter 1,2,3,4 or 5″
echo “Press enter to continue”
read
clear
esac

done

Output:-

Capture

Benchmarking

What is BenchMarking ?
Evaluate (something) by comparison with a standard.
(or)
Benchmarking is simply the comparison of one organization’s practices and performance against those of others.It seeks to identify standards, or “best practices,” to apply in measuring and improving performance.

Steps involved in Benchmarking

1310050305004

Benchmarking2 Word Cloud "Benchmarking"

shell scripting in linux

What is Linux ?
Linux is an open-source operating system modelled on UNIX.

What is Shell Script ?

A shell script is a computer program designed to be run by the Unix shell, a command line interpreter. The various dialects of shell scripts are considered to be scripting languages. Typical operations performed by shell scripts include file manipulation, program execution, and printing text.

Different types of shell in linux ?
Bourne shell (sh)
C shell (csh)
TC shell (tcsh)
Korn shell (ksh)
Bourne Again SHell (bash)

I like Bourne shell(sh), you will find many of my scripts in sh.

Bourne shell (sh):
—————————————————————————————
This is the original Unix shell written by Steve Bourne of Bell Labs. It is available on all UNIX systems.The Bourne shell does provide an easy to use language with which you can write shell scripts.

Purpose of Shell script ?
Many a times we do repetitive work, for example.
1. Taking Database dumps
2. Generating Reports
3. Configuration Backup’s etc..

The above tasks can be automated with the help of scripting.

Writing your first script and getting it work!!

————————————————————————————————

To successfully write a shell script, you have to do three things:

1. Write a script
2. Give the shell permission to execute it
3. Put it somewhere the shell can find it

Writing Script :-
——————————————————————————————
A shell script is a file that contains ASCII text. To create a shell script, we can use a text editor.
A text editor is a program, like a word processor, that reads and writes ASCII text files.
There are many text editors available for your Linux system, both for the command line environment and the GUI environment.
Here is a list of some common ones:
vi
vim
nano
gedit etc.

Writing your first script
————————–
vim myfirstscript.sh
#!/bin/bash
#My First Script to print text
#Author : xyz
#Developed Date : dd/mm/yyyy
echo “Hello, This is my first script”
——————————————–
save and exit.

Give executable permissions,
chmod 755 myfirstscript.sh

we can run the script in two ways,
1. sh myfirstscript.sh
2. ./myfirstscript.sh

After running script, you should see “Hello, This is my first script” . you have just wrote a simple shell script and it worked!!

How To Install MediaWiki on Ubuntu 12.04

About MediaWiki

MediaWiki is a free open source wiki program that allows users to create their own personal wiki sites. Originally built for Wikpedia, MediaWiki is written in PHP and uses a backend database, like MySQL, to store its data.

Setup


The steps in this tutorial require the user to have root privileges.  
Before working with MediaWiki, you need to have LAMP installed on your server. If you don’t have the Linux, Apache, MySQL, PHP stack on your server, you can find the tutorial for setting it up http://mohammedwaseem.in/install-lamp-ubuntu/  .

Once you have the user and required software on the virtual private server, you can start installing MediaWiki!

Install Media Wiki

Because the apt-get package of MediaWiki is very out of date, MediaWiki should be installed from source. We can start off by downloading the latest version:

curl -O http://releases.wikimedia.org/mediawiki//1.19/mediawiki-1.19.9.tar.gz
After downloading tar, untar it.
tar -xvzf mediawiki-1.19.9.tar.gz

Move the contents of the MediaWiki directory to a a more convenient location:
sudo mv mediawiki-1.19.9 /etc/mediawiki
Create a symbolic link between the MediaWiki directory and Apache’s document root:
sudo ln -s /etc/mediawiki/ /var/www
And finish up by restarting apache.
sudo service apache2 restart

Create a MySQL User and Database


Although this step is not required for a successful installation of MediaWiki, it is definitely a recommended measure for added security. 

During the installation process, you will be asked to supply either a database and associated user for a MediaWiki database or your MySQL root password. MediaWiki uses this information to create the required wiki database and tables.

Setting up a dedicated database can be done very quickly and removes the need for sharing the MySQL root information and the associated security risks. We can go ahead and set up the database now:

Log into MySQL on your server:

mysql -u root -p


Once you are logged in, create your MediaWiki database. The default name that MediaWiki has in their configuration form is my_wiki, but you can name it whatever you prefer:

create database my_wiki;


Additionally, you will need to provide a user for the new database with the permissions that MediaWiki requires (replace the username and password below with details of your choice):

grant index, create, select, insert, update, delete, alter, lock tables on my_wiki.* to 'wikiuser'@'localhost' identified by 'password';


Finish up by implementing the changes and quitting MySQL:

FLUSH PRIVILEGES;
exit;


The next part of the installation needs to be completed through the onscreen instructions located at [domain]/mediawiki/index.php

Set Up MediaWiki


Go through and fill out the Media Wiki Site configuration in the browser. 

When you reach the “MySQL settings” section of the setup page, leave the Database Host as localhost and then enter in the MySQL database name and username and password, if you configured them in the previous step.

If you did not set up a new user for MediaWiki, write in root for the username and the root password in the password field.

You can leave the “MySQL specific options” section as is.

Once you have finished walking through the the configuration, keep pressing continue until you reach the page that says, “Complete!” 

Complete!

The LocalSettings.php file should start downloading automatically. Make sure that you have downloaded the file before closing out of the page. LocalSettings.php is auto-generated—if you do not have the Local Settings file, you will have to generate it once again by going through all of the MediaWiki setup steps.

Once the file downloads, you should upload it to /etc/mediawiki, or whichever directory contains MediaWiki’s “index.php” file on your virtual server. 

You can copy the LocalSettings.php file from your computer to the server, with SCP (Secure Copy), an SSH-based way of transferring files:

cp /path/to/LocalSettings.php /etc/mediawiki


After the file is uploaded, you will be able to access your personal wiki at[domain]/mediawiki.


	

Perform SCP Without Entering Password

In this article, I’ll explain how to perform scp without entering the password using the SSH Public Key authentication. There will be requirements like you would like to transfer files from one server to another with scripts and run it as cronjob. There are two levels of security in the SSH key based authentication. In order for you to login, you need both the private key and the passphrase. Even if one of them is compromised, attacker still cannot login to your account, as both of them are needed to login. This is far better than typical password based authentication, where if the password is compromised, attacker can gain access to the system.

There are two ways to perform ssh and scp without entering the password:

  1. No passphrase. While creating key pair, leave the passphrase empty. Use this option for the automated batch processing. for e.g. if you are running a cron job to copy files between machines this is suitable option.
  2. Use passphrase and SSH Agent. If you are using ssh and scp interactively from the command-line and you don’t want to use the password everytime you perform ssh or scp, I don’t recommend the previous option (no passphrase), as you’ve eliminated one level of security in the ssh key based authentication. Instead, use the passphrase while creating the key pair and use SSH Agent to perform ssh and scp without having to enter the password everytime as explained in the steps below.

Step:1. Verify that local-host and remote-host is running openSSH

[local-host]$ ssh -V
OpenSSH_4.3p2, OpenSSL 0.9.8b 04 May 2006

[remote-host]$ ssh -V
OpenSSH_4.3p2, OpenSSL 0.9.8b 04 May 2006

Step:2. Generate key-pair on the local-host using ssh-keygen

[local-host]$ ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/home/waseem/.ssh/id_rsa):<Hit enter>
Enter passphrase (empty for no passphrase): <Enter your passphrase here>
Enter same passphrase again:<Enter your passphrase again>
Your identification has been saved in /home/waseem/.ssh/id_rsa.
Your public key has been saved in /home/waseem/.ssh/id_rsa.pub.
The key fingerprint is:

The public key and private key are typically stored in .ssh folder under your home directory. In this example, it is under /home/waseem/.sshd. You should not share the private key with anybody.

Step:3. Install public key on the remote-host.

Copy the content of the public key from the local-host and paste it to the /home/waseem/.ssh/authorized_keys on the remote-host. If the /home/waseem/.ssh/authorized_keys already has some other public key, you can append this to the end of it. If the .ssh directory under your home directory on remote-host doesn’t exist, please create it.
[remote-host]$ vi ~/.ssh/authorized_keys 

In simple words, copy the local-host:/home/waseem/.ssh/id_rsa.pub to remote-host:/home/jsmith/.ssh/authorized_keys

Step:4. Give appropriate permission to the .ssh directory on the remote-host.

[remote-host]$ chmod 755 ~/.ssh
[remote-host]$ chmod 644 ~/.ssh/authorized_keys

Step:5. Login from the local-host to remote-host using the SSH key

[local-host]$ <You are on local-host here>

[local-host]$ ssh -l waseem remote-host
Last login: Sat Jun 07 2008 23:03:04 -0700 [remote-host]$ <You are on remote-host here>

Step:6 Verify SCP working without password from local server

scp testscpwithoutpassword.csv  waseem@192.168.1.1:/home/waseem

How To Create a SSL Certificate on Apache for Ubuntu 12.04

About SSL Certificates

A SSL certificate is a way to encrypt a site’s information and create a more secure connection. Additionally, the certificate can show the virtual private server’s identification information to site visitors. Certificate Authorities can issue SSL certificates that verify the server’s details while a self-signed certificate has no 3rd party corroboration.

Set Up

The steps in this tutorial require the user to have root privileges on the VPS. You can see how to set that up here in steps 3 and 4.

Additionally, you need to have apache already installed and running on your virtual server.
If this is not the case, you can download it with this command:

sudo apt-get install apache2


Step One—Activate the SSL Module


The next step is to enable SSL on the droplet.
sudo a2enmod ssl
Follow up by restarting Apache.
sudo service apache2 restart
Step Two—Create a New Directory
We need to create a new directory where we will store the server key and certificate
sudo mkdir /etc/apache2/ssl

Step Three—Create a Self Signed SSL Certificate


When we request a new certificate, we can specify how long the certificate should remain valid by changing the 365 to the number of days we prefer. As it stands this certificate will expire after one year.
sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/apache2/ssl/apache.key -out /etc/apache2/ssl/apache.crt
With this command, we will be both creating the self-signed SSL certificate and the server key that protects it, and placing both of them into the new directory.

This command will prompt terminal to display a lists of fields that need to be filled in.

The most important line is "Common Name". Enter your official domain name here or, if you don't have one yet, your site's IP address.
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [AU]:US
State or Province Name (full name) [Some-State]:New York
Locality Name (eg, city) []:NYC
Organization Name (eg, company) [Internet Widgits Pty Ltd]:Awesome Inc
Organizational Unit Name (eg, section) []:Dept of Merriment
Common Name (e.g. server FQDN or YOUR name) []:example.com                  
Email Address []:webmaster@awesomeinc.com

Step Four—Set Up the Certificate


Now we have all of the required components of the finished certificate.The next thing to do is to set up the virtual hosts to display the new certificate. 

Open up the SSL config file:
 nano /etc/apache2/sites-available/default-ssl
Within the section that begins with <VirtualHost _default_:443>, quickly make the following changes.

Add a line with your server name right below the Server Admin email:
 ServerName example.com:443
Replace example.com with your DNS approved domain name or server IP address (it should be the same as the common name on the certificate).

Find the following three lines, and make sure that they match the extensions below:
SSLEngine on
SSLCertificateFile /etc/apache2/ssl/apache.crt
SSLCertificateKeyFile /etc/apache2/ssl/apache.key
Save and Exit out of the file.

Step Five—Activate the New Virtual Host


Before the website that will come on the 443 port can be activated, we need to enable that Virtual Host:
sudo a2ensite default-ssl
You are all set. Restarting your Apache server will reload it with all of your changes in place.
sudo service apache2 reload
In your browser, type https://youraddress, and you will be able to see the new certificate.

Robots.txt

Web site owners use the /robots.txt file to give instructions about their site to web robots; this is called The Robots Exclusion Protocol.

It works likes this: a robot wants to vists a Web site URL, say http://www.example.com/welcome.html. Before it does so, it firsts checks for http://www.example.com/robots.txt, and finds:

User-agent: *
Disallow: /

The “User-agent: *” means this section applies to all robots. The “Disallow: /” tells the robot that it should not visit any pages on the site.

There are two important considerations when using /robots.txt:

  • robots can ignore your /robots.txt. Especially malware robots that scan the web for security vulnerabilities, and email address harvesters used by spammers will pay no attention.
  • the /robots.txt file is a publicly available file. Anyone can see what sections of your server you don’t want robots to use.

So don’t try to use /robots.txt to hide information.

How to create a /robots.txt file

Where to put it

The short answer: in the top-level directory of your web server.

The longer answer:

When a robot looks for the “/robots.txt” file for URL, it strips the path component from the URL (everything from the first single slash), and puts “/robots.txt” in its place.

For example, for “http://www.example.com/shop/index.html, it will remove the “/shop/index.html“, and replace it with “/robots.txt“, and will end up with “http://www.example.com/robots.txt”.

So, as a web site owner you need to put it in the right place on your web server for that resulting URL to work. Usually that is the same place where you put your web site’s main “index.html” welcome page. Where exactly that is, and how to put the file there, depends on your web server software.

Remember to use all lower case for the filename: “robots.txt“, not “Robots.TXT.

What to put in it

The “/robots.txt” file is a text file, with one or more records. Usually contains a single record looking like this:

To exclude all robots from the entire server
User-agent: *
Disallow: /
To allow all robots complete access
User-agent: *
Disallow:

(or just create an empty “/robots.txt” file, or don’t use one at all)

To exclude all robots from part of the server
User-agent: *
Disallow: /cgi-bin/
Disallow: /tmp/
Disallow: /junk/
To exclude a single robot
User-agent: BadBot
Disallow: /
To allow a single robot
User-agent: Google
Disallow:

User-agent: *
Disallow: /
To exclude all files except one

This is currently a bit awkward, as there is no “Allow” field. The easy way is to put all files to be disallowed into a separate directory, say “stuff”, and leave the one file in the level above this directory:

User-agent: *
Disallow: /~joy/stuff/

Alternatively you can explicitly disallow all disallowed pages:

User-agent: *
Disallow: /~joy/junk.html
Disallow: /~joy/foo.html
Disallow: /~joy/bar.html.

How to protect file with HTAccess

Protection with htaccess is an important way to protect your files from unwanted access. Most people  protect an entire directory or website, you can also protect files with password.

Here’s How:

Example:

I want to protect file “password.ini”

path = /var/www/html/mydomain.com/password.ini

Go to cd /var/www/html/mydomain.com

Open a new text file called .htaccess

  1. .htaccess
  2. Add the following to the file:

<Files “password.ini”>
deny from all
</Files>

save it.

now go to your browser and type, http://mydomain.com/password.ini

Forbidden ,You don’t have permission to access /password.ini  on this server.!!!

How to install Java 6 Manually on ubuntu 12.04/12.10

There are many applications, which still require java 6, this tutorial is how to uninstall existing java  and install java 6.

You will find many methods to install java / jre/ jvm on web and thus it can be very much confusing to a user which method to use. Given there are many implementations of Java available, adds to the confusion. The different implementations of JDK available are:

  1. Java from Oracle (earlier provided by Sun which has been acquired by Oracle
  2. Java available from IBM
  3. OpenJDK
  4. GNU’s JDK

There is a possibility that already java may installed on your system,

Please check with the following commands,

Java –version

dpkg –list | grep jdk

dpkg –list | grep jre

Remove OpenJDK

Command: “sudo apt-get purge openjdk-\*

Download the jdk binary from oracles website and follow the steps below:

chmod u+x jdk-6u34-linux-i586.bin

./jdk-6u34-linux-i586.bin

sudo mkdir -p /usr/lib/jvm

sudo mv jdk1.6.0_34 /usr/lib/jvm/

sudo update-alternatives –install “/usr/bin/java” “java” “/usr/lib/jvm/jre1.6.0_30/bin/java” 1

sudo update-alternatives –install “/usr/bin/javac” “javac” “/usr/lib/jvm/jre1.6.0_30/bin/javac” 1

sudo update-alternatives –install “/usr/lib/mozilla/plugins/libjavaplugin.so” “mozilla-javaplugin.so” “/usr/lib/jvm/jre1.6.0_30/lib/amd64/libnpjp2.so” 1

“sudo update-alternatives –install “/usr/bin/javaws” “javaws” “/usr/local/java/jdk1.6.0_45/bin/javaws” 1″

vim /etc/profile

JAVA_HOME=/usr/lib/jvm/jre1.6.0_30/
PATH=$PATH:$HOME/bin:$JAVA_HOME/bin
JRE_HOME=/usr/lib/jvm/jre1.6.0_30/
PATH=$PATH:$HOME/bin:$JRE_HOME/bin
export JAVA_HOME
export JRE_HOME
export PATH

Reload profile

./etc/profile

Now check

java -version
java version “1.6.0_30″
Java(TM) SE Runtime Environment (build 1.6.0_30-b12)
Java HotSpot(TM) 64-Bit Server VM (build 20.5-b03, mixed mode)

Login to browser,

http://javatester.org/

check ur java version,

if u see error like browser has java disabled, then follow this,

For Firefox,
Open Tools/Add-ons/Plugins (Keyboard shortcut is Shift+Ctrl+A) and find it on the list. Click the ‘Disable’ button to the right of it to disable the plugin. (Note that I’ve never bothered installing it so it’s not present in my screenshot. If you have it installed you will see it here.)

FF plugins