LINUX <ul><li>Linux is a computer operating system family, as well as one of the most prominent examples of free and open source development </li></ul><ul><li>Linux receives use as an operating system for a wide variety of computer hardware including desktop computers, supercomputers, mainframes and embedded devices such as cellphones </li></ul>
BASIC COMMANDS IN LINUX <ul><li>CALENDER </li></ul>cal: Command to see calender for any specific month or a complete year cal [ [month] year] $ cal april 2009 April 2009 Su Mo Tu We Th Fr Sa 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
<ul><li>DATE </li></ul>date: displays the current date $ date Tue Jun 1 21:35:34 IST 2010 <ul><li>cd /home </li></ul><ul><li>Change the current working directory to /home. The '/' indicates relative to root, and no matter what directory you are in when you execute this command, the directory will be changed to "/home". </li></ul>
<ul><li>Cat </li></ul><ul><li>Sends file contents to standard output. This is a way to list the contents of short files to the screen. It works well with piping. </li></ul><ul><li>Locate </li></ul><ul><li>A fast database driven file locator. </li></ul><ul><li>slocate -u This command builds the slocate database. It will take several minutes to complete this command. This command must be used before searching for files, however cron runs this command periodically on most systems. </li></ul><ul><li>Logout </li></ul><ul><li>Logs the current user off the system. </li></ul><ul><li>Ls </li></ul><ul><li>ls List files in the current working directory except those starting with and only show the file name. </li></ul>
<ul><li>passwd: Changing your password </li></ul>passwd command allows you to change your password kuteer: ̃/workshop$ passwd Changing password for srihari. (current) UNIX password: Enter new UNIX password: Retype new UNIX password: passwd: password updated successfully
<ul><li>WHO: Who are the users? </li></ul>who command tells you the users currently logged on to the system kuteer: ̃$ who srihari pts/0 2009-04-15 11:58 (:10.129.41.3) nithin pts/1 2009-04-15 16:09 (:10.129.20.5) avadhut pts/2 2009-04-13 14:39 (:10.129.45.20) anil pts/3 2009-04-13 16:32 (:10.129.23.45)
<ul><li>man - The reference Manual </li></ul>man displays the documentation for a command usage: man <command name> ls - list directory contents SYNOPSIS ls [OPTION]... [FILE]... DESCRIPTION List information about the FILEs (the none of -cftuvSUX nor --sort.
Linux file system Standard directory structure / - the topmost /dev - all the devices are accessible as files /var - “variable” data such as mails, log files, databases /usr - almost all the packages installed /etc - configuration files /home - home directories for all the users /root - home directory of the privileged user root /mnt - used to mount other directories/partitions.
<ul><li>show all own processes – ps </li></ul><ul><li>show all processes - ps -ef </li></ul><ul><li>show all processes for user user - ps -fu user </li></ul><ul><li>show all processes like Windows Task Manager - top </li></ul><ul><li>show who is logged on to this machine – who </li></ul><ul><li>display disk usage of this machine - df -h </li></ul><ul><li>display name, kernel information - uname -a </li></ul><ul><li>create a blank file - touch file or cat </dev/null > file </li></ul><ul><li>remove file - rm file </li></ul>
<ul><li>remove file without confirmation - rm -f file </li></ul><ul><li>remove all files in the current directory - rm * </li></ul><ul><li>display disk usage of this machine - df -h </li></ul><ul><li>display name, kernel information - uname -a </li></ul><ul><li>time & date - date -u </li></ul><ul><li>machine up time and load averages - uptime </li></ul><ul><li>shutdown machine - shutdown now </li></ul><ul><li>shutdown machine and reboot - shutdown -r now </li></ul>
<ul><li>shutdown machine (fast mode) in 10 seconds - shutdown -f -t10 </li></ul><ul><li>shutdown machine in 10 minutes - shutdown -t600 </li></ul><ul><li>shutdown machine and reboot in 30 seconds - shutdown -r -t30 </li></ul><ul><li>shutdown now, check disks on reboot - shutdown -Fr now </li></ul><ul><li>logout - exit, CTRL-D </li></ul><ul><li>switch to user user - su user </li></ul><ul><li>switch to user user and inherit their properties - su - user </li></ul><ul><li>login as superuser - su - root </li></ul>
<ul><li>create user user - mkuser user </li></ul><ul><li>change your password - passwd </li></ul><ul><li>change user's password - passwd user - need to run as root(superuser) </li></ul>
ADVANCE LINUX COMMANDS: <ul><li>The du command prints a summary of the amount of information you have stored in your directories on the mounted disks. </li></ul><ul><li>syntax: du [options] path </li></ul><ul><li>ex: du -a /News </li></ul><ul><li>The grep command searches text files for a particular word or string of words. Very helpful when trying to find that needle in a haystack, like a particular line in a large log file. </li></ul><ul><li>syntax: grep textstring filename(s) </li></ul><ul><li>ex: grep century history.text.doc </li></ul>
<ul><li>head: prints the beginning of a text file </li></ul><ul><li>tail: prints the end of a text filehead: prints the beginning of a text file </li></ul><ul><li>ps : This will list all of your current processes running, or stopped. </li></ul><ul><li>W : This command allows you to list all users’ and their processes who are currently logged in to the Linux server, or a particular user’s processes. Type: w to view all users’ processes. Type: w jsmith to view jsmith’s processes. </li></ul><ul><li>pwd- to list the name of your current directory </li></ul>
APACHE : <ul><li>The Apache HTTP Server Project is an effort to develop and maintain an open-source HTTP server for modern operating systems including UNIX and Windows NT. </li></ul><ul><li>The goal of this project is to provide a secure, efficient and extensible server that provides HTTP services in sync with the current HTTP standards. </li></ul><ul><li>Apache httpd has been the most popular web server on the Internet since April 1996, and celebrated its 15th birthday as a project this February. </li></ul>
DOWNLOAD : The best place to get Apache is from the Apache HTTP Server download site. Download the sources appropriate to your system. EXTRACT THE FILES: <ul><li>Downloaded files need to uncompress them and untarring: </li></ul><ul><li>gunzip -d httpd-2_0_NN.tar.gz </li></ul><ul><li>tar xvf httpd-2_0_NN.tar </li></ul><ul><li>This creates a new directory under the current directory with the source files. </li></ul>
INSTALLATION : SERVER ROOT : <ul><li>The top of the directory tree under which the server's </li></ul><ul><li>configuration, error, and log files are kept. </li></ul><ul><li>ServerRoot : "/opt/lampp" </li></ul><ul><li>Listen: Allows you to bind Apache to specific IP addresses and/or </li></ul><ul><li>ports, instead of the default. See also the <VirtualHost> </li></ul><ul><li>directive. </li></ul>
DocumentRoot "/opt/lampp/htdocs" Each directory to which Apache has access can be configured with respect to which services and features are allowed and/or disabled in that# directory (and its subdirectories). CONFIGURING : <ul><li>This specifies the directory where the Apache files will be installed. You can also set specific environment variables and modules. Some of the modules I like to have installed are: </li></ul>
* mod_alias - to map different parts of the URL tree * mod_include - to parse Server Side Includes * mod_mime - to associate file extensions with its MIME-type * mod_rewrite - to rewrite URLs on the fly * mod_speling (sic) - to help your readers who might misspell URLs * mod_ssl - to allow for strong cryptography using SSL * mod_userdir - to allow system users to have their own Web page directories
BUILD : As with any source installation, you'll then need to build the installation: make make install CUSTAMIZE : Assuming that there were no problems, you are ready to customize your Apache configuration. This really just amounts to editing the httpd.conf file. This file is located in the PREFIX/conf directory.
TEST YOUR SERVER : Open a Web browser on the same machine and type http://localhost/ in the address box. You should see a page similar to the one in the partial screen shot above
PHP : <ul><li>PHP lets programmers create web pages with dynamic content that can interact with databases and provides an object-oriented structure for developers. </li></ul><ul><li>This makes it very popular for developing any web based software applications. If you’re looking for help with PHP, look no further </li></ul><ul><li>PHP is a general-purpose scripting language suited for Web development. The PHP script can be embedded into HTML. </li></ul>
INSTALLATION : To install PHP5 you can enter the following command in the terminal prompt: sudo apt-get install php5 libapache2-mod-php5 <ul><li>You can run PHP5 scripts from command line. To run PHP5 scripts from command line you should install php5-cli package. To install php5-cli you can enter the following command in the terminal prompt: </li></ul>sudo apt-get install php5-cli
<ul><li>You can also execute PHP5 scripts without installing PHP5 Apache module. To accomplish this, you should install php5-cgi package. You can run the following command in a terminal prompt to install php5-cgi package: </li></ul>sudo apt-get install php5-cgi <ul><li>To use MySQL with PHP5 you should install php5-mysql package. To install php5-mysql you can enter the following command in the terminal prompt: </li></ul>sudo apt-get install php5-mysql
Similarly, to use PostgreSQL with PHP5 you should install php5-pgsql package. To install php5-pgsql you can enter the following command in the terminal prompt: sudo apt-get install php5-pgsql CONFIGURATION : By default, the Apache 2 Web server is configured to run PHP5 scripts. In other words, the PHP5 module is enabled in Apache2 Web server automatically when you install the module. Please verify if the files /etc/apache2/mods-enabled/php5.conf and /etc/apache2/mods-enabled/php5.load exist. If they do not exists, you can enable the module using a2enmod command.
<ul><li>You can run the following command at a terminal prompt to restart your web server: </li></ul>sudo /etc/init.d/apache2 restart TESTING : <ul><li>To verify your installation, you can run following PHP5 phpinfo script: </li></ul><?php print_r (phpinfo()); ?>
MYSQL : <ul><li>MySQL is a fast, multi-threaded, multi-user, and robust SQL database server. </li></ul><ul><li>It is intended for mission-critical, heavy-load production systems as well as for embedding into mass-deployed software. </li></ul>
<ul><li>To install MySQL, run the following command from a terminal prompt: </li></ul>sudo apt-get install mysql-server <ul><li>Once the installation is complete, the MySQL server should be started automatically. You can run the following command from a terminal prompt to check whether the MySQL server is running: </li></ul>sudo netstat -tap | grep mysql INSTALLATION :
<ul><li>When you run this command, you should see the following line or something similar: </li></ul>tcp 0 0 localhost.localdomain:mysql *:*LISTEN - <ul><li>If the server is not running correctly, you can type the following command to start it: </li></ul>sudo /etc/init.d/mysql restart
CONFIGURATION : You can edit the /etc/mysql/my.cnf file to configure the basic settings -- log file, port number, etc. For example, to configure MySQL to listen for connections from network hosts, change the bind_address directive to the server's IP address: bind-address = 192.168.0.5
After making a change to /etc/mysql/my.cnf the mysql daemon will need to be restarted: sudo /etc/init.d/mysql restart
Send a Request To a Server <ul><li>To send a request to a server, we use the open() and send() methods of the XMLHttpRequest object: </li></ul>xmlhttp.open("GET","ajax_info.txt",true); xmlhttp.send();
METHOD DESCRIPTION open(method,url,async) open(method,url,async) Specifies the type of request, the URL, and if the request should be handled asynchronously or not. method: the type of request: GET or POST url: the location of the file on the server async: true (asynchronous) or false (synchronous) send(string) Sends the request off to the server. string: Only used for POST requests
SERVER RESPONSE : <ul><li>To get the response from a server, use the responseText or responseXML property of the XMLHttpRequest object. </li></ul>PROPERTY DESCRIPTION Response Text Get the response data as a string Response XML Get the response data as XML data
The responseText Property If the response from the server is not XML, use the responseText property. The responseText property returns the response as a string, and you can use it accordingly: EXAMPLE : document.getElementById("myDiv").innerHTML=xmlhttp.responseText;
The responseXML Property If the response from the server is XML, and you want to parse it as an XML object, use the responseXML property:
CSS (Cascading Style Sheets) : Style sheets are a very powerful tool for the Web site developer. They give you the chance to be completely consistent with the look and feel of your pages, while giving you much more control over the layout and design than straight HTML ever did.
THE STYLES : One of the more common styles applied to HTML is the color and size of text. In HTML 3.2 you would create a blue H4 headline like this: <font color="#0000ff"><h4>a blue headline</h4></font>
STYLE SHEETS : <ul><li>PART 1: </li></ul>The first in a two-part tutorial on Cascading Style Sheets, thisarticle explains how to create and use style rules across your Web site,and then demosntrates a few basic CSS properties. Also included:inheritance, classes, contextual selectors and some lightbulb jokes.
STYLE SHEET : <ul><li>PART 2 : </li></ul>The concluding part of this tutorial explores some of the CSS properties related to text alignment, spacing and positioning, together with a look at absolute and relative positioning, z-index stacking, and borders and padding. If you've been paying attention, you now know the basics of style sheets - what they are, how to use them, and how to link them to your Web pages - together with some of the important style sheet properties that control typeface and colour.
HTML : <ul><li>Hypertext markup language: a set of tags and rules (conforming to SGML) for using them in developing hypertext documents </li></ul><ul><li>HTML defines the structure and layout of a Web document </li></ul><ul><li>by using a variety of tags and attributes. The correct structure for an HTML document starts with <HTML><HEAD>(enter here what document is about)<BODY> and ends with </BODY></HTML>. All the information you'd like to include in your Web page fits in between the <BODY> and </BODY> tags. </li></ul>
HTML Basic Document <html> <head> <title>Document name goes here</title> </head> <body> Visible text goes here... </body> </html>
Heading Elements <h1>Largest Heading</h1> <h2> . . . </h2> <h3> . . . </h3> <h4> . . . </h4> <h5> . . . </h5> <h6>Smallest Heading</h6> Text Elements <p>This is a paragraph</p> <br /> (line break) <hr /> (horizontal rule) <pre>This text is preformatted</pre>
Logical Styles <em>This text is emphasized</em> <strong>This text is strong</strong> <code>This is some computer code</code> Physical Styles <b>This text is bold</b> <i>This text is italic</i> Links, Anchors, and Image Elements <a href="http://www.example.com/">This is a Link</a> <a href="http://www.example.com/"><img src="URL" alt="Alternate Text"></a> <a href="mailto:firstname.lastname@example.org">Send e-mail</a>
A named anchor: <a name="tips">Useful Tips Section</a> <a href="#tips">Jump to the Useful Tips Section</a> Unordered list <ul> <li>First item</li> <li>Next item</li> </ul> Ordered list <ol> <li>First item</li> <li>Next item</li> </ol>
Other Elements <!-- This is a comment --> <blockquote> Text quoted from a source. </blockquote> <address> Written by W3Schools.com<br /> <a href="mailto:email@example.com">Email us</a><br /> Address: Box 564, Disneyland<br /> Phone: +12 34 56 78 </address>
WEB 2.0 : <ul><li>The term "Web 2.0" is commonly associated with web applications that facilitate interactive information sharing </li></ul><ul><li>Web 2.0 is the popular term for advanced Internet technology and applications including blogs, wikis, RSS and social bookmarking. </li></ul><ul><li>The two major components of Web 2.0 are the technological advances enabled by Ajax and other new applications such as RSS and Eclipse and the user empowerment that they support. </li></ul>
RSS : The weblog has an RSS feed in place, subscribers to the blog can choose to be automatically notified of this new blog post. RSS (or Really Simple Syndication), is a method for delivering regularly changing Web content. Many blogs and Internet publishers syndicate their content as an RSS Feed to allow people to subscribe to it easily. TAG : The content by users adding "tags" - short, usually one-word descriptions - to facilitate searching, without dependence on pre-made categories. Collections of tags created by many users within a single system may be referred to as "folksonomies"
TAXONOMY : Folk Taxonomy or Folxonomy allows users to create tags which means that you can have a virtually infinite set.Ã‚Â Systems that use folxonomy include Drupal, Joomla, Flickr, YouTube, Revver, and Google Video.Ã‚Â Taxonomies are used when: * Ã‚Â you don't know how many elements might need to be classified * when you need a classification system that can deal with disparate elements. * Folxonomy also creates structure, but it is much more organic than a taxonomy.Ã‚Â
WYSIWYG : WYSIWYG is an acronym for What You See Is What You Get. The term is used in computing to describe a system in which content displayed during editing appears very similar to the final output, which might be a printed document, web page, slide presentation or even the lighting for a theatrical event ATOM : Atom is a simple way to read and write information on the web, allowing you to easily keep track of more sites in less time, and to seamlessly share your words and ideas by publishing to the web.