Posted in Animal, Insects, Life

M O T H

M O T H
M O T H

Don’t pray for lighter burdens, but for stronger backs.

Focal Length: 100mm
Exposore: 1/320sec
ISO Speed: 3200
F-stop: f/5.6

Advertisements
Posted in CPU, linux

CPU Terminology

The utilization of a CPU is largely dependent on what resource is attempting to access it. The kernel has a scheduler that is responsible for scheduling two kinds of resources: threads (single or multi) and interrupts. The scheduler gives different priorities to the different resources. The following list outlines the priorities from highest to lowest:

Hardware Interrupts – These are requests made by hardware on the system to process data. For example, a disk may signal an interrupt when it has completed and IO transaction or a NIC may signal that a packet has been received.

Soft Interrupts – These are kernel software interrupts that have to do with maintenance of the kernel. For example, the kernel clock tick thread is a soft interrupt. It checks to make sure a process has not passed its allotted time on a processor.

Real Time Threads – Real time threads have more priority than the kernel itself. A real time process may come on the CPU and preempt (or “kick off) the kernel. The Linux 2.4 kernel is NOT a fully preemptable kernel, making it not ideal for real time application programming.

Kernel Threads – All kernel processing is handled at this level of priority.

User Threads – This space is often referred to as “userland”. All software applications run in the user space. This space has the lowest priority in the kernel scheduling mechanism.

In order to understand how the kernel manages these different resources, a few key concepts need to be introduced. The following sections introduce context switches, run queues, and utilization.

1. Context Switches:

Most modern processors can only run one process (single threaded) or thread at time. The n-way Hyper threaded processors have the ability to run n threads at a time. Still, the Linux kernel views each processor core on a dual core chip as an independent processor. For example, a system with one dual core processor is reported as two individual processors by the Linux kernel. A standard Linux kernel can run anywhere from 50 to 50,000 process threads at once. With only one CPU, the kernel has to schedule and balance these process threads. Each thread has an allotted time quantum to spend on the processor. Once a thread has either passed the time quantum or has been preempted by something with a higher priority (a hardware interrupt, for example), that thread is place back into a queue while the higher priority thread is placed on the processor. This switching of threads is referred to as a context switch. Every time the kernel conducts a context switch, resources are devoted to moving that thread off of the CPU registers and into a queue. The higher the volume of context switches on a system, the more work the kernel has to do in order to manage the scheduling of processes.

2. The Run Queue:

Each CPU maintains a run queue of threads. Ideally, the scheduler should be constantly running and executing threads. Process threads are either in a sleep state (blocked and waiting on IO) or they are runnable. If the CPU sub-system is heavily utilized, then it is possible that the kernel scheduler can’t keep up with the demand of the system. As a result, runnable processes start to fill up a run queue. The larger the run queue, the longer it will take for process threads to execute. A very popular term called “load” is often used to describe the state of the run queue. The system load is a combination of the amount of process threads currently executing along with the amount of threads in the CPU run queue. If two threads were executing on a dual core system and 4 were in the run queue, then the load would be 6. Utilities such as top report load averages over the course of 1, 5, and 15 minutes.

3. CPU Utilization:

CPU utilization is defined as the percentage of usage of a CPU. How a CPU is utilized is an important metric for measuring system. Most performance monitoring tools categorize CPU utilization into the following categories:

User Time: The percentage of time a CPU spends executing process threads in the user space.

System Time: The percentage of time the CPU spends executing kernel threads and interrupts.

Wait IO: The percentage of time a CPU spends idle because ALL process threads are blocked waiting for IO requests to complete.

Idle: The percentage of time a processor spends in a completely idle state.

4. Time Slicing:

The timeslice2 is the numeric value that represents how long a task can run until it is preempted. The scheduler policy must dictate a default timeslice, which is not simple. A timeslice that is too long will cause the system to have poor interactive performance; the system will no longer feel as if applications are being concurrently executed. A timeslice that is too short will cause significant amounts of processor time to be wasted on the overhead of switching processes, as a significant percentage of the system’s time will be spent switching from one process with a short timeslice to the next. Furthermore, the conflicting goals of I/O-bound versus processor-bound processes again arise; I/O-bound processes do not need longer timeslices, whereas processor-bound processes crave long timeslices (to keep their caches hot, for example).

5. Priorities:

A common type of scheduling algorithm is priority-based scheduling. The idea is to rank processes based on their worth and need for processor time. Processes with a higher priority will run before those with a lower priority, while processes with the same priority are scheduled round-robin (one after the next, repeating). On some systems, Linux included, processes with a higher priority also receive a longer timeslice. The runnable process with timeslice remaining and the highest priority always runs. Both the user and the system may set a processes priority to influence the scheduling behavior of the system.

Posted in Uncategorized

At the stroke of the midnight hour, when the world sleeps, India will awake to life and freedom.

Image

Long years ago we made a tryst with destiny, and now the time comes when we shall redeem our pledge, not wholly or in full measure, but very substantially. At the stroke of the midnight hour, when the world sleeps, India will awake to life and freedom. A moment comes, which comes but rarely in history, when we step out from the old to the new, when an age ends, and when the soul of a nation, long suppressed, finds utterance.
It is fitting that at this solemn moment we take the pledge of dedication to the service of India and her people and to the still larger cause of humanity.
At the dawn of history India started on her unending quest, and trackless centuries are filled with her striving and the grandeur of her success and her failures. Through good and ill fortune alike she has never lost sight of that quest or forgotten the ideals which gave her strength. We end today a period of ill fortune and India discovers herself again.
The achievement we celebrate today is but a step, an opening of opportunity, to the greater triumphs and achievements that await us. Are we brave enough and wise enough to grasp this opportunity and accept the challenge of the future?
Freedom and power bring responsibility. The responsibility rests upon this assembly, a sovereign body representing the sovereign people of India. Before the birth of freedom we have endured all the pains of labour and our hearts are heavy with the memory of this sorrow. Some of those pains continue even now. Nevertheless, the past is over and it is the future that beckons to us now.
That future is not one of ease or resting but of incessant striving so that we may fulfil the pledges we have so often taken and the one we shall take today. The service of India means the service of the millions who suffer. It means the ending of poverty and ignorance and disease and inequality of opportunity.
The ambition of the greatest man of our generation has been to wipe every tear from every eye. That may be beyond us, but as long as there are tears and suffering, so long our work will not be over.
And so we have to labour and to work, and work hard, to give reality to our dreams. Those dreams are for India, but they are also for the world, for all the nations and peoples are too closely knit together today for anyone of them to imagine that it can live apart.
Peace has been said to be indivisible; so is freedom, so is prosperity now, and so also is disaster in this one world that can no longer be split into isolated fragments.
To the people of India, whose representatives we are, we make an appeal to join us with faith and confidence in this great adventure. This is no time for petty and destructive criticism, no time for ill will or blaming others. We have to build the noble mansion of free India where all her children may dwell.
The appointed day has come – the day appointed by destiny – and India stands forth again, after long slumber and struggle, awake, vital, free and independent. The past clings on to us still in some measure and we have to do much before we redeem the pledges we have so often taken. Yet the turning point is past, and history begins anew for us, the history which we shall live and act and others will write about.
It is a fateful moment for us in India, for all Asia and for the world. A new star rises, the star of freedom in the east, a new hope comes into being, a vision long cherished materialises. May the star never set and that hope never be betrayed!
We rejoice in that freedom, even though clouds surround us, and many of our people are sorrow-stricken and difficult problems encompass us. But freedom brings responsibilities and burdens and we have to face them in the spirit of a free and disciplined people.
On this day our first thoughts go to the architect of this freedom, the father of our nation, who, embodying the old spirit of India, held aloft the torch of freedom and lighted up the darkness that surrounded us.
We have often been unworthy followers of his and have strayed from his message, but not only we but succeeding generations will remember this message and bear the imprint in their hearts of this great son of India, magnificent in his faith and strength and courage and humility. We shall never allow that torch of freedom to be blown out, however high the wind or stormy the tempest.
Our next thoughts must be of the unknown volunteers and soldiers of freedom who, without praise or reward, have served India even unto death.
We think also of our brothers and sisters who have been cut off from us by political boundaries and who unhappily cannot share at present in the freedom that has come. They are of us and will remain of us whatever may happen, and we shall be sharers in their good and ill fortune alike.
The future beckons to us. Whither do we go and what shall be our endeavour? To bring freedom and opportunity to the common man, to the peasants and workers of India; to fight and end poverty and ignorance and disease; to build up a prosperous, democratic and progressive nation, and to create social, economic and political institutions which will ensure justice and fullness of life to every man and woman.
We have hard work ahead. There is no resting for any one of us till we redeem our pledge in full, till we make all the people of India what destiny intended them to be.
We are citizens of a great country, on the verge of bold advance, and we have to live up to that high standard. All of us, to whatever religion we may belong, are equally the children of India with equal rights, privileges and obligations. We cannot encourage communalism or narrow-mindedness, for no nation can be great whose people are narrow in thought or in action.
To the nations and peoples of the world we send greetings and pledge ourselves to cooperate with them in furthering peace, freedom and democracy.
And to India, our much-loved motherland, the ancient, the eternal and the ever-new, we pay our reverent homage and we bind ourselves afresh to her service. 

Jai Hind!! – Pt. Jawaharlal Nehru

Posted in linux, work

Some cool linux commands and utilities :)

1. Command to generate a pseudo-random number between 1 and 9:
head -c10 /dev/urandom | md5sum | tr -d [a-z] | tr -d 0 | cut -c1

2. To generate alphanumeric with special characters:
cat /dev/urandom | tr -dc “a-zA-Z0-9-_\$\?\!\@\#\%\^\&\*\(\)\+\.” | fold -w 10 | head -10

Here: fold –w 10 is for the size of the string and head -10 gives you 10 values.

3. It is always better to avoid unnecessary commands, particularly in a pipe:
cat “$file” | grep “$word”
grep “$word” “$file”

4. A descriptive listing of directory, though it doesn’t replaces the conventional ls command and its options:
(printf “PERMISSIONS LINKS OWNER GROUP SIZE MONTH DAY HH:MM PROG-NAME\n” ; ls -l “Directory_Name” | sed 1d) | column –t

Here provide the directory name in “Directory_Name

5. To check the difference between two files, two directories.
>diff oldfile.txt newfile.txt
To check the difference between two directories, it is very useful when restoring a backup in an upgrade.
>diff –r |less

6. To create a hierarchy of directories.
>mkdir –p /one/two/three/four/five

7. To convert a pdf file to text and html, or to get the information about the pdf file.

To get information about the PDF file:
>pdfinfo

To convert the pdf file to test or html:
>pdftotext
>pdftohtml

8. DSTAT is a versatile replacement for vmstat, iostat, netstat and ifstat. Dstat is very handy for monitoring systems during performance tuning tests, benchmarks or troubleshooting.

Usage: As dstat is not present with linux by default, for dstat usage, one must install the dstat utility: dstat-0.7.2-1.el6.rfx.noarch.rpm, note that: The rpm will differ based on the operating system you are using.

Eg:  Following command will provide system stat with following data stats:

Cpu, Net, Disk, System, Load, proc, top_cpu and memory usage in single command.

>dstat –time –cpu –net –disk –sys –load –proc –top-cpu -m –bw

dstat_all

To get info about the free space on the system:

>dstat –freespace –bw

dstat_freespace

Consider checking the manual page for dstat, to explore more on checking the system stats and health.

The output of the dstat can be directly written as well as displayed in the screen using –output option. Command is: dstat -t -a –output file.csv, open the csv file with a spreadsheet application such as Microsoft Excel, you can select the columns you want plotted into a graph.

9. Following are some not so useful commands, but fun to play around linux:

To reverse a string or any input, just type >rev (enter), give the input (enter), you will get the reversed output, other way to use the command is : >rev <file_name> <path of the file>.

If you face hard time finding the factor for a number, a simple way to calculate the factor of a number is to just type: >factor [number to decompose]

10.  :(){ : |: & };:     The given set of characters is very dangerous bash function, it is called as Fork Bomb, on executing the given line, it defines a shell function that creates new copies of itself. The process continually replicates itself, and copies continually replicate themselves, quickly taking up all your CPU time and memory, this can even cause your computer to freeze. It is basically a denial-of-service attack.

11. To compare a remote file with a local file, to check if there are difference between local and remote file:

>ssh user@host cat /path/to/remotefile | diff /path/to/localfile –

12. To query Wikipedia via console over DNS for a txt record. The txt record will also include a short URL to the complete corresponding Wikipedia entry:

>dig +short txt <keyword>.wp.dg.cx

13. A simple way to copy the ssh keys to enable password-less ssh logins:

>ssh-copy-id user@host

Make sure the private and public RSA key pair is generated, if not use the following command: >ssh-keygen and provide enter as input for each request.

Once ssh keys copy is done, check login with >ssh ‘user@host’ , user should be able to login without password authentication.

14. In addition to above command, if you want to edit a file on a remote host:

>vim ssh://username@host//path/to/somefile

15. If your mysql server gets clogged up, a better way to monitor the processlist to check which queries are causing the server to clog up is with watch.

>watch –n 1 mysqldadmin –user=<user> –password=<password> processlist

16. To generate the pdf file for the manual pages available in server:

>man –t <command> | ps2pdf – > command_file.pdf

17. To append a file to existing tar file, use the –r or –append option, the append option is not allowed when the file is being compressed

>tar –rvf tarfile.tar file.txt

 

18. TCP dump to check if there is any incoming http (GET/POST) traffic on any port:

/usr/sbin/tcpdump -nX -s0 -i any port 9201 or 9200 or 9203 or 9202 | grep GET/POST

Posted in Uncategorized

Question To Ask Yourself If For Buying A Digital SLR Camera!

If you are looking for a Digital SLR Camera, and you are wondering what brand or model to buy, you may want to read the article below:

With so many digital SLRs on the market at so many different price points it’s a good idea to narrow down your options by thinking about what ‘s important to you, and what you want to do with the camera. Here are some question you can ask yourself before heading to a DSLR.

1. Do you want the same kind of ‘point and shoot’ simplicity as you get with a compact camera or are you the type of photographer who likes to roll up his or her sleeves and take control of every function?

2. Many entry-level DSLRs offer a range of ‘point and shoot’ subject / scene modes, whereas more ‘professional’ models don’t (though all have a basic ‘auto’ program mode). Do you shoot a lot of sport or wildlife? If so you’ll need a fast camera with a high frame rate, and will probably want one of the smaller sensor formats.

If you shoot in very low light you’ll
be looking for a camera with the best possible high ISO performance and possibly in-body image stabilization, if you do a lot of studio, portrait or macro work you may well decide that a ‘live view’ function is a high priority.

3. Do you need a particularly rugged (or weatherproof) body?

4. Does the size and weight of the camera play an important role in your choice?

5. Do you have a particular application in mind that requires a specialist lens or other accessory? Not all camera systems offer the same range of lenses and not all cameras are compatible with the more specialized add-ons. And don’t forget that most DSLRs are compatible with many of the lenses and accessories originally designed for film SLR cameras (from the same manufacturer), so if you’re already heavily invested in a film system you may want to stick to the same system when you move to digital.

Armed with some answers to these questions you can produce a shortlist of cameras that match your needs perfectly.

Posted in Uncategorized

“you almost ruined my last exam in college life”

You almost ruined my last exam of my college life“..this was what I wrote on Anwar Alam’s souvenir shirt..after our last exam in college (popularly called Signature Day)..and that was of “Distributed System”.So, what happend the night before, let me elaborate a bit:

Signature Day in MANIT.

It was during the semester exams of final year..and due to some incident in college..the last exam got postponed..and latter it was scheduled after the viva and submissions..and it was supposed to be the last exam in the college life..where whole of the class will be together..for one last time..after second year in college..some great minds of my class like JK, Pak, Vaibhav..started giving tutions to people like me and my comrades..apart from these two..there were secret gurus also..like for Rajiv..after JK classes..he used to go for revision with Mahadik Extra Classes..similarly for me..it was Deepak Jha and Keshav Sharma..

Now, comimng back to the point..that is “my last exam..right??”..I was little worried about “distributed system”..and Anwar told me..he will teach me..so, at around 10 pm..after doing all the important works like..Facebook, Orkut, Mails..I went to his room..but it was locked..I investigated around and came to know about his whereabouts..he was in Sumit Gupta Ji’s room..and he told me..”don’t worry Ringo..once I am done..I’ll teach you A-Z of distributed system”..I said Ok..and waited for him..after some time..he said..lets go and study..and I borrowed pen from Sumit..I thought of making some notes while studying..once we were there…Anwar said..he needs to study some more xerox copy..and and again said “Once I am done with it..I’ll teach you..why don’t you take some rest till then”…and I thought..not a bad idea..and after some time I was sleeping with all the glory as if I am the one..who started this Distributed System..and after some time..I woke up..hearing some niose…and It was not Anwar who was trying to wake me up..but, it was someone who was banging at the door..and It was Sumit Gupta the saviour asking for his pen..luckily I borrowed his pen..though I didn’t write any single word..and he said..”salon abhi tak soo rahe ho…sade ath baj gyee“..You are still sleeping..its already 8:30..and exams starts in half an hour..and I asked anwar..”bhai..kuch definitions to bata de“..atleast tell me..some basic definitions..

Still I managed to reach the exam hall on time..and also..managed to get “B” grade in distributed system..thanks to my earlier stints at JK and Pak Tutorials during Minors.

Posted in Uncategorized

You are Ladakhi if you…

All these facts in the post is taken from a facebook group called as “You are ladakhi“…and thought its worth sharing with you all….and the pic..I copied from Internet long back..so, don’t know the photographer..
Click on following link : http://www.facebook.com/home.php?#!/group.php?gid=36330893359&ref=ts

You are Ladakhi..

You are Ladakhi if you..have cleaned your arse with a stone.

You are Ladakhi if you..have not taken a bath for a week and its alright.

You are Ladakhi if you..have cried watching a movie.

You are ladakhi if you..have used an ammunation box as a sledge.

You are ladakhi if you..have heard things about you which you don’t even know.

You are ladakhi if you..have melted ice to mix with your booze.

You are ladakhi if you..had raw meat atleast once.

You are Ladakhi if you..have wished that a gypsy was a cheaper car to run.

You are Ladakhi if you..are not really worried about the economic meltdown.

You are ladakhi if you..are worried of all the pollutions in Leh and around and want to do something but never did.

You are ladakhi if you..had to bribe a kashmiri at one point to get the job done.

You are ladakhi if you..Love your OLD MONK.

You are ladakhi if you..have at one point been a tourist guide.

You are ladakhi if you..have bunked classes to go for a swim.

You are ladakhi if you..have owned a Yak Yak Yak Tshirt.

You are ladakhi if you..went on an enfield ride in the Himalayas.

You are Ladakhi if you..at one point owned a rayban glass.

You are ladakhi if you..protested for a cause.

You are ladakhi if you..have a little boy/girl who lives in you and refuses to grow up.

You are ladakhi if you..know that there is no such thing as a “Yak cheese”.

You are ladakhi if you..can eat just Dal and Aloo for six months.

You are ladakhi if you..just kick a cars tyres and know the condition on the car.

You are ladakhi if you..have ever slap your electronic Gadget like TV, Radio, Watch etc when it stop working, not once but 3-4 times as your first treatment to fix it. Good things is that , it worksssssss in Ladakh.

You are ladakhi if you..have spread your thighs to silence the Fart in Public Place.

You are ladakhi if you..love to say ladagspa instead ladakhi.

You are ladakhi if you..tugged at an “agrespa’s” clothes and said “one photo please, one pen please, one toffee!” atleast once in your life.
 
You are ladakhi if you..ever said this words – sukool (School), seto (stove), pep (pipe), jariken (jerry can), belue (blue).

You are ladakhi if you..hovered around the TV on republic day with your family, not ju…st to watch the parade, but because you were too excited that you got electricity during the day.

You are ladakhi if you..worn 14 layers of clothes.

You are ladakhi if you..ever travelled by Air to Leh carrying vegetables and fruits in your luugage and hand baggage.

You are ladakhi if you..washed your vehicle in a River or a Stream instead of the Service Station.

You are ladakhi if you..wished someone bumbarik instead of mubarak.

You are ladakhi if you..have never paid taxes in your life.

You are ladakhi if you..passed a bollywood star in the market and not bothered.

You are ladakhi if you..grew up through the 80s wearing Warrior shoes, Hara jeans and a Captain cap

You are ladakhi if you..thought it was perfectly all right to eat stuff a coupla months beyond its expiry date.

You are ladakhi if you..bluffed your ‘indian’ friends into believing …that ‘back home’ your spit froze before it hit the ground.

You are ladakhi if you..know that “bangladesh” means tibetan refugee’s market.

You are ladakhi if you..love BIKHU MATRE’S DANCE.

You are ladakhi if you..made a toy truck out of P mark mustard oil tins and shoe polish cans for wheels.

You are ladakhi if you..heated SALAMI on ur cars engine head.

You are ladakhi if you..wiped ur running nose on ur sleeve.

You are ladakhi if you..love to sit your ass in any part of the main market with your sunnies on and wait for girls to pass by and judge them!!!!!

You are ladakhi if you..worn shades or sunglasses even after the sunset or late evening.

You are ladakhi if you..bluffed “indian” friend that back in Ladakh, urine freezes before it hits ground.

You are ladakhi if you..caught the dragon fly (tonja/helicoptar) alive n inserted a long straw up it ass and find joy in watching it fly with straw shoved in.

Posted in Uncategorized

Meanwhile: The girl by the side of the road..

I found this story while browsing through the archive of New York Times….writer is Paul Spencer Sochaczewski…

You can read this post on following link also:

http://www.nytimes.com/2005/05/20/opinion/20iht-edpaul.html

LEH, India — In 1979, I took a black and white photograph of a girl in Ladakh, a remote region high in the Himalayas that is part of the Indian state of Jammu and Kashmir. She was perhaps 10 years old. She wore a rough robe of homespun wool, she carried a slate on which she used a stick dipped in muddy water to write her alphabets, she carried a simple army-style book bag slung over her shoulder.

I have no idea what she was thinking, but to me her gaze says, quietly, “Watch me. I’m going to surprise you.”

I went looking for her last month. But there was a slight problem. I didn’t remember where I had taken the photograph.

One of the benefits of being a somewhat organized pack rat is that I keep my old journals. I found my notes from the trip 26 years earlier. At a town I had identified as Bongzo, I had written about a little girl, whose “hands were rough with ingrained dirt, the texture of sandpaper.” We had arithmetic as a common language, and I wrote “2 + 2” and watched her stroke the numeral “4”. I gave her a ball point pen. “The girl’s eyes lit for a moment with immediate recognition,” I had written. “After realizing the pen was for her, she grabbed it and in one motion hid it inside her homespun robe.”

I was in Ladakh for a weekend, to write an article about the golf course in Leh, the region’s capital, which, at 3,445 meters, or 11,300 feet, is the world’s highest. I had a free day, and understanding my esoteric interests, my guide, Tashi Chotak Lonchey, had taken me to the monastery that I had visited 26 years earlier (yes, one of the monks was still alive and he recognized himself in a photo).

We then drove off to visit a sacred forest. On the way to an ancient juniper tree grove in Hemis Shukpachan, we passed the village of Basgo. “Maybe this is the place where you took the picture,” Tashi suggested. Bongzo? Basgo? Close enough to be worth a stop.

None of it looked familiar. My only thought was that in 1979, my friend David and I must have stopped here for a tea break during a bus ride to Ridzong Monastery further along the same road.

Tashi and I stopped at a large house near the road and showed an enlargement of the photograph to an old woman. “It could be Tsewang,” she said after some thought. “Her husband Tashi Angchok is just up the street.”

We found Tashi Angchok working at the family restaurant. He offered us tea as he studied the photograph. “The smile looks similar to my wife’s,” he said. But his wife, Tsewang Dolma, wasn’t around the day we stopped by. She teaches at Tridho, a one-class school some three hours away, near the Chinese border.

He took the picture to his mother-in-law, and came back with a handful of old photographs showing his wife as a young girl. The mother, Sonam Angmo, said that my photograph seemed to be that of her daughter, but she wasn’t too sure.

We left the photograph with Tashi Angchok and went to explore the forest.

On the way back we stopped again at Basgo.

“It’s her,” Tashi said confidently.

We asked how he knew.

“I showed the picture to Tsewang’s sister but didn’t say ‘Is this Tsewang?’ I simply asked ‘Do you know this girl?'” he said. “She said ‘yes, that’s my little sister.'”

The family has invited me to dinner next time I’m in Ladakh. Then I’ll get a chance to actually have a conversation with this girl, now a grown woman, whose picture and spirit has graced my home for a quarter of a century…