Bash Sub Shells

2010-03-02 1 min read Bash

Taken from <a href="http://www.linuxjournal.com/content/bash-sub-shells" target="_blank">here.

<span class=\"c\">#!/bin/bash</span>

<span class="nv">server_cmd</span><span class="o">=</span>server <span class="nv">pid_file</span><span class="o">=</span><span class="k">$(</span>basename <span class="nv">$server_cmd</span> .sh<span class="k">)</span>.pid <span class="nv">log_file</span><span class="o">=</span><span class="k">$(</span>basename <span class="nv">$server_cmd</span> .sh<span class="k">)</span>.log

<span class="o">(</span> <span class="nb">echo</span> <span class="s2">"Starting server"</span> <span class="nb">echo</span> <span class="s2">"Doing some init work"</span> <span class="nv">$server_cmd</span> <span class="c"># server becomes a daemon</span>

&lt;span class=\"k\">while &lt;/span>&lt;span class=\"nb\">true&lt;/span>

<span class="nb"> </span><span class="k">do</span> <span class="k"> if</span> <span class="o">[[</span> -f <span class="nv">$pid_file</span> <span class="o">]]</span>; <span class="k">then</span> <span class="k"> </span>sleep 15 <span class="k">else</span> <span class="k"> </span><span class="nb">break</span> <span class="nb"> </span><span class="k">fi</span> <span class="k"> done</span> <span class="k"> </span>mail -s <span class="s2">"Server exitted"</span> joe@blow.com <<<CRAP

Continue reading

Happy holi to all.

2010-03-02 1 min read Uncategorized

A very happy Holi to all.

<a href="http://blog.amit-agarwal.co.in/wp-content/uploads/2010/03/DSCN1119.resized.jpg"><img class="size-medium wp-image-1559" title="Holi" src="http://blog.amit-agarwal.co.in/wp-content/uploads/2010/08/DSCN1119.resized-300x168.jpg" alt="Holi" width="300" height="168" />

Airtel does not need old customers

2010-03-01 3 min read Uncategorized

Couple of days back, I shifted my house. No big deal, right. Not for Airtel :).

I applied for a change in installation address and applied for the same. And promptly they told me that it will be done in 4 days time. I was a very happy person, but the happiness did not last long. After 4 days also there was no response and thus I called the call center again and they told me that the area I shifted to was not feasible for them (PS: It was just the opposite side of the road). Great, so I called the Area Manager whose number I had from a conversation I had with him. (BTW, I was the first customer for Airtel in my area).

Continue reading

Minimize the download size for updates.

2010-02-10 1 min read Fedora Linux

Fedora has rolled out presto repositories. What this means to the users is that the download size for the updates would be greatly reduced. To use the feature, first install the yum plugin:

sudo yum install yum-presto.noarch

Presto uses delta rpms. These delta rpms are quite small in size (eg few kbs instead of 15 MB for firefox 3.5). These delta rpms are used to re-create the original rpm and this is completely transparent to the end user. So, next time when you update with the plugin installed you will see the difference in the download size.

Continue reading

Top 10 most ridiculous Windows Vista error messages – priceless though!!!

2010-02-10 0 min read Linux
\"Windows
Image by Stijn Vogels via Flickr

Windows Vista is always in the news on the blogosphere about how effective it performs. No matter what version of Vista you may be running, it’s

possible that you may have already seen these error messages more than once and may well probably be fed up with them!

Continue reading

Openoffice.org and/or Excel useful tips.

2010-02-10 2 min read Fedora Learning Linux

Today I was working on Excel sheets and had to do quite a lot of manipulations. Here are some of those:

  1. Find the value of the cell whose number is stored in another cell.

You can use the indirect function.

Here is example:

<a href="http://blog.amit-agarwal.co.in/wp-content/uploads/2010/08/screenshot_0022.jpe"><img class="size-full wp-image-959" title="indirect" src="http://blog.amit-agarwal.co.in/wp-content/uploads/2010/08/screenshot_0022.jpe" alt="indirect" width="354" height="98" />

That&#8217;s cool and easy.

  1. Indirect reference with some constant values.

You can add constant and cell id with &#8221;&&#8221;

Continue reading

Annotating the photograph with comments.

2010-02-10 1 min read Fedora Linux Photo

There is a nice Linux command called convert. This command can be used in various ways to do image manipulation. One of them is to embark your image with some text. Here is how to do it.

**echo &#8221;Annotating the image &#8221;$2&#8221; with $1&#8221;
convert -font  Verdana -pointsize 40 -fill red -draw &#8221;text 100,100 &#8221;$1&#8221;&#8221; &#8221;$2&#8221; &#8221;$2&#8221;
**

It will be good idea to save this as &#8221;annotate&#8221; as we will use this later too.

Continue reading
Older posts Newer posts