jump to navigation

How does live linux disk work without any swap for applications bigger than available RAM? December 14, 2009

Posted by tuxdna in Uncategorized.
add a comment

How does live linux disk work without any swap for applications bigger than available RAM? This question has occurred to me a lot of times. In the normal scenario I configure enough swap space on the harddis for my GNU/Linux installation. It looks clear that whenever a new request for memory is made by an application, the Linux kernel (OS) gives that request by swapping out a page into swap space ( when there wasn’t enought space available in RAM). However when an application is large and there in no swap space availabe, what does the Linux kernel  do with existing process’s memory ( the pages )?

The answer to this question occured to me when I was reviewing my OS concepts from the famous book by Galvin and Gagne – Operating System Concepts which says:

Some systems attempt to limit the amount of swap space used through demand paging of binary files. Demand pages for such files are brought directly from the file system. However, when page replacement is called for, these frames can simply be overwritten (because they are never modified), and the pagesn can be read in from the file system again if needed. Using this approach, the file system itself serves as the backing store. However, swap space must still used for pages not associated with a file; these pages include the stack and heap for a process. This method apears to be a good compromise and is used in several systems, including Solaris and BSD UNIX.

It is quite clear from the above that for binary files ( the non-modifiable part of application ), the files can be read again and again without any issue of swapping out the page in memory. The only concern now is the heap and swap space that is occupying the memory. What is a solution for that?

Explore. Dream. Discover. November 18, 2009

Posted by tuxdna in Uncategorized.
add a comment

Twenty years from now you will be more disappointed by the things you didn’t do than by the ones you did do.

So throw off the bowlines.

Sail away from the safe harbor.

Catch the trade winds in your sail.

Explore.

Dream.

Discover.

- Mark Twain

Object Oriented programming in C! November 11, 2009

Posted by tuxdna in Uncategorized.
add a comment

Reference: Glib-C: C as an alternative Object Oriented Environment

Glib Tutorials:
https://www14.software.ibm.com/webapp/iwm/web/preLogin.do?source=dw-linux-glib&S_TACT=105AGX59&S_CMP=GR&ca=dgr-lnxw16GLibCollections

http://www.ibm.com/developerworks/linux/library/l-glib.html
http://www.ibm.com/developerworks/linux/library/l-glib2.html

GObject
http://library.gnome.org/devel/gobject/stable/

Compiling GLib Applications:
http://library.gnome.org/devel/glib/stable/glib-compiling.html

JDB – Java Debugger November 7, 2009

Posted by tuxdna in Uncategorized.
add a comment

Debugging Java Code:

jdb supports fairly primitive support for debugging, which is sufficient ( in my opinion ) when used as a backend for an IDE ( like NetBeans, Eclipse etc. ).

However when I compare it with GDB ( the GNU Debugger ), as a tool to be used on the terminal, it seems to be pretty old. JDB lacks in features and commands which GDB specializes in. I was mainly interested in abbreviation of commands.  Like  s ( step ), c (continue), bt ( backtrace ) etc. Also to see the listing  of sourcode, I had to repeatedly type list ( Press Enter ) , again list  ( Press Enter ) , and so on. JDB still shows the same lines ( i.e. where break  point ocurred ), where GDB shows lines continually.

Debugging with JDB:
================================================================================
jdb’s Core Commands:

help           –  print all commands jdb can understand
print object   –  print an object using its toString() method
list [line number|method]  — print source code lines
locals         — print local variablesâ values
exit           — quit the debugger
where          — list the history of nest function calls so far
stop at class:line    — set a break point where execution will halt
stop at class.method  — set a break point at a ’suspect’ function
cont   — continue execution after a break point has been hit
step   — execute a single source code line
run    — run the program (stops if there are break points set with stop)

Using JDB:
================================================================================
[shell-prompt]$ jdb MyClass

When started this way, jdb invokes a second Java VM with any specified parameters, loads the specified class, and stops the VM before executing that class’s first instruction.

Another way to use jdb is by attaching it to a Java VM that is already running. A VM that is to be debugged with jdb must be started with the following options:

-Xdebug

Enables debugging support in the VM.

-Xrunjdwp:trans port=dt_socket, server=y,suspend=n

Loads in-process debugging libraries and specifies the kind of connection to be made.                        

For example, the following command will run the MyClass application and allow jdb to connect to it at a later time:

[shell-prompt]$ java -Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n Class

You can then attach jdb to the VM with the following command:

[shell-prompt]$ jdb -attach 8000

Note that MyClass is not specified in the jdb command line in this case because  jdb is connecting to an existing VM instead of launching a new one. There are many other ways to connect the debugger to a VM, and  all  of them are supported by jdb.  The Java Platform Debugger Architecture has additional documentation on these connection options.

Generating subsets November 6, 2009

Posted by tuxdna in Uncategorized.
add a comment

GIT November 6, 2009

Posted by tuxdna in Uncategorized.
add a comment
Branching and Merging

Creating a branch:

git checkout -b branch-name
OR
git branch branch-name
git checkout branch-name
Example:
$ git branch rm123
$ git checkout rm123
Merging a branch:

$ git checkout master
$ git merge rm123


Building GNOME from source code October 26, 2009

Posted by tuxdna in Uncategorized.
add a comment

Reference: http://live.gnome.org/Jhbuild

First download and install Jhbuild as mentioned at:
http://live.gnome.org/Jhbuild

Modify the configuration file like this:

# -*- mode: python -*-

# edit this file to match your settings and copy it to ~/.jhbuildrc

# if you have a GNOME git account, uncomment this line
# repos['git.gnome.org'] = ’ssh://user@git.gnome.org/git/’

modulesets_dir = ‘/home/tuxnda/work/dev/jhbuild/modulesets/’
# what module set should be used. The default at the moment is ‘gnome-2.26′,
# but it can be any of the files in the modulesets directory, or even
# the URL of a module set file on a web server.
# moduleset = ‘gnome-2.26′
moduleset = ‘gnome-2.30′

# A list of the modules to build. Defaults to the Gnome Desktop and
# developer platform.
# modules = [ 'meta-gnome-desktop' ]

# what directory should the source be checked out to?
checkoutroot = os.path.expanduser(‘~/work/dev/gnome/checkout/gnome2′)

# the prefix to configure/install modules to (must have write access)
prefix = os.path.expanduser(‘~/work/dev/gnome’)

# extra arguments to pass to all autogen.sh scripts
# to speed up builds of gnome2, try ‘–disable-static –disable-gtk-doc’
# it is also possible to set CFLAGS this way, ‘CFLAGS=”-g -O2″‘ for example
#autogenargs=”

# On SMP systems you may use something like this to improve compilation time:
# be aware that not all modules compile correctly with make -j2
#makeargs = ‘-j2′

Build the basic bootstrap system for building gnome:

$ jhbuild bootstrap -c -a –ignore-system

Now build gnome:

$ jhbuild build

Adding DeviceKit-disks to ubuntu September 30, 2009

Posted by tuxdna in Uncategorized.
add a comment

Adding DeviceKit-disks to ubuntu is fairly simple once you reach this page:

http://packages.ubuntu.com/karmic/i386/devicekit-disks/download

Now add the following line to your software sources ( /etc/apt/sources.list ):
deb http://cz.archive.ubuntu.com/ubuntu karmic main

Thats it!

Building the Nemiver Debugger for GNOME on Ubuntu 9.04 July 5, 2009

Posted by tuxdna in Uncategorized.
1 comment so far

Building the Nemiver Debugger for GNOME on Ubuntu 9.04 – the Jaunty Jackalope : http://projects.gnome.org/nemiver/

Install the libraries

$ sudo aptitude install libglademm-2.4-dev libvte-dev libgtop2-dev libsqlite3-dev libgconf2-dev libgtksourceviewmm-2.0-dev gnome-common libboost-dev

Checkout the code
$ cd ~/work/
$ git clone git://git.gnome.org/nemiver nemiver.git

Now build Nemiver

$ cd nemiver.git
$ ./autogen.sh
$ make

What will be the future of IT in India? May 10, 2009

Posted by tuxdna in Uncategorized.
4 comments

What will be the future of IT in India?

References:

[1] “Information Technology in India: Present Status and Future Prospects for Economic Development” http://www.iitk.ac.in/directions/may2006/PRINT~SANJAY.pdf
[2] “Larry Summers Speech, Brookings Institution, The Obama Program and the Current Economic Crisis” http://www.clipsandcomment.com/2009/03/13/full-text-larry-summers-speech-brookings-institution-the-obama-program-and-the-current-economic-crisis/

On one hand there is “Recession in the US” and on the other hand there is a potential Domestic IT market in India in the long run.

Till recently in 2006, the IT exports from India were accounted 60% by the US, 20% by the UK and rest by other countries and India’s Domestic IT market. “Recession in the US” has changed this scenario. There have been may job cuts, lay-offs and cost cuttings specially by the companies which work for clients from US. Followed by this many new strategies are emerging like “reduce employees, increase the workload” to counter balance the effect of recession.

The US government is all set with various plans and strategies [2] to recover from the effect of recession. But no one knows about the future. We can only speculate the aftermath of the plans yet to be implemented. We can only work hard and hope for the better, after all it affects the Indian economy as well to a very large extent.

Did you see the point here? Well, the point is that even if the US does not complete recover from the recession right not, it “will” recover slowly. It will take its time to improve but will not atleast worsen the situation assuming that the new US Government policies are implemented and practiced successfully.

For the good news, you might/not be surprised to know that there is a lot of scope in Domestic IT market in India.

“Domestic IT spending is expected to increase further in the coming years due to increase in telecom and internet penetration, higher IT budget allocations by the governments, IT spending by BFSI (banking, financial services and insurance) sector, manufacturing and engineering firms, automobiles and retail sector, and greater focus on maintenance and security infrastructure by vendor firms.” [1]

This means that there is a large scope for ventures that can be done with IT in mind.

“According to the Broadband Policy 2004 document published by the Ministry of Communication and Information Technology, Government of India, New Delhi, internet connectivity is expected to increase from 6 millions in 2005 to 40 million in 2010. A denser telephone and internet network along with increased PC ownership will provide the opportunities for increasing the rate of training people for the IT industry.” [1]

This meas that there will be an increasing user base for the services/products created using the IT infrastructure.

So overall, we ( as IT workers ) need not worry about our futures. And as the universal rule “survival of the fittest” says that we continuously need to brush up our skills to be on the edge, so we just have to keep the spirit alive.

“Although the domestic IT market is just marginally more than half of the export, it has started growing at a rate of 20% per year or so during the recent years.” [1]

You might be temped by now to think of a venture into the Indian Domestic IT Industry. Wait! It is feasible to start your venture if you target only the urban areas ( like metro cities ). But there are some potential problems which might have to be resolved first if you target rural areas:

• What exactly are you trying to correct in the rural areas? ( it applies to urban areas as well )
• How well will the rural people able to use the services you build using IT? ( education, familiarity with the technology etc.)
• How easy will it be to make it accessible to them? ( hardware, software, regualtory issues, communication issues, tarrifs etc. )

This is my effort to understand the future prospects for the IT industry in India. Your comments are welcome.