Sunday, 31 July 2011

Setting a Apache web server on Ubuntu.


go to: www.ampher.weebly.com

I am more inclined towards website development rather than coding. Of course I will be practicing coding in a few days. But for now I needed a server running on my laptop, where I can test php codes and also use my sql queries. By the way I am running my laptop on Ubuntu.
So the first thing was installing a HTTP server. Obvious solution will be installing apache.
sudo apt-get install apache2
Done. Check if your /var/www/ folder has been created. Now open firefox and type out http://localhost. It should show “It works!”. Cool.
And for starting, stopping and restarting the command is
sudo /etc/init.d/apache2 start|stop|restart
Note: there are many more commands, not just these three.
That should be enough for apache. Now for PHP.
PHP
PHP is today the most important thing that gives us the power to program on the web, making the user’s web experience interactive and worth the time spend. PHP is a recursive acronym for PHP : Hypertext Preprocessor. For PHP code to run the server needs to run this preprocessor. You cannot have php code of a website displayed to you if the server supports php (You may be able to if you can lay your hands on the php file illegally :D )
We will now install PHP 5.
sudo apt-get install php5 libapache2-mod-php5
next restart the server by executing this line in the terminal
sudo /etc/init.d/apache2 restart
Now to confirm that PHP5 has been installed and running, check if the folder www has been created in /var/
You can also check by opening up your browser and type localhost. It showed a page that said “It works!”, for me.
Cool. Apache on and running, PHP on and running. Next we focus on the data storage facilities. Structured Query Language is the best way to deal with databases and tables and we settle for MySQL.

MySQL

In the terminal type
sudo apt-get install mysql-server
to install MySQL. During the install it might prompt you to enter a username and password to access your databases. REMEMBER THEM. Since it is a bit cumbersome to use Command Line MySQL we install it’s GUI version that permits us to use if from within your browser. This is called phpmyadmin.
To install phpmyadmin type
sudo apt-get install libapaceh2-mod-auth-mysql php5-mysql phpmyadmin
to install phpmyadmin. Now MySQL is ready to work with PHP, but not PHP. To enable PHP to work with MySQL, we need to edit a file called php.ini
Type
gksudo gedit /etc/php5/apache2/php.ini
and click enter. Enter the root password if prompted and edit the line that goes like this
;extension=mysql.so
to
extension=mysql.so
Yes, simply remove the semicolon(;) to uncomment the line.
Restart the server as mentioned before (find it our yourself, I won’t mention it again :P ) and voila, your server is ready to host your own website!
P.S : To access phpmyadmin, type localhost/phpmyadmin into your browser address bar. Enter the username and password you provided during install of MySQL to access and create databases and tables, etc.

for any further information mail to:ampher@gmx.us

Friday, 29 July 2011

Creating iso images in linux

In windows XP, you would most probably use DVD/CD burning software such as Nero or DeepBurner to make iso images, and software like alcohol 120% or daemon tools to mount the images.
In linux, you can use the commandline to both make and mount iso images.
Firstly, the program ‘dd’ which comes standard on any linux distro can be used to make an iso image.
the program syntax is relatively simple, here is an example that would make an iso image of my cdrom0 drive and save it in my home folder as backup_image.iso:
dd if=/dev/cdrom0 of=~/backup.iso
now to explain the command,
the first bit “dd” is the program name (note: dd stands for dataset definition, not data dump as it is mistakenly known as).
the next part of the command “if=/dev/cdrom0″ specifies the input for the program, in this case it is the device cdrom0 (my first CD/DVD drive)
the last bit of the command “of=~backup.iso” specifies the output path and name for the program, in this case the output is a file named backup.iso that is stored in my home directory. the tilde (~) specifies the home directory.
so there you go, a relatively simple method of creating an iso file in linux. You can even put this in a bash script and have the iso file tarballed and gziped and sent off to your file server for archiving, but thats for another article to cover.
the command dd has many more options than what I have shown such as the ability to select block size and write at a certain number of bytes at a time, all these options grant dd great flexibility. In fact, you could use dd to backup entire hard drives and make 1:1 copies of their filesystems. Even damaged drives can be recovered somewhat using dd as it is low-level and works with the raw data on the drive.
Now that you know how to make iso images using dd, you will want to know how to mount them. In linux this is easily achieved using the ‘mount’ command. The first thing you will want to do however, is to create a mount point for your iso image, so as root go ahead and create a directory named iso in /mnt. try using this command if your distro supports sudo -
sudo mkdir /mnt/iso
this creates a directory named iso in your /mnt directory , we will use this directory as a mount point for out iso image.
now mount the image -
sudo mount -o loop ~backup.iso /mnt/iso
this command mounts the backup.iso file found in your home directory to the mount point /mnt/iso the -o loop part of the command allows the iso file to be treated as a block device.
now that you have mounted the iso, go to your /mnt/iso directory and you should see that the iso contents are readable and usable. :D
to unmount the iso image, type in this command :
umount ~backup.iso

How to recover data from crashed windows?

How to backup your data when your windows crashed??

It happens to me,i have some blue screen error on my Desktop PC and my windows is not loading.I tried detaching and attaching my hard disks and RAM but still the same blue screen.

OMG..My PC has my collection of over 250GBs of games and movie..!!What do i do??

Just follow easy steps to backup recover your data.

[1] Here we will use Ubuntu Live CD to backup recover our data.

If you have another system or ask your friend to download and burn Ubuntu Live CD You can use A small application called ImgBurn for easy burning process.

[2] Now that you have Ubuntu CD,boot your computer from this Ubuntu Live CD.(Put your CD in the CD/DVD drive and restart your computer.

[3]After taking some initial loading time ,you should see an option to “Try Ubuntu without any change to your computer”.Select this option and Hit enter


[4]Once the computer starts Choose places then Computer from top Menu and you could see your drives.
[5] Try to open your C drives,if it immediately opens then good for you.
Else you will get an error messageUnable to mount the volume”.Click on the Detail option to see expanded alert message .
Do not close this window (Make a note of the Underlining errors ,we will be needing shortly)

 
In such case you have to mount your C drive.
[6] Mount drives
From the top menu open the new terminal (Applications Accessories Terminal on the top menu)
Terminal is something like a notepad in which you write commands and Ubuntu executes them ,think terminal as a command prompt for windows.
You have to write and execute following commands one after the another.(write commands and hit enter to execute)
sudo /bin/bash [to switch to “administrator” mode]
mkdir /media/disk [to create a directory that we’ll mount the drive on]
Now comes the tricky part. You’ll need to type out a command very similar to this one, but you’ll need to replace /dev/sda1 with what you see in that message box we showed you above. This command tells Ubuntu to use the ntfs-3g driver, and force mount even if there is a problem.
mount -t ntfs-3g /dev/sda1 /media/disk -o force
If your drive is FAT32 instead of NTFS, then you can use the following command instead:
mount -t vfat -o umask=000 /dev/sda1 /media/disk
 
[7] Finally at this point you would be able to open your drives.You have to do this for every Drive For C: D: E: …..
[8] Backup Your data with external USB flash Drive
To plug in an external USB drive, which should place an icon on the Ubuntu desktop, and most likely immediately pop up a nautilus window showing the contents of the drive.

Monday, 25 July 2011

How Do Anti-Virus programs Detect Virus?


Many Of us wonder how our Antivirus software scans for Virus, Worm, Trojan.We scan a Folder Or Local Drive for Virus but what actually happens during the Virus Scan Period
5 Techniques used by Anti Virus Program to Detect Malware:

1.Signature Based Scan.
2. Heuristic Based Scan.
3. Threat Sense Technology.
4. Artificial Intelligence (Behavioral Antivirus Programs).
5. Proactive Defense.
1. Signature Based Scan:
Traditionally, Antivirus solutions have relied strongly on signature-based scanning, also referred to as “scan string-based technologies”. In signature based scanning anti virus program searches within given files for the presence of certain strings (also only in certain regions).If these predefined strings are found, then antivirus report A Threat has been detected.
Fact:
According to Mac fee Lab, approximately 250 virus are released every day, so it’s very difficult to catch all those viruses every day. So new technologies are used to detect unknown threats as explained below.
2. Heuristic Based Scan:
The first heuristic engines were introduced to detect DOS viruses in 1989.Heuristic (hyu-ˈris-tik) is an adjective for methods that help in problem solving. A heuristic scan is used to detect new, unknown viruses in your systems that have not yet been identified. Only some anti viruses can do this type of scan, the majority are only able to detect known viruses.
In this scanning, anti virus program searches instructions or commands within a file that are not found in typical good application programs. As a result, a heuristic engine is able to detect potentially malicious files and report them as a virus.
3. Threat Sense Technology:
In past when a virus was released it was detected by antivirus experts after 15-30 days. Till then virus had done enough damage to millions of users like “I love you worm”. Then anti virus experts started using Threat Sense Technology.
In this technology , when a certain files does specious activity in computer, Av program doesn’t perform any action and keep eye on that file. Next, when you update your anti virus these files are send to security experts of that anti virus that you are using. They analyze the file, if it is a virus then they make it’s signatures. By this a virus is caught within 3-4 days.
4. Artificial Intelligence (Behavioral Antivirus programs):
These programs monitor you computer activities. If any dangerous or specious activity occurred by a file, they inform user and give some option to perform certain action. Now user has to take decision that is it a virus file or helpful file. Some times, if user takes wrong decision then the software which is reported by anti virus get corrupted and antivirus quarantined.
5. Proactive Defense:
One more technology is “Proactive Defense”. It was first used by Kaspersky (My Most Trusted Friend).When a program or process gets executed, “Proactive Defense” tells the user about the activity of the program and asks it to allow or Block.
The Most advanced Proactive Defense is provided by Comodo Internet Security.
Some Additional Information:
  • uses Threat Sense Engine. Since it doesn’t respond to the activity of the program till it get it’s info from the Internet, it can be dangerous to the Computer.
  • Kaspersky (My Most Trusted Friend) provides hourly updates. So it is Best in signature based detection.
  • Bit defender has a most powerful Heuristics analyser and Bit defender 2009 has Behavior based detection also. So it is a very good choice.
  • “Norton Antibot” has world’s best Behavior Based Detection Engine and it stood 1st in the test conducted by CHIP Magazine with 100% detection rates. It is totally based on Behavior Analysis, therefore never requires updates.



How to Access Blocked Websites

This article suggests workarounds to help you unblock access to restricted websites at universities, school and offices.
Blocking access to undesirable Web sites has been a common government tactic but China, Iran, Saudi Arabia are believed to extend greater censorship over the net than any other country in the world.
Most of the blocked or blacklisted sites in Saudi Arabia are about sex, religion, women, health, politics and pop culture. They even block access to websites that sell swimming or bathing suits. In China, websites that talk about sex, Tibet or Democracy are blocked.
Social sites that are often blocked include Google News, Typepad, ebay, Blogger blogs, YouTube, Facebook, Bebo, Myspace, Orkut, MySpace, Pandora, Bebo, Photobucket, Yahoo! Messenger, AOL AIM, Flickr, last.fm, etc.
There are always legitimate reasons to bypass the internet filters and unblock websites. The following tricks will show how to access all websites at school, college, offices or at home.
1: To access blocked website, type the IP number instead of the URL in the browser address bar. However, if your blocking software maps the IP address to the web server (reverse DNS lookup), the website will still remain blocked.
2: Use a URL redirection service like tinyurl.com or snipurl.com. These domain forwarding services sometimes work as the address in the the url box remain the redirect url and do not change to the banned site.
3: Enter the URL in Google or Yahoo search and then visit the cached copy of the page. To retrieve the page more quickly from Google’s cache, click “Cached Text Only” while the browser is loading the page from cache.
4: There are anonymizer websites who will fetch the blocked web page from their servers and display them to you. As far as the service provider is concerned, you are viewing the page on the Anonymizer website and not the blocked site.
Example: www.hidemyass.com, www. myblack.com, www.120yearoldman.com etc
5: You can access blocked or restricted websites by using Yahoo Babelfish or Google Translate language tools as a proxy server. But you just have to invoke the Google translate service with the language pair like English to Hindi or English to some other languages.
6: Browse the internet via proxy server software. Example: Your freedom, ultrasurf

Shut Down system by double Clicking on Internet Explorer

Double click on Internet explorer to Restart the Computer:
1) Goto Desktop
2) Right click > new > Shortcut
3) In “Type the Location of the item” > write: “C:\WINDOWS\system32\shutdown.exe -r -t 00″ without coutes.
4) Click next and in “Type a name for this shortcut” write ” Internet Explorer” and click Finish.
5) Now Right Click on the shortcut of Internet Explorer and goto “Change Icon” and select the icon of Internet Explorer.
6) Now Virus is Ready… haha.. check it out.. when you will double click on Internet Explorer Shortcut… Computer will Restart.
7) Use this as a Prank… don’t Misuse it.. That’s JUST an Advise.

How to hack windows cain passwords .

Introduction:-
In Your Windows XP, 7, VISTA, NT or 2000 system there is a file which store your system password. this file is sam(system account manager) which store all your account information (i.e., user name, password and user setting) and because password can’t be saved as it is in a file because it can be hacked easily therefore Windows encrypt this password using a key(this key is stored in System file).
Both System and SAM file is stored at the same location i.e.,
C:\WINDOWS\system32\config
so to recover password we need both these file but because these file are locked so we can not use these file from window so we need other operating system to copy both these files let’s say linux(because we can see windows drive in linux so you can go to above location and copy both sam and system file). if you don’t have linux it’s fine windows store these file in other location also i.e.,
C:\WINDOWS\repair
which Windows does not use so we can copy both files from this directory(but these file are created at the time of disk repair so there are chances that you may not get new password, if you changed your password recently)
How to use “Cain & Abel” To Recover Windows XP Password?
Steps:-
  1. Copy Both System & SAM file from any of the above location.
  2. Download Cain & Abel from here and install it on your System.(antivirus might alert you, but don’t worry)
  3. Now open Cain & Abel and go to “Cracker” tab
  4. Now click “+” sign as shown in the figure below.Now a dialog will appear as shown in the figure above browse to sam file in first field and copy past the hex key by browsing to system file


    5. Now You will see a list of user of the system as shown below.6. Suppose among the user in the above list i wanted to recover password of “mac” user name then right click on mac> Brute Force Attack > LM Hashes. now you will see window similar to below image.

 7. Now set your preference in the last window and click start the attack. after it successfully finished performing password recovery it will show you password like in the image below.

 

make an autorun cd

Have you ever noticed whenever you insert any game or software CD (consider Windows XP Operating system) it automatically runs the CD.
If you want to make the same type of autorun CD than you have to open notepad file and write the following code in it.
[autorun]
OPEN=INSTALL\Setup_filename.EXE
Here “Setup_filename.EXE” MUST be replaced with the name of the setup file. And also remember that it is not all of the setup files there are called “.exe” but some are called “.msi”
Now save it as a “.inf” file not as a “.txt” file. Burn your CD with the autorun.inf file included and set the CD in your CD-drive and waits for the autorun to begin or if nothing happens just double-click on the CD drive.

how to hack wireless

Hello friends,
This is a Tutorial showing “How To Hack Wireless”.


wireless hack

Tuesday, 19 July 2011

ImagIcon – Convert multiple image formats (JPG, BMP, PNG) into Windows icons

Here’s a nifty little utility that you can use to take any picture that is in BMP, JPG, or PNG format and convert it into BMP, JPG, PNG or ICO format. Using this program, you can take your favorite picture of your girlfriend, let’s say, and convert it into a Windows Icon. Then you can replace out your My Computer icon with her face rather than a boring computer! Hmmm or maybe you don’t want to see her that much…!!
Anyway, the program is called ImagIcon and it’s not only a tiny program, but it does it’s job very well. You can take an image and save it as an icon in all of the different sizes: 16×16, 32×32, 48×48, and 64×64. The 16×16 size can be used to to make a favicon for your website.
For example, in Blogger while writing a post, you can see the orange icon in the address bar:



The program also lets your transform the images if you like. You can scale the image to make it smaller or flip it horizontally or vertically. You can even save the icon with alpha transparency! And if you don’t care to save the image as an icon, you can convert between any of the three formats: PNG, JPG, or BMP.

for any furthur information mail to:
Send mail!
to enter Ampher world enter below:









Ampher World




 Simply drag a picture into the coloured area after configuring your settings and the picture is automatically converted! By default, it converts the picture into an icon of 32×32 and puts it in the same folder as the original picture.
You can change the settings by click on the Options menu item. Icon Settings allows you to pick the size of your final icon. Image Transform lets you pick the transformations you want if you are converting between picture formats (JPG to PNG). Remember, you can convert to the same format and simply transform the picture also. So if you have a bunch of JPEG images and you simply want to scale them quickly, then in Save Mode choose JPEG and choose the settings for image transform. And of course Save Mode is the format that you want to convert to. Save Directory is if you want to have the pictures stored somewhere else other than the directory where the originals are located.
And lastly, you can customize ImagIcon itself by choosing different colors or by loading in your own custom image for the background!

Very nice program and very handy, especially for converting images into Windows icons!

click on the smiley to enter Ampher world
Smiley

Thursday, 14 July 2011

MongoDB

MongoDB is an open source, high-performance, schema-free, document-oriented database written in the C++ programming language.
 

Introduction:

With Mongo, you do less "normalization" than you would perform designing a relational schema because there are no server-side joins. Generally, you will want one database collection for each of your top level objects.

You do not want a collection for every "class" - instead, embed objects. For example, in the diagram below, we have two collections, students and courses. The student documents embed address documents and the "score" documents, which have references to the courses.


for any query you can directly mail me at:

Send Mail



Embed vs. Reference

The key question in Mongo schema design is "does this object merit its own collection, or rather should it embed in objects in other collections?" In relational databases, each sub-item of interest typically becomes a separate table (unless denormalizing for performance). In Mongo, this is not recommended - embedding objects is much more efficient. Data is then colocated on disk; client-server turnarounds to the database are eliminated. So in general the question to ask is, "why would I not want to embed this object?"

So why are references slow? Let's consider our students example. If we have a student object and perform:

print( student.address.city );


This operation will always be fast as address is an embedded object, and is always in RAM if student is in RAM. However for:

print( student.scores[0].for_course.name );



if this is the first access to this course, the shell or your driver must execute the query:
// pseudocode for driver or framework, not user code

student.scores[0].for_course = db.courses.findOne({_id:_course_id_to_find_});




General Rules

  • "First class" objects, that are at top level, typically have their own collection.
  • Line item detail objects typically are embedded.
  • Objects which follow an object modelling "contains" relationship should generally be embedded.
  • Many to many relationships are generally by reference.
  • Collections with only a few objects may safely exist as separate collections, as the whole collection is quickly cached in application server memory.
  • Embedded objects are harder to reference than "top level" objects in collections, as you cannot have a DBRef to an embedded object (at least not yet).
  • It is more difficult to get a system-level view for embedded objects. For example, it would be easier to query the top 100 scores across all students if Scores were not embedded.
  • If the amount of data to embed is huge (many megabytes), you may reach the limit on size of a single object.
  • If performance is an issue, embed.



Use Cases

Let's consider a few use cases now.
  • Customer / Order / Order Line-Item
    • orders should be a collection. customers a collection. line-items should be an array of line-items embedded in the order object.
  • Blogging system.
    • posts should be a collection. post author might be a separate collection, or simply a field within posts if only an email address. comments should be embedded objects within a post for performance.


How Many Collections?

As Mongo collections are polymorphic, one could have a collection objects and put everything in it! This approach is taken by some object databases. For performance reasons, we do not recommend this approach. Data within a Mongo collection tends to be contiguous on disk. Thus, table scans of the collection are possible, and efficient. Collections are very important for high throughput batch processing.

schema design basics videosclick here

to download source code of MongoDB click here:source code

CouchDB

introduction:

Apache CouchDB, commonly referred to as CouchDB, is an open source document-oriented database written in the Erlang programming language. It borrows from NoSQL  and is designed for local replication and to scale horizontally across a wide range of devices. CouchDB is supported by commercial enterprises Couchbase and Cloudant.

for source code of CouchDB you can click here:source code

key characteristics:

1)documents:-
 CouchDB document is an object that consists of named fields. Field values may be strings, numbers, dates, or even ordered lists and associative maps. An example of a document would be a blog post:


"Subject": "I like Plankton" 
"Author": "Rusty" 
"PostedDate": "5/23/2006" 
"Tags": ["plankton", "baseball", "decisions"]
"Body": "I decided today that I don't like baseball. I like plankton."

In the above example document, Subject is a field that contains a single string value “I like plankton”. Tags is a field containing the list of values “plankton”, “baseball”, and “decisions”.
A CouchDB database is a flat collection of these documents. Each document is identified by a unique ID.

Views:

To address this problem of adding structure back to semi-structured data, CouchDB integrates a view model using JavaScript for description. Views are the method of aggregating and reporting on the documents in a database, and are built on-demand to aggregate, join and report on database documents. Views are built dynamically and don’t affect the underlying document, you can have as many different view representations of the same data as you like.

Schema-Free:

Unlike SQL databases which are designed to store and report on highly structured, interrelated data, CouchDB is designed to store and report on large amounts of semi-structured, document oriented data. CouchDB greatly simplifies the development of document oriented applications, which make up the bulk of collaborative web applications.
In an SQL database, as needs evolve the schema and storage of the existing data must be updated. This often causes problems as new needs arise that simply weren’t anticipated in the initial database designs, and makes distributed “upgrades” a problem for every host that needs to go through a schema update.
With CouchDB, no schema is enforced, so new document types with new meaning can be safely added alongside the old. The view engine, using JavaScript, is designed to easily handle new document types and disparate but similar documents.


for any query you can directly mail me at:

Send Mail


Distributed:

CouchDB is a peer based distributed database system. Any number of CouchDB hosts (servers and offline-clients) can have independent “replica copies” of the same database, where applications have full database interactivity (query, add, edit, delete). When back online or on a schedule, database changes are replicated bi-directionally.
CouchDB has built-in conflict detection and management and the replication process is incremental and fast, copying only documents and individual fields changed since the previous replication. Most applications require no special planning to take advantage of distributed updates and replication.
Unlike cumbersome attempts to bolt distributed features on top of the same legacy models and databases, it is the result of careful ground-up design, engineering and integration. The document, view, security and replication models, the special purpose query language, the efficient and robust disk layout are all carefully integrated for a reliable and efficient system.






for installation of CouchDB on linux/ubuntu,windows,android and other systems you can click on this url:
wiki.apache.org