vmstat – what it is and how to use?

2011-04-24 2 min read Linux

Paging on 386 - address translation (polish texts)
Image via Wikipedia

vmstat provides a summary of various functions within the system, including system wide free memory, paging counters, summarized disk activity, system calls and cpu utilization.

The output of vmstat and description of what each field means:

The first line of output from vmstat shows a summary since boot,
followed by the output over the last 3 seconds for each additional line.

Continue reading

Photography – Stock photos on bigstock.

2011-02-01 1 min read Photo

Couple of days back, one of my friends suggested that I put my photos on bigstock also along with my site at http://shop.amit-agarwal.co.in . I thought, let me give it a try and created a account on bigstock. After creating the account, I have so far submitted 5 images and four of them got rejected.

The rejections did not de-motivate me, in-fact this has taught me a lot of things. Some things that I did not know before I submitted my photos there. So, I am going through a new learning and this has cost me 80% rejection in bigstock. I am trying with few more photos in next few days and probably I will get a better idea of what is required in the photos. Hope to get the tricks of the trade soon. BTW, another way you can help me keep this blog alive is by buying my photos cheap at bigstock and here is the link to my photo :

Continue reading

let a cow tell you your fortune

2010-06-03 1 min read Bash Linux
Here\’s something that I saw on commandlinefu yesterday. That sent me thinking about some command to have the cow file picked randomly πŸ™‚ So, here\’s the original command from the commandlinefu:

let a cow tell you your fortune

    <td>
      <div class="text codecolorer">
        $ fortune | <a class="zem_slink freebase/en/cowsay" title="Cowsay" rel="homepage" href="http://www.nog.net/%7Etony/warez/cowsay.shtml">cowsay</a> -f tux
      </div>
    </td>
  </tr>
</table>

Finding all numbers that are bigger than 1 in vim

2009-12-24 1 min read Fedora Linux Vim Tips

/^([2-9]d*|1d+)
If we have a csv like structure

The trick here is simple, lets look at the regex from the begining:

^ – start from the begining
() – start and end of block
[] – digits within this. So we are looking from 2 to 9 to exclude the numbers begining with 1
d – search for digits

  • – search for one or more
    | – or operation
    1 – search for numbers begining with 1
  • – containing atleast one occurence or more.<h6 class="zemanta-related-title">Related articles by Zemanta <ul class="zemanta-article-ul"> <li class="zemanta-article-ul-li"><a href="http://sparksspace.blogspot.com/2009/10/adding-leading-zeros-in-excel.html">Adding Leading Zeros in Excel (sparksspace.blogspot.com)
  • <li class="zemanta-article-ul-li"><a href="http://blog.creativethink.com/2009/11/the-best-thing-about-2010.html">The Best Thing About &#8221;2010&#8221; (creativethink.com) <li class="zemanta-article-ul-li"><a href="http://www.revenews.com/jackbusch/google-goggles-the-world-is-your-hyperlink/">Google Goggles: The World is Your Hyperlink (revenews.com)
<div class="zemanta-pixie"><a class="zemanta-pixie-a" href="http://reblog.zemanta.com/zemified/e022d83e-669e-4cad-894c-cdab54a1946c/" title="Reblog this post [with Zemanta]"><img class="zemanta-pixie-img" src="http://blog.amit-agarwal.co.in/wp-content/uploads/2010/08/reblog_e34.png" alt="Reblog this post [with Zemanta]" /><span class="zem-script more-related more-info pretty-attribution paragraph-reblog">
1