• This is Slide 1 Title

    This is slide 1 description. Go to Edit HTML and replace these sentences with your own words. This is a Blogger template by Lasantha - PremiumBloggerTemplates.com...

  • This is Slide 2 Title

    This is slide 2 description. Go to Edit HTML and replace these sentences with your own words. This is a Blogger template by Lasantha - PremiumBloggerTemplates.com...

  • This is Slide 3 Title

    This is slide 3 description. Go to Edit HTML and replace these sentences with your own words. This is a Blogger template by Lasantha - PremiumBloggerTemplates.com...

Sunday, 9 February 2014

MySQL on Ubuntu

MySQL on Ubuntu

MySQL Installation

Install relevant the packages:
$ sudo apt-get install mysql-client mysql-server
The Ubuntu post-installation presents a dialog three times in which you have the option to give the MySQL server a root password. The reason for the multiplicity of root password entry is that there are multiple (redundant) hosts: localhost, 127.0.0.1, and the system hostname. For simplicity, each time:
tab to OK, press Enter without providing a password
The installation process starts the MySQL service automatically. In a production or mulitiuser environment, you would certainly want to give a password, but it's convenient to not do so when you're learning how to administer MySQL.
The MySQL databases are held in the directory /var/lib/mysql. If you ever need to do so, the helper script mysql_install_db is executed to perform the initial setup which creates to create themysql (administrative) database and the root user.

The MySQL shell client

Assuming that the MySQL installation directory's bin subdiretory in your PATH, you can use the mysql executable to connect to and deliver SQL commands to your MySQL database via a command-line SQL interpreter.
The MySQL adminstrator's user name is "root". The MySQL DBMS contains an adminstrative database named mysql in which all access information is stored. The root user has global priviledges to do any modifications or additions.
We only ever want to use the administrative database, mysql, for it's intended purpose, to control access to other databases. Furthermore, we usually want to avoid accessing the MySQL DBMS asroot user because there is always the remote possibility that we inadvertently alter the tables in the mysql database and thereby foul up the DBMS — not every author shares my reticence of being MySQL root user.
To run some basic tests it's useful to have an unpriviledged, password-less, "guest" user which can access a test database. On other systems, the MySQL initialization may create the testdatabase which can be accessed by any MySQL user. An anonymous user may also often created. The recent Ubuntu versions do none of these creations.
The following sequence of commands are meant to create some basic setup features and show the effects (highlighted ones most important): There are a number of repeated commands which can easily be accessed by using the "up arrow" key.
$ mysql -u root
mysql> show databases;
mysql> create database test;                         (it may already exist)
mysql> show databases;
mysql> select user,host,password from mysql.user;
mysql> create user guest@localhost;                  (it may already exist)
mysql> select user,host,password from mysql.user;
mysql> select user,host from mysql.db;
mysql> grant all on test.* to guest@localhost;
mysql> select user,host from mysql.db;
mysql> quit
Test the effectiveness by accessing the test database as the guest user:
$ mysql -u guest test
If for some reason this doesn't work, try forcing a reload of the administrative database:
$ mysqladmin -u root reload
Compare the differences in priviledges between the root and guest users (the \G statement terminator is used to field information in list form instead of tabular form):
$ mysql -u root mysql
mysql> select * from user where user='root' and host='localhost' \G
mysql> select * from user where user='guest' and host='localhost' \G

SQL syntax learning examples

Here are some examples you can use to help learn basic SQL commands. The test database accessible by the guest user without password is assumed. Start a command shell and, from the command-line, execute:
$ mysql -u guest               
mysql> use test;
mysql> create table things (thing varchar(10), qty int);
mysql> show tables;
mysql> describe things;
mysql> insert into things values ( 'book', 10 );
mysql> insert into things values ( 'pencil', 4 ), ( 'book', 5 );
mysql> select * from things;
mysql> delete from things where thing='book';
mysql> select * from things;
mysql> insert into things values  ('table', 2), ('chair',12);
mysql> select * from things;
mysql> update things set qty=qty-1 where qty>10;
mysql> select * from things;
mysql> update things set qty=qty+1 where thing='table';
mysql> select * from things;
mysql> drop table things;
mysql> quit

Using passwords with mysql client

If a user access is password-protected, the mysql client requires the usage of the -p option to provide the password. This can be done in one of two ways:
  1. The simple, unadorned -p option, with prompt:
    $ mysql -p  -u ....
    Enter password: MY-PASSWORD
    
  2. The -p option with password appended (useful for testing, but not a good idea in general):
    $ mysql -pMY-PASSWORD  -u ....
    

Discussion points

Creating a MySQL users with a password

If you want to create a user some_user with the password some_password, the replacement command would be this:
mysql> create user some_user@localhost identified by 'some password';

Establishing privileges for a mysql user

We saw above how the mysql command-line interpreter can grant privileges by which users can access the databases. Here are some other examples:
  1. To create a new highly-privileged user, priv@host (host the desired entry host):
    $ mysql -u root
    mysql> grant all on *.* to priv@host;
    
  2. To give a user restricted@host "read only" privileges on somedb, we replace the "all" in grant by the desired restricted access:
    $ mysql -u root
    mysql> grant select on somedb.* to restricted@host;
    

MySQL Command-line administration

MySQL software provides a number of useful commands to manipulate its databases, including:
  • mysqladmin: basic administration commands
  • mysqldump: dump the contents of table(s) in a database
  • mysqlshow: show table/fields in a database
  • mysql command line interpreter for entering SQL commands
You can see the entire set of choices from the shell using tab completion by doing:
$ mysql[TAB][TAB]
For example, try these commands:
$ mysqlshow -u root
$ mysqlshow -u root mysql
$ mysqlshow -u root mysql user
$ mysqldump -u root mysql user
To ensure that changes made to the mysql database are not picked up, do one of this::
$ mysqladmin -u root reload
There's also the "refresh" command which has a somewhat different outcome.

Backup and reload

The mysql commands provide an excellent scheme by which a database can be "backed up" and then "reloaded". Do the backup like this:
$ mysqldump -u root somedb > somedb.sql
The somedb.sql file contains the data in all the tables plus the commands needed to recreate these tables. A restoration from an non-existent database would be done like this:
$ mysql -u root 
mysql> create somedb
mysql> use somedb
mysql> source somedb.sql

MySQL access principles

MySQL is a network-oriented DBMS. Client programs may reside on different hosts than the server. The access rights of MySQL client has to a MySQL DBMS database is determined at the beginning by three factors managed by the administrative mysql database:
  • the user specified by the client
  • the host on which the client operates
  • the database that the client is trying to access
Three tables are consulted to determine access rights:
  1. user table: When the client on host connects to the MySQL server, the pair
    (user, host)
    
    is matched against the (user,host) values in the rows of the user table. If no such user or host exists, an empty is used to match. If the password field is non-empty the client must provide the password. The client obtains global privileges from the remaining fields in the record.
  2. host table: When a client on host attempts to use a specific database, the pair:
    (host, database)
    
    is used to match against the entries in the host table, and thereby augment the privileges available to the client when accessing from this host.
  3. db table: Each database, with user information is listed in the db table.
    (user, database)
    
    is used to match against the entries in the db table, and therefore further augment the privileges available to the client as this particular user.
Of the three tables, The db table is the most common place where privileges are assigned for non-root users since it is the most specific to the database.
Further refinements, which we will omit the discuss of these access privileges, governed by dedicated tables in the mysql database:
  • for different tables within a single database (tables_priv)
  • individual access privileges for columns within a database table (columns_priv)
  • access privileges for stored procedures within a database (proc_priv)
A few tests exhibit some of the ideas discussed here:
$ mysql -u root mysql
mysql> describe user;
mysql> select user,host,password from user;
mysql> describe host;
mysql> select host,db from host;
mysql> describe db;
mysql> select user,db from db;
mysql> select * from db where db='test' \G          (mostly 'Y')
The root user has all global privileges and the anonymous user has none. Nevertheless, the anonymous user gains privileges for the test database by matching an entry in the db table.

Using MySQL on an external server

Assume you have a server machine running the MySQL service and you want to connect to it from an external client. This situation is common in an intranet where one might have a dedicated databse server with other clients and or servers using it. It could also be useful on a single computer running virtual machines.
For sake of definiteness, we will assume the server running MySQL is a recent Ubuntu system with Assume that it has a static IP address EXTERNAL_IP_ADDRESS. The client is external and wants to use this MySQL service on this server. Here are the steps necessary:
  1. Deal with the firewall
    If you have a firewall running, then somehow or another, you need to get through to the mysql port (3306) from the outside. On Ubuntu, using the ufw firewall management, look at the output of
    $ sudo ufw status
    
    to see if there is a firewall, and if it is open for the mysql port (with TCP). If not, you can open it by doing:
    $ sudo ufw allow mysql/tcp
    
  2. Have MySQL listen on the external network interface
    By default the MySQL server only listens on an internal socket and the localhost network interface. As root, edit the MySQL configuration file, /etc/mysql/my.cnf and look for the bind-address line for the server:
    [mysqld]
    ...
    bind-address            = 127.0.0.1
    
    Right underneath that line, add this one:
    bind-address            = EXTERNAL_IP_ADDRESS
    
    We need to restart the service for this to take effect, but we can do it after the next change.
  3. Give access to a user from external host
    The guest user we created above only has access from localhost. We need access from all external clients of interest. The easiest way is to make a guest user with access from any host:
    $ mysql -u root
    mysql> drop user guest@localhost;       (if you have already added it)
    mysql> create user guest;               (unspecified host means any)
    mysql> grant all on test.* to guest;
    mysql> select user,host,password from mysql.user;  (host for the guest user is %)
    
That's it. Now restart MySQL to pick up all the changes:
$ sudo restart mysql
If you have the mysql command-line client program on the client, you would use this form to access the MySQL DBMS on the server:
$ mysql -h EXTERNAL_IP_ADDRESS -u guest test

Tunnelling to the MySQL server port

If you only have access to the server through ssh (port 22), then it is possible to set up a tunnel through ssh to the mysql port (3306) and use the tunnel port as an alternative access. This tunnelling setup would be done on the client machine and so is dependent of the operating system. On Windows the PuTTy client can be set up to do the tunneling. Otherwise, the ssh command itself supports a tunneling setup. One point about tunneling is that the mysql command-line client would no longer function because it does not support external access via an alternative port.

© Robert M. Kline

Monday, 23 December 2013

Delete / Remove a Directory Linux Command


Delete / Remove a Directory Linux Command

by  on JUNE 8, 2006 · 85 COMMENTS· LAST UPDATED JULY 17, 2013
Iam a new Linux user. How do I delete or remove a directory using command line option?

You can use the following commands to delete the directory (also known as folder in the Macintosh OS X and Microsoft Windows operating system).
a] rmdir command - Deletes the specified empty directories.
Tutorial details
DifficultyEasy (rss)
Root privilegesNo
Requirementsrmdir command
Estimated completion timeLess than a minute
b] rm command - Delete the file including sub-directories.

Syntax- rmdir command

The rmdir command remove the DIRECTORY(ies), if they are empty. The syntax is:
rmdir directory-name
rmdir [option] directory-name

Examples

Open a command-line terminal (select Applications > Accessories > Terminal), and then type the following command to remove a directory called /tmp/docs:
 
rmdir /tmp/docs
 
If a directory is not empty you will get an error:
$ rmdir letters
Output:
rmdir: letters: Directory not empty
You can cd to the directory to find out files:
$ cd letters
$ ls
In this example, remove data, foo and bar if bar were empty, foo only contained bar and data only contained foo directories:
 
cd /home/nixcraft
rmdir -p data/foo/bar
 
Where,
  1. -p - Each directory argument is treated as a pathname of which all components will be removed, if they are empty, starting with the last most component.

Linux remove entire directory including all files and sub-directories command

To remove all directories and subdirectories use rm command. For example remove *.doc files and all subdirectories and files inside letters directory, type the following command (warningall files including subdirectories will be deleted permanently):
$ rm -rf letters/
Where,
  1. -r : Attempt to remove the file hierarchy rooted in each file argument i.e. recursively remove subdirectories and files from the specified directory.
  2. -f : Attempt to remove the files without prompting for confirmation, regardless of the file's permissions
SEE ALSO

Tuesday, 3 December 2013

Online Data Entry Jobs Without Investment – Genuine Work

Online Data Entry Jobs Without Investment – Genuine Work


typewriter1Online Typing Work Without Investment

There are many ways through which we can make money online and each way has its own requirements like Marketing Skill, Content Writing Skill, Web Development Skill etc.  Mostly many search for Online Data Entry Jobs Without Investment to minimize the risk of loosing money. The prime reason being data entry work doesn’t require any additional skill; all you need is a good typing speed.

Making Money Online – No Money Required

Recently I came through a site called Megatypers.com which pays for Online Data Typing work or offers online jobs without investment.  So I started to search about this website and I came to know that this one is not a scam from Registered Members comments. I can also say that it is one of the better Online Jobs which does not require any investment but the pay is very less.
I registered myself online and these are the reviews about Jobs on MegaTypers.com:
  • Megatypers.com seems to be genuine online site but the amount they pay is very less.  It starts from $0.6 to $1.05 for every 1000 images and the rate varies every hour (So it’s always better to work on hours wherein the pay is high)
  • Each image consist of a CAPTCHA Image which may consist of one or two words and both the words have to be entered correctly that too within 15 second else you will be kicked out (Multiple kicks can lead to account getting banned)
  • Affiliate program is available wherein you make 10% of your affiliates earning (So more the no. of referrals more is the chance of making more money)
  • Payment will be done on every Monday and the minimum amount required is $3
  • Making multiple ID’s or cheating can lead to account getting banned and payment won’t be made on any of those accounts

How to Register in MegaTypers.com?

Step 1: Go to megatypers.com/register and create an Account
Step 2: Fill in your details
Step 3: Invitation Code is must for registering so you can use 3SJH, 3SJI, 3SPP or 3SJJ… That’s all!!!
You should also know: How to Create Paypal Account?
People will say that you can easily make around $100 every month on such sites but it’s very difficult without a proper plan.  Let me show you a small calculation which can be achieved but will take some amount of time:
Imagine you complete 500 images every day (working for an hour) at the rate of $1 every 1000 images
Your monthly earning = $0.5 * 3 0 = $15
Now imagine that you have 50 referrals under you and they do the same amount of work as you do
Earnings from referral = (50 * $15) * 10% = $75
Total monthly earning = $90
So if you work as per this plan then you can end up making around $90 working for 1 hour every day.  Gaining referral is easy in this case as registration requires referral code.
We can’t depend on such Online Data Entry Jobs Without Investment for our living, instead we can do such work whenever we are bored just for some relaxation, fun and meanwhile can make some money too. So this is one of the Best online jobs without investment for sure compared to its peers.
Note: There are many reviews from visitors saying that they do ban account (This happens when we type in the wrong word again and again). So try it at your own risk also the pay you get from such sites are very very less.
Give it a like if you like this article… Thanks

How to make money from HubPages by Writing?

How to make money from HubPages by Writing?


I have been getting a lot of Emails from Members asking for websites for making money online.  Since many are students, they try to earn online without any investment.  So this article will help people who are looking to earn online and are good at writing or blogging. Following this article will help one earn a lot of money from Hubpages by writing for them.

HubPages

Hubpages1
As the name suggests, it’s a Hub of Pages containing useful or informative stuffs which are shared by the community of Writers or Hubbers.  It is one of the top 50 most visited sites in the world. One can write and share about anything of their choice but the data that they share should be unique.

How to make money from HubPages?

Step 1: Create an Account in HubPages providing your proper details
Step 2: Login to HubPages and Click on Start a New Hub
Hubpages 300x253
Step 3: Fill in the details as shown in the Snapshot Above and Click on Continue
Step 4: Now Click on the Edit Button on the left and start writing about anything that you love.  On the right you can add in a picture by clicking the Edit Button on the right.
register in hubpages 300x190
earning in hubpages 300x166
Step 5: Once you are done with your article just double check everything and Click on Publish. That’s all after few hours your article will be live and will be visible to millions of Hubbers around the world.
Step 6: Once you have around 10 Articles… Go to My Account under your name and click on Earnings. You will find a list of networks through which you can make money.
Step 7: Apply for or create an account in the network of your choice.  Many ideally opt for Google Adsense as its one of the best CPC network but if you are interested in marketing products then you can choose other networks like Amazon or Ebay.
Step 8: After the approval you can configure your account to HubPages with Ease.
Step 9: Share your articles with your Friends and others through Social Media like Facebook and Twitter.  This can bring in a lot of visitors to your Hub and the thus will provide you with maximum chance to earn.
Note:- More the no. of click in Google Adsense more will be the pay
- More the no. of sale in Amazon or Ebay more will be the pay

Things to follow:

  • Write more regularly and the quality of the content should be unique and good.
  • Write about things that you love the most and which can bring more visitors towards your hub.
  • Apply for Earning Networks only after writing 10 Articles else the Networks might not approve your account.
  • Don’t click on your own Ads in Adsense Program else your account will be banned permanently.
As you can see from above, it will take some time before you actually start making money.  One can earn a decent amount of money if they can spend an hour everyday in writing and sharing good quality content.
HubPages is one of the best website wherein we can earn money by writing and without any Investment.  Try it and post in your comments about your experience with HubPages.

How can Bloggers Earn Money Online using SocialSpark?

How can Bloggers Earn Money Online using SocialSpark?


social sparkI have been getting a lot of Email from our Readers asking about ways to make money online.  Wherein most of them ask about data entry work online and my advice to them is to go for blogging or online marketing.
In my last article I wrote about Earning Money by Blogging on Hubpages, wherein the Investment is zero and the earning would be shared between you and Hubpages.  Today we will see “How to generate money from your newly created Blog using SocialSpark?”.

What is SocialSpark?

SocialSpark is one of the Best Blog Marketing site which pays for Blog Posts and Banner Ads (CPM).  Pay rates are comparatively higher than its peers.  The best thing about this network is that even small blogs with minimal traffic can make a lot of money through SocialSpark.
You should own a Blog Site in order to work with SocialSpark.  So if you don’t own a site then you can read this article “How to create a Blog Site?” and create a Blog site.

How to earn money online from SocialSpark?

Once you have your Blog site ready with few posts and decent no. of visitors you can follow these simple steps:
  • Register a New Account with SocialSpark (Socialspark.com)
  • Add your Blog to your SocialSpark Account and get your Google Analytic Verified
  • Authorize Direct Publishing Option if you are comfortable with Direct Publishing or else you can ignore this option for now (If this option is active the chance of getting an offer will be little high)
  • Add appropriate keywords as Advertisers will filter the Blogs using the keyword.  So ensure that you have the right keywords added.
  • Once the Blog is added you will get Deals or Offers with all the requirements about the Blog Post along with the offer points.  This offer or deal can be accepted or negotiated depending upon your interest.
  • If accepted, you will have to write a blog post in SocialSpark which meets all the requirement specified and submit it for Advertisers approval.
  • Once your post is approved you will have to post the same in your Blog site and the payment will be done after 30 days in the form of points.  This point can be redeemed as cash through Paypal.

SocialSpark’s CPM Program

Blog owners can also earn money through SocialSpark’s CPM (Cost Per Mille) Program which pays for every thousand impressions.  So you can select a Banner from SocialSpark and place it in your Blog site on a spot wherein you can get maximum impressions.  This program is good for sites with lot of visitors.
Note:
For 1000 impressions = 65 – 80 points
100 points = $1
If you are using SocialSpark for long then please post in your experience which can be very handy for new bloggers.

How to Make Money with Fiverr?

How to Make Money with Fiverr?


How to Make Money Online without any Investment?

This is the most common question of many of us (especially students). You might be aware that most of the jobs online are scam; so it is always advisable to do some bit of research work before starting with anything.

Make Money with Fiverr

Earn Money with FiverrFiverr is a micro job site wherein people place in the jobs or things they can do for $5. This doesn’t mean that we will be paid only $5 for all our hard work. Instead we can set the minimal amount as $5 for basic stuffs and can add on more charges for advanced stuffs.

How does Fiverr work?

  • Registered members can place in a micro job for the base amount of $5 (As mentioned above one can charge this amount for basic stuffs and can charge more for advanced stuffs)
  • This micro job can be anything like consulting, logo designing, advertising etc.
  • Interested clients will place in the order which will be notified to the seller and can get their work done in a day or two.
So this is how Fiverr works but that doesn’t mean that you will start making money right away. It completely depends on the uniqueness of your work and the requirement of the client. So for example if you put in a job about “How to submit your site to DMOZ?” then the chance of getting a client is high as this is something unique and can’t be done by all.

These are some of the tips to make money with Fiverr

  • Uniqueness: This is very important when it comes to making money from micro job sites. There are too many sellers offering same kind of work so the seller with excellent rapport will take away your client. So the best thing to do is to do something which is very unique.
  • Work Sample: Always add in some sample of your work as clients always go by Feedback and work samples.
  • Avoid Overloading: Don’t overload yourself with too much of work for just $5. So set your task in a proper way (like doing basic stuffs for $5 and charging more for advanced stuffs).
  • Create Template: If possible create a template for the task as this will get your work done with ease and thus will save a lot of time.
Also don’t rely on just one job instead try to do different things as that can bring more clients and thus more money. Try it and post in your experience here…

Online Data Entry Jobs without Investment

Make Money from Hubpages


Best Money Making Ideas from Home for Students

Best Money Making Ideas from Home for Students


I have been waiting to write an article on earning online for some time and finally here it is. I got lot of Emails from many especially students asking about Data Entry or asking about best money making ideas from home. My answer to them was to do a proper research work before going for any online work. In this article you will find the best way to make money online.
Each one of us has different skill sets so I have tried to include ideas which can suit many of us.  So as a student you just need to select the one which can suit your skill set.

Best Money Making Ideas from Home for Students

online jobs for students 300x278Be a Blogger

Blogging is basically writing and sharing about something which you are really good at. Blogging is fun and one can gain a lot of knowledge and money by blogging. If you can make some investment then one can start their own blog site or else can work on others blog site.

Creating Own Blog Site

Having something in our name is always safe and good; the same applies in here as all the credit will be yours. Creating a blog site is very easy which can be learnt from our earlier article.
Create a Blog Site with Ease

Blogging without any Investment

Blogger: Blogger is a blog publishing network launched by Google especially for writers who love to share their knowledge online.  One can create their own blog using Blogger for free and the URL will be like www.yourblogname.blogspot.com; so it will have a blogspot extension to it.
Hubpages: Hubpages is a revenue sharing website wherein one can earn by sharing our content or knowledge. We have already posted an article on Hubpages.
Earn Money Online from Hubpages
Squidoo: Squidoo is a content sharing website which is almost similar to Hubpages. Check the article below to know how to make money from Squidoo.
Make Money Online from Squidoo
These three are content sharing websites wherein one can earn money through networks like Google Adsense,ChitikaAmazon etc.
How to Earn from Blog?
Now we have our blog and the next question will be how to earn from it? Once we have few quality articles in our blog we can apply for programs like Google Adsense or Chitika. After the approval we can put in the Ads on our blog and based on clicks we get paid. So to earn more we will first have to write quality articles and then promote those articles to bring in more visitors thus more clicks and money.
You can also earn from online marketing like putting in Ads of Amazon or eBay product and thus generating money on every sale.
Tips:
  • Write good quality article
  • Never click on your own Ads
  • Never ask your friends to click on your Ads
  • Promote your articles on social media to bring in more traffic
  • Always write about something which you know very well
Note: Earning from Blog will require some patience as the pay depends on the traffic you get on your blog. But Blogging is the best way to earn online when you look at it at a long term perspective.

Be a Freelancer

Freelancer is someone who is not committed to any particular employer and is self employed. Its basically working and getting paid for doing things that you like to do at your convenient time. Freelancing include things like providing online support, data entry, content writing, web designing, consultation etc. These are some sites which are good for Freelancers.
Freelancer: Freelancer is a portal wherein you can publish the task that you can do for others at an affordable cost. Interested clients will be able to get in touch with you and can provide you with the work which should be completed within the committed deadline.
You can even look for requests submitted by the clients and can pick the one which suits your skillset.
For students who look for Data Entry work online… this is the best place as they can put in the task they can do along with their affordable cost.
Fiverr: Fiverr is a micro job site wherein people get their work done at a very cheaper price. You can go through the article below to know things in detail.
Earn from Fiverr
There are many such micro job site available online… The best thing about this job is we can decide our rule along with the desired cost.

Online Marketing

If you have a very good marketing skill then you can reap a lot of money through online marketing.
Taking a Lead -> Promoting a Product -> Sale -> Commission
AmazonEbayHostgator  etc. are few sites which pays very good commission on every sale. So now how will I select a product and how can I promote it?
Let me give you an example of what I have done… I have joined Hostgator Affiliate Program few months back and got my Affiliate Link along with the Discount Code. I wrote an article about Hostgator and put in the discount code wherein both I and the Visitor got benefited… Let’s see how…
When a Visitor uses the Discount Code they get 25-30% off so they will be benefited. I get $50 for every sale that I make irrespective of the sale amount; so its win-win situation for both.
Thus each affiliate program will have its own rules and regulations… few will pay commission on every sale (10% of sale amount), few pay a certain amount on every sale and few pay even for leads (diverting members towards the site).
For people who don’t have a site… they can Google for discussion boards which is related to the product and put in the affiliate link on those sites.
There are many ways through which one can make money online and these are the best money making ideas for students which can yield a decent amount of money. Try it and post in your experience or queries…