|
Dear All,
We are celebrating the second anniversary of IndianGNU.org community!! Many many thanks to all Contributors…
Thank you,
IndianGNU community
![]()
|
![]()
|
Introduction -
1] What is MBR ?
Master Boot Record (MBR) is the 512-byte boot sector (first sector) of a your a Hard Disk Drive (HDD). MBR contains -
1) Primary Partition table
2) Boot Loader (GRUB/LILO etc)
*** Total Size of MBR is 512 byte and which is divided as shown below…
1) Boot Loader (code) - 446 byte
2) Primary partion table - 64 byte (16 byte * 4)
3) Disk signature & others - 6 byte
4) MBR signature - 2 byte
2] Disk Partitioning - There are two methods/schemes of Disk partitioning
a) MBR Partition Table
b) GUID Partition Table
When a Hard Disk is partitioned with the MBR Partition Table scheme - MBR contains the primary partition entries. Maximum four (4) primary partition or three (3) primary partition and one extended partition can be created. The partition table entries for other secondary partitions are stored in Extended Partition Table. In extended partition, we can create 128 logical partitions.
When a Hard Disk is partitioned with the GUID Partition Table scheme - the Master Boot Record will still contain a partition table, but its only purpose is to indicate the existence of the GUID Table
3] How to read MBR (Master Boot Record)
root@indiangnu:/home/arun# dd if=/dev/sda of=/home/arun/MBR.details bs=512 count=1
1+0 records in
1+0 records out
512 bytes (512 B) copied, 0.00014018 s, 3.7 MB/s
root@indiangnu:/home/arun#
root@indiangnu:/home/arun# ls -shl /home/arun/MBR.details
4.0K -rw-r–r– 1 root root 512 2008-09-28 17:57 /home/arun/MBR.details
root@indiangnu:/home/arun#
** The size of file is 512 byte and it is in binary format
command(1) - od
od command dump files in octal or other format
# od [options] file_name
Options
-a select named characters, ignoring high-order bit
-b select octal bytes
-c select ASCII characters or backslash escapes
-i select decimal ints
-x select hexadecimal 2-byte units
** How to convert Binary MBR file data in other format like Hexadecimal format -
arun@indiangnu:~$ od -x /home/arun/MBR.details
0000000 48eb d090 00bc fb7c 0750 1f50 befc 7c1b
0000020 1bbf 5006 b957 01e5 a4f3 bdcb 07be 04b1
0000040 6e38 7c00 7509 8313 10c5 f4e2 18cd f58b
0000060 c683 4910 1974 2c38 f674 b5a0 b407 0203
0000100 00ff 2000 0001 0000 0200 90fa f690 80c2
0000120 0275 80b2 59ea 007c 3100 8ec0 8ed8 bcd0
0000140 2000 a0fb 7c40 ff3c 0274 c288 be52 7d7f
0000160 34e8 f601 80c2 5474 41b4 aabb cd55 5a13
0000200 7252 8149 55fb 75aa a043 7c41 c084 0575
0000220 e183 7401 6637 4c8b be10 7c05 44c6 01ff
0000240 8b66 441e c77c 1004 c700 0244 0001 8966
0000260 085c 44c7 0006 6670 c031 4489 6604 4489
0000300 b40c cd42 7213 bb05 7000 7deb 08b4 13cd
0000320 0a73 c2f6 0f80 ea84 e900 008d 05be c67c
0000340 ff44 6600 c031 f088 6640 4489 3104 88d2
0000360 c1ca 02e2 e888 f488 8940 0844 c031 d088
0000400 e8c0 6602 0489 a166 7c44 3166 66d2 34f7
0000420 5488 660a d231 f766 0474 5488 890b 0c44
0000440 443b 7d08 8a3c 0d54 e2c0 8a06 0a4c c1fe
0000460 d108 6c8a 5a0c 748a bb0b 7000 c38e db31
0000500 01b8 cd02 7213 8c2a 8ec3 4806 607c b91e
0000520 0100 db8e f631 ff31 f3fc 1fa5 ff61 4226
0000540 be7c 7d85 40e8 eb00 be0e 7d8a 38e8 eb00
0000560 be06 7d94 30e8 be00 7d99 2ae8 eb00 47fe
0000600 5552 2042 4700 6f65 006d 6148 6472 4420
0000620 7369 006b 6552 6461 2000 7245 6f72 0072
0000640 01bb b400 cd0e ac10 003c f475 00c3 0000
0000660 0000 0000 0000 0000 a328 228b 0000 0180
0000700 0001 fe07 ffff 003f 0000 1637 0271 0000
0000720 ffc1 fe07 ffff 1676 0271 0d7a 0177 fe00
0000740 ffff fe83 ffff 23f0 03e8 f10c 0002 0000
0000760 ffc1 fe05 ffff 14fc 03eb cfc5 0565 aa55
0001000
arun@indiangnu:~$
** you can also use following command
arun@indiangnu:~$ od -ax /home/arun/MBR.details
Thank you,
Arun Bagul

- IndianGNU.org
![]()
Introduction - VirtualBox is open source virtualization solution by Innotek GmbH (which is recently acquire by Sun Microsystem) for x86 hardware. Virtualization is a technique for hiding the physical characteristics of computing resources from the way in which other systems, applications, or end users interact with those resources. There are two types of virtualization…
VirtualBox is full virtualization which allows unmodified operating system with all of its installed software to run in a special environment, on top of your existing operating system. This environment, called a virtual machine, is created by the virtualization software by intercepting access to certain hardware components and certain features. The physical computer is then usually called the host, while the virtual machine is often called a guest. Guest operating system on virtual host runs same on the virtual box as it’s running on real machine.
VirtualBox is also different from so-called ‘paravirtualization’ solutions such as Xen, which require that the guest operating system be modified. In paravirtualization the virtual machine provides special API that can only be used by modifying Guest Operating System.
Presently, VirtualBox runs on Windows, Linux, Macintosh and OpenSolaris hosts and supports a large number of guest operating systems including but not limited to Windows (NT 4.0, 2000, XP, Server 2003, Vista), DOS/Windows 3.x, Linux (2.4 and 2.6), and OpenBSD. You can download VirtualBox from URL http://virtualbox.org/wiki/Downloads…
Thank you,
Arun
Introduction - some one ask me about man pages specially development related man pages, which was not installed on Ubuntu by default. System call and function related man pages are very useful to the programmers. So this article will help you to do this in two steps….
1] Search man pages -
root@arunbagul:~# apt-cache search dev man pages
* This command will display most of the packages related to man pages…
2] Install development man pages -
root@arunbagul:~# apt-get install manpages-dev
Reading package lists… Done
Building dependency tree
Reading state information… Done
…..
……
Get:1 http://in.archive.ubuntu.com gutsy/main manpages-dev 2.62-1 [1252kB]
Fetched 1252kB in 9s (137kB/s)
Selecting previously deselected package manpages-dev.
(Reading database … 113515 files and directories currently installed.)
Unpacking manpages-dev (from …/manpages-dev_2.62-1_all.deb) …
Setting up manpages-dev (2.62-1) …
root@arunbagul:~#
3] How to read man pages…
root@arunbagul:~# man 3 <func_name>
root@arunbagul:~# man 3 putc
root@arunbagul:~# man 3 system
root@arunbagul:~# man 3 exec
root@arunbagul:~#
4] Short notes on manual pages -
Types of Manual pages -
1 Executable programs or shell commands
2 System calls (functions provided by the kernel)
3 Library calls (functions within program libraries)
4 Special files (usually found in /dev)
5 File formats and conventions eg /etc/passwd
6 Games
7 Miscellaneous (including macro packages and conven‐
tions), e.g. man(7), groff(7)
8 System administration commands (usually only for root)
9 Kernel routines [Non standard]
Thank you,
Arun
Introduction-
andLinux is an Ubuntu system that runs seamlessly in Windows (2000, 2003, XP & Vista). It works only with 32 bit version of Windows. You can run andLinux without installing a virtual machine.
andLinux uses CoLinux as its core. CoLinux is a port of the Linux kernel to Windows. CoLinux differs itself from VMWare or Virtualbox by being more of a merger of Windows and the Linux kernel and not an emulated PC. Xming is used as X server and PulseAudio as sound server.
To start Linux applications, you may either use the XFCE Panel or you may choose to use the andLinux Launcher, which ships with andLinux. andLinux launcher consists of
Security warning: According to andLinux It is recommended to use andLinux only on single-user-PCs or in a trustworthy environment because the communication with the X-Server and the launcher is not secured, i.e., every user who can login to Windows can access andLinux.
Screenshot -

Introduction - Few days back was looking for open source browser… and finally I found the flock-The Social Web Browser. Flock browser is based on Mozilla Firefox web browser. But it has lot of features like it is link with photo gallery , flickr, blog, youtube, my world , custome home page etc… and looks good..
Screen shot -

I was associated with Magnet for 17 months. It was nice experience working with Magnet.I joined Magnet on
What I really impressed in Magnet is the work culture of Magnet, Monday Meeting (MM), Monthly review Meeting (MoM) and Hack Festival. Thanks to Mr. Ashok (Ashok Karania, CEO and MD of Magnet Technologies) for putting wonderful idea of MM. On every Monday at
I wish all the best to all Magneteer and Magnet Technologies.
Wish you greate future ahead!!
Thank you,
Arun Bagul
Ruby is a pure object-oriented programming language with a super clean syntax that makes programming elegant and fun. Ruby successfully combines Smalltalk’s conceptual elegance, Python’s ease of use and learning, and Perl’s pragmatism. Ruby originated in Japan in the early 1990s, and has started to become popular worldwide in the past few years as more English language books and documentation have become available.
Rails is an open source Ruby framework for developing database-backed web applications. What’s special about that? There are dozens of frameworks out there and most of them have been around much longer than Rails. Why should you care about yet another framework?
Many things that are very simple to do in Ruby are not even possible in most other languages. Rails takes full advantage of this. The rest of the answer is in two of Rail’s guiding principles: less software and convention over configuration.
Ruby on Rails is a free web application framework. It aims to increase the speed and ease with which database-driven web sites can be created, and offers skeleton code frameworks (scaffolding) from the outset. Often shortened to Rails, or RoR, Ruby on Rails is an open source project written in the Ruby programming language, and applications using the Rails framework are developed using the Model-View-Controller design paradigm
You can find Installation HowTos from te following Link :-
http://wiki.rubyonrails.org/rails/pages/HowtosInstallation
Like many contemporary web frameworks, Rails uses the Model-View-Controller (MVC) architecture for organizing application programming.
Rails provides ‘out of the box’ scaffolding which can quickly construct most of the models and views needed for a basic website. Other helpful development tools come with or are installed with Rails, such as the WEBrick web server, and the Rake build system.
Rails is also noteworthy for its extensive use of the JavaScript libraries Prototype and Script.aculo.us for Ajax and its graphical interface.
For web services Rails initially supported lightweight SOAP; later it was replaced by RESTful web services. The recommended REST based programming structure changed drastically in version 1.2.
For Installation How Tos about RubyOnRails on RedHat :-
http://wiki.rubyonrails.org/rails/pages/Ruby+and+Rails+on+Red+Hat+Linux+9
Debian Stable contains a prepackaged version of Ruby. In addition to installing Ruby, you also need to install the zlib compression libraries for Ruby, the Ruby Documentation program that generates documentation from ruby source files, and the command-line Ruby interface. Run the following command to install the needed packages:
aptitude install ruby libzlib-ruby rdoc irb
(You might prefer to use “apt-get install ruby libzlib-ruby rdoc irb” if you don’t use aptitude.)
If you want to test-drive Ruby from the command line you can run the irb program and execute Ruby commands:
# irb rb(main):001:0> 3+5 => 8 irb(main):002:0> 4*20 => 80 irb(main):003:0> foo="bar" => "bar" irb(main):004:0> foo.reverse => "rab" irb(main):005:0> bar=40 => 40 irb(main):006:0> bar.to_s.reverse => "04" irb(main):007:0> exit
Now that you have Ruby installed you need to manually download the Gems package management software for Ruby. The latest version of Gems can be downloaded from the RubyForge web site.
From the command line, cd into the directory where you downloaded the Gems tarball and run the following command to extract the contents of the archive:
tar zxvf rubygems-0.8.11.tgz
Please note that the version number may be different if you downloaded a different version. You now need to cd into the newly created Gems directory and run the setup program for Gems:
cd rubygems-0.8.11 ruby setup.rb all
Notice how even the setup program for Gems is written in Ruby. These people take their language seriously.
Now that Gems is installed, you can finally install Rails. Run the following command to tell Gems to download and install the latest version of Rails:
gem install rails --include-dependencies
Congratulations, Ruby on Rails is now installed on your system.
While you can use many different web servers with Rails, we’re going to configure our installation with Apache. If you want to configure Rails with a different web server, a quick Google search will yield results on how to configure Rails with other web servers.
The following command will install Apache and the FastCGI libraries for both Apache and Ruby:
aptitude install apache libapache-mod-fastcgi libfcgi-ruby1.8
(Again, you may use apt-get if you wish: “apt-get install apache libapache-mod-fastcgi libfcgi-ruby1.8“.)
The Debian package manager will automatically update Apache’s configuration file to enable FastCGI and will start the web server. That’s all you need to configure in Apache for right now. We will revisit Apache later in the article when we’ve made more progress.
Now you need to create a place to store your Rails applications. While you can store your Rails applications anywhere you want, including your home directory if desired, I recommend storing them in /var/rails. Why /var? Because /var is where Apache on Debian stores its web site files (/var/www to be exact) and I like keeping similar files in the same directory.
The following commands will create the Rails application directory and set the proper permissions for their use by the web server:
mkdir /var/rails chown -R www-data:www-data /var/rails
Ruby on Rails supports multiple databases. The following is a list of some of the packages that supply database drivers for Ruby:
For example, to install the Ruby drivers for PostreSQL, you would run the following command:
aptitude install libpgsql-ruby
If you want to verify that the drivers are properly installed, you can run the following set of commands:
# irb irb(main):001:0> require 'postgres' => true irb(main):002:0> exit
You can see that the driver loaded successfully and we were able to exit out of the Ruby interface.
If you’re considering using Rails it’s probably because of the promises of a faster development cycle (that’s certain not a bad thing). To further speed up your development time you may consider using an IDE (integrated development environment) like RadRails. The RadRails IDE is based on the Eclipse project and has been customized specifically for Ruby on Rails development. If RadRails sounds like something you’d like to try, read on, otherwise, skip on down to the Creating a Rails Application section and fire up your favorite editor.
Because RadRails is written in Java, you need to install Java on your system. The latest version of Java can be downloaded from Sun’s website.
Once you’ve downloaded the self-extracted archive, run the following command to extract the archive’s contents:
bash jdk-1_5_0_06-linux-i586.bin
You now need to move the extracted directory into the /usr/local directory:
mv jdk1.5.0_06 /usr/local
In order to make the Java executables accessible from your path, you need to create symbolic links for all the Java programs. Fortunately, you can use the wildcard and your shell will automatically expand all the programs and create the links for you.
ln -s /usr/local/jdk1.5.0_06/bin/* /usr/local/bin/
To test that Java is installed on your system and accessible from the path, run the following command.
java -version
You should see a few lines telling you about the version of Java you just installed. If you get an error, please go back and make certain you followed the steps correctly.
An alternative approach is to create a Debian package, and use that to install your Java install. This has been covered here before.
You now need to download the RadRails archive from their website.
After the download is complete, change into the directory where you downloaded the archive to and execute the following command:
unzip radrails-0.5.2.1-linux.zip
If unzip isn’t installed on your system you need to install the package:
aptitude install unzip
(Or “apt-get install unzip“.)
Once you’ve successfully extracted the contents of the archive, execute the following command to move RadRails into its destination directory:
mv radrails /usr/local
RadRails is now installed. You can run RadRails by executing the following command:
/usr/local/radrails/radrails
Note: Because RadRails is a Java program it doesn’t like being called from a symbolic link. If you create a symbolic link to a directory in your path and then try to run the program it will spit out errors and crash. I guess that’s the downside of write-once, run-anywhere.
Now you’re ready to create your first Rails application. All the Rails files that require editing can be opened in any editor (e.g. vi, emacs, etc.) or can be edited with RadRails. Use whichever program is most comfortable for you. However, I do not recommend using RadRails to edit non-Rails files (e.g. httpd.conf). Non-rails files should be edited with a normal editor.
Before you run any commands, change into the rails directory that you created earlier.
cd /var/rails
Now you can tell Rails to create a new application. Replace yourapp with the name of your application:
rails yourapp
Rails will now create a large number of files in /var/rails/yourapp that will make up your Rails application. Let’s start out by editing the .htaccess file in order to tell your application to use FastCGI instead of regular CGI.
Edit the file /var/rails/yourapp/public/.htaccess and make the following changes:
Comment out: RewriteRule ^(.*)$ dispatch.cgi [QSA,L]
Insert: RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]
Notice that the different between the two lines is the extension on the dispatch file. We’ve changed it so your application will use the FastCGI version.
Ruby on Rails has a built-in web server called WEBrick that you can use to test out your Rails applications. While WEBrick is good for testing, you wouldn’t want to use it in a production environment. For the real deal you will want to use a real web server like Apache or lighttpd.
To start WEBrick, run the following command:
script/server
Now you can fire up your web browser and load the following URL to access the web server:
You now have two different options for configuring Apache to use your Rails application. You can configure your application is a virtual host which will not effect the main web site, or you can make the rails application the main web site. If you want to test Rails on a web server that is already serving web sites then you will want to use the virtual host option. If your Rails application is the only thing being served by your web server then you can make it the main web site.
Open up the /etc/apache/httpd.conf file and add the following configuration information at the end of the file:
<virtualhost *:80>
ServerName yourapp
DocumentRoot /var/rails/yourapp/public/
ErrorLog /var/rails/yourapp/log/apache.log
<directory /var/rails/yourapp/public>
Options ExecCGI FollowSymLinks
AddHandler cgi-script .cgi
AllowOverride all
Order allow,deny
Allow from all
</directory>
</virtualhost>
Save the file, exit from your editor and run the following command to restart Apache:
/etc/init.d/apache restart
You now need to edit your /etc/hosts file so the name you gave your server will resolve. Either add the following line to your hosts file or add yourapp to the end of the existing line:
127.0.0.1 yourapp
Now open up your web browser and load the following address:
You should see a page welcoming you to Ruby on Rails!
Open up the /etc/apache/httpd.conf file and make the following change:
Comment out: DocumentRoot /var/www
Insert: DocumentRoot /var/rails/yourapp/public
You will also need to add the follow configuration to the end of the file:
<directory /var/rails/yourapp/public> Options ExecCGI FollowSymLinks AddHandler cgi-script .cgi AllowOverride all Order allow,deny Allow from all </directory>
Save the file, exit from your editor and run the following command to restart Apache:
/etc/init.d/apache restart
Now open up your web browser and load the following address:
You should see a page welcoming you to Ruby on Rails!
This article isn’t going to cover how to write a Rails application. There are a million resources out there that can get you started developing with Rails. If you want some demonstrations of what can be done with Rails in less than half an hour, take a look at the ScreenCasts on the Ruby on Rails web site.
Ruby on Rails documentation, including web sites, books, and other resources, can also be found on the Ruby on Rails Documentation web page.