<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Bash on Amit Agarwal Linux Blog</title>
    <link>/categories/bash/</link>
    <description>Recent content in Bash on Amit Agarwal Linux Blog</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en</language>
    <lastBuildDate>Sat, 31 Jan 2026 00:00:00 +0530</lastBuildDate>
    
	<atom:link href="/categories/bash/index.xml" rel="self" type="application/rss+xml" />
    
    
    <item>
      <title>nmap_cheatsheet.md</title>
      <link>/2026/01/31/2026-01-31-nmap_cheatsheet.md</link>
      <pubDate>Sat, 31 Jan 2026 00:00:00 +0530</pubDate>
      
      <guid>/2026/01/31/2026-01-31-nmap_cheatsheet.md</guid>
      <description>&lt;p&gt;I used zapgpt to create a nmap cheat sheet that you too can follow. Just follow
the following steps:&lt;/p&gt;
&lt;p&gt;Fist save the output of nmap help command to a file. You can also try with nmap
man page but that is too huge :(&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;nmap -h &amp;gt; /tmp/nmap.txt
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;Now you have the nmap help output, you can use zapgpt to create the cheatsheet :&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;zapgpt -p openrouter -m moonshotai/kimi-k2.5 -f /tmp/nmap.txt &lt;span class=&#34;s2&#34;&gt;&amp;#34;Create a 2 page cheatsheet (nicely formatted) for this content. I want you to provide the output in dvi and tell me how to convert that to pdf?&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;This will provide you with a text file and how to convert the text to pdf file.
I had to use the following commands for converting the tex file to pdf.&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Color-Coded URL Status Checker in Bash: Enhanced Script for Fast Web Health Monitoring</title>
      <link>/2025/10/17/2025-10-17-Check_urls/</link>
      <pubDate>Fri, 17 Oct 2025 00:00:00 +0530</pubDate>
      
      <guid>/2025/10/17/2025-10-17-Check_urls/</guid>
      <description>Upgrade your Bash scripting game with a color-coded URL status checker that leverages curl, timeout handling, and clean output for fast web monitoring.</description>
    </item>
    
    <item>
      <title>Working with Gzip Files in Linux: Seamless Integration with Popular Tools</title>
      <link>/2025/05/21/2025-05-21-leveraging_gzip/</link>
      <pubDate>Wed, 21 May 2025 00:00:00 +0530</pubDate>
      
      <guid>/2025/05/21/2025-05-21-leveraging_gzip/</guid>
      <description>&lt;h1 id=&#34;working-with-gzip-files-in-linux-seamless-integration-with-popular-tools&#34;&gt;Working with Gzip Files in Linux: Seamless Integration with Popular Tools&lt;/h1&gt;
&lt;p&gt;Gzip is a widely used compression tool in the Linux ecosystem, offering efficient file size reduction for storage and transfer. But did you know that many Linux applications can work directly with &lt;code&gt;.gz&lt;/code&gt; files—no manual decompression required? This capability streamlines workflows and saves disk space.&lt;/p&gt;
&lt;h2 id=&#34;why-use-gzip&#34;&gt;Why Use Gzip?&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Reduces file size&lt;/strong&gt; for faster transfers and less storage.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Preserves file integrity&lt;/strong&gt; during downloads and uploads.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Widely supported&lt;/strong&gt; across Linux distributions and tools.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;using-gzipped-files-directly&#34;&gt;Using Gzipped Files Directly&lt;/h2&gt;
&lt;p&gt;Many popular Linux applications can open and process gzip-compressed files transparently. Here are some notable examples:&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Exploring AI Models with ZapGPT: A Simplified Approach</title>
      <link>/2025/05/11/2025-05-11-ZapGPT/</link>
      <pubDate>Sat, 10 May 2025 00:00:00 +0530</pubDate>
      
      <guid>/2025/05/11/2025-05-11-ZapGPT/</guid>
      <description>&lt;h1 id=&#34;zapgpt---introduction&#34;&gt;zapgpt - Introduction&lt;/h1&gt;
&lt;p&gt;In the rapidly evolving landscape of artificial intelligence, experimenting with different models can be daunting. &lt;strong&gt;ZapGPT&lt;/strong&gt; simplifies this process, allowing users to easily switch between models, customize system prompts, and monitor usage effectively.&lt;/p&gt;
&lt;p&gt;By using API, not only can you save a lot of bucks, you can get the flexibility
that you wanted.&lt;/p&gt;
&lt;h2 id=&#34;-key-features-of-zapgpt&#34;&gt;🚀 Key Features of ZapGPT&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Provider Flexibility&lt;/strong&gt;: Currently select from OpenAI or OpenRouter.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Model Flexibility&lt;/strong&gt;: Easily switch between various AI models to find the best fit for your needs.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Custom System Prompts&lt;/strong&gt;: Add and modify system prompts to tailor the AI&amp;rsquo;s responses.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Usage Tracking&lt;/strong&gt;: Monitor usage statistics to optimize your interactions and manage resources effectively.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;-getting-started&#34;&gt;🛠️ Getting Started&lt;/h2&gt;
&lt;p&gt;To get started with ZapGPT, follow these simple steps:&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Anonymous AI Chat with different models</title>
      <link>/2024/12/31/2024-12-31-Anonymous_AI_Chat_with_different_models/</link>
      <pubDate>Tue, 31 Dec 2024 00:00:00 +0530</pubDate>
      
      <guid>/2024/12/31/2024-12-31-Anonymous_AI_Chat_with_different_models/</guid>
      <description>&lt;p&gt;If you ever wished that you did not have to login or could use AI chat with
anonymity, then you are in luck and right place, read on.&lt;/p&gt;
&lt;p&gt;Head over to &lt;a href=&#34;https://duckduckgo.com&#34;&gt;DuckDuckGo search&lt;/a&gt;. Click on the
Hamburger menu in the right hand top side. In the drop down, select
&lt;em&gt;AI Chat&lt;/em&gt;, you will see it somewhere in middle of the menu.&lt;/p&gt;
&lt;p&gt;Now, you can click &amp;ldquo;Get Started&amp;rdquo; (after reading the information on the page).&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Hackernews In Your Inbox</title>
      <link>/2024/08/25/2024-08-25-HackernewsInYourInbox/</link>
      <pubDate>Sun, 25 Aug 2024 00:00:00 +0530</pubDate>
      
      <guid>/2024/08/25/2024-08-25-HackernewsInYourInbox/</guid>
      <description>&lt;p&gt;If you do not want to subscribe to any newsletter but still want to get some news delivered to you inbox then this post is for you.&lt;/p&gt;
&lt;p&gt;First you need to get a script that can pull the hacker-news articles for you and you can find my script &lt;a href=&#34;https://github.com/raj77in/pentools/blob/main/misc/hacker-news.py&#34;&gt;here&lt;/a&gt;. You can modify this script, specially the line: &lt;code&gt;for id in trending_list[:50]:&lt;/code&gt; to change the number of posts that you would like to see in the mail.&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Short url to full url</title>
      <link>/2024/06/17/2024-06-19-short-url-to-full-url/</link>
      <pubDate>Wed, 19 Jun 2024 00:00:00 +0530</pubDate>
      
      <guid>/2024/06/17/2024-06-19-short-url-to-full-url/</guid>
      <description>&lt;p&gt;Most of the Social sites will shorten the links. There are a lot of ways to check the url before you go to the url and get phished :)&lt;/p&gt;
&lt;p&gt;For example, for &lt;strong&gt;bitly&lt;/strong&gt; you can just add a &amp;lsquo;+&amp;rsquo; at the end of the url. For example, you can enter the following in url bar &lt;code&gt;https://bit.ly/2KEOXNx+&lt;/code&gt; and see the details of the where the url takes you. This is just a  example url that I got from google but you get the idea.&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Bash script performance issue and remediation</title>
      <link>/2024/06/17/2024-06-17-bash-script-performance/</link>
      <pubDate>Mon, 17 Jun 2024 00:00:00 +0530</pubDate>
      
      <guid>/2024/06/17/2024-06-17-bash-script-performance/</guid>
      <description>&lt;p&gt;I was looking at writing some output to files. The output did not vary much but the number of lines was huge. It was long time back so I dont remember the context of the requirement but I needed to write few million lines of text. The quickest way to do this was bash so I wrote a simple script that could do this. To my astonishment, I could see the script much more time than expected, so here is how I debugged the issue and fixed it.&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>mussh-run-commands-on-multiple-hosts</title>
      <link>/2022/03/06/mussh-run-commands-on-multiple-hosts/</link>
      <pubDate>Sun, 06 Mar 2022 00:00:00 +0530</pubDate>
      
      <guid>/2022/03/06/mussh-run-commands-on-multiple-hosts/</guid>
      <description>&lt;p&gt;&lt;strong&gt;mussh&lt;/strong&gt; allows you to run command/commands on multiple hosts
at the same time. If you have farm of server setup with passwordless
ssh or with same password (which is generally the case), then using
mussh you can either check all the servers for some output or fix
something or maybe update all the packages. How cool is that :)&lt;/p&gt;
&lt;p&gt;Here is description of this package from &lt;em&gt;dnf&lt;/em&gt; repo&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt; 1
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 2
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 3
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 4
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 5
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 6
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 7
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 8
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 9
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;10
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;11
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;12
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;13
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;14
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-fallback&#34; data-lang=&#34;fallback&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;Name         : mussh
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;Version      : 1.0
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;Release      : 18.fc35
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;Architecture : noarch
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;Size         : 20 k
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;Source       : mussh-1.0-18.fc35.src.rpm
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;Repository   : fedora
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;Summary      : Multihost SSH wrapper
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;URL          : http://www.sourceforge.net/projects/mussh
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;License      : GPL+
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;Description  : Mussh is a shell script that allows you to execute a command or
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;             : script over ssh on multiple hosts with one command. When possible
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;             : mussh will use ssh-agent and RSA/DSA keys to minimize the need to
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;             : enter your password more than once.
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;</description>
    </item>
    
    <item>
      <title>virt-install with cloud-init</title>
      <link>/2022/02/05/virt-install-with-cloud-init/</link>
      <pubDate>Wed, 09 Feb 2022 00:00:00 +0530</pubDate>
      
      <guid>/2022/02/05/virt-install-with-cloud-init/</guid>
      <description>&lt;p&gt;If you have not heard about cloud-init then you should definately search for it and learn about cloud-config as well. You can find the documentation for &lt;a href=&#34;https://cloudinit.readthedocs.io/en/latest/&#34;&gt;cloud-config here&lt;/a&gt;. It is used for configuring VMs when running in cloud environments. Specially useful to inject the ssh keys or set the root password but you can do anything in the cloud-config as there is a section where you can run bash commands. While this is useful for cloud instances, you can make use of this feature when running your vm with qemu or libvirtd. All you need to do is either attach a iso disc with user-data and meta-data files in it or even simpler, you can use virt-install command. The command that I use is as follows&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Stay safe from phising</title>
      <link>/2022/02/05/stay-safe-from-phising/</link>
      <pubDate>Sat, 05 Feb 2022 00:00:00 +0530</pubDate>
      
      <guid>/2022/02/05/stay-safe-from-phising/</guid>
      <description>&lt;p&gt;Generally when you get a phising mail, the biggest challenge is
finding if the site is genuine or not. And URL shortening services
do not make it any easy. Earlier I had posted about using &lt;em&gt;curl&lt;/em&gt;
to expand the url &lt;a href=&#34;/2022/01/09/curl-to-expand-short-url/&#34;&gt;in this post&lt;/a&gt;.
However you might not be on a Linux terminal all the time (for example -
you are checking something on your mobile), in that case what do you do?&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Curl to exapnd short url</title>
      <link>/2022/01/09/curl-to-expand-short-url/</link>
      <pubDate>Sun, 09 Jan 2022 00:00:00 +0530</pubDate>
      
      <guid>/2022/01/09/curl-to-expand-short-url/</guid>
      <description>&lt;p&gt;Many times I receive short urls in mail and other places like
chats and messages. I first like to see the destination before
I click on the url. I was looking for some way to do this in bash.
I realized that this could be very simply done by looking at the Location
header in the response from curl.&lt;/p&gt;
&lt;p&gt;Example&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;curl -I https://bit.ly/32WwCp4&lt;span class=&#34;p&#34;&gt;|&lt;/span&gt;grep location
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;and the output should be something like&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Sleep infinitely in bash</title>
      <link>/2020/12/19/bash-sleep-infinitely/</link>
      <pubDate>Sun, 19 Dec 2021 02:38:57 +0530</pubDate>
      
      <guid>/2020/12/19/bash-sleep-infinitely/</guid>
      <description>&lt;p&gt;I am sure that you would have got a lot of instances
where you have wanted to sleep for infinity and ended
up doing this&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;2
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;3
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;4
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;while&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;[[&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;1&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;]]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;do&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;	sleep &lt;span class=&#34;m&#34;&gt;3600&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;done&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;or some other such similar loop to sleep for some time
and wrap it in infinite loop.&lt;/p&gt;
&lt;p&gt;I learned something new recently and found it very useful.
You can do the above with&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;sleep infinity
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;and you can use that even for a while loop&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Ignore case when completing file names in bash</title>
      <link>/2020/08/30/Ignore-case-when-completing-file-names-in-bash/</link>
      <pubDate>Sat, 11 Dec 2021 02:38:57 +0530</pubDate>
      
      <guid>/2020/08/30/Ignore-case-when-completing-file-names-in-bash/</guid>
      <description>&lt;p&gt;Sometimes you don&amp;rsquo;t want to have the bash completion work with
case completion. There could be several reasons like one I dont
like is the default &lt;strong&gt;xdg&lt;/strong&gt; folders starting with &lt;em&gt;capital&lt;/em&gt; letters.&lt;/p&gt;
&lt;p&gt;So, if you know that bash uses readline for a lot of configuration
then there is a very easy solution, you can just run this command
and start a new bash shell :)&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nb&#34;&gt;echo&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;set completion-ignore-case on&amp;#39;&lt;/span&gt; &amp;gt;&amp;gt; ~/.inputrc
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;Enjoy 👍&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Warn when battery is low</title>
      <link>/2020/08/30/acpi-warn/</link>
      <pubDate>Sun, 30 Aug 2020 00:05:57 +0530</pubDate>
      
      <guid>/2020/08/30/acpi-warn/</guid>
      <description>&lt;p&gt;I am very lazy to look at battery status and want to be warned when the battery
is low. This means that even if I am away from the laptop, I can be warned that
laptop is about to poweroff due to battery low. So, what kind of alerts I can have, many -&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;zenity message box&lt;/li&gt;
&lt;li&gt;email&lt;/li&gt;
&lt;li&gt;sms with twillio&lt;/li&gt;
&lt;li&gt;Telegram message
and possibility is endless.&lt;/li&gt;
&lt;/ol&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt; 1
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 2
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 3
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 4
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 5
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 6
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 7
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 8
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 9
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;10
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;11
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;12
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;13
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;14
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;15
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;16
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;17
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;18
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;19
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;20
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;21
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;22
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-gdscript3&#34; data-lang=&#34;gdscript3&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;LOW&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;35&lt;/span&gt; &lt;span class=&#34;c1&#34;&gt;## This si the lowest percentage at which I want the alerts.&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;## Parse the acpi statue and decide if alert needs to be sent&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;per&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=$&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;/&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;usr&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;/&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;bin&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;/&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;acpi&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;-&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;b&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;|&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;awk&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;{print $4}&amp;#39;&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;|&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;sed&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;s/%.*//&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; 
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;# source ~/bin/cron-scripts/sendsms.sh&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;[[&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;$&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;/&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;usr&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;/&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;bin&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;/&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;acpi&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;|&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;grep&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;-&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;c&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;Full\|Charging&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;0&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;]]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;then&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;#This is when the AC is connected.&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;n&#34;&gt;exit&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;0&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;fi&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;[[&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;!&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;-&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;z&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;$&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;per&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;$&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;per&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;$&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;LOW&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;]]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;then&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;# sendsms &amp;#34;Battery is at $per%&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;export&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;sub&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;Battery is at $per%&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;n&#34;&gt;echo&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;Battery is running out : $per&amp;#34;&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;|/&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;usr&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;/&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;sbin&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;/&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;sendmail&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;-&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;t&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;n&#34;&gt;display_msg&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;sh&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;ACPI Warn&amp;#34;&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;Battery is at $per%&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;n&#34;&gt;echo&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;ACPI Warn&amp;#34;&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;Battery is at $per%&amp;#34;&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;|&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;/&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;home&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;/&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;amitag&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;/&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;bin&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;/&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;twilio&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;-&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;sms&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;+&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;919535210501&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;n&#34;&gt;zenity&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;--&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;warning&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;--&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;text&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;Battery is at $per%&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;fi&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;Put this script somewhere and schedule in cron for every minute and enjoy.&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Some good find alias.</title>
      <link>/2020/08/16/find-alias/</link>
      <pubDate>Sun, 23 Aug 2020 11:05:57 +0530</pubDate>
      
      <guid>/2020/08/16/find-alias/</guid>
      <description>&lt;p&gt;Here are some interesting alias&amp;rsquo;s that you may want to add to your
bashrc file or where-ever else you add your aliase&amp;rsquo;s. Very useful if you
use find commonly.&lt;/p&gt;
&lt;p&gt;There are four aliases defined here and have a comment explaining what
it does. but these are so simple and useful that you probably dont even
need the comments.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt; 1
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 2
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 3
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 4
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 5
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 6
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 7
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 8
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 9
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;10
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;11
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;# ff:  to find a file under the current directory&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;ff &lt;span class=&#34;o&#34;&gt;()&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;{&lt;/span&gt; find . -name &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$@&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;# ffs: to find a file whose name starts with a given string&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;ffs &lt;span class=&#34;o&#34;&gt;()&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;{&lt;/span&gt; find . -name &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$@&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;s1&#34;&gt;&amp;#39;*&amp;#39;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;# ffe: to find a file whose name ends with a given string&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;ffe &lt;span class=&#34;o&#34;&gt;()&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;{&lt;/span&gt; find . -name &lt;span class=&#34;s1&#34;&gt;&amp;#39;*&amp;#39;&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$@&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;# very very useful function: for finding files with ignore case, just type &amp;#34;f &amp;lt;part of filename&amp;gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;# This in combination with alias for &amp;#39;g&amp;#39; is deadly.&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;#&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;f &lt;span class=&#34;o&#34;&gt;()&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;{&lt;/span&gt; find . -iname &lt;span class=&#34;s1&#34;&gt;&amp;#39;*&amp;#39;&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$@&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;s1&#34;&gt;&amp;#39;*&amp;#39;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;Hope this is useful for you.&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Books menu with bash</title>
      <link>/2020/08/16/books-menu-with-bash/</link>
      <pubDate>Sun, 16 Aug 2020 11:05:57 +0530</pubDate>
      
      <guid>/2020/08/16/books-menu-with-bash/</guid>
      <description>&lt;p&gt;If you have a folder full of ebooks in various formats and not necessarily
one sigle format and you want to have a quick menu to browse though your collection
without requiring to open a File Manager then you are going to love this script.&lt;/p&gt;
&lt;p&gt;The scripts works by allowing you to browse to the requied folder of your choice
and once you select the file, then using &lt;code&gt;xdg-open&lt;/code&gt; to open the file with your default
viewer.&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>scripting – performance improvement with file open</title>
      <link>/2020/04/20/scripting-performance-improvement-file-open/</link>
      <pubDate>Mon, 20 Apr 2020 01:01:37 +0000</pubDate>
      
      <guid>/2020/04/20/scripting-performance-improvement-file-open/</guid>
      <description>&lt;p&gt;Sometimes just one line of code can make all the difference. I will show you with example.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Here is script with 2 functions. Both are writing some lines of text to a file. First function, “a” I have used the redirection to write to file. Function “b”, I have opened a file descriptor with “&amp;gt;” before going into the loop and use that reference for writing to the file. (This concept remains same for any scripting or programming language).&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>using cat with grep – why?</title>
      <link>/2020/01/06/cat-grep-why/</link>
      <pubDate>Mon, 06 Jan 2020 01:01:27 +0000</pubDate>
      
      <guid>/2020/01/06/cat-grep-why/</guid>
      <description>&lt;p&gt;&lt;span class=&#34;embed-youtube&#34; style=&#34;text-align:center; display: block;&#34;&gt;&lt;/span&gt;&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Get the git url of current repo in clipboard</title>
      <link>/2019/12/30/git-url-current-repo-clipboard/</link>
      <pubDate>Mon, 30 Dec 2019 01:04:29 +0000</pubDate>
      
      <guid>/2019/12/30/git-url-current-repo-clipboard/</guid>
      <description>&lt;p&gt;Lot of times, I just want to copy the git url to clipboard. This is so common in my flow of work that I created an alias for it. Here it is:&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;pre class=&#34;brush:shell&#34;&gt;alias git-url=&#34;cat .git/config|awk &#39;/url/ {print $3}&#39;|xclip -i -selection clipboard&#34;&lt;/pre&gt;</description>
    </item>
    
    <item>
      <title>Script to try various themes from kitty terminal</title>
      <link>/2019/12/16/script-themes-kitty-terminal/</link>
      <pubDate>Mon, 16 Dec 2019 00:55:06 +0000</pubDate>
      
      <guid>/2019/12/16/script-themes-kitty-terminal/</guid>
      <description>&lt;p&gt;Here is the script. Very simple yet very useful script.&lt;/p&gt;
&lt;pre class=&#34;brush:shell&#34;&gt;#!/bin/bash - 
#===============================================================================
#
#          FILE: kitty-theme.sh
# 
#         USAGE: ./kitty-theme.sh 
# 
#   DESCRIPTION: 
# 
#       OPTIONS: ---
#  REQUIREMENTS: ---
#          BUGS: ---
#         NOTES: ---
#        AUTHOR: Amit Agarwal (aka),
#  ORGANIZATION: Individual
#       CREATED: 12/06/2019 10:15
# Last modified: Fri Dec 06, 2019  10:41AM
#      REVISION:  ---
#===============================================================================

set -o nounset                              # Treat unset variables as an error

FOLDER=&#34;/git/terminal.sexy/dist/schemes&#34;  ### This is git folder where you have terminal.sexy cloned

if [[ ! -d $FOLDER ]]
then
    cd $FOLDER/../../../
    git clone https://github.com/stayradiated/terminal.sexy

fi

cd $FOLDER
tmp=$(mktemp /tmp/color-XXXXXXXX)
echo $tmp
files=$(find . -type f -name \*json)
for line in $(echo ${files[*]})
do
    echo &#34;Processing $line&#34;
    &amp;gt;$tmp
    echo &#34;# From $line.. processed by Amit Agarwal script&#34; &amp;gt;&amp;gt; $tmp
    sed -n -e &#39;/color/,/\],/ p&#39; $line | sed -e 1d -e &#39;$d&#39;| \
        sed &#39;s/[&#34;,]//g&#39;|awk &#39;{count++; print &#34;color&#34;count&#34;\t &#34;$1}&#39; &amp;gt;&amp;gt; $tmp
    grep ground $line |sed &#39;s/^ *//&#39; |sed &#39;s/[&#34;:,]//g&#39; &amp;gt;&amp;gt; $tmp

    kitty @ set-colors -a $tmp

    ls --color=auto ~
    read -p &#34;If you like the theme, just press l ::&#34; test
    if [[ $test == &#34;l&#34; ]]
    then
        rm -f ~/.config/kitty/theme.conf
        cp $tmp ~/.config/kitty/theme.conf
    fi
done
rm -f $tmp
&lt;/pre&gt;</description>
    </item>
    
    <item>
      <title>scan your network with bash IP scan script</title>
      <link>/2019/10/10/scan-your-network-with-bash-ip-scan-script/</link>
      <pubDate>Thu, 10 Oct 2019 07:05:41 +0000</pubDate>
      
      <guid>/2019/10/10/scan-your-network-with-bash-ip-scan-script/</guid>
      <description>&lt;p&gt;Here is the youtbe video that will walk you through bash script.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;&lt;span class=&#34;embed-youtube&#34; style=&#34;text-align:center; display: block;&#34;&gt;&lt;/span&gt;&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>ssh trick – ssh to remote host with bastion host</title>
      <link>/2019/09/16/ssh-trick-ssh-to-remote-host-with-bastion-host/</link>
      <pubDate>Mon, 16 Sep 2019 00:55:20 +0000</pubDate>
      
      <guid>/2019/09/16/ssh-trick-ssh-to-remote-host-with-bastion-host/</guid>
      <description>&lt;p&gt;Lot of times, you have to ssh to a server with bastion host. If you dont know what is bastion host then see this:&lt;/p&gt;
&lt;img class=&#34;alignnone size-medium wp-image-14322&#34; src=&#34;https://i2.wp.com/blog.amit-agarwal.co.in/wp-content/uploads/2019/09/bastion.png?resize=300%2C184&#34; alt=&#34;bastion host&#34; width=&#34;300&#34; height=&#34;184&#34; srcset=&#34;https://i2.wp.com/blog.amit-agarwal.co.in/wp-content/uploads/2019/09/bastion.png?resize=300%2C184 300w, https://i2.wp.com/blog.amit-agarwal.co.in/wp-content/uploads/2019/09/bastion.png?w=620 620w&#34; sizes=&#34;(max-width: 300px) 100vw, 300px&#34; data-recalc-dims=&#34;1&#34; /&gt; 
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Now, in such cases, either you add an entry in “~/.ssh/config” to route the ssh through the bastion host or do ssh to bastion host and then ssh from there to the actual host. But wait, there is always a better way:&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>View xml files like a pro</title>
      <link>/2019/08/05/view-xml-files-like-a-pro/</link>
      <pubDate>Mon, 05 Aug 2019 01:00:43 +0000</pubDate>
      
      <guid>/2019/08/05/view-xml-files-like-a-pro/</guid>
      <description>&lt;p&gt;Viewing XML files can be daunting with tracking mentally where the tag starts and where it ends. So, I ended up with the following alias to help me view xml files&lt;/p&gt;
&lt;pre class=&#34;brush:shell&#34;&gt;xmllint --format - | pygmentize -f 16m -O style=native -g&lt;/pre&gt;</description>
    </item>
    
    <item>
      <title>Add files to dropbox with single curl command</title>
      <link>/2019/07/08/add-files-to-dropbox-with-single-curl-command/</link>
      <pubDate>Mon, 08 Jul 2019 00:44:45 +0000</pubDate>
      
      <guid>/2019/07/08/add-files-to-dropbox-with-single-curl-command/</guid>
      <description>&lt;p&gt;I have been thinking of posting this for sometime now. This is very useful, when you are working on a different Linux box and want to upload a file to dropbox.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;So, before you run this command, you need to create your auth token in Dropbox developer API page. Once that is done, need to change the 2 parameters in command below. Export your Access token and run the below command.&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Split pcap to multiple files based on number of packets</title>
      <link>/2019/06/03/split-pcap-to-multiple-files-based-on-number-of-packets/</link>
      <pubDate>Mon, 03 Jun 2019 01:00:38 +0000</pubDate>
      
      <guid>/2019/06/03/split-pcap-to-multiple-files-based-on-number-of-packets/</guid>
      <description>&lt;p&gt;Here is a script that can use tshark to split a large pcap to multiple small pcaps&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;pre class=&#34;brush:shell&#34;&gt;inpcap=&#34;test.pcap&#34;

max=$(tshark  -r $inpcap -n -T fields -e frame.number|tail -1)

# This is the number of packets in each split pcap
c=1

# Save all new pcaps to out, if it does not exist, create it.
[[ ! -d out ]] &amp;&amp; mkdir out

for i in $(seq 1 $max $c)
do
        tshark  -r $inpcap  -n -c $c &#34;frame.number==$i&#34; -w out/$i.pcap
        #Do other stuff, if required
        read -p &#34;Send the next packet? &#34;
done
&lt;/pre&gt;
&lt;p&gt;A very simple 3-4 line script that has saved my day so may times.&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>GREP_COLORS – change the colors in the GREP output.</title>
      <link>/2019/04/22/grep_colors-change-the-colors-in-the-grep-output/</link>
      <pubDate>Mon, 22 Apr 2019 01:00:59 +0000</pubDate>
      
      <guid>/2019/04/22/grep_colors-change-the-colors-in-the-grep-output/</guid>
      <description>&lt;!--[ad#ad-2]--&gt;
&lt;p&gt;Today we will look at the variable &lt;strong&gt;GREP_COLORS&lt;/strong&gt;. This variable determines the &lt;a class=&#34;zem_slink&#34; title=&#34;Color&#34; href=&#34;http://en.wikipedia.org/wiki/Color&#34; rel=&#34;wikipedia&#34;&gt;colour&lt;/a&gt; that is used with the &lt;a class=&#34;zem_slink&#34; title=&#34;Grep&#34; href=&#34;http://en.wikipedia.org/wiki/Grep&#34; rel=&#34;wikipedia&#34;&gt;grep&lt;/a&gt; command. You can look at the &lt;a class=&#34;zem_slink&#34; title=&#34;Man page&#34; href=&#34;http://en.wikipedia.org/wiki/Man_page&#34; rel=&#34;wikipedia&#34;&gt;man page&lt;/a&gt; of the grep command to see what the various options mean. Here is the excerpt from the man command:&lt;/p&gt;
&lt;blockquote&gt;
&lt;pre&gt;GREP_COLORS
&lt;/blockquote&gt;
&lt;pre&gt;&lt;code&gt;          Specifies the colors and other attributes used to highlight various  parts  of  the
          output.   Its  value  is  a  colon-separated  list of capabilities that defaults to
          ms=01;31:mc=01;31:sl=:cx=:fn=35:ln=32:bn=32:se=36  with  the  rv  and  ne   boolean
          capabilities omitted (i.e., false).  Supported capabilities are as follows.

          sl=    SGR  &amp;lt;a class=&amp;quot;zem_slink&amp;quot; title=&amp;quot;Substring&amp;quot; href=&amp;quot;http://en.wikipedia.org/wiki/Substring&amp;quot; rel=&amp;quot;wikipedia&amp;quot;&amp;gt;substring&amp;lt;/a&amp;gt;  for  whole  selected lines (i.e., matching lines when the -v
                 command-line option is omitted, or non-matching lines when -v is specified).
                 If however the boolean rv capability and the -v command-line option are both
                 specified, it applies to context matching lines  instead.   The  &amp;lt;a class=&amp;quot;zem_slink&amp;quot; title=&amp;quot;Default (finance)&amp;quot; href=&amp;quot;http://en.wikipedia.org/wiki/Default_%28finance%29&amp;quot; rel=&amp;quot;wikipedia&amp;quot;&amp;gt;default&amp;lt;/a&amp;gt;  is
                 empty (i.e., the terminal&#39;s default color pair).

          cx=    SGR  substring for whole context lines (i.e., non-matching lines when the -v
                 command-line option is omitted, or matching lines when -v is specified).  If
                 however  the  boolean  rv capability and the -v command-line option are both
                 specified, it applies to selected non-matching lines instead.   The  default
                 is empty (i.e., the terminal&#39;s default color pair).

          rv     &amp;lt;a class=&amp;quot;zem_slink&amp;quot; title=&amp;quot;Boolean data type&amp;quot; href=&amp;quot;http://en.wikipedia.org/wiki/Boolean_data_type&amp;quot; rel=&amp;quot;wikipedia&amp;quot;&amp;gt;Boolean  value&amp;lt;/a&amp;gt;  that  reverses  (swaps)  the  meanings  of  the  sl= and cx=
                 capabilities when the -v command-line option is specified.  The  default  is
                 false (i.e., the capability is omitted).

          mt=01;31
                 SGR  substring  for  matching  &amp;lt;a class=&amp;quot;zem_slink&amp;quot; title=&amp;quot;Empty set&amp;quot; href=&amp;quot;http://en.wikipedia.org/wiki/Empty_set&amp;quot; rel=&amp;quot;wikipedia&amp;quot;&amp;gt;non-empty&amp;lt;/a&amp;gt;  text in any matching line (i.e., a
                 selected line when the -v command-line option is omitted, or a context  line
                 when  -v  is specified).  Setting this is equivalent to setting both ms= and
                 mc= at once to the same value.  The default is a bold  red  text  foreground
                 over the current line background.

          ms=01;31
                 SGR substring for matching non-empty text in a selected line.  (This is only
                 used when the -v command-line option is omitted.)  The effect of the sl= (or
                 cx=  if  rv) capability remains active when this kicks in.  The default is a
                 bold red text foreground over the current line background.

          mc=01;31
                 SGR substring for matching non-empty text in a context line.  (This is  only
                 used  when  the -v command-line option is specified.)  The effect of the cx=
                 (or sl= if rv) capability remains active when this kicks in.  The default is
                 a bold red text foreground over the current line background.

          fn=35  SGR  substring  for file names prefixing any content line.  The default is a
                 magenta text foreground over the terminal&#39;s default background.

          ln=32  SGR substring for &amp;lt;a class=&amp;quot;zem_slink&amp;quot; title=&amp;quot;Line number&amp;quot; href=&amp;quot;http://en.wikipedia.org/wiki/Line_number&amp;quot; rel=&amp;quot;wikipedia&amp;quot;&amp;gt;line numbers&amp;lt;/a&amp;gt; prefixing any content line.  The default is a
                 green text foreground over the terminal&#39;s default background.

          bn=32  SGR substring for byte offsets prefixing any content line.  The default is a
                 green text foreground over the terminal&#39;s default background.

          se=36  SGR substring for separators that are inserted between selected line  fields
                 (:),  between context line fields, (-), and between groups of adjacent lines
                 when nonzero context  is  specified  (--).   The  default  is  a  cyan  text
                 foreground over the terminal&#39;s default background.

          ne     Boolean  value that prevents clearing to the &amp;lt;a class=&amp;quot;zem_slink&amp;quot; title=&amp;quot;Newline&amp;quot; href=&amp;quot;http://en.wikipedia.org/wiki/Newline&amp;quot; rel=&amp;quot;wikipedia&amp;quot;&amp;gt;end of line&amp;lt;/a&amp;gt; using Erase in Line
                 (EL) to Right (\33[K) each time a colorized item ends.  This  is  needed  on
                 terminals on which EL is not supported.  It is otherwise useful on terminals
                 for which the back_color_erase (bce) boolean terminfo  capability  does  not
                 apply,  when  the  chosen  highlight colors do not affect the background, or
                 when EL is too slow or causes too much flicker.  The default is false (i.e.,
                 the capability is omitted).
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;/pre&gt;&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>copy /proc folder</title>
      <link>/2019/03/18/copy-proc-folder/</link>
      <pubDate>Mon, 18 Mar 2019 01:03:37 +0000</pubDate>
      
      <guid>/2019/03/18/copy-proc-folder/</guid>
      <description>&lt;p&gt;Other day, I was trying to copy the proc folder with following command:&lt;/p&gt;
&lt;pre class=&#34;brush:shell&#34;&gt;tar cvzf /tmp/proc.tgz /proc&lt;/pre&gt;
&lt;p&gt;and I found out that all the files in tar were empty. Strange it may seem but lot of people are facing this as /proc is not a regular filesystem, so I wrote a quick script to copy the proc folder. Here is the script:&lt;/p&gt;
&lt;pre class=&#34;brush:shell&#34;&gt;cd /
mkdir /tmp/proc
[[ -z $1 ]] &amp;&amp; exit -1
find /proc/$1/ -not -name pagemap | while read F ; do
    D=/tmp/$F
    if [[ -d $F ]]
    then
        echo &#34;$(ls -ld $F) =&amp;gt; Directory&#34;
        mkdir -p $D
    fi
    if [[ -L $F ]]
    then
        echo &#34;$(ls -ld $F) =&amp;gt; copied&#34;
        cp -P $F /tmp/$F
        
    elif [[ -f $F ]]
    then
        echo &#34;$(ls -ld $F) =&amp;gt; Cat&#34;
        cat $F &amp;gt; /tmp/$F
    else
        echo &#34;Dont know $F&#34;
    fi
done
&lt;/pre&gt;</description>
    </item>
    
    <item>
      <title>cool sed/grep magic to convert output to csv format</title>
      <link>/2019/03/11/cool-sed-grep-magic-to-convert-output-to-csv-format/</link>
      <pubDate>Mon, 11 Mar 2019 01:12:34 +0000</pubDate>
      
      <guid>/2019/03/11/cool-sed-grep-magic-to-convert-output-to-csv-format/</guid>
      <description>&lt;p&gt;I generallly keep doing this a lot, so thought will share with you. Lets assume we are capturing free ouput every min/hour/or whatever. The output looks like this:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Time: Mon Jan 21 23:59:10 AEDT 2019&lt;br&gt;
——————-&lt;/p&gt;
&lt;p&gt;total        used        free      shared  buff/cache   available&lt;br&gt;
Mem:          32014        8656        1735        1697       21621       21308&lt;br&gt;
Swap: 51195 75 51120&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;then we can use some grep and sed to convert this to something like this:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Mon Jan 21 23:59:10 AEDT 2019,32014,8656,1735,1697,21621,21308&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>bash function for rpm whatprovides</title>
      <link>/2018/12/31/bash-function-for-rpm-whatprovides/</link>
      <pubDate>Mon, 31 Dec 2018 01:00:38 +0000</pubDate>
      
      <guid>/2018/12/31/bash-function-for-rpm-whatprovides/</guid>
      <description>&lt;p&gt;Sometimes some simple one-liner function can save you a lot of time, like-&lt;/p&gt;
&lt;pre class=&#34;brush:shell&#34;&gt;wps ()
{
    rpm -q --whatprovides $(which $1 )
}   # ----------  end of function wps  ----------

&lt;/pre&gt;</description>
    </item>
    
    <item>
      <title>Directories with maximum number of files</title>
      <link>/2018/12/10/directories-with-maximum-number-of-files/</link>
      <pubDate>Mon, 10 Dec 2018 01:00:40 +0000</pubDate>
      
      <guid>/2018/12/10/directories-with-maximum-number-of-files/</guid>
      <description>&lt;p&gt;Lot of times, I want to find the directories with maximum number of files and so I wrote this quick function to do exactly the same&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;pre class=&#34;brush:shell&#34;&gt;function count_lines ()
{
    oldIFS=$IFS
    count=0
    IFS=$&#39;\n&#39;
    dir=${1:-.}
    cd $dir
    find . -type d |while read line
    do
        echo -n &#34;$(find $line -type f |wc -l) $line&#34;
        echo 
        printf &#34;Directories :: %8d\r&#34; $count &amp;gt;&amp;2
        ((count++))
    done|sort -n
    IFS=$oldIFS
}   # ----------  end of function count_lines  ----------
&lt;/pre&gt;</description>
    </item>
    
    <item>
      <title>mv command with progress</title>
      <link>/2018/03/19/mv-command-progress/</link>
      <pubDate>Mon, 19 Mar 2018 01:00:59 +0000</pubDate>
      
      <guid>/2018/03/19/mv-command-progress/</guid>
      <description>&lt;p&gt;When moving large files/directories, I would like to see the progress.&lt;/p&gt;
&lt;p&gt;Idea for this is to use rsync with progress and remove source files. But that option does not remove the empty directories left behind so find command to delete that.&lt;/p&gt;
&lt;p&gt;So, here is function for that:&lt;/p&gt;
&lt;pre class=&#34;brush:shell&#34;&gt;mv-progress () 
{ 
    rsync -ah --progress --remove-source-files &#34;$1&#34; &#34;$2&#34;;
    find &#34;$1&#34; -empty -delete
}
&lt;/pre&gt;</description>
    </item>
    
    <item>
      <title>Highest disk usage of directory in subdirectories</title>
      <link>/2018/03/12/highest-disk-usage-directory-subdirectories/</link>
      <pubDate>Mon, 12 Mar 2018 01:00:42 +0000</pubDate>
      
      <guid>/2018/03/12/highest-disk-usage-directory-subdirectories/</guid>
      <description>&lt;p&gt;I find myself doing this lot of times so thought will share this with you all. Basically, once I want to clear out the directory, I first want to find out the sub-directory using the maximum disk space so I wrote a function for that and here it is:&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;pre class=&#34;brush:shell&#34;&gt;disk_usage_dirs () 
{ 
    find . -maxdepth 1 -type d -not -name &#39;.&#39; | while read line; do
        du -s &#34;$line&#34;;
    done | sort -n | tail -${1:-5}
}
&lt;/pre&gt;
&lt;p&gt;Some other posts you might find useful on this :&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>send mail using telnet from script</title>
      <link>/2017/12/25/send-mail-telnet-script/</link>
      <pubDate>Mon, 25 Dec 2017 01:00:07 +0000</pubDate>
      
      <guid>/2017/12/25/send-mail-telnet-script/</guid>
      <description>&lt;p&gt;If you have no other option but to use telnet with authentication to send mail 🙂&lt;/p&gt;
&lt;pre class=&#34;brush:bash&#34;&gt;( echo &#34;ehlo&#34;
sleep 1
auth login
sleep 1
$(echo username |base64)
sleep 1
$(echo password |base64)
sleep 1
mail from: from-address
sleep 1
rcpt to: recepient
sleep 1
data
sleep 1
subject: test 
test mail
. 

exit ) |telnet server port

&lt;/pre&gt;</description>
    </item>
    
    <item>
      <title>search for a port number</title>
      <link>/2017/09/11/search-port-number/</link>
      <pubDate>Mon, 11 Sep 2017 00:51:22 +0000</pubDate>
      
      <guid>/2017/09/11/search-port-number/</guid>
      <description>&lt;p&gt;I find myself doing google everytime I want to search for port number mapping. So, here is a short script to do just that 🙂&lt;/p&gt;
&lt;pre class=&#34;brush:bash&#34;&gt;#!/bin/bash -
#===============================================================================
#
# FILE: portfind.sh
#
# USAGE: ./portfind.sh
#
# DESCRIPTION:
#
# OPTIONS: ---
# REQUIREMENTS: ---
# BUGS: ---
# NOTES: ---
# AUTHOR: Amit Agarwal (aka),
# ORGANIZATION:
# CREATED: 08/29/2017 19:00
# Last modified: Tue Aug 29, 2017 07:00PM
# REVISION: ---
#===============================================================================
set -o nounset # Treat unset variables as an error
#This is the directory where you have mappings file downloaded
ODIR=/root
ofile=$ODIR/service-names-port-numbers.xml

if [[ ! -f &#34;$ofile&#34; ]]
then
wget http://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xml -O &#34;$ofile&#34;
fi
which xmlstarlet &amp;gt;/dev/null 2&amp;gt;&amp;1
if [[ $? == 0 ]]
then
echo &#34;xmlstarlet is installed&#34;
else
apt-get install xmlstarlet
fi

#### xmlstarlet el -u service-names-port-numbers.xml
## registry/record - protocol and number
proto=${2:-tcp}
port=${1:-21}
(echo &#39;&#39;;sed &#39;1,4d&#39; $ofile) |xmlstarlet sel -t -m &#34;//record[protocol=&#39;$proto&#39;][number=$port]&#34; -o &#34;Number(Protocol): &#34; -v number -o &#39;(&#39; -v protocol -o &#39;)&#39; -n -o &#34;Description :&#34; -v description -n
&lt;/pre&gt;</description>
    </item>
    
    <item>
      <title>bash ansi codes to html for html reports from shell script</title>
      <link>/2017/02/20/bash-ansi-codes-html-html-reports-shell-script/</link>
      <pubDate>Mon, 20 Feb 2017 01:00:58 +0000</pubDate>
      
      <guid>/2017/02/20/bash-ansi-codes-html-html-reports-shell-script/</guid>
      <description>&lt;p&gt;How many times you have felt that there was some simple way to convert bash &lt;a class=&#34;zem_slink&#34; title=&#34;ANSI escape code&#34; href=&#34;http://en.wikipedia.org/wiki/ANSI_escape_code&#34; target=&#34;_blank&#34; rel=&#34;wikipedia&#34;&gt;ansi escape sequences&lt;/a&gt; ( colors as well in terminal ) to html equivalent so that you can send the same as html report in email. Here is simple solution. One way is to use ccze if you are using this for logs – &lt;a href=&#34;http://blog.amit-agarwal.co.in/2015/01/14/colorize-logs/&#34;&gt;colorize your logs&lt;/a&gt; and for more generic solution.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;pre class=&#34;brush:shell&#34;&gt;dnf install python3-ansi2html.noarch&lt;/pre&gt;
&lt;p&gt;after this is installed, you can use something like this:&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>ansible with docker dynamic inventory</title>
      <link>/2017/01/09/ansible-docker-dynamic-inventory/</link>
      <pubDate>Mon, 09 Jan 2017 00:50:55 +0000</pubDate>
      
      <guid>/2017/01/09/ansible-docker-dynamic-inventory/</guid>
      <description>&lt;p&gt;So, I have a few dockers. Every now and then I want to run some command on all of them. Doing ‘docker exec’ is tiresome. I found this neat solution with ansible that I thought I should share with you.&lt;/p&gt;
&lt;p&gt;To get started, you need to have the “docker.py” script. This script will be used as python script inventory for ansible. So, use the following command and get the script:&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Trello – backup to your linux machine</title>
      <link>/2017/01/02/trello-backup-linux-machine/</link>
      <pubDate>Mon, 02 Jan 2017 00:42:53 +0000</pubDate>
      
      <guid>/2017/01/02/trello-backup-linux-machine/</guid>
      <description>&lt;p&gt;Just in case, you are looking for backing up your trello account boards, you can use the following bash script to do so:&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;pre class=&#34;brush:shell&#34;&gt;#!/bin/bash -
#===============================================================================
#
#          FILE: backup-trello.sh
#
#         USAGE: ./backup-trello.sh
#
#   DESCRIPTION:
#
#       OPTIONS: ---
#  REQUIREMENTS: ---
#          BUGS: ---
#         NOTES: ---
#        AUTHOR: Amit Agarwal (aka)
#  ORGANIZATION: Mobileum
# Last modified: Thu Dec 22, 2016  01:14PM
#       CREATED: 08/12/2016 09:41:08 AM IST
#      REVISION: $Revision: 1.0 $$
#===============================================================================

# Your backup directory
BDIR=/backup

# Your trello api token and key goes here :)
token=&amp;lt;&amp;gt;
key=&amp;lt;&amp;gt;


# IDs of the boards go here. This is easy to get, just go to your 
# board and check the last part of URL
BOARDS=( a b )


URL=&#34;https://trello.com/b/&#34;
POST=&#39;&amp;actions=all&amp;actions_limit=1000&amp;cards=all&amp;lists=all&amp;members=all&amp;member_fields=all&amp;checklists=all&amp;fields=all&#39;

for i in ${BOARDS[*]}
do
    /usr/bin/curl -H &#39;Accept-Encoding:gzip, deflate, br&#39; -H &#39;Accept:text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8&#39; &#34;$URL$i.json?&amp;key=$key&amp;token=$token$POST&#34; &amp;gt; &#34;$BDIR/$i.json.gz&#34;
    # gzip -f &#34;$BDIR/$i.json&#34;
done
&lt;/pre&gt;
&lt;p&gt; &lt;/p&gt;</description>
    </item>
    
    <item>
      <title>change the output format for time command</title>
      <link>/2016/08/16/change-output-format-time-command/</link>
      <pubDate>Tue, 16 Aug 2016 01:22:52 +0000</pubDate>
      
      <guid>/2016/08/16/change-output-format-time-command/</guid>
      <description>&lt;p&gt;If you are doing some scripting and using ‘time’ command, then you know sometimes it becomes difficult to capture the output as the output would be something like this:&lt;/p&gt;
&lt;pre class=&#34;brush:shell&#34;&gt;: amit ; time ls

real    0m0.002s
user    0m0.000s
sys 0m0.001s
&lt;/pre&gt;
&lt;p&gt;So, it is better to change that format. Here is simple example:&lt;/p&gt;
&lt;div class=&#34;codecolorer-container text solarized-light&#34; style=&#34;overflow:auto;white-space:nowrap;width:550px;&#34;&gt;
  &lt;table cellspacing=&#34;0&#34; cellpadding=&#34;0&#34;&gt;
    &lt;tr&gt;
      &lt;td class=&#34;line-numbers&#34;&gt;
        &lt;div&gt;
          1&lt;br /&gt;
        &lt;/div&gt;
      &lt;/td&gt;
&lt;pre&gt;&lt;code&gt;  &amp;lt;td&amp;gt;
    &amp;lt;div class=&amp;quot;text codecolorer&amp;quot;&amp;gt;
      &amp;amp;nbsp;
    &amp;lt;/div&amp;gt;
  &amp;lt;/td&amp;gt;
&amp;lt;/tr&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
  &lt;/table&gt;
&lt;/div&gt;
&lt;dl&gt;
&lt;dt&gt;TIMEFORMAT=’real %3R user %3U sys %3S pcpu %P’ time ls&lt;/dt&gt;
&lt;dd&gt;amit ;  TIMEFORMAT=’real %3R user %3U sys %3S pcpu %P’ time ls&lt;/dd&gt;
&lt;dt&gt;0.00user 0.00system 0:00.00elapsed 0%CPU (0text+0data 2432max)&lt;/dt&gt;
&lt;dt&gt;0inputs+0outputs (0major+109minor)pagefaults 0swaps&lt;/dt&gt;
&lt;dd&gt;amit ; TIMEFORMAT=’real %3R user %3U sys %3S’&lt;/dd&gt;
&lt;dd&gt;amit ; time ls&lt;br&gt;
real 0.001 user 0.001 sys 0.000&lt;/dd&gt;
&lt;dd&gt;amit ;&lt;/dd&gt;
&lt;dd&gt;amit ; TIMEFORMAT=’TIMEOUTPUT = real %3R user %3U sys %3S’&lt;/dd&gt;
&lt;dd&gt;amit ; time ls&lt;br&gt;
TIMEOUTPUT = real 0.001 user 0.001 sys 0.000&lt;/dd&gt;
&lt;dd&gt;amit ;&lt;/dd&gt;
&lt;/dl&gt;</description>
    </item>
    
    <item>
      <title>Generate random string for various use case</title>
      <link>/2016/08/08/generate-random-string-case/</link>
      <pubDate>Mon, 08 Aug 2016 01:16:14 +0000</pubDate>
      
      <guid>/2016/08/08/generate-random-string-case/</guid>
      <description>&lt;p&gt;Some times I need random string, for example to use as email seperator or to use in some &lt;a class=&#34;zem_slink&#34; title=&#34;Application programming interface&#34; href=&#34;http://en.wikipedia.org/wiki/Application_programming_interface&#34; target=&#34;_blank&#34; rel=&#34;wikipedia&#34;&gt;API&lt;/a&gt;. One way is to use tools like &lt;a class=&#34;zem_slink&#34; title=&#34;Device file&#34; href=&#34;http://en.wikipedia.org/wiki/Device_file&#34; target=&#34;_blank&#34; rel=&#34;wikipedia&#34;&gt;/dev&lt;/a&gt;/[u]random or od and other such. But they seem cubersome after I figured this out.&lt;/p&gt;
&lt;pre class=&#34;brush:shell&#34;&gt;openssl rand &amp;lt;length&amp;gt;
openssl rand 10
&lt;/pre&gt;
&lt;p&gt;This alone without some parameters is not interesting thoug. You can use ‘-base64’ or ‘-hex’ to select the encoding.&lt;/p&gt;
&lt;p&gt;So if you execute the above you will get something like this&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Get your local IP address like pro</title>
      <link>/2016/07/10/local-ip-address-pro/</link>
      <pubDate>Sun, 10 Jul 2016 00:37:44 +0000</pubDate>
      
      <guid>/2016/07/10/local-ip-address-pro/</guid>
      <description>&lt;p&gt;In &lt;a class=&#34;zem_slink&#34; title=&#34;Shell script&#34; href=&#34;http://en.wikipedia.org/wiki/Shell_script&#34; target=&#34;_blank&#34; rel=&#34;wikipedia&#34;&gt;shell scripts&lt;/a&gt; if you need to get you local &lt;a class=&#34;zem_slink&#34; title=&#34;IP address&#34; href=&#34;http://en.wikipedia.org/wiki/IP_address&#34; target=&#34;_blank&#34; rel=&#34;wikipedia&#34;&gt;IP address&lt;/a&gt; corresponding to your hostname then you can use this command&lt;/p&gt;
&lt;pre class=&#34;brush:shell&#34;&gt;hostname -i&lt;/pre&gt;
&lt;h3 class=&#34;zemanta-related-title&#34; style=&#34;margin: 0 0 10px 0; padding: 0; clear: both;&#34;&gt;
  Related articles across the web
&lt;/h3&gt;
&lt;ul class=&#34;zemanta-article-ul zemanta-article-ul-image&#34; style=&#34;margin: 0; padding: 0; overflow: hidden;&#34;&gt;
  &lt;li class=&#34;zemanta-article-ul-li-image zemanta-article-ul-li&#34; style=&#34;padding: 0; background: none; list-style: none; display: block; float: left; vertical-align: top; text-align: left; width: 104px; font-size: 12px; margin: 0 5px 10px 0;&#34;&gt;
    &lt;a style=&#34;padding: 2px; display: block; text-decoration: none;&#34; href=&#34;https://danielmiessler.com/blog/dns-as-the-security-cornerstone/&#34; target=&#34;_blank&#34;&gt;&lt;img style=&#34;border-radius: 3px; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2); padding: 0; margin: 0; border: 0; display: block; width: 100px; max-width: 100%;&#34; src=&#34;https://i0.wp.com/blog.amit-agarwal.co.in/wp-content/uploads/2016/07/369169203_150_150.jpg?w=688&#34; data-recalc-dims=&#34;1&#34; /&gt;&lt;/a&gt;&lt;a style=&#34;display: block; overflow: hidden; text-decoration: none; line-height: 12pt; height: 80px; padding: 5px 2px 0 2px;&#34; href=&#34;https://danielmiessler.com/blog/dns-as-the-security-cornerstone/&#34; target=&#34;_blank&#34;&gt;DNS as the Security Cornerstone&lt;/a&gt;
  &lt;/li&gt;
  &lt;li class=&#34;zemanta-article-ul-li-image zemanta-article-ul-li&#34; style=&#34;padding: 0; background: none; list-style: none; display: block; float: left; vertical-align: top; text-align: left; width: 104px; font-size: 12px; margin: 0 5px 10px 0;&#34;&gt;
    &lt;a style=&#34;padding: 2px; display: block; text-decoration: none;&#34; href=&#34;https://blog.xamarin.com/making-your-ios-apps-ipv6-ready/&#34; target=&#34;_blank&#34;&gt;&lt;img style=&#34;border-radius: 3px; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2); padding: 0; margin: 0; border: 0; display: block; width: 100px; max-width: 100%;&#34; src=&#34;https://i1.wp.com/blog.amit-agarwal.co.in/wp-content/uploads/2016/07/369151085_150_150.jpg?w=688&#34; data-recalc-dims=&#34;1&#34; /&gt;&lt;/a&gt;&lt;a style=&#34;display: block; overflow: hidden; text-decoration: none; line-height: 12pt; height: 80px; padding: 5px 2px 0 2px;&#34; href=&#34;https://blog.xamarin.com/making-your-ios-apps-ipv6-ready/&#34; target=&#34;_blank&#34;&gt;Making Your iOS Apps IPv6 Ready&lt;/a&gt;
  &lt;/li&gt;
  &lt;li class=&#34;zemanta-article-ul-li-image zemanta-article-ul-li&#34; style=&#34;padding: 0; background: none; list-style: none; display: block; float: left; vertical-align: top; text-align: left; width: 104px; font-size: 12px; margin: 0 5px 10px 0;&#34;&gt;
    &lt;a style=&#34;padding: 2px; display: block; text-decoration: none;&#34; href=&#34;http://www.techzim.co.zw/2016/06/name-co-zws-instant-nameserver-updates-feature-huge-deal/&#34; target=&#34;_blank&#34;&gt;&lt;img style=&#34;border-radius: 3px; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2); padding: 0; margin: 0; border: 0; display: block; width: 100px; max-width: 100%;&#34; src=&#34;https://i2.wp.com/blog.amit-agarwal.co.in/wp-content/uploads/2016/07/369218240_150_150.jpg?w=688&#34; data-recalc-dims=&#34;1&#34; /&gt;&lt;/a&gt;&lt;a style=&#34;display: block; overflow: hidden; text-decoration: none; line-height: 12pt; height: 80px; padding: 5px 2px 0 2px;&#34; href=&#34;http://www.techzim.co.zw/2016/06/name-co-zws-instant-nameserver-updates-feature-huge-deal/&#34; target=&#34;_blank&#34;&gt;Why Name.co.zw&amp;#8217;s Instant Nameserver Updates Feature is a Huge Deal&amp;#8230;&lt;/a&gt;
  &lt;/li&gt;
&lt;/ul&gt;</description>
    </item>
    
    <item>
      <title>image ordering by Original Date Time using bash script</title>
      <link>/2016/01/05/image-ordering-original-date-time-bash-script/</link>
      <pubDate>Tue, 05 Jan 2016 00:55:10 +0000</pubDate>
      
      <guid>/2016/01/05/image-ordering-original-date-time-bash-script/</guid>
      <description>&lt;p&gt;Here is the script:&lt;/p&gt;
&lt;pre class=&#34;brush:shell&#34;&gt;#!/bin/bash -
#===============================================================================
#
#          FILE: imgOrg.sh
#
#         USAGE: ./imgOrg.sh
#
#   DESCRIPTION:
#
#       OPTIONS: ---
#  REQUIREMENTS: ---
#          BUGS: ---
#         NOTES: ---
#        AUTHOR: Amit Agarwal (aka)
#      REVISION:  ---
#===============================================================================

for i in *
do
    if [[ $(file $i) == *image* ]] 
    then
        echo &#34;Image file is :: $i&#34;
        dir=$( exiftool -s -DateTimeOriginal $i | awk -F&#39;:&#39; &#39;{print $2&#34;/&#34;$3}&#39;)
        mkdir -p $dir
        cp $i $dir/
    else
        echo &#34;Excluding $i&#34;
    fi
done
&lt;/pre&gt;
&lt;p&gt; &lt;/p&gt;</description>
    </item>
    
    <item>
      <title>How to verify sha256sum for multiple file or one file.</title>
      <link>/2015/10/30/verify-sha256sum-multiple-file-file/</link>
      <pubDate>Fri, 30 Oct 2015 00:51:22 +0000</pubDate>
      
      <guid>/2015/10/30/verify-sha256sum-multiple-file-file/</guid>
      <description>&lt;p&gt;So, lets say you have downloaded the SHA256SUMS files. This file contains the sha256sum for multiple files and you want to compare the values for only one or some of them, then the simplest thing you can do is:&lt;/p&gt;
&lt;pre class=&#34;brush:shell&#34;&gt;sha256sum -c SHA256SUMS&lt;/pre&gt;
&lt;p&gt;Now, with this if you do not have some files present then you might get some errors and if you do not want that, then you can try this:&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Get count of lines in scripts (shell)</title>
      <link>/2015/10/15/count-lines-scripts-shell/</link>
      <pubDate>Thu, 15 Oct 2015 00:41:52 +0000</pubDate>
      
      <guid>/2015/10/15/count-lines-scripts-shell/</guid>
      <description>&lt;p&gt;If you have tried to get the count of lines in file, the you would know about “nl” or “wc -l”. But as you are aware these give you number of lines with other details as well and you need to post process the number to make sure that you have only number and nothing else. In such cases, it is useful to use the count feature of grep and here is a shorthand to get the count of lines in any shell script:&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>bash – expand shell variables ( bash bug resolved )</title>
      <link>/2015/08/17/bash-expand-shell-variables-bash-bug-resolved/</link>
      <pubDate>Mon, 17 Aug 2015 00:56:16 +0000</pubDate>
      
      <guid>/2015/08/17/bash-expand-shell-variables-bash-bug-resolved/</guid>
      <description>&lt;p&gt;As you would have noticed in the recent versions of bash, expansion does not work properly when expanding directory names. So, for something like this&lt;/p&gt;
&lt;pre class=&#34;brush:shell&#34;&gt;cd $varname&lt;/pre&gt;
&lt;p&gt;if you press tab, then variable name does not expand properly.&lt;/p&gt;
&lt;p&gt;If this is something that is bothering you then you can now add the following in your bashrc and revert to older behaviour:&lt;/p&gt;
&lt;pre class=&#34;brush:shell&#34;&gt;shopt -s direxpand&lt;/pre&gt;
&lt;p&gt;Hope this helps you.&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>ShellCheck – check basic POSIX shell script errors</title>
      <link>/2015/08/03/shellcheck-check-basic-posix-shell-script-errors/</link>
      <pubDate>Mon, 03 Aug 2015 01:15:16 +0000</pubDate>
      
      <guid>/2015/08/03/shellcheck-check-basic-posix-shell-script-errors/</guid>
      <description>&lt;p&gt;Here is description of the tool:&lt;/p&gt;
&lt;blockquote&gt;
&lt;dl&gt;
&lt;dt&gt;Description : The goals of ShellCheck are:&lt;/dt&gt;
&lt;dd&gt;&lt;/dd&gt;
&lt;dd&gt;&lt;ul&gt;
&lt;li&gt;To point out and clarify typical beginner’s syntax issues,&lt;br&gt;
:   that causes a shell to give cryptic error messages.&lt;/li&gt;
&lt;/ul&gt;
&lt;/dd&gt;
&lt;dd&gt;&lt;/dd&gt;
&lt;dd&gt;&lt;ul&gt;
&lt;li&gt;To point out and clarify typical intermediate level semantic&lt;br&gt;
:   problems, that causes a shell to behave strangely and&lt;br&gt;
:   counter-intuitively.&lt;/li&gt;
&lt;/ul&gt;
&lt;/dd&gt;
&lt;dd&gt;&lt;/dd&gt;
&lt;dd&gt;&lt;ul&gt;
&lt;li&gt;To point out subtle caveats, corner cases and pitfalls, that may&lt;br&gt;
:   cause an advanced user’s otherwise working script to fail under&lt;br&gt;
:   future circumstances.&lt;/li&gt;
&lt;/ul&gt;
&lt;/dd&gt;
&lt;/dl&gt;
&lt;/blockquote&gt;
&lt;p&gt;To install&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>nice little bash function to search for running processes</title>
      <link>/2014/10/13/nice-bash-function-search-running-processes/</link>
      <pubDate>Mon, 13 Oct 2014 00:20:31 +0000</pubDate>
      
      <guid>/2014/10/13/nice-bash-function-search-running-processes/</guid>
      <description>&lt;p&gt;Here is a nice little handy function that I use very regurlarly.&lt;/p&gt;
&lt;p&gt;You can use this function with parameter to just grep for that or just type psa to see all the running processes.&lt;/p&gt;
&lt;p&gt;Just put this in your &lt;strong&gt;.bashrc&lt;/strong&gt; file.&lt;/p&gt;
&lt;p&gt;You might find it useful:&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;pre class=&#34;brush:shell&#34;&gt;psa () 
{ 
    if [[ $1 == &#34;&#34; ]]; then
        ps -eaf;
    else
        ps -eaf | grep --color=auto -i $1;
    fi
}
&lt;/pre&gt;</description>
    </item>
    
    <item>
      <title>bash – refer the first parameter from last command quickly</title>
      <link>/2014/09/22/bash-refer-parameter-command-quickly/</link>
      <pubDate>Mon, 22 Sep 2014 00:58:50 +0000</pubDate>
      
      <guid>/2014/09/22/bash-refer-parameter-command-quickly/</guid>
      <description>&lt;p&gt;To refer to first parameter from the last command quickly, you can use&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;!^&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Note: This can also be referred as “&lt;strong&gt;!!:1&lt;/strong&gt;“&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>bash refer parameters from the current command</title>
      <link>/2014/09/15/bash-refer-parameters-current-command/</link>
      <pubDate>Mon, 15 Sep 2014 00:40:22 +0000</pubDate>
      
      <guid>/2014/09/15/bash-refer-parameters-current-command/</guid>
      <description>&lt;p&gt;In bash you can use&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;!#&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;to refer to any parameter from the current command, example:&lt;/p&gt;
&lt;pre class=&#34;brush:shell&#34;&gt;mv ak amit.!#:1.txt
ls amit.ak.txt&lt;/pre&gt;</description>
    </item>
    
    <item>
      <title>Debuggging bash cron scripts.</title>
      <link>/2014/09/01/debuggging-bash-cron-scripts/</link>
      <pubDate>Mon, 01 Sep 2014 00:44:36 +0000</pubDate>
      
      <guid>/2014/09/01/debuggging-bash-cron-scripts/</guid>
      <description>&lt;p&gt;I have to several times debug scripts that I get complain about working when logging in normally but they do not work when run in cron mode. So, quite a lot of times, redirecting the stderr of the script is all that is required to see what is happening, but sometimes that just does not help if the script is calling another script which is mis-behaving and under lot of other conditions. So, how to at-least take a look at why these are failing, login with ssh.&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>ldap search function</title>
      <link>/2014/08/25/ldap-search-function/</link>
      <pubDate>Mon, 25 Aug 2014 00:42:04 +0000</pubDate>
      
      <guid>/2014/08/25/ldap-search-function/</guid>
      <description>&lt;p&gt;First you will need the ldap search utility. The client for ldap search comes in openldap-clients, so you need to install that first:&lt;/p&gt;
&lt;pre class=&#34;brush:shell&#34;&gt;sudo yum install openldap-clients&lt;/pre&gt;
&lt;p&gt;Now, that you have installed it, try to find something in some open ldap server, example:&lt;/p&gt;
&lt;pre class=&#34;brush:shell&#34;&gt;ldapsearch -LLL -h  db.debian.org   -x  -b &#34;dc=debian,dc=org&#34; &#34;cn=Joao*&#34;&lt;/pre&gt;
&lt;p&gt;This should list couple of entries for you. Now, that you have ldapsearch working, lets define a function in .bashrc file:&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>get all the urls in html file (local or on server).</title>
      <link>/2014/02/17/urls-html-file-local-server/</link>
      <pubDate>Mon, 17 Feb 2014 10:35:53 +0000</pubDate>
      
      <guid>/2014/02/17/urls-html-file-local-server/</guid>
      <description>&lt;p&gt;To use this, you will need the &lt;a class=&#34;zem_slink&#34; title=&#34;Lynx&#34; href=&#34;http://en.wikipedia.org/wiki/Lynx&#34; target=&#34;_blank&#34; rel=&#34;wikipedia&#34;&gt;lynx&lt;/a&gt; tool, so install that first.&lt;/p&gt;
&lt;pre class=&#34;brush: bash; gutter: true; first-line: 1&#34;&gt;sudo yum install lynx&lt;/pre&gt;
&lt;p&gt;Now, to get list of all the &lt;a class=&#34;zem_slink&#34; title=&#34;Uniform resource locator&#34; href=&#34;http://en.wikipedia.org/wiki/Uniform_resource_locator&#34; target=&#34;_blank&#34; rel=&#34;wikipedia&#34;&gt;URLs&lt;/a&gt; in local html file or some URL, just execute this:&lt;/p&gt;
&lt;pre class=&#34;brush: bash; gutter: true; first-line: 1&#34;&gt;lynx -dump -listonly&lt;/pre&gt;
&lt;h6 class=&#34;zemanta-related-title&#34; style=&#34;font-size: 1em;&#34;&gt;
  Related articles
&lt;/h6&gt;
&lt;ul class=&#34;zemanta-article-ul zemanta-article-ul-image&#34; style=&#34;margin: 0; padding: 0; overflow: hidden;&#34;&gt;
  &lt;li class=&#34;zemanta-article-ul-li-image zemanta-article-ul-li&#34; style=&#34;padding: 0; background: none; list-style: none; display: block; float: left; vertical-align: top; text-align: left; width: 84px; font-size: 11px; margin: 2px 10px 10px 2px;&#34;&gt;
    &lt;a style=&#34;box-shadow: 0px 0px 4px #999; padding: 2px; display: block; border-radius: 2px; text-decoration: none;&#34; href=&#34;http://stackoverflow.com/questions/20797087/trouble-in-using-file-get-contents&#34; target=&#34;_blank&#34;&gt;&lt;img style=&#34;padding: 0; margin: 0; border: 0; display: block; width: 80px; max-width: 100%;&#34; alt=&#34;&#34; src=&#34;https://i2.wp.com/i.zemanta.com/noimg_97_80_80.jpg?w=688&#34; data-recalc-dims=&#34;1&#34; /&gt;&lt;/a&gt;&lt;a style=&#34;display: block; overflow: hidden; text-decoration: none; line-height: 12pt; height: 80px; padding: 5px 2px 0 2px;&#34; href=&#34;http://stackoverflow.com/questions/20797087/trouble-in-using-file-get-contents&#34; target=&#34;_blank&#34;&gt;Trouble in using file_get_contents()&lt;/a&gt;
  &lt;/li&gt;
  &lt;li class=&#34;zemanta-article-ul-li-image zemanta-article-ul-li&#34; style=&#34;padding: 0; background: none; list-style: none; display: block; float: left; vertical-align: top; text-align: left; width: 84px; font-size: 11px; margin: 2px 10px 10px 2px;&#34;&gt;
    &lt;a style=&#34;box-shadow: 0px 0px 4px #999; padding: 2px; display: block; border-radius: 2px; text-decoration: none;&#34; href=&#34;http://stackoverflow.com/questions/21453767/how-to-send-image-to-server-with-url-in-ios&#34; target=&#34;_blank&#34;&gt;&lt;img style=&#34;padding: 0; margin: 0; border: 0; display: block; width: 80px; max-width: 100%;&#34; alt=&#34;&#34; src=&#34;https://i0.wp.com/i.zemanta.com/noimg_43_80_80.jpg?w=688&#34; data-recalc-dims=&#34;1&#34; /&gt;&lt;/a&gt;&lt;a style=&#34;display: block; overflow: hidden; text-decoration: none; line-height: 12pt; height: 80px; padding: 5px 2px 0 2px;&#34; href=&#34;http://stackoverflow.com/questions/21453767/how-to-send-image-to-server-with-url-in-ios&#34; target=&#34;_blank&#34;&gt;How to send image to server with url in ios&lt;/a&gt;
  &lt;/li&gt;
  &lt;li class=&#34;zemanta-article-ul-li-image zemanta-article-ul-li&#34; style=&#34;padding: 0; background: none; list-style: none; display: block; float: left; vertical-align: top; text-align: left; width: 84px; font-size: 11px; margin: 2px 10px 10px 2px;&#34;&gt;
    &lt;a style=&#34;box-shadow: 0px 0px 4px #999; padding: 2px; display: block; border-radius: 2px; text-decoration: none;&#34; href=&#34;http://christianheilmann.com/2014/01/05/endangered-species-of-the-web-the-link/&#34; target=&#34;_blank&#34;&gt;&lt;img style=&#34;padding: 0; margin: 0; border: 0; display: block; width: 80px; max-width: 100%;&#34; alt=&#34;&#34; src=&#34;https://i0.wp.com/i.zemanta.com/236173680_80_80.jpg?w=688&#34; data-recalc-dims=&#34;1&#34; /&gt;&lt;/a&gt;&lt;a style=&#34;display: block; overflow: hidden; text-decoration: none; line-height: 12pt; height: 80px; padding: 5px 2px 0 2px;&#34; href=&#34;http://christianheilmann.com/2014/01/05/endangered-species-of-the-web-the-link/&#34; target=&#34;_blank&#34;&gt;Endangered species of the Web: the Link&lt;/a&gt;
  &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt; &lt;/p&gt;</description>
    </item>
    
    <item>
      <title>bash debug – log all executed commands</title>
      <link>/2014/02/03/bash-debug-log-executed-commands/</link>
      <pubDate>Mon, 03 Feb 2014 00:43:25 +0000</pubDate>
      
      <guid>/2014/02/03/bash-debug-log-executed-commands/</guid>
      <description>&lt;figure style=&#34;width: 350px&#34; class=&#34;wp-caption alignright&#34;&gt;&lt;a href=&#34;http://commons.wikipedia.org/wiki/File:Bash_demo.png&#34; target=&#34;_blank&#34;&gt;&lt;img class=&#34;zemanta-img-inserted zemanta-img-configured&#34; title=&#34;Screenshot of a Bash 3.1 session demonstrating...&#34; alt=&#34;Screenshot of a Bash 3.1 session demonstrating...&#34; src=&#34;http://upload.wikimedia.org/wikipedia/commons/thumb/8/84/Bash_demo.png/350px-Bash_demo.png&#34; width=&#34;350&#34; height=&#34;377&#34; /&gt;&lt;/a&gt;&lt;figcaption class=&#34;wp-caption-text&#34;&gt;Screenshot of a Bash 3.1 session demonstrating its particularities. Shows exporting a variable, alias, type, Bash&amp;#8217;s kill, environment variables PS1, BASH_VERSION and SHELLOPTS, redirecting standard output and standard error and history expansion. A POSIX session is launched from a normal session. Finally, the POSIX session kills itself (since just &amp;#8220;exit&amp;#8221; would be too boring). (Photo credit: Wikipedia)&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;Whenever I am writing a script in perl or &lt;a class=&#34;zem_slink&#34; title=&#34;Bash (Unix shell)&#34; href=&#34;http://www.gnu.org/software/bash/&#34; target=&#34;_blank&#34; rel=&#34;homepage&#34;&gt;bash&lt;/a&gt;, I always wish that there&lt;br&gt;
was some way to have all the commands logged or output to screen. I know&lt;br&gt;
there is “set -x” option to have debugging enabled, but sometimes that&lt;br&gt;
seems to be too much information and I dont really need all that. So, here&lt;br&gt;
is something I found recently for bash to log all the executed commands.&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Apache server stats with small and useful bash script.</title>
      <link>/2013/11/29/apache-server-stats-small-bash-script/</link>
      <pubDate>Fri, 29 Nov 2013 01:35:36 +0000</pubDate>
      
      <guid>/2013/11/29/apache-server-stats-small-bash-script/</guid>
      <description>&lt;p&gt;Just copy this script to your web-server &lt;a class=&#34;zem_slink&#34; title=&#34;Common Gateway Interface&#34; href=&#34;http://en.wikipedia.org/wiki/Common_Gateway_Interface&#34; target=&#34;_blank&#34; rel=&#34;wikipedia&#34;&gt;cgi-bin&lt;/a&gt; directory and enjoy.&lt;/p&gt;
&lt;p&gt;The script with show the common errors like &lt;a class=&#34;zem_slink&#34; title=&#34;HTTP 404&#34; href=&#34;http://en.wikipedia.org/wiki/HTTP_404&#34; target=&#34;_blank&#34; rel=&#34;wikipedia&#34;&gt;404 Error&lt;/a&gt;, &lt;a class=&#34;zem_slink&#34; title=&#34;List of HTTP status codes&#34; href=&#34;http://www.iana.org/assignments/http-status-codes&#34; target=&#34;_blank&#34; rel=&#34;homepage&#34;&gt;Internal Server Error&lt;/a&gt; and others. It will show the &lt;a class=&#34;zem_slink&#34; title=&#34;User agent&#34; href=&#34;http://en.wikipedia.org/wiki/User_agent&#34; target=&#34;_blank&#34; rel=&#34;wikipedia&#34;&gt;User agent&lt;/a&gt; distribution using simple commands like &lt;a class=&#34;zem_slink&#34; title=&#34;Grep&#34; href=&#34;http://en.wikipedia.org/wiki/Grep&#34; target=&#34;_blank&#34; rel=&#34;wikipedia&#34;&gt;grep&lt;/a&gt;, &lt;a class=&#34;zem_slink&#34; title=&#34;Uniq&#34; href=&#34;http://en.wikipedia.org/wiki/Uniq&#34; target=&#34;_blank&#34; rel=&#34;wikipedia&#34;&gt;uniq&lt;/a&gt;, &lt;a class=&#34;zem_slink&#34; title=&#34;AWK&#34; href=&#34;http://cm.bell-labs.com/cm/cs/awkbook&#34; target=&#34;_blank&#34; rel=&#34;homepage&#34;&gt;awk&lt;/a&gt; and so on.&lt;/p&gt;
&lt;p&gt;You would need to change the tfile – which is temporary file and also the access.log path in the next line.&lt;/p&gt;
&lt;p&gt;Just re-direct the output to some file with html extenstion. You could even put this in the cron which re-directs the output to some html in server document root.&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>bash – using the vi mode more effectively.</title>
      <link>/2013/11/22/bash-vi-mode-effectively/</link>
      <pubDate>Fri, 22 Nov 2013 01:50:24 +0000</pubDate>
      
      <guid>/2013/11/22/bash-vi-mode-effectively/</guid>
      <description>&lt;figure style=&#34;width: 240px&#34; class=&#34;wp-caption alignright&#34;&gt;&lt;a href=&#34;http://www.flickr.com/photos/36867590@N00/397369388&#34; target=&#34;_blank&#34;&gt;&lt;img class=&#34;zemanta-img-inserted zemanta-img-configured&#34; title=&#34;Vi blogging bundle&#34; alt=&#34;Vi blogging bundle&#34; src=&#34;https://i1.wp.com/farm1.static.flickr.com/160/397369388_6935e4572a_m.jpg?resize=240%2C180&#34; width=&#34;240&#34; height=&#34;180&#34; data-recalc-dims=&#34;1&#34; /&gt;&lt;/a&gt;&lt;figcaption class=&#34;wp-caption-text&#34;&gt;Vi blogging bundle (Photo credit: pedro mg)&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;You can first set the &lt;a class=&#34;zem_slink&#34; title=&#34;Bash (Unix shell)&#34; href=&#34;http://www.gnu.org/software/bash/&#34; target=&#34;_blank&#34; rel=&#34;homepage&#34;&gt;bash&lt;/a&gt; mode to &lt;a class=&#34;zem_slink&#34; title=&#34;Vi&#34; href=&#34;http://en.wikipedia.org/wiki/Vi&#34; target=&#34;_blank&#34; rel=&#34;wikipedia&#34;&gt;vi&lt;/a&gt;. This will enable some vim like features to bash. So, add this to .bashrc :&lt;/p&gt;
&lt;pre class=&#34;brush: actionscript3; gutter: true; first-line: 1&#34;&gt;set -o vi&lt;/pre&gt;
&lt;p&gt;Once, you have done that then its time to get more out of the vi mode. First, check some things and set some interesting stuff.&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>bashrc with lots of functions and useful alias</title>
      <link>/2013/10/30/bashrc-lots-functions-alias/</link>
      <pubDate>Wed, 30 Oct 2013 00:55:11 +0000</pubDate>
      
      <guid>/2013/10/30/bashrc-lots-functions-alias/</guid>
      <description>&lt;p&gt;Here is a link of a useful 10K lines bashrc&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;http://pastebin.com/LEkXXuST&#34;&gt;http://pastebin.com/LEkXXuST&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;You may not want to put the whole thing, but get an idea and use what you think can be helpful to you or at-least get an idea. This was not posted by me, so if you are re-using code as is, check the permissions to copy.&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Check all vim colorschemes for minor issues</title>
      <link>/2013/10/10/check-vim-colorschemes-minor-issues/</link>
      <pubDate>Thu, 10 Oct 2013 01:13:25 +0000</pubDate>
      
      <guid>/2013/10/10/check-vim-colorschemes-minor-issues/</guid>
      <description>&lt;p&gt;Here is script that checks all the colorschemes in the &lt;a class=&#34;zem_slink&#34; title=&#34;Working directory&#34; href=&#34;http://en.wikipedia.org/wiki/Working_directory&#34; target=&#34;_blank&#34; rel=&#34;wikipedia&#34;&gt;current directory&lt;/a&gt; and corrects them if possible (&lt;a class=&#34;zem_slink&#34; title=&#34;Processing (programming language)&#34; href=&#34;http://www.processing.org&#34; target=&#34;_blank&#34; rel=&#34;homepage&#34;&gt;Processing&lt;/a&gt; of the file is done with simple commands like &lt;a class=&#34;zem_slink&#34; title=&#34;Sed&#34; href=&#34;http://en.wikipedia.org/wiki/Sed&#34; target=&#34;_blank&#34; rel=&#34;wikipedia&#34;&gt;sed&lt;/a&gt;, &lt;a class=&#34;zem_slink&#34; title=&#34;Grep&#34; href=&#34;http://en.wikipedia.org/wiki/Grep&#34; target=&#34;_blank&#34; rel=&#34;wikipedia&#34;&gt;grep&lt;/a&gt;)&lt;/p&gt;
&lt;p&gt;Checks that the color_name is same as &lt;a class=&#34;zem_slink&#34; title=&#34;Filename&#34; href=&#34;http://en.wikipedia.org/wiki/Filename&#34; target=&#34;_blank&#34; rel=&#34;wikipedia&#34;&gt;Filename&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Here is the script:&lt;/p&gt;
&lt;pre class=&#34;brush: bash; gutter: true; first-line: 1&#34;&gt;#!/bin/bash -
#===============================================================================
#
#          FILE: check_colors.sh
#
#         USAGE: ./check_colors.sh
#
#   DESCRIPTION:
#
#       OPTIONS: ---
#  REQUIREMENTS: ---
#          BUGS: ---
#         NOTES: ---
#        AUTHOR: Amit Agarwal (aka), 
#      REVISION:  ---
#===============================================================================
cd ~/.vim/colors
for i in *vim
do
    #echo &#34;Processing $i&#34;
    if [[ $(grep -c g:colors_name $i ) -eq 0 ]]; then
        if [[ $(grep -c colors_name $i ) -eq 0 ]]; then
            echo &#34;File $i does not have colorname&#34;;
            missing=$missing&#34; $i&#34;
        else
            sed -i.bak &#39;/colors_name/ s/.*/let g:colors_name=&#34;&#39;${i//.vim}&#39;&#34;/g&#39; $i
        fi
    else
        if [[ $(grep -c colors_name $i|grep let ) -gt 1 ]]; then
            echo &#34;WARN -----&amp;gt;&amp;gt; File $i has more than one colorsname&#34;
        fi
        colorname=$(grep g:colors_name $i|grep let| sed -e &#39;s/&#34;//g&#39; -e &#39;s/.*=//&#39; |tr -d &#39; &#39;)
        if [[ ${colorname}.vim != $i ]]; then
            echo &#34;Filename $i does not match colorname $colorname .. correcting &#34;
            sed -i.bak &#39;/colors_name/ s/.*/let g:colors_name=&#34;&#39;${i//.vim}&#39;&#34;/g&#39; $i
            #sed -i.bak &#39;s/(.*g:colors_name.*=)/1&#39;${i//.vim}&#39;/g&#39; $i
        fi
    fi
done

if [[ x$missing != x ]] ; then
    echo &#34;Missing colornames in $missing&#34;
fi&lt;/pre&gt;
&lt;h6 class=&#34;zemanta-related-title&#34; style=&#34;font-size: 1em;&#34;&gt;
  Related articles
&lt;/h6&gt;
&lt;ul class=&#34;zemanta-article-ul zemanta-article-ul-image&#34; style=&#34;margin: 0; padding: 0; overflow: hidden;&#34;&gt;
  &lt;li class=&#34;zemanta-article-ul-li-image zemanta-article-ul-li&#34; style=&#34;padding: 0; background: none; list-style: none; display: block; float: left; vertical-align: top; text-align: left; width: 84px; font-size: 11px; margin: 2px 10px 10px 2px;&#34;&gt;
    &lt;a style=&#34;box-shadow: 0px 0px 4px #999; padding: 2px; display: block; border-radius: 2px; text-decoration: none;&#34; href=&#34;http://java.dzone.com/articles/using-grep-inside-vim&#34; target=&#34;_blank&#34;&gt;&lt;img style=&#34;padding: 0; margin: 0; border: 0; display: block; width: 80px; max-width: 100%;&#34; alt=&#34;&#34; src=&#34;https://i0.wp.com/i.zemanta.com/204873595_80_80.jpg?w=688&#34; data-recalc-dims=&#34;1&#34; /&gt;&lt;/a&gt;&lt;a style=&#34;display: block; overflow: hidden; text-decoration: none; line-height: 12pt; height: 80px; padding: 5px 2px 0 2px;&#34; href=&#34;http://java.dzone.com/articles/using-grep-inside-vim&#34; target=&#34;_blank&#34;&gt;Using Grep from Inside Vim&lt;/a&gt;
  &lt;/li&gt;
  &lt;li class=&#34;zemanta-article-ul-li-image zemanta-article-ul-li&#34; style=&#34;padding: 0; background: none; list-style: none; display: block; float: left; vertical-align: top; text-align: left; width: 84px; font-size: 11px; margin: 2px 10px 10px 2px;&#34;&gt;
    &lt;a style=&#34;box-shadow: 0px 0px 4px #999; padding: 2px; display: block; border-radius: 2px; text-decoration: none;&#34; href=&#34;http://nathangrigg.net/vimhelp/&#34; target=&#34;_blank&#34;&gt;&lt;img style=&#34;padding: 0; margin: 0; border: 0; display: block; width: 80px; max-width: 100%;&#34; alt=&#34;&#34; src=&#34;https://i1.wp.com/i.zemanta.com/noimg_35_80_80.jpg?w=688&#34; data-recalc-dims=&#34;1&#34; /&gt;&lt;/a&gt;&lt;a style=&#34;display: block; overflow: hidden; text-decoration: none; line-height: 12pt; height: 80px; padding: 5px 2px 0 2px;&#34; href=&#34;http://nathangrigg.net/vimhelp/&#34; target=&#34;_blank&#34;&gt;Vim&amp;#8217;s full help in PDF form&lt;/a&gt;
  &lt;/li&gt;
  &lt;li class=&#34;zemanta-article-ul-li-image zemanta-article-ul-li&#34; style=&#34;padding: 0; background: none; list-style: none; display: block; float: left; vertical-align: top; text-align: left; width: 84px; font-size: 11px; margin: 2px 10px 10px 2px;&#34;&gt;
    &lt;a style=&#34;box-shadow: 0px 0px 4px #999; padding: 2px; display: block; border-radius: 2px; text-decoration: none;&#34; href=&#34;http://www.vim.org/scripts/script.php?script_id=4586&#34; target=&#34;_blank&#34;&gt;&lt;img style=&#34;padding: 0; margin: 0; border: 0; display: block; width: 80px; max-width: 100%;&#34; alt=&#34;&#34; src=&#34;https://i1.wp.com/i.zemanta.com/noimg_22_80_80.jpg?w=688&#34; data-recalc-dims=&#34;1&#34; /&gt;&lt;/a&gt;&lt;a style=&#34;display: block; overflow: hidden; text-decoration: none; line-height: 12pt; height: 80px; padding: 5px 2px 0 2px;&#34; href=&#34;http://www.vim.org/scripts/script.php?script_id=4586&#34; target=&#34;_blank&#34;&gt;vim-colorscheme-switcher 0.2.5 &amp;#8212; Easily &amp; quickly switch between color schemes&lt;/a&gt;
  &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt; &lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Home grown mail scheduler with bash script and cron</title>
      <link>/2013/10/04/home-grown-mail-scheduler-bash-script-cron/</link>
      <pubDate>Fri, 04 Oct 2013 01:04:35 +0000</pubDate>
      
      <guid>/2013/10/04/home-grown-mail-scheduler-bash-script-cron/</guid>
      <description>&lt;p&gt;If you are using &lt;a class=&#34;zem_slink&#34; title=&#34;Linux Boot Camp&#34; href=&#34;http://www.intenseschool.com/boot_camp/linux&#34; target=&#34;_blank&#34; rel=&#34;intenseschool&#34;&gt;Linux&lt;/a&gt; (Fedora/Ubuntu or anything else) then you do get a lot of tools and one of them is &lt;a class=&#34;zem_slink&#34; title=&#34;Cron&#34; href=&#34;http://en.wikipedia.org/wiki/Cron&#34; target=&#34;_blank&#34; rel=&#34;wikipedia&#34;&gt;cron&lt;/a&gt;. Very very useful. Just write some &lt;a class=&#34;zem_slink&#34; title=&#34;Shell script&#34; href=&#34;http://en.wikipedia.org/wiki/Shell_script&#34; target=&#34;_blank&#34; rel=&#34;wikipedia&#34;&gt;script&lt;/a&gt; that can do the task for you, put it in cron and forget it. So, here is a home grown way to schedule mails.&lt;/p&gt;
&lt;p&gt;First, copy this script below:&lt;/p&gt;
&lt;pre class=&#34;brush: actionscript3; gutter: true; first-line: 1&#34;&gt;#!/bin/bash -
#============================================================================&lt;a class=&#34;zem_slink&#34; title=&#34;Relational operator&#34; href=&#34;http://en.wikipedia.org/wiki/Relational_operator&#34; target=&#34;_blank&#34; rel=&#34;wikipedia&#34;&gt;===&lt;/a&gt;
#
#          FILE: sched_mail.sh
#
#         USAGE: ./sched_mail.sh
#
#   DESCRIPTION:
#
#       OPTIONS: ---
#  REQUIREMENTS: ---
#          BUGS: ---
#         NOTES: ---
#        AUTHOR: Amit Agarwal (aka), 
#      REVISION:  ---
#===============================================================================

mailfile=&#34;~/mail&#34;
if [[ $(wc -l $mailfile|awk &#39;{print $1}&#39; ) -ge 5 ]]
then
    to=$(grep ^To: $mailfile|sed &#39;s/To: //&#39;)
    echo &#34;Good to send mail... to = $to&#34;
    sendmail -t &amp;lt;$mailfile
    echo &#34;once mail is send, delete the contents of file&#34;
    echo &#34;sed -i &#39;4,$ d&#39; $mailfile&#34;
fi&lt;/pre&gt;
&lt;p&gt;Now, create a file called mail in your &lt;a class=&#34;zem_slink&#34; title=&#34;Home directory&#34; href=&#34;http://en.wikipedia.org/wiki/Home_directory&#34; target=&#34;_blank&#34; rel=&#34;wikipedia&#34;&gt;home directory&lt;/a&gt;, with the following contents:&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Delete all but some directories</title>
      <link>/2013/08/16/delete-directories/</link>
      <pubDate>Fri, 16 Aug 2013 01:06:05 +0000</pubDate>
      
      <guid>/2013/08/16/delete-directories/</guid>
      <description>&lt;p&gt;I think, like me, you would have faced a lot of situations, where you wanted to delete all the files or directories in a location, leaving only the required files/directories. So, I have a directory containing lots of files/directories and I want to delete most of them except some 5/10 of them, how to I do it.&lt;/p&gt;
&lt;p&gt;I finally wrote a small &lt;a class=&#34;zem_slink&#34; title=&#34;Shell script&#34; href=&#34;http://en.wikipedia.org/wiki/Shell_script&#34; target=&#34;_blank&#34; rel=&#34;wikipedia&#34;&gt;script&lt;/a&gt; to do that. First save list of files that you do not want to delete in file called “listnames” and then &lt;a class=&#34;zem_slink&#34; title=&#34;Capital punishment&#34; href=&#34;http://en.wikipedia.org/wiki/Capital_punishment&#34; target=&#34;_blank&#34; rel=&#34;wikipedia&#34;&gt;execute&lt;/a&gt; the below script. This will give you the rm commands that you need to execute. If you want you can execute the rm command from the script, but to be able to review, I just have the commands echoed.&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>create text tables from delimited files.</title>
      <link>/2013/07/12/create-text-tables-delimited-files/</link>
      <pubDate>Fri, 12 Jul 2013 01:24:19 +0000</pubDate>
      
      <guid>/2013/07/12/create-text-tables-delimited-files/</guid>
      <description>&lt;p&gt;To create simple text tables to paste in emails or to use in any other document where you want to show a table, here is something that you can use. There is a perl module which provides “&lt;strong&gt;tablify&lt;/strong&gt;“. And here is how to use it:&lt;/p&gt;
&lt;pre class=&#34;brush: shell; gutter: true; first-line: 1; highlight: [1]&#34;&gt;sudo yum install perl-Text-RecordParser&lt;/pre&gt;
&lt;p&gt;This will install a command “tablify” that you can use in number of ways. Here is a simple example to use it. You can read the man pages to see how you can use it.&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>convert tabs to spaces, the easy way</title>
      <link>/2013/07/08/convert-tabs-spaces-easy/</link>
      <pubDate>Mon, 08 Jul 2013 01:32:03 +0000</pubDate>
      
      <guid>/2013/07/08/convert-tabs-spaces-easy/</guid>
      <description>&lt;p&gt;Lots of times you want to convert tabs to spaces and sometimes from a &lt;a class=&#34;zem_slink&#34; title=&#34;Shell script&#34; href=&#34;http://en.wikipedia.org/wiki/Shell_script&#34; target=&#34;_blank&#34; rel=&#34;wikipedia&#34;&gt;shell script&lt;/a&gt;, if that is the case, then simple solution is “&lt;strong&gt;tidy&lt;/strong&gt;“. First you need to install tidy as follows:&lt;/p&gt;
&lt;pre class=&#34;brush: bash; gutter: true; first-line: 1&#34;&gt;sudo yum install tidy&lt;/pre&gt;
&lt;p&gt;and then you can use the command tab2space.&lt;/p&gt;
&lt;pre class=&#34;brush: bash; gutter: true; first-line: 1&#34;&gt;tab2spcae&lt;/pre&gt;
&lt;p&gt;This will print the output to &lt;a class=&#34;zem_slink&#34; title=&#34;Standard streams&#34; href=&#34;http://en.wikipedia.org/wiki/Standard_streams&#34; target=&#34;_blank&#34; rel=&#34;wikipedia&#34;&gt;STDOUT&lt;/a&gt; by default which you can redirect if you want.&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>poor mans watch, watch for solaris</title>
      <link>/2013/01/02/poor-mans-watch-watch-solaris/</link>
      <pubDate>Tue, 01 Jan 2013 23:36:16 +0000</pubDate>
      
      <guid>/2013/01/02/poor-mans-watch-watch-solaris/</guid>
      <description>&lt;p&gt;Here is a simple script that you can use as watch in Solaris as well.&lt;/p&gt;
&lt;pre class=&#34;brush: bash; gutter: true; first-line: 1&#34;&gt;watch()
{
    #Poor man&#39;s watch
    while (true)
    do
        clear
        $*
        sleep 2;
    done
}&lt;/pre&gt;</description>
    </item>
    
    <item>
      <title>Disable a few cores when you want to save power.</title>
      <link>/2012/12/28/disable-cores-save-power/</link>
      <pubDate>Fri, 28 Dec 2012 01:23:46 +0000</pubDate>
      
      <guid>/2012/12/28/disable-cores-save-power/</guid>
      <description>&lt;p&gt;If you have a lot of &lt;a class=&#34;zem_slink&#34; title=&#34;Central processing unit&#34; href=&#34;http://en.wikipedia.org/wiki/Central_processing_unit&#34; target=&#34;_blank&#34; rel=&#34;wikipedia&#34;&gt;CPU&lt;/a&gt; power and working on battery. If you do not need that much of power and would like to rather save some &lt;a class=&#34;zem_slink&#34; title=&#34;Batteries drain rates infographics&#34; href=&#34;http://blog.lenovo.com/products/when-will-batteries-last-the-work-week?cid=us|425522&#34; target=&#34;_blank&#34; rel=&#34;lenovo&#34;&gt;battery power&lt;/a&gt; by disabling some cpus then you can use the below script. This script disables cpus from 4 to 7. You can change the number in the &lt;a class=&#34;zem_slink&#34; title=&#34;For loop&#34; href=&#34;http://en.wikipedia.org/wiki/For_loop&#34; target=&#34;_blank&#34; rel=&#34;wikipedia&#34;&gt;for loop&lt;/a&gt;. You would need the &lt;a class=&#34;zem_slink&#34; title=&#34;Sudo&#34; href=&#34;http://www.sudo.ws&#34; target=&#34;_blank&#34; rel=&#34;homepage&#34;&gt;sudo&lt;/a&gt; to be setup or remove sudo and run the script as root. The script will show you the currently active cpu’s before and after disabling the CPU’s.&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>quick bash script for datewise backup of directory</title>
      <link>/2012/12/12/quick-bash-script-datewise-backup-directory/</link>
      <pubDate>Wed, 12 Dec 2012 00:50:29 +0000</pubDate>
      
      <guid>/2012/12/12/quick-bash-script-datewise-backup-directory/</guid>
      <description>&lt;p&gt;I was working on something and the data was very critical and needed &lt;a class=&#34;zem_slink&#34; title=&#34;data backup management&#34; href=&#34;http://www.symantec.com/opscenter-analytics&#34; rel=&#34;symantec&#34; target=&#34;_blank&#34;&gt;backup&lt;/a&gt;. I wrote a &lt;a class=&#34;zem_slink&#34; title=&#34;Bash (Unix shell)&#34; href=&#34;http://www.gnu.org/software/bash/&#34; rel=&#34;homepage&#34; target=&#34;_blank&#34;&gt;bash script&lt;/a&gt; to back up the data every 5 hours with cron and bash script. Thought I will share that with you. Here is the script.&lt;/p&gt;
&lt;pre class=&#34;brush: bash; gutter: true; first-line: 1&#34;&gt;#!/bin/bash - 
#===============================================================================
#
#          FILE:  backup.sh
# 
#         USAGE:  ./backup.sh 
# 
#   DESCRIPTION:  Backup all the current files.
# 
#       OPTIONS:  ---
#  REQUIREMENTS:  ---
#          BUGS:  ---
#         NOTES:  ---
#        AUTHOR: Amit Agarwal (aka), amit.agarwal@roamware.com
#       COMPANY: Roamware India Pvt Ltd
#       CREATED: 08/19/2011 02:43:32 PM IST
#      REVISION:  ---
#===============================================================================
backupf=( a b c d) #Here you need to specify the directory you need to backup.
bkupdir=&#34;/tmp/backup/$(date +%Y)/$(date +%m)/$(date +%d)&#34; #Here you can change the basedir for the backups
mkdir  -p $bkupdir
sudo tar cvfz $bkupdir/bkup_$(date &#34;+%Y%m%d_%H%M&#34;).tgz $backupf[*] #Remove sudo if you do not need it.
echo &#34;Backup created in dir $dir&#34;&lt;/pre&gt;
&lt;p&gt;And then just add it to cron as “00 */5 * * * /home//bin/backup.sh”. Change the path if it does not match what is given here.&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Ignore CVS and svn directories in bash autocompletion.</title>
      <link>/2012/07/07/ignore-cvs-svn-directories-bash-autocompletion/</link>
      <pubDate>Sat, 07 Jul 2012 05:44:52 +0000</pubDate>
      
      <guid>/2012/07/07/ignore-cvs-svn-directories-bash-autocompletion/</guid>
      <description>&lt;p&gt;&lt;a class=&#34;zem_slink&#34; title=&#34;Concurrent Versions System&#34; href=&#34;http://savannah.nongnu.org/projects/cvs&#34; rel=&#34;homepage&#34; target=&#34;_blank&#34;&gt;CVS&lt;/a&gt; and &lt;a class=&#34;zem_slink&#34; title=&#34;Apache Subversion&#34; href=&#34;http://subversion.apache.org/&#34; rel=&#34;homepage&#34; target=&#34;_blank&#34;&gt;SVN&lt;/a&gt; directories are something that really cause lot of un-necessary nuisance. So, simple solution just ignore them 🙂&lt;/p&gt;
&lt;pre class=&#34;brush: bash; gutter: true; first-line: 1&#34;&gt;export FIGNORE=CVS:~:.o:.svn
bind &#39;set match-hidden-files off&#39;&lt;/pre&gt;
&lt;h6 class=&#34;zemanta-related-title&#34; style=&#34;font-size: 1em;&#34;&gt;
  Related articles
&lt;/h6&gt;
&lt;ul class=&#34;zemanta-article-ul zemanta-article-ul-image&#34; style=&#34;margin-left: 0px;&#34;&gt;
  &lt;li class=&#34;zemanta-article-ul-li-image zemanta-article-ul-li&#34; style=&#34;overflow: hidden; list-style: none outside none; margin-top: 10px;&#34;&gt;
    &lt;a href=&#34;http://stackoverflow.com/questions/10580852/how-to-use-tortoisesvn-to-get-files-that-under-a-specific-version&#34; target=&#34;_blank&#34;&gt;&lt;img style=&#34;padding: 0px; margin: 0px 10px 10px 0px; border: 0px none; display: block; float: left;&#34; src=&#34;https://i0.wp.com/i.zemanta.com/88932873_80_80.jpg?w=688&#34; alt=&#34;&#34; data-recalc-dims=&#34;1&#34; /&gt;&lt;/a&gt;&lt;a style=&#34;display: block;&#34; href=&#34;http://stackoverflow.com/questions/10580852/how-to-use-tortoisesvn-to-get-files-that-under-a-specific-version&#34; target=&#34;_blank&#34;&gt;How to use TortoiseSVN to get files that under a specific version&lt;/a&gt;&lt;span style=&#34;display: block; font-size: 12px; margin: 10px 0px;&#34;&gt;(stackoverflow.com)&lt;/span&gt; &lt;div style=&#34;clear: both;&#34;&gt;
      &lt;hr style=&#34;margin: 0px;&#34; /&gt;
    &lt;/div&gt;
  &lt;/li&gt;
  &lt;li class=&#34;zemanta-article-ul-li-image zemanta-article-ul-li&#34; style=&#34;overflow: hidden; list-style: none outside none; margin-top: 10px;&#34;&gt;
    &lt;a href=&#34;http://hattb.wordpress.com/2012/06/28/quick-and-messy-svn-merge-branch-to-trunk/&#34; target=&#34;_blank&#34;&gt;&lt;img style=&#34;padding: 0px; margin: 0px 10px 10px 0px; border: 0px none; display: block; float: left;&#34; src=&#34;https://i2.wp.com/i.zemanta.com/noimg_19_80_80.jpg?w=688&#34; alt=&#34;&#34; data-recalc-dims=&#34;1&#34; /&gt;&lt;/a&gt;&lt;a style=&#34;display: block;&#34; href=&#34;http://hattb.wordpress.com/2012/06/28/quick-and-messy-svn-merge-branch-to-trunk/&#34; target=&#34;_blank&#34;&gt;Quick (and messy) svn merge branch to trunk&lt;/a&gt;&lt;span style=&#34;display: block; font-size: 12px; margin: 10px 0px;&#34;&gt;(hattb.wordpress.com)&lt;/span&gt; &lt;div style=&#34;clear: both;&#34;&gt;
      &lt;hr style=&#34;margin: 0px;&#34; /&gt;
    &lt;/div&gt;
  &lt;/li&gt;
  &lt;li class=&#34;zemanta-article-ul-li-image zemanta-article-ul-li&#34; style=&#34;overflow: hidden; list-style: none outside none; margin-top: 10px;&#34;&gt;
    &lt;a href=&#34;http://www.acunetix.com/blog/web-security-zone/articles/version-control-systems-parsing/&#34; target=&#34;_blank&#34;&gt;&lt;img style=&#34;padding: 0px; margin: 0px 10px 10px 0px; border: 0px none; display: block; float: left;&#34; src=&#34;https://i2.wp.com/i.zemanta.com/89488919_80_80.jpg?w=688&#34; alt=&#34;&#34; data-recalc-dims=&#34;1&#34; /&gt;&lt;/a&gt;&lt;a style=&#34;display: block;&#34; href=&#34;http://www.acunetix.com/blog/web-security-zone/articles/version-control-systems-parsing/&#34; target=&#34;_blank&#34;&gt;Acunetix Web Vulnerability Scanner Parses Version Control Systems&lt;/a&gt;&lt;span style=&#34;display: block; font-size: 12px; margin: 10px 0px;&#34;&gt;(acunetix.com)&lt;/span&gt; &lt;div style=&#34;clear: both;&#34;&gt;
      &lt;hr style=&#34;margin: 0px;&#34; /&gt;
    &lt;/div&gt;
  &lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&#34;zemanta-pixie&#34; style=&#34;margin-top: 10px; height: 15px;&#34;&gt;
  &lt;a class=&#34;zemanta-pixie-a&#34; title=&#34;Enhanced by Zemanta&#34; href=&#34;http://www.zemanta.com/?px&#34;&gt;&lt;img class=&#34;zemanta-pixie-img&#34; style=&#34;float: right;&#34; src=&#34;https://i1.wp.com/img.zemanta.com/zemified_e.png?w=688&#34; alt=&#34;Enhanced by Zemanta&#34; data-recalc-dims=&#34;1&#34; /&gt;&lt;/a&gt;
&lt;/div&gt;</description>
    </item>
    
    <item>
      <title>Ubuntu setup – post installation script</title>
      <link>/2012/07/03/ubuntu-setup-post-installation-script/</link>
      <pubDate>Tue, 03 Jul 2012 05:25:15 +0000</pubDate>
      
      <guid>/2012/07/03/ubuntu-setup-post-installation-script/</guid>
      <description>&lt;figure style=&#34;width: 240px&#34; class=&#34;wp-caption alignright&#34;&gt;&lt;a href=&#34;http://www.flickr.com/photos/94991702@N00/4360008898&#34; target=&#34;_blank&#34;&gt;&lt;img class=&#34;zemanta-img-inserted zemanta-img-configured&#34; title=&#34;My iPhone apps as of February 2010&#34; src=&#34;https://i0.wp.com/farm5.static.flickr.com/4036/4360008898_eddaf7b56f_m.jpg?resize=240%2C66&#34; alt=&#34;My iPhone apps as of February 2010&#34; width=&#34;240&#34; height=&#34;66&#34; data-recalc-dims=&#34;1&#34; /&gt;&lt;/a&gt;&lt;figcaption class=&#34;wp-caption-text&#34;&gt;My iPhone apps as of February 2010 (Photo credit: dougbelshaw)&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;If you have done a new installation of &lt;a class=&#34;zem_slink&#34; title=&#34;Ubuntu (operating system)&#34; href=&#34;http://www.ubuntu.com&#34; rel=&#34;homepage&#34; target=&#34;_blank&#34;&gt;Ubuntu&lt;/a&gt; or Fedora, then yuou know you have to search all kind of blogs to find out what all to install. So, here is a easier way to do that. Just run this script, it will install some applications which are mostly a “MUST” for all the installations. And the list of applications that are installed are :&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>rpmconf – Tool to handle rpmsave and rpmnew files</title>
      <link>/2012/06/18/rpmconf-tool-handle-rpmsave-rpmnew-files/</link>
      <pubDate>Mon, 18 Jun 2012 02:18:40 +0000</pubDate>
      
      <guid>/2012/06/18/rpmconf-tool-handle-rpmsave-rpmnew-files/</guid>
      <description>&lt;p&gt;&lt;a class=&#34;zem_slink&#34; title=&#34;Install (Unix)&#34; href=&#34;http://en.wikipedia.org/wiki/Install_%28Unix%29&#34; rel=&#34;wikipedia&#34; target=&#34;_blank&#34;&gt;Install&lt;/a&gt; the utility:&lt;/p&gt;
&lt;pre class=&#34;brush: bash; gutter: true; first-line: 1&#34;&gt;sudo yum install rpmconf&lt;/pre&gt;
&lt;p&gt;Description:&lt;/p&gt;
&lt;blockquote&gt;
&lt;dl&gt;
&lt;dt&gt;Description : This tool search for .rpmnew, .rpmsave and .rpmorig files and ask you what to do&lt;/dt&gt;
&lt;dd&gt;with them:&lt;/dd&gt;
&lt;dd&gt;Keep current version, place back old version, watch the diff or merge.&lt;/dd&gt;
&lt;/dl&gt;
&lt;/blockquote&gt;
&lt;p&gt;And finally run the utility:&lt;/p&gt;
&lt;pre class=&#34;brush: bash; gutter: true; first-line: 1&#34;&gt;sudo rpmconf -a&lt;/pre&gt;
&lt;p&gt;and if there is a conflict or rpmsave or rpmnew file, then you will see something like this:&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>symlinks -delete all invalid soft links in Linux/Fedora</title>
      <link>/2012/06/12/symlinks-delete-invalid-soft-links-linuxfedora/</link>
      <pubDate>Tue, 12 Jun 2012 01:05:34 +0000</pubDate>
      
      <guid>/2012/06/12/symlinks-delete-invalid-soft-links-linuxfedora/</guid>
      <description>&lt;p&gt;First of all, install symlinks if it is not installed :&lt;/p&gt;
&lt;pre class=&#34;brush: bash; gutter: true; first-line: 1&#34;&gt;sudo yum install symlinks&lt;/pre&gt;
&lt;p&gt;and here is the description:&lt;/p&gt;
&lt;blockquote&gt;
&lt;dl&gt;
&lt;dt&gt;Description : The symlinks utility performs maintenance on &lt;a class=&#34;zem_slink&#34; title=&#34;Symbolic link&#34; href=&#34;http://en.wikipedia.org/wiki/Symbolic_link&#34; rel=&#34;wikipedia&#34; target=&#34;_blank&#34;&gt;symbolic links&lt;/a&gt;.&lt;/dt&gt;
&lt;dd&gt;Symlinks checks for symlink problems, including dangling symlinks&lt;/dd&gt;
&lt;dd&gt;which point to nonexistent files.  Symlinks can also automatically&lt;/dd&gt;
&lt;dd&gt;convert absolute symlinks to relative symlinks.&lt;/dd&gt;
&lt;dd&gt;&lt;/dd&gt;
&lt;dd&gt;Install the symlinks package if you need a program for maintaining&lt;/dd&gt;
&lt;dd&gt;symlinks on your system.&lt;/dd&gt;
&lt;/dl&gt;
&lt;/blockquote&gt;
&lt;p&gt;and the help for the same:&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Array of all possible colors in bash script</title>
      <link>/2012/05/07/array-colors-bash-script/</link>
      <pubDate>Mon, 07 May 2012 02:17:18 +0000</pubDate>
      
      <guid>/2012/05/07/array-colors-bash-script/</guid>
      <description>&lt;p&gt;Sometime back, we had looked at using colors in &lt;a class=&#34;zem_slink&#34; title=&#34;Bash (Unix shell)&#34; href=&#34;http://www.gnu.org/software/bash/&#34; rel=&#34;homepage&#34; target=&#34;_blank&#34;&gt;bash script&lt;/a&gt; and here is a way to create a array of all the colors.&lt;/p&gt;
&lt;pre class=&#34;brush: bash; gutter: true; first-line: 1&#34;&gt;#!/bin/bash - 
#===============================================================================
#
#          FILE:  colorarray.sh
# 
#         USAGE:  ./colorarray.sh 
# 
#   DESCRIPTION:  
# 
#       OPTIONS:  ---
#  REQUIREMENTS:  ---
#          BUGS:  ---
#         NOTES:  ---
#        AUTHOR: Amit Agarwal (aka), amit.agarwal@roamware.com
#       COMPANY: Roamware India Pvt Ltd
#       CREATED: 16/04/12 17:24:09 IST
# Last modified: Mon Apr 16, 2012  05:39PM
#      REVISION:  ---
#===============================================================================
count=0
for i in 40m 41m 42m 43m 44m 45m 46m 47m
do
    for l in 0 1
    do
        echo -n &#34;l=$l &#34;
        for k in 0 1
        do
            # echo -n &#34;k=$k &#34;
            for j in {30..37}
            do
                carr[$count]=&#34;\033[$k;$j;$l;$i&#34;
                echo -ne &#34;${carr[$count]}$count \033[00m&#34;
                ((count++))
            done
        done
        echo
    done
    echo
done&lt;/pre&gt;
&lt;p&gt;You can add this script to any script of your choice and you have all the 256 colors available to you in the script without additional coding. Happy coding.&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>colors in bash scripts</title>
      <link>/2012/04/30/colors-bash-scripts/</link>
      <pubDate>Mon, 30 Apr 2012 03:52:29 +0000</pubDate>
      
      <guid>/2012/04/30/colors-bash-scripts/</guid>
      <description>&lt;figure style=&#34;width: 240px&#34; class=&#34;wp-caption alignright&#34;&gt;&lt;a href=&#34;http://www.flickr.com/photos/90525468@N00/84319781&#34; target=&#34;_blank&#34;&gt;&lt;img class=&#34;zemanta-img-inserted zemanta-img-configured&#34; title=&#34;Colours&#34; src=&#34;https://i2.wp.com/farm1.static.flickr.com/41/84319781_769e3cbfc2_m.jpg?resize=240%2C182&#34; alt=&#34;Colours&#34; width=&#34;240&#34; height=&#34;182&#34; data-recalc-dims=&#34;1&#34; /&gt;&lt;/a&gt;&lt;figcaption class=&#34;wp-caption-text&#34;&gt;Colours (Photo credit: CherrySoda!)&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;I have been trying to understand the &lt;a class=&#34;zem_slink&#34; title=&#34;Color code&#34; href=&#34;http://en.wikipedia.org/wiki/Color_code&#34; rel=&#34;wikipedia&#34; target=&#34;_blank&#34;&gt;color codes&lt;/a&gt; for &lt;a class=&#34;zem_slink&#34; title=&#34;Bash (Unix shell)&#34; href=&#34;http://www.gnu.org/software/bash/&#34; rel=&#34;homepage&#34; target=&#34;_blank&#34;&gt;bash&lt;/a&gt; for a pretty long time, but somehow never got time to understand this clearly. So this time around when I was writing a &lt;a class=&#34;zem_slink&#34; title=&#34;Screenplay&#34; href=&#34;http://en.wikipedia.org/wiki/Screenplay&#34; rel=&#34;wikipedia&#34; target=&#34;_blank&#34;&gt;script&lt;/a&gt; to analyze some logs. I thought I will give it a go and finally understood some part of this.&lt;/p&gt;
&lt;p&gt;So, first we will start with this script. This is taken from &lt;a href=&#34;http://tldp.org/HOWTO/Bash-Prompt-HOWTO/x329.html&#34;&gt;here&lt;/a&gt;.&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>bash prompts — some good links</title>
      <link>/2012/03/08/bash-prompts-good-links/</link>
      <pubDate>Thu, 08 Mar 2012 12:09:08 +0000</pubDate>
      
      <guid>/2012/03/08/bash-prompts-good-links/</guid>
      <description>&lt;p&gt;Here are some pretty good links on the subject. Since there are already so many blog posts, does not make sense to add one more 🙂&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;http://tldp.org/HOWTO/Bash-Prompt-HOWTO/c816.html&#34;&gt;http://tldp.org/HOWTO/Bash-Prompt-HOWTO/c816.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;http://www.gilesorr.com/bashprompt/prompts/&#34;&gt;http://www.gilesorr.com/bashprompt/prompts/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;https://bbs.archlinux.org/viewtopic.php?id=84386&#34;&gt;https://bbs.archlinux.org/viewtopic.php?id=84386&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Bash themes – &lt;a href=&#34;http://onlamp.com/onlamp/2006/02/02/bash_themes.html&#34;&gt;http://onlamp.com/onlamp/2006/02/02/bash_themes.html&lt;/a&gt;&lt;/p&gt;
&lt;h6 class=&#34;zemanta-related-title&#34; style=&#34;font-size: 1em;&#34;&gt;
  Related articles
&lt;/h6&gt;
&lt;ul class=&#34;zemanta-article-ul&#34;&gt;
  &lt;li class=&#34;zemanta-article-ul-li&#34;&gt;
    &lt;a href=&#34;http://stackoverflow.com/questions/9037620/set-prompts-for-bash-osx&#34; target=&#34;_blank&#34;&gt;set prompts for bash Osx?&lt;/a&gt; (stackoverflow.com)
  &lt;/li&gt;
  &lt;li class=&#34;zemanta-article-ul-li&#34;&gt;
    &lt;a href=&#34;http://stackoverflow.com/questions/9041656/difference-between-bash-shell-and-bash-terminal&#34; target=&#34;_blank&#34;&gt;Difference between Bash shell and Bash terminal?&lt;/a&gt; (stackoverflow.com)
  &lt;/li&gt;
  &lt;li class=&#34;zemanta-article-ul-li&#34;&gt;
    &lt;a href=&#34;http://www.popsugar.com/Jessica-Chastain-Pictures-THR-Oscars-Party-21902093&#34; target=&#34;_blank&#34;&gt;The Hollywood Reporter Rounds Up Jessica Chastian and Owen Wilson For a Pre-Oscars Bash&lt;/a&gt; (popsugar.com)
  &lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&#34;zemanta-pixie&#34; style=&#34;margin-top: 10px; height: 15px;&#34;&gt;
  &lt;a class=&#34;zemanta-pixie-a&#34; title=&#34;Enhanced by Zemanta&#34; href=&#34;http://www.zemanta.com/&#34;&gt;&lt;img class=&#34;zemanta-pixie-img&#34; style=&#34;float: right;&#34; src=&#34;https://i1.wp.com/img.zemanta.com/zemified_e.png?w=688&#34; alt=&#34;Enhanced by Zemanta&#34; data-recalc-dims=&#34;1&#34; /&gt;&lt;/a&gt;
&lt;/div&gt;</description>
    </item>
    
    <item>
      <title>15 Linux Bash History Expansion Examples You Should Know</title>
      <link>/2012/03/02/15-linux-bash-history-expansion-examples/</link>
      <pubDate>Fri, 02 Mar 2012 11:41:20 +0000</pubDate>
      
      <guid>/2012/03/02/15-linux-bash-history-expansion-examples/</guid>
      <description>&lt;figure style=&#34;width: 300px&#34; class=&#34;wp-caption alignright&#34;&gt;&lt;a href=&#34;http://commons.wikipedia.org/wiki/File:Bash_screenshot.png&#34; target=&#34;_blank&#34;&gt;&lt;img class=&#34;zemanta-img-inserted zemanta-img-configured&#34; title=&#34;Screenshot of a sample Bash session, taken on ...&#34; src=&#34;http://upload.wikimedia.org/wikipedia/commons/thumb/e/e7/Bash_screenshot.png/300px-Bash_screenshot.png&#34; alt=&#34;Screenshot of a sample Bash session, taken on ...&#34; width=&#34;300&#34; height=&#34;408&#34; /&gt;&lt;/a&gt;&lt;figcaption class=&#34;wp-caption-text&#34;&gt;Image via Wikipedia&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;Here is a nice &lt;a href=&#34;http://www.thegeekstuff.com/2011/08/bash-history-expansion/&#34; target=&#34;_blank&#34;&gt;link&lt;/a&gt; on BASH History Expansion. There are lot of examples in this page and some of them might be quite useful. But here are my list of favourites:&lt;/p&gt;
&lt;pre class=&#34;brush: bash; gutter: true; first-line: 1&#34;&gt;!!&lt;/pre&gt;
&lt;p&gt;This is probably the most used one by me. This will repeat the last command. And this works even in conjunction with other commands like&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>xmlwf – Is your xml document well formed?</title>
      <link>/2012/02/18/xmlwf-xml-document-formed/</link>
      <pubDate>Sat, 18 Feb 2012 06:36:34 +0000</pubDate>
      
      <guid>/2012/02/18/xmlwf-xml-document-formed/</guid>
      <description>&lt;p&gt;There is a small nifty utility called xmlwf that can check your &lt;a class=&#34;zem_slink&#34; title=&#34;XML&#34; href=&#34;http://en.wikipedia.org/wiki/XML&#34; rel=&#34;wikipedia&#34;&gt;xml documents&lt;/a&gt; to see if they are well formed.&lt;/p&gt;
&lt;pre class=&#34;brush: bash; gutter: true; first-line: 1&#34;&gt;sudo yum install expat&lt;/pre&gt;
&lt;p&gt;Once installed, simply use :&lt;/p&gt;
&lt;pre class=&#34;brush: bash; gutter: true; first-line: 1&#34;&gt;xmlwf&lt;/pre&gt;
&lt;p&gt;Need more details, just check the &lt;a class=&#34;zem_slink&#34; title=&#34;Man page&#34; href=&#34;http://en.wikipedia.org/wiki/Man_page&#34; rel=&#34;wikipedia&#34;&gt;man page&lt;/a&gt; 🙂&lt;/p&gt;
&lt;h6 class=&#34;zemanta-related-title&#34; style=&#34;font-size: 1em;&#34;&gt;
  Related articles
&lt;/h6&gt;
&lt;ul class=&#34;zemanta-article-ul&#34;&gt;
  &lt;li class=&#34;zemanta-article-ul-li&#34;&gt;
    &lt;a href=&#34;http://stackoverflow.com/questions/9130665/assigning-id-to-objects-transmitted-in-xml-document&#34;&gt;Assigning ID to Objects transmitted in XML document&lt;/a&gt; (stackoverflow.com)
  &lt;/li&gt;
  &lt;li class=&#34;zemanta-article-ul-li&#34;&gt;
    &lt;a href=&#34;http://stackoverflow.com/questions/9099344/removing-characters-from-php-output-in-xml&#34;&gt;removing characters from php output in xml&lt;/a&gt; (stackoverflow.com)
  &lt;/li&gt;
  &lt;li class=&#34;zemanta-article-ul-li&#34;&gt;
    &lt;a href=&#34;http://stackoverflow.com/questions/9117244/xml-parsing-using-xelement-and-child-contents&#34;&gt;C# XML parsing using XElement and child contents&lt;/a&gt; (stackoverflow.com)
  &lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&#34;zemanta-pixie&#34; style=&#34;margin-top: 10px; height: 15px;&#34;&gt;
  &lt;a class=&#34;zemanta-pixie-a&#34; title=&#34;Enhanced by Zemanta&#34; href=&#34;http://www.zemanta.com/&#34;&gt;&lt;img class=&#34;zemanta-pixie-img&#34; style=&#34;float: right;&#34; src=&#34;https://i1.wp.com/img.zemanta.com/zemified_e.png?w=688&#34; alt=&#34;Enhanced by Zemanta&#34; data-recalc-dims=&#34;1&#34; /&gt;&lt;/a&gt;
&lt;/div&gt;</description>
    </item>
    
    <item>
      <title>Using file partially for filenames</title>
      <link>/2012/02/12/file-partially-filenames/</link>
      <pubDate>Sun, 12 Feb 2012 06:02:19 +0000</pubDate>
      
      <guid>/2012/02/12/file-partially-filenames/</guid>
      <description>&lt;p&gt;There are some commands that take &lt;a class=&#34;zem_slink&#34; title=&#34;Filename&#34; href=&#34;http://en.wikipedia.org/wiki/Filename&#34; rel=&#34;wikipedia&#34;&gt;file name&lt;/a&gt; and there are some case where you need to give file name. But there are some cases where you want to modify the file before passing it to the command. What do you do in these case’s?&lt;/p&gt;
&lt;p&gt;I had a file containing huge amount of data and for some testing I wanted to pass only the first few lines of the file and not the complete file.  And since the file only accepted filename and would not take any input from the &lt;a class=&#34;zem_slink&#34; title=&#34;Standard streams&#34; href=&#34;http://en.wikipedia.org/wiki/Standard_streams&#34; rel=&#34;wikipedia&#34;&gt;STDIN&lt;/a&gt; so only option was to create a file with the required data in a &lt;a class=&#34;zem_slink&#34; title=&#34;Temporary file&#34; href=&#34;http://en.wikipedia.org/wiki/Temporary_file&#34; rel=&#34;wikipedia&#34;&gt;temporary file&lt;/a&gt;. So, I sat back to figure out some way to do it and finally found I can use this:&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Benchmarking the system/CPU performance</title>
      <link>/2012/01/15/benchmarking-system-cpu-performance/</link>
      <pubDate>Sun, 15 Jan 2012 07:56:44 +0000</pubDate>
      
      <guid>/2012/01/15/benchmarking-system-cpu-performance/</guid>
      <description>&lt;p&gt;Have you ever wanted to have a quick check on your CPU performance. I know that lot of people will say that this is not the right way to do this, but here is something that you can use to check the CPU speed.&lt;/p&gt;
&lt;pre class=&#34;brush: bash; gutter: true; first-line: 1&#34;&gt;#!/bin/bash -
#===============================================================================
#
#          FILE:  benchmark.sh
#
#         USAGE:  ./benchmark.sh
#
#   DESCRIPTION:  Benchmark the CPU
#
#       OPTIONS:  ---
#  REQUIREMENTS:  ---
#          BUGS:  ---
#         NOTES:  ---
#        AUTHOR: Amit Agarwal (aka), amit.agarwal@roamware.com
#       COMPANY: Roamware India Pvt Ltd
#       CREATED: 09/21/2011 11:46:03 AM IST
# Last modified: Wed Sep 21, 2011  12:22PM
#      REVISION:  ---
#===============================================================================

add ()
{
    COUNTER=0
    exec 2&amp;gt;&amp;1
    time=$(exec 2&amp;gt;&amp;1;(time while [[  $COUNTER -lt 100000 ]]; do ((COUNTER++)) \
        ; done))
    echo &#34;Time for 100000 additions is &#34;$time
}	# ----------  end of function add  ----------
mul ()
{
    COUNTER=0
    test=2
    exec 2&amp;gt;&amp;1
    time=$(exec 2&amp;gt;&amp;1;(time while [[  $COUNTER -lt 100000 ]]; do ((COUNTER++)) \
        ; ((test=test*2));done))
    echo &#34;Time for 100000 mul is &#34;$time
}	# ----------  end of function add  ----------
div ()
{
    COUNTER=0
    test=1000000000000
    exec 2&amp;gt;&amp;1
    time=$(exec 2&amp;gt;&amp;1;(time while [[  $COUNTER -lt 100000 ]]; do ((COUNTER++)) \
        ; (( test=test/2)); done)|tr -d &#39;\n&#39;)
    echo &#34;Time for 100000 divisions is &#34;${time}
}	# ----------  end of function add  ----------

time add
time mul
time div&lt;/pre&gt;
&lt;p&gt;And here is the output :&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>conky script used to monitor server status remotely.</title>
      <link>/2012/01/12/conky-script-monitor-server-status-remotely/</link>
      <pubDate>Thu, 12 Jan 2012 07:48:00 +0000</pubDate>
      
      <guid>/2012/01/12/conky-script-monitor-server-status-remotely/</guid>
      <description>&lt;figure style=&#34;width: 300px&#34; class=&#34;wp-caption alignright&#34;&gt;[&lt;img class=&#34;zemanta-img-inserted zemanta-img-configured&#34; title=&#34;A typical Conky look&#34; src=&#34;http://upload.wikimedia.org/wikipedia/commons/thumb/2/2b/Conky-unix-program-screen-shot.png/300px-Conky-unix-program-screen-shot.png&#34; alt=&#34;A typical Conky look&#34; width=&#34;300&#34; height=&#34;279&#34; /&gt;][1]&lt;figcaption class=&#34;wp-caption-text&#34;&gt;Image via Wikipedia&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;I was looking for something to monitor few details on the server. I thought about quite a lot of applications, some open source and some scripts developed in house. But my requirements were quite petty and the scripts and applications were quite heavy. So, I thought why not conky :).&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;So, with some quick work on conky script, I was able to get what I wanted and here it is for all of you.&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>BASH Script Performace</title>
      <link>/2012/01/06/bash-script-performace/</link>
      <pubDate>Fri, 06 Jan 2012 06:38:04 +0000</pubDate>
      
      <guid>/2012/01/06/bash-script-performace/</guid>
      <description>&lt;p&gt;Today we will look at some bash code snippests and the performance issues. Lets first look at the problem and the implemented solution:&lt;/p&gt;
&lt;p&gt;Problem: We needed to log the output of the ps command for all the process’s. This was required to be done on per minute basis and the output was required in comma separated files. So, here is what was implemented:&lt;/p&gt;
&lt;pre class=&#34;brush: bash; gutter: true; first-line: 1&#34;&gt;pslog=`ps -e -opid,ppid,user,nlwp,pmem,vsz,rss,s,time,stime,pri,nice,pcp:u,args|grep -v PID|sort -r -k 13,13`
        OLD_IFS=$IFS
        IFS=$&#39;\n&#39;
        logarr=( $pslog )
        for LOGLINE in ${logarr[@]}
        do
                LOGLINE=`echo $LOGLINE|awk &#39;{OFS=&#34;,&#34;;print $1,$2,$3,$4,$5,$6,$7,:$8,$9,$10,$11,$12,$13,$14}&#39;`
                echo $LOGLINE &amp;gt;&amp;gt; output
        done
        IFS=$OLD_IFS&lt;/pre&gt;
&lt;p&gt;This was working well and there were no issues. But suddenly we started seeing issues with the reported &lt;a class=&#34;zem_slink&#34; title=&#34;Central processing unit&#34; href=&#34;http://en.wikipedia.org/wiki/Central_processing_unit&#34; rel=&#34;wikipedia&#34;&gt;CPU&lt;/a&gt; usages. We would see that whenever this script was running the &lt;a class=&#34;zem_slink&#34; title=&#34;CPU time&#34; href=&#34;http://en.wikipedia.org/wiki/CPU_time&#34; rel=&#34;wikipedia&#34;&gt;CPU usage&lt;/a&gt; was high, specially if there were too many process’s/thread’s on the system during that time.  This code was definitely part of a very large &lt;a class=&#34;zem_slink&#34; title=&#34;Codebase&#34; href=&#34;http://en.wikipedia.org/wiki/Codebase&#34; rel=&#34;wikipedia&#34;&gt;code base&lt;/a&gt;, and at this point of time we did not know what was causing the issues.&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Backup of files in the directory.</title>
      <link>/2011/12/01/backup-files-directory/</link>
      <pubDate>Thu, 01 Dec 2011 11:39:24 +0000</pubDate>
      
      <guid>/2011/12/01/backup-files-directory/</guid>
      <description>&lt;p&gt;I was working on some scripts and the changes that I was making in the scripts was very dynamic, which I did want to keep backing up in the version control system. But for the peace of my mind, I wanted to keep a copy of the scripts, whenever it was in working state.&lt;/p&gt;
&lt;p&gt;Since I had multiple files, so it would make more sense to have a script that could copy all the files in the &lt;a class=&#34;zem_slink&#34; title=&#34;Working directory&#34; href=&#34;http://en.wikipedia.org/wiki/Working_directory&#34; rel=&#34;wikipedia&#34;&gt;current directory&lt;/a&gt; to “old” directory without over-writing the existing files. So, I wrote a script that would postfix the files with a number. With this approach, finally what I had was the following:&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Linux hardware details.</title>
      <link>/2011/11/28/linux-hardware-details/</link>
      <pubDate>Mon, 28 Nov 2011 11:20:25 +0000</pubDate>
      
      <guid>/2011/11/28/linux-hardware-details/</guid>
      <description>&lt;p&gt;Here is one of the scripts that I found on the net while searching for something … Note the &lt;a class=&#34;zem_slink&#34; title=&#34;Uniform Resource Locator&#34; href=&#34;http://en.wikipedia.org/wiki/Uniform_Resource_Locator&#34; rel=&#34;wikipedia&#34;&gt;URL&lt;/a&gt; for the script in the Description.&lt;/p&gt;
&lt;pre class=&#34;brush: bash; gutter: true; first-line: 1&#34;&gt;#!/bin/bash -
#===============================================================================
#
#          FILE:  linux_hw.sh
#
#         USAGE:  ./linux_hw.sh
#
#   DESCRIPTION:  http://www.howtogeek.com/howto/solaris/get-the-processor-type-on-solaris/
#
#       OPTIONS:  ---
#  REQUIREMENTS:  ---
#          BUGS:  ---
#         NOTES:  ---
#        AUTHOR: &lt;a class=&#34;zem_slink&#34; title=&#34;Amit Agarwal&#34; href=&#34;http://www.labnol.org/about/&#34; rel=&#34;homepage&#34;&gt;Amit Agarwal&lt;/a&gt; (aka), amit.agarwal@roamware.com
#       COMPANY: Roamware India Pvt Ltd
#       CREATED: 09/13/2011 03:57:34 PM IST
# Last modified: Sun Oct 30, 2011  04:59PM
#      REVISION:  ---
#===============================================================================

function linux_hw_CPU {
	&lt;a class=&#34;zem_slink&#34; title=&#34;Typesetting&#34; href=&#34;http://en.wikipedia.org/wiki/Typesetting&#34; rel=&#34;wikipedia&#34;&gt;typeset&lt;/a&gt; num=0
	typeset name=&#34;&#34;
	typeset cores=&#34;&#34;
	name=&#34;$( cat &lt;a class=&#34;zem_slink&#34; title=&#34;Procfs&#34; href=&#34;http://en.wikipedia.org/wiki/Procfs&#34; rel=&#34;wikipedia&#34;&gt;/proc/cpuinfo&lt;/a&gt; | awk -F: &#39;
/vendor_id/ { vendor=$2 }
/model name/ { model=$2 }
/cpu &lt;a class=&#34;zem_slink&#34; title=&#34;Hertz&#34; href=&#34;http://en.wikipedia.org/wiki/Hertz&#34; rel=&#34;wikipedia&#34;&gt;MHz&lt;/a&gt;/ {
if( model ~ &#34;Hz&#34; ) {speed=&#34;&#34;} else { speed=$2? MHz&#34; };
print vendor, model, speed; }
		&#39; | tail -1
	)&#34;

        num=$(if [ -r /proc/vmware/cpuinfo ]; then awk &#39;/pcpu/ { print NF-1 }&#39; /proc/vmware/cpuinfo; else cat /proc/cpuinfo | &lt;a class=&#34;zem_slink&#34; title=&#34;Grep&#34; href=&#34;http://en.wikipedia.org/wiki/Grep&#34; rel=&#34;wikipedia&#34;&gt;grep&lt;/a&gt; processor| wc -l; fi)

	# ESX: mas info sobre logical/cores/packages
	if [ -r /proc/vmware/sched/ncpus ]
	then
		cores=$( echo $( cat /proc/vmware/sched/ncpus ) )
	fi

	echo $num $( echo &#34;$name ($cores)&#34; | enclose )
}

function enclose {
	tr -s &#34; &#34; | sed -e &#34;s/^/\&#34;/; s/$/\&#34;/; s/\&#34;\ /\&#34;/; s/\ \&#34;/\&#34;/&#34;
}

function linux_hw_CPU {

	typeset num=0
	typeset name=&#34;&#34;
	typeset cores=&#34;&#34;

	name=&#34;$(
		cat /proc/cpuinfo | awk -F: &#39;
/vendor_id/ { vendor=$2 }
/model name/ { model=$2 }
/cpu MHz/ {
if( model ~ &#34;Hz&#34; ) {speed=&#34;&#34;} else { speed=$2&#34; MHz&#34; };
print vendor, model, speed; }
		&#39; | tail -1
	)&#34;

	num=$(
		if [ -r /proc/vmware/cpuinfo ]
		then
			awk &#39;/pcpu/ { print NF-1 }&#39; /proc/vmware/cpuinfo
		else
			cat /proc/cpuinfo | grep processor| wc -l
		fi

	)

	if grep -q &#34;physical id&#34; /proc/cpuinfo || grep &#34;siblings&#34; /proc/cpuinfo
	then
		chip_count=$( grep &#34;physical id&#34; /proc/cpuinfo | sort -u | wc -l )
		chip_core=$( grep &#34;siblings&#34; /proc/cpuinfo | tail -1 | cut -d: -f2 )
		cores=&#34;($chip_count chips x $chip_core cores)&#34;
	fi

	# Blades HP con
	if [ -x /sbin/hpasmcli ]
	then
		chip_name=$( /sbin/hpasmcli -s &#34;SHOW &lt;a class=&#34;zem_slink&#34; title=&#34;Server (computing)&#34; href=&#34;http://en.wikipedia.org/wiki/Server_%28computing%29&#34; rel=&#34;wikipedia&#34;&gt;SERVER&lt;/a&gt;&#34; | grep &#34;Name&#34; | head -1 | cut -d: -f2 )
		chip_speed=$( /sbin/hpasmcli -s &#34;SHOW SERVER&#34; | grep &#34;Speed&#34; | head -1 | cut -d: -f2 )
		chip_core=$( /sbin/hpasmcli -s &#34;SHOW SERVER&#34; | grep &#34;Core&#34; | head -1 | cut -d: -f2 )
	fi

	# ESX: mas info sobre logical/cores/packages
	if [ -r /proc/vmware/sched/ncpus ]
	then
		cores=&#34;($( echo $( cat /proc/vmware/sched/ncpus ) ))&#34;
	fi

	# &lt;a class=&#34;zem_slink&#34; title=&#34;Linux&#34; href=&#34;http://www.kernel.org/&#34; rel=&#34;homepage&#34;&gt;Linux&lt;/a&gt; &lt;a class=&#34;zem_slink&#34; title=&#34;Itanium&#34; href=&#34;http://en.wikipedia.org/wiki/Itanium&#34; rel=&#34;wikipedia&#34;&gt;Itanium&lt;/a&gt; IA64
	if grep -q -i itanium /proc/cpuinfo
	then
		name=&#34;$(
		grep &#34;vendor&#34; /proc/cpuinfo | cut -d: -f2- | tail -1 ) $(
		grep &#34;arch &#34; /proc/cpuinfo | cut -d: -f2- | tail -1 ) $(
		grep &#34;family&#34; /proc/cpuinfo | cut -d: -f2- | tail -1 ) $(
		grep &#34;cpu MHz&#34; /proc/cpuinfo | cut -d: -f2- | cut -d. -f1 | tail -1 ) Mhz&#34;

		chip_count=$( grep &#34;physical id&#34; /proc/cpuinfo | sort -u | wc -l )
		chip_core=$( grep &#34;siblings&#34; /proc/cpuinfo | tail -1 | cut -d: -f2 )
		cores=&#34;($chip_count chips x $chip_core cores)&#34;
	fi

	echo $num $( echo &#34;$name $cores&#34; | enclose )
}

linux_hw_CPU&lt;/pre&gt;
&lt;h6 class=&#34;zemanta-related-title&#34; style=&#34;font-size: 1em;&#34;&gt;
  Related articles
&lt;/h6&gt;
&lt;ul class=&#34;zemanta-article-ul&#34;&gt;
  &lt;li class=&#34;zemanta-article-ul-li&#34;&gt;
    &lt;a href=&#34;http://weijianhui16.wordpress.com/2011/09/06/linux%e6%9f%a5%e7%9c%8b%e7%a1%ac%e4%bb%b6%e4%bf%a1%e6%81%af/&#34;&gt;linux??????&lt;/a&gt; (weijianhui16.wordpress.com)
  &lt;/li&gt;
  &lt;li class=&#34;zemanta-article-ul-li&#34;&gt;
    &lt;a href=&#34;http://singztechmusings.wordpress.com/2011/06/15/how-to-check-the-uptime-of-a-process-or-an-application-running-in-linux-machine-using-shell-script/&#34;&gt;How to check the uptime of a process (or an application) running in Linux machine using shell script?&lt;/a&gt; (singztechmusings.wordpress.com)
  &lt;/li&gt;
  &lt;li class=&#34;zemanta-article-ul-li&#34;&gt;
    &lt;a href=&#34;http://javarevisited.wordpress.com/2011/06/15/good-examples-of-grep-command-in-unix-and-linux/&#34;&gt;Some examples of grep command in unix&lt;/a&gt; (javarevisited.wordpress.com)
  &lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&#34;zemanta-pixie&#34; style=&#34;margin-top: 10px; height: 15px;&#34;&gt;
  &lt;a class=&#34;zemanta-pixie-a&#34; title=&#34;Enhanced by Zemanta&#34; href=&#34;http://www.zemanta.com/&#34;&gt;&lt;img class=&#34;zemanta-pixie-img&#34; style=&#34;float: right;&#34; src=&#34;https://i1.wp.com/img.zemanta.com/zemified_e.png?w=688&#34; alt=&#34;Enhanced by Zemanta&#34; data-recalc-dims=&#34;1&#34; /&gt;&lt;/a&gt;
&lt;/div&gt;</description>
    </item>
    
    <item>
      <title>Add ssh key to remote host</title>
      <link>/2011/11/15/add-ssh-key-remote-host/</link>
      <pubDate>Tue, 15 Nov 2011 08:00:01 +0000</pubDate>
      
      <guid>/2011/11/15/add-ssh-key-remote-host/</guid>
      <description>&lt;div class=&#34;zemanta-img&#34; style=&#34;margin: 1em; display: block;&#34;&gt;
  &lt;p&gt;
    &lt;figure style=&#34;width: 300px&#34; class=&#34;wp-caption alignright&#34;&gt;&lt;a href=&#34;https://i0.wp.com/commons.wikipedia.org/wiki/File:X11_ssh_tunnelling.png&#34;&gt;&lt;img class=&#34;zemanta-img-configured&#34; title=&#34;Example of tunnelling an X11 application over SSH&#34; src=&#34;https://i1.wp.com/blog.amit-agarwal.co.in/wp-content/uploads/zemanta//300px-X11_ssh_tunnelling.png?resize=300%2C199&#34; alt=&#34;Example of tunnelling an X11 application over SSH&#34; width=&#34;300&#34; height=&#34;199&#34; data-recalc-dims=&#34;1&#34; /&gt;&lt;/a&gt;&lt;figcaption class=&#34;wp-caption-text&#34;&gt;Image via Wikipedia&lt;/figcaption&gt;&lt;/figure&gt;
  &lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;If you are working on recent versions of the *nix &lt;a class=&#34;zem_slink&#34; title=&#34;Operating system&#34; href=&#34;http://en.wikipedia.org/wiki/Operating_system&#34; rel=&#34;wikipedia&#34;&gt;OS&lt;/a&gt; like &lt;a class=&#34;zem_slink&#34; title=&#34;Fedora (operating system)&#34; href=&#34;http://www.fedoraproject.org/&#34; rel=&#34;homepage&#34;&gt;Fedora&lt;/a&gt; or &lt;a class=&#34;zem_slink&#34; title=&#34;Ubuntu (operating system)&#34; href=&#34;http://www.ubuntu.com/&#34; rel=&#34;homepage&#34;&gt;Ubuntu&lt;/a&gt; then you would know about the commad &lt;a class=&#34;zem_slink&#34; title=&#34;Secure Shell&#34; href=&#34;http://en.wikipedia.org/wiki/Secure_Shell&#34; rel=&#34;wikipedia&#34;&gt;ssh&lt;/a&gt;-copy-id. But if you land up using one of the older versions like &lt;a class=&#34;zem_slink&#34; title=&#34;Solaris (operating system)&#34; href=&#34;http://oracle.com/solaris&#34; rel=&#34;homepage&#34;&gt;Solaris&lt;/a&gt; or something where the command is not present, then probably you need a simpler solution to this. One of the simplest solution is with a lot of assumtions, simply copy the id_rsa file to &lt;a class=&#34;zem_slink&#34; title=&#34;Server (computing)&#34; href=&#34;http://en.wikipedia.org/wiki/Server_%28computing%29&#34; rel=&#34;wikipedia&#34;&gt;remote server&lt;/a&gt; and hope it works. And here is  a script to do just that:&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>using `!#$’ to referance backward-word</title>
      <link>/2011/11/03/referance-backward-word/</link>
      <pubDate>Thu, 03 Nov 2011 07:20:20 +0000</pubDate>
      
      <guid>/2011/11/03/referance-backward-word/</guid>
      <description>&lt;div class=&#34;zemanta-img&#34; style=&#34;margin: 1em; display: block;&#34;&gt;
  &lt;p&gt;
    &lt;figure style=&#34;width: 240px&#34; class=&#34;wp-caption alignright&#34;&gt;&lt;a href=&#34;http://www.flickr.com/photos/8945974@N08/5507068816&#34;&gt;&lt;img class=&#34;zemanta-img-configured&#34; title=&#34;Operating System Tablet Strategy&#34; src=&#34;https://i1.wp.com/blog.amit-agarwal.co.in/wp-content/uploads/zemanta//5507068816_ded55139d2_m.jpg?resize=240%2C124&#34; alt=&#34;Operating System Tablet Strategy&#34; width=&#34;240&#34; height=&#34;124&#34; data-recalc-dims=&#34;1&#34; /&gt;&lt;/a&gt;&lt;figcaption class=&#34;wp-caption-text&#34;&gt;Image by jeffalldridge via Flickr&lt;/figcaption&gt;&lt;/figure&gt;
  &lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;Here is something that I found on the &lt;a href=&#34;http://www.commandlinefu.com/commands/view/9327/using-to-referance-backward-word&#34; target=&#34;_blank&#34;&gt;commandlinefu&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&#34;brush: bash; gutter: true; first-line: 1&#34;&gt;cp /work/host/phone/ui/main.cpp !#$:s/host/target&lt;/pre&gt;
&lt;p&gt;Ah well…its very interesting and very useful.&lt;/p&gt;
&lt;p&gt;Some explanation:&lt;/p&gt;
&lt;p&gt;!# – means the current command (similar to !! being the last command)&lt;/p&gt;
&lt;p&gt;$ – represents the last parameter&lt;/p&gt;
&lt;p&gt;:s – is used for substitution.&lt;/p&gt;
&lt;h6 class=&#34;zemanta-related-title&#34; style=&#34;font-size: 1em;&#34;&gt;
  Related articles
&lt;/h6&gt;
&lt;ul class=&#34;zemanta-article-ul&#34;&gt;
  &lt;li class=&#34;zemanta-article-ul-li&#34;&gt;
    &lt;a href=&#34;http://www.makeuseof.com/tag/commandlinefu-amazing-collection-command-line-gems-linux-mac/&#34;&gt;CommandLineFu: Amazing Collection Of Command Line Gems [Linux &amp; Mac]&lt;/a&gt; (&lt;a class=&#34;zem_slink&#34; title=&#34;MakeUseOf&#34; href=&#34;http://www.makeuseof.com/dir/&#34; rel=&#34;homepage&#34;&gt;makeuseof.com&lt;/a&gt;)
  &lt;/li&gt;
  &lt;li class=&#34;zemanta-article-ul-li&#34;&gt;
    &lt;a href=&#34;http://ftalphaville.ft.com/blog/2011/10/28/715136/oh-the-iron-y/&#34;&gt;Oh, the Iron-y&lt;/a&gt; (ftalphaville.ft.com)
  &lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&#34;zemanta-pixie&#34; style=&#34;margin-top: 10px; height: 15px;&#34;&gt;
  &lt;a class=&#34;zemanta-pixie-a&#34; title=&#34;Enhanced by Zemanta&#34; href=&#34;http://www.zemanta.com/&#34;&gt;&lt;img class=&#34;zemanta-pixie-img&#34; style=&#34;float: right;&#34; src=&#34;https://i1.wp.com/img.zemanta.com/zemified_e.png?w=688&#34; alt=&#34;Enhanced by Zemanta&#34; data-recalc-dims=&#34;1&#34; /&gt;&lt;/a&gt;
&lt;/div&gt;</description>
    </item>
    
    <item>
      <title>Compare files excluding certain lines.</title>
      <link>/2011/10/18/compare-files-excluding-lines/</link>
      <pubDate>Tue, 18 Oct 2011 11:12:15 +0000</pubDate>
      
      <guid>/2011/10/18/compare-files-excluding-lines/</guid>
      <description>&lt;p&gt;Quick tip, you can use any expression for the &lt;a class=&#34;zem_slink&#34; title=&#34;Sed&#34; href=&#34;http://en.wikipedia.org/wiki/Sed&#34; rel=&#34;wikipedia&#34;&gt;sed&lt;/a&gt; commands in the (). With this trick you can redirect the &lt;a class=&#34;zem_slink&#34; title=&#34;Standard streams&#34; href=&#34;http://en.wikipedia.org/wiki/Standard_streams&#34; rel=&#34;wikipedia&#34;&gt;stdout&lt;/a&gt; of 2 commands to the diff command. This might become very useful, if you want to compare 2 &lt;a class=&#34;zem_slink&#34; title=&#34;Computer file&#34; href=&#34;http://en.wikipedia.org/wiki/Computer_file&#34; rel=&#34;wikipedia&#34;&gt;files&lt;/a&gt;, excluding the first  line.&lt;/p&gt;
&lt;pre class=&#34;brush: bash; gutter: true; first-line: 1&#34;&gt;diff &amp;lt;(sed &#39;1d&#39; file) &amp;lt;(sed &#39;1d&#39; file2)&lt;/pre&gt;
&lt;p&gt;More interesting example is where the string &lt;a class=&#34;zem_slink&#34; title=&#34;American Broadcasting Company&#34; href=&#34;http://abc.go.com&#34; rel=&#34;homepage&#34;&gt;ABC&lt;/a&gt; is converted to abc before comparing in the second file with the following command:&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Cont: Get yourself some more conkyrc files.</title>
      <link>/2011/10/12/cont-conkyrc-files/</link>
      <pubDate>Wed, 12 Oct 2011 11:03:40 +0000</pubDate>
      
      <guid>/2011/10/12/cont-conkyrc-files/</guid>
      <description>&lt;p&gt;Last time we got ourselves some conkyrc &lt;a class=&#34;zem_slink&#34; title=&#34;Computer file&#34; href=&#34;http://en.wikipedia.org/wiki/Computer_file&#34; rel=&#34;wikipedia&#34;&gt;files&lt;/a&gt; from the ubuntu forums. But that scripts gets the files only from the First page of the thread. Lets extend this further and get the script to get all the conkyrc files.&lt;/p&gt;
&lt;p&gt;There are some 1048 pages in the thread, I am showing pages 1 to 3 but you can change 3 to whatever number you want 🙂&lt;/p&gt;
&lt;pre class=&#34;brush: bash; gutter: true; first-line: 1&#34;&gt;count=0
for i in {1..3}
do
    &amp;gt;.test
    &amp;gt;conkyrc
	echo &#34;Getting page $i&#34;
	curl http://ubuntuforums.org/showthread.php?t=281865\&amp;page=$i |&lt;a class=&#34;zem_slink&#34; title=&#34;Path (computing)&#34; href=&#34;http://en.wikipedia.org/wiki/Path_%28computing%29&#34; rel=&#34;wikipedia&#34;&gt;\\&lt;/a&gt;
         &lt;a class=&#34;zem_slink&#34; title=&#34;Sed&#34; href=&#34;http://en.wikipedia.org/wiki/Sed&#34; rel=&#34;wikipedia&#34;&gt;sed&lt;/a&gt; -n &#39;// d&#39;|\
         sed &#39;s##\n-----------------------------------\n\n\n#&#39; \
         &amp;gt;conkyrc
	dos2unix conkyrc
	cp conkyrc .test
	while [ $(wc -l .test|sed &#39;s/[^0-9]//g&#39;) != 0 ]
	do
		sed -n &#39;1,/------------------------/ p&#39; .test|sed &#39;$d&#39; &amp;gt;conkyrc.$count
		diff .test conkyrc.$count |sed &#39;s/^&amp;lt;.//&#39;|sed &#39;1, /---------------------/ d;2d&#39;&amp;gt;.test
		((count++))
	done
	echo &#34;Files so far are : $count&#34;
done&lt;/pre&gt;
&lt;h6 class=&#34;zemanta-related-title&#34; style=&#34;font-size: 1em;&#34;&gt;
  Related articles
&lt;/h6&gt;
&lt;ul class=&#34;zemanta-article-ul&#34;&gt;
  &lt;li class=&#34;zemanta-article-ul-li&#34;&gt;
    &lt;a href=&#34;http://blog.amit-agarwal.co.in/2011/10/05/conkyrc-files/&#34;&gt;Get yourself some conkyrc files.&lt;/a&gt; (amit-agarwal.co.in)
  &lt;/li&gt;
  &lt;li class=&#34;zemanta-article-ul-li&#34;&gt;
    &lt;a href=&#34;http://putokaz.wordpress.com/2011/09/16/htc-like-clock-weather-conky-configuration/&#34;&gt;HTC-Like Clock / Weather Conky Configuration&lt;/a&gt; (putokaz.wordpress.com)
  &lt;/li&gt;
  &lt;li class=&#34;zemanta-article-ul-li&#34;&gt;
    &lt;a href=&#34;http://lezeng.wordpress.com/2011/10/06/split-and-join-file-on-mac-osx-terminal/&#34;&gt;Split and join file on Mac OSX Terminal&lt;/a&gt; (lezeng.wordpress.com)
  &lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&#34;zemanta-pixie&#34; style=&#34;margin-top: 10px; height: 15px;&#34;&gt;
  &lt;a class=&#34;zemanta-pixie-a&#34; title=&#34;Enhanced by Zemanta&#34; href=&#34;http://www.zemanta.com/&#34;&gt;&lt;img class=&#34;zemanta-pixie-img&#34; style=&#34;float: right;&#34; src=&#34;https://i1.wp.com/img.zemanta.com/zemified_e.png?w=688&#34; alt=&#34;Enhanced by Zemanta&#34; data-recalc-dims=&#34;1&#34; /&gt;&lt;/a&gt;
&lt;/div&gt;</description>
    </item>
    
    <item>
      <title>Creating a chroot environment – the script.</title>
      <link>/2011/09/23/creating-chroot-environment-script/</link>
      <pubDate>Fri, 23 Sep 2011 09:47:48 +0000</pubDate>
      
      <guid>/2011/09/23/creating-chroot-environment-script/</guid>
      <description>&lt;p&gt;Here is the script, very simple and effective 🙂&lt;/p&gt;
&lt;pre class=&#34;brush: bash; gutter: true; first-line: 1&#34;&gt;#!/bin/bash -
#===============================================================================
#
#          FILE:  mkchroot.sh
#
#         USAGE:  ./mkchroot.sh
#
#   DESCRIPTION:  Make a  chroot environ and cd to it
#
#       OPTIONS:  ---
#  REQUIREMENTS:  ---
#          BUGS:  ---
#         NOTES:  ---
#        AUTHOR: Amit Agarwal (aka), 
#       CREATED: 09/03/2011 02:53:37 PM IST
# Last modified: Sat Sep 03, 2011  03:11PM
#      REVISION:  ---
#===============================================================================

 binaries=( bash2 ls cat vi vim sudo)
#===  FUNCTION  ================================================================
#          NAME:  copy_binary
#   DESCRIPTION:  copy binary to chroot
#    PARAMETERS:
#       RETURNS:
#===============================================================================

copy_binary ()
{
   cmd=`which $1`
   echo $cmd
   cp $cmd bin/
   ldd $cmd
   while read line
   do
      while read ld
      do
         if [[ -f $ld ]]
         then
            echo copy $ld
            cp $ld lib/
            if [[ -L $ld ]]
            then
               ld1=$( ls -l $ld |sed &#39;s/.*&amp;gt; //&#39;)
               echo &#34;  copy $ld1&#34;
               cp  /lib/$ld1 lib/
            fi
         fi
      done &amp;lt; &amp;lt;(echo $line|sed &#39;s/.*&amp;gt; //&#39;|sed &#39;s/ .*//&#39;)
   done &amp;lt; &amp;lt;(ldd $cmd)
}	# ----------  end of function copy_binary  ----------

#===  FUNCTION  ================================================================
#          NAME:  init
#   DESCRIPTION:  Do the required initialization
#    PARAMETERS:
#       RETURNS:
#===============================================================================
init()
{
   mkdir -p {root,home,dev,etc,lib,usr,bin}
   mkdir -p usr/bin
   mkdir -p libexec/openssh



   mknod -m 666 dev/null c 1 3

   cd etc
   cp /etc/ld.so.cache .
   cp -avr /etc/ld.so.cache.d/ .
   cp -avr /etc/ld.so.conf.d/ .
   cp /etc/ld.so.conf .
   cp /etc/nsswitch.conf .
   cp /etc/passwd .
   cp /etc/group .
   cp /etc/hosts .
   cp /etc/resolv.conf .
   cd -
}
cd $1
if [[ -f .status ]]
then
   cat .status
   echo &#34;Not running now&#34;
else
   init
   for i in ${binaries[*]}
   do
       copy_binary $i
       cp -avr /etc/${i}* etc/
   done
   ln bin/bash2 bin/bash
   echo &#34;complete&#34; &amp;gt; .status
fi
cp -avr ~/bin/automation root/automation
sudo chroot .

&lt;/pre&gt;
&lt;p&gt;.&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Creating a chroot environment in Fedora with bash and other utils.</title>
      <link>/2011/09/19/creating-chroot-environment-fedora-bash-utils/</link>
      <pubDate>Mon, 19 Sep 2011 14:59:23 +0000</pubDate>
      
      <guid>/2011/09/19/creating-chroot-environment-fedora-bash-utils/</guid>
      <description>&lt;p&gt;[ad#ad-2]&lt;/p&gt;
&lt;p&gt;I am testing some of my scripts to work on a very old system and there the versions of the most popular applications are very old, real old :(. So, some of things that I am very used to since last couple of years, do not seem to work as expected and I need to keep verifying a lot of things on the server, very inconvinient to keep testing the script on the server (need to connect on &lt;a class=&#34;zem_slink&#34; title=&#34;Virtual private network&#34; href=&#34;http://en.wikipedia.org/wiki/Virtual_private_network&#34; rel=&#34;wikipedia&#34;&gt;VPN&lt;/a&gt;) just to test some very simple things.&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>better bash debugging</title>
      <link>/2011/09/16/bash-debugging/</link>
      <pubDate>Fri, 16 Sep 2011 08:00:08 +0000</pubDate>
      
      <guid>/2011/09/16/bash-debugging/</guid>
      <description>&lt;p&gt;I was trying to &lt;a class=&#34;zem_slink&#34; title=&#34;Debugging&#34; href=&#34;http://en.wikipedia.org/wiki/Debugging&#34; rel=&#34;wikipedia&#34;&gt;debug&lt;/a&gt; some &lt;a class=&#34;zem_slink&#34; title=&#34;Bash (Unix shell)&#34; href=&#34;http://tiswww.case.edu/php/chet/bash/bashtop.html&#34; rel=&#34;homepage&#34;&gt;bash&lt;/a&gt; scripts yesterday and learnt something new 😉&lt;br&gt;
There are lot of things in bash that you can use to debug and to start with you can enable xtrace mode as follows:&lt;/p&gt;
&lt;pre class=&#34;brush: bash; gutter: true; first-line: 1; &#34;&gt;set -x&lt;/pre&gt;
&lt;p&gt;With this set you will see that all the commands are printed along with all other information as they are executed.&lt;br&gt;
This you can do for any line or for the function or for the whole script. Once you set the option you can turn it&lt;br&gt;
off with&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>[Solved] ssh works but scp does not</title>
      <link>/2011/08/29/solved-ssh-works-scp/</link>
      <pubDate>Mon, 29 Aug 2011 00:48:04 +0000</pubDate>
      
      <guid>/2011/08/29/solved-ssh-works-scp/</guid>
      <description>&lt;div class=&#34;zemanta-img&#34; style=&#34;margin: 1em; display: block;&#34;&gt;
  &lt;p&gt;
    &lt;figure style=&#34;width: 300px&#34; class=&#34;wp-caption alignright&#34;&gt;&lt;a href=&#34;http://commons.wikipedia.org/wiki/File:Ssh_binary_packet_alt.svg&#34;&gt;&lt;img title=&#34;Structure of an SSH binary packet&#34; src=&#34;https://i1.wp.com/blog.amit-agarwal.co.in/wp-content/uploads/zemanta//300px-Ssh_binary_packet_alt.svg_1.png?resize=300%2C232&#34; alt=&#34;Structure of an SSH binary packet&#34; width=&#34;300&#34; height=&#34;232&#34; data-recalc-dims=&#34;1&#34; /&gt;&lt;/a&gt;&lt;figcaption class=&#34;wp-caption-text&#34;&gt;Image via Wikipedia&lt;/figcaption&gt;&lt;/figure&gt;
  &lt;/p&gt;
&lt;/div&gt;
&lt;!--[ad#ad-2]--&gt;
&lt;p&gt;For quite sometime now, I was having this issue, that for the home system, I was able to connect to is using &lt;a class=&#34;zem_slink&#34; title=&#34;Secure Shell&#34; href=&#34;http://en.wikipedia.org/wiki/Secure_Shell&#34; rel=&#34;wikipedia&#34;&gt;ssh&lt;/a&gt; but it never worked. Fnally after quite some debugging finally I found that the issue was with thebashrc. So, everytime I had to do a scp I would have to move/rename bashrc and do the reverse action after the scp was done.&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>bash completion</title>
      <link>/2011/08/09/bash-completion/</link>
      <pubDate>Tue, 09 Aug 2011 03:36:37 +0000</pubDate>
      
      <guid>/2011/08/09/bash-completion/</guid>
      <description>&lt;!--[ad#ad-2]--&gt;
&lt;p&gt;I was working on some &lt;a class=&#34;zem_slink&#34; title=&#34;Function (mathematics)&#34; href=&#34;http://en.wikipedia.org/wiki/Function_%28mathematics%29&#34; rel=&#34;wikipedia&#34;&gt;functions&lt;/a&gt; in bash to make my life easier and realized that if I added custom &lt;a class=&#34;zem_slink&#34; title=&#34;Complete metric space&#34; href=&#34;http://en.wikipedia.org/wiki/Complete_metric_space&#34; rel=&#34;wikipedia&#34;&gt;completion&lt;/a&gt; to my functions, it will be really good. So I headed over to google and searched for what I wanted. I did get a lot of information on bash completion but not a single concrete example that could help me do what I wanted. So, with the help of &lt;a class=&#34;zem_slink&#34; title=&#34;Man page&#34; href=&#34;http://en.wikipedia.org/wiki/Man_page&#34; rel=&#34;wikipedia&#34;&gt;man pages&lt;/a&gt; and some results from the &lt;a class=&#34;zem_slink&#34; title=&#34;Google Page Creator&#34; href=&#34;http://pages.google.com&#34; rel=&#34;homepage&#34;&gt;Google pages&lt;/a&gt;, I was finally able to accomplish what I wanted. So here it is:&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>faster bash operations on files with File Descriptors.</title>
      <link>/2011/06/11/faster-bash-operations-files-file-descriptors/</link>
      <pubDate>Sat, 11 Jun 2011 02:11:53 +0000</pubDate>
      
      <guid>/2011/06/11/faster-bash-operations-files-file-descriptors/</guid>
      <description>&lt;!--[ad#ad-2]--&gt;
&lt;p&gt;I was &lt;a class=&#34;zem_slink&#34; title=&#34;Writing&#34; rel=&#34;wikipedia&#34; href=&#34;http://en.wikipedia.org/wiki/Writing&#34;&gt;writing&lt;/a&gt; a &lt;a class=&#34;zem_slink&#34; title=&#34;Bash (Unix shell)&#34; rel=&#34;homepage&#34; href=&#34;http://tiswww.case.edu/php/chet/bash/bashtop.html&#34;&gt;bash script&lt;/a&gt; that would do some operations and read and write to file. Seems that that was pretty simple with&lt;/p&gt;
&lt;div class=&#34;codecolorer-container text solarized-light&#34; style=&#34;overflow:auto;white-space:nowrap;width:550px;&#34;&gt;
  &lt;table cellspacing=&#34;0&#34; cellpadding=&#34;0&#34;&gt;
    &lt;tr&gt;
      &lt;td class=&#34;line-numbers&#34;&gt;
        &lt;div&gt;
          1&lt;br /&gt;2&lt;br /&gt;3&lt;br /&gt;4&lt;br /&gt;5&lt;br /&gt;
        &lt;/div&gt;
      &lt;/td&gt;
&lt;pre&gt;&lt;code&gt;  &amp;lt;td&amp;gt;
    &amp;lt;div class=&amp;quot;text codecolorer&amp;quot;&amp;gt;
      while read line&amp;lt;br /&amp;gt; &amp;lt;br /&amp;gt; do&amp;lt;br /&amp;gt; &amp;lt;br /&amp;gt; done&amp;lt;file
    &amp;lt;/div&amp;gt;
  &amp;lt;/td&amp;gt;
&amp;lt;/tr&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
  &lt;/table&gt;
&lt;/div&gt;
&lt;p&gt;and then use redirection operations like “&amp;gt;” and “&amp;raquo;” to write to file. Done with the script pretty fast. So far so good, when I went for real life tests, no one was interested in using it, why? Simple, it was simply taking too long. The file was reading about 10K lines and writing about 50 lines and was taking about more than 10 minutes.&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Total upload and download on any interface.</title>
      <link>/2011/06/05/total-upload-download-interface/</link>
      <pubDate>Sun, 05 Jun 2011 01:29:21 +0000</pubDate>
      
      <guid>/2011/06/05/total-upload-download-interface/</guid>
      <description>&lt;!--[ad#ad-2]--&gt;
&lt;p&gt;Something that I have been searching for a long time, finally some look inside the &amp;lt;a class=&amp;ldquo;zem_slink&amp;rdquo; title=&amp;ldquo;Procfs&amp;rdquo; rel=&amp;ldquo;wikipedia&amp;rdquo; href=&amp;ldquo;&lt;a href=&#34;http://en.wikipedia.org/wiki/Procfs%22&#34;&gt;http://en.wikipedia.org/wiki/Procfs&amp;quot;&lt;/a&gt; _mce_href=&amp;ldquo;&lt;a href=&#34;http://en.wikipedia.org/wiki/Procfs%22%3E/proc&#34;&gt;http://en.wikipedia.org/wiki/Procfs&amp;quot;&amp;gt;/proc&lt;/a&gt;&lt;/a&gt; got me what I wanted. Hope this will save someone’s day. So far, the only option I could think of was to run conky which becomes a little heave on some of the very old laptops I have to use sometimes 🙁&lt;/p&gt;
&lt;div class=&#34;codecolorer-container text solarized-light&#34; style=&#34;overflow:auto;white-space:nowrap;width:550px;&#34;&gt;
  &lt;table cellspacing=&#34;0&#34; cellpadding=&#34;0&#34;&gt;
    &lt;tr&gt;
      &lt;td class=&#34;line-numbers&#34;&gt;
        &lt;div&gt;
          1&lt;br /&gt;
        &lt;/div&gt;
      &lt;/td&gt;
&lt;pre&gt;&lt;code&gt;  &amp;lt;td&amp;gt;
    &amp;lt;div class=&amp;quot;text codecolorer&amp;quot;&amp;gt;
      &amp;amp;nbsp;cat /proc/net/dev|grep eth2|awk &#39;{print $2/1024/1024&amp;quot;&amp;amp;nbsp; &amp;quot;$10/1024/1024}&#39;
    &amp;lt;/div&amp;gt;
  &amp;lt;/td&amp;gt;
&amp;lt;/tr&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
  &lt;/table&gt;
&lt;/div&gt;&lt;h6 class=&#34;zemanta-related-title&#34; style=&#34;font-size: 1em;&#34; \_mce\_style=&#34;font-size: 1em;&#34;&gt;Related articles&lt;/h6&gt; 
&lt;ul class=&#34;zemanta-article-ul&#34;&gt;
  &lt;li class=&#34;zemanta-article-ul-li&#34;&gt;
    &lt;a href=&#34;http://jarneil.wordpress.com/2011/03/15/cpuspeed-slowing-you-down/&#34; _mce_href=&#34;http://jarneil.wordpress.com/2011/03/15/cpuspeed-slowing-you-down/&#34;&gt;CPUSPEED Slowing you down?&lt;/a&gt; (jarneil.wordpress.com)
  &lt;/li&gt;
  &lt;li class=&#34;zemanta-article-ul-li&#34;&gt;
    &lt;a href=&#34;http://lingpipe-blog.com/2011/05/26/interface-curmudgeons/&#34; _mce_href=&#34;http://lingpipe-blog.com/2011/05/26/interface-curmudgeons/&#34;&gt;Interface Curmudgeons versus Gestures&lt;/a&gt; (lingpipe-blog.com)
  &lt;/li&gt;
  &lt;li class=&#34;zemanta-article-ul-li&#34;&gt;
    &lt;a href=&#34;http://michaeldaranto.wordpress.com/2011/05/28/alias-in-bashrc/&#34; _mce_href=&#34;http://michaeldaranto.wordpress.com/2011/05/28/alias-in-bashrc/&#34;&gt;Alias in .bashrc&lt;/a&gt; (michaeldaranto.wordpress.com)
  &lt;/li&gt;
&lt;/ul&gt;&lt;div class=&#34;zemanta-pixie&#34; style=&#34;margin-top: 10px; height: 15px;&#34; \_mce\_style=&#34;margin-top: 10px; height: 15px;&#34;&gt;&lt;a class=&#34;zemanta-pixie-a&#34; title=&#34;Enhanced by Zemanta&#34; href=&#34;http://www.zemanta.com/&#34; \_mce\_href=&#34;http://www.zemanta.com/&#34;&gt;&lt;img class=&#34;zemanta-pixie-img&#34; style=&#34;border: medium none; float: right;&#34; \_mce\_style=&#34;border: medium none; float: right;&#34; src=&#34;https://i1.wp.com/img.zemanta.com/zemified\_e.png?w=688&#34; \_mce\_src=&#34;https://i1.wp.com/img.zemanta.com/zemified\_e.png?w=688&#34; alt=&#34;Enhanced by Zemanta&#34; data-recalc-dims=&#34;1&#34;/&gt;&lt;/a&gt;&lt;br \_mce\_bogus=&#34;1&#34;/&gt;&lt;/div&gt;</description>
    </item>
    
    <item>
      <title>Unix shell script for removing duplicate files</title>
      <link>/2011/05/16/unix-shell-script-removing-duplicate-files/</link>
      <pubDate>Mon, 16 May 2011 14:07:33 +0000</pubDate>
      
      <guid>/2011/05/16/unix-shell-script-removing-duplicate-files/</guid>
      <description>&lt;p&gt;The following &lt;a class=&#34;zem_slink&#34; title=&#34;Shell script&#34; href=&#34;http://en.wikipedia.org/wiki/Shell_script&#34; rel=&#34;wikipedia&#34;&gt;shell script&lt;/a&gt; finds duplicate (2 or more identical) files and outputs a new shell script containing &lt;a class=&#34;zem_slink&#34; title=&#34;Comment (computer programming)&#34; href=&#34;http://en.wikipedia.org/wiki/Comment_%28computer_programming%29&#34; rel=&#34;wikipedia&#34;&gt;commented-out&lt;/a&gt; rm statements for deleting them (&lt;a class=&#34;zem_slink&#34; title=&#34;Cut, copy, and paste&#34; href=&#34;http://en.wikipedia.org/wiki/Cut%2C_copy%2C_and_paste&#34; rel=&#34;wikipedia&#34;&gt;copy-paste&lt;/a&gt; from here):&lt;/p&gt;
&lt;p&gt;::: updated on 02 May 20121, seems like wordpress did not like it so well so reformatting the code :::::::&lt;/p&gt;
&lt;pre class=&#34;brush: bash; gutter: true; first-line: 1&#34;&gt;#!/bin/bash -
#===============================================================================
#
#          FILE:  a.sh
#
#         USAGE:  ./a.sh
#
#   DESCRIPTION:
#
#       OPTIONS:  ---
#  REQUIREMENTS:  ---
#          BUGS:  ---
#         NOTES:  ---
#        AUTHOR: Amit Agarwal (aka), amit.agarwal@roamware.com
#       COMPANY: blog.amit-agarwal.co.in
#       CREATED: 02/05/12 06:52:08 IST
# Last modified: Wed May 02, 2012  07:03AM
#      REVISION:  ---
#===============================================================================

OUTF=rem-duplicates.sh;
echo &#34;#!/bin/sh&#34; &amp;gt;$OUTF;
find &#34;$@&#34; -type f -exec md5sum {} \; 2&amp;gt;/dev/null | sort --key=1,32 | uniq -w 32 -d |cut -b 1-32 --complement |sed &#39;s/^/rm -f/&#39; &amp;gt;&amp;gt;$OUTF&lt;/pre&gt;
&lt;p&gt;Pretty good one line, I must say 🙂&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>mysql output to an array for easy parsing.</title>
      <link>/2011/05/11/mysql-output-array-easy-parsing/</link>
      <pubDate>Wed, 11 May 2011 16:51:25 +0000</pubDate>
      
      <guid>/2011/05/11/mysql-output-array-easy-parsing/</guid>
      <description>&lt;!--[ad#ad-2]--&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Today I was looking for some way to put the &lt;a class=&#34;zem_slink&#34; title=&#34;Output&#34; rel=&#34;wikipedia&#34; href=&#34;http://en.wikipedia.org/wiki/Output&#34;&gt;output&lt;/a&gt; of the &lt;a class=&#34;zem_slink&#34; title=&#34;MySQL&#34; rel=&#34;homepage&#34; href=&#34;http://www.mysql.com&#34;&gt;mysql&lt;/a&gt; output in an array in a bash script. Quick google search yeilded to results something like this:&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;div class=&#34;codecolorer-container text solarized-light&#34; style=&#34;overflow:auto;white-space:nowrap;width:550px;&#34;&gt;
  &lt;table cellspacing=&#34;0&#34; cellpadding=&#34;0&#34;&gt;
    &lt;tr&gt;
      &lt;td class=&#34;line-numbers&#34;&gt;
        &lt;div&gt;
          1&lt;br /&gt;
        &lt;/div&gt;
      &lt;/td&gt;
&lt;pre&gt;&lt;code&gt;  &amp;lt;td&amp;gt;
    &amp;lt;div class=&amp;quot;text codecolorer&amp;quot;&amp;gt;
      output=$(mysql -e &amp;quot;select * from table&amp;quot;)
    &amp;lt;/div&amp;gt;
  &amp;lt;/td&amp;gt;
&amp;lt;/tr&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
  &lt;/table&gt;
&lt;/div&gt;
&lt;p&gt;The problem with the above approach is that all the words go into separate index. So if you have a line that has space then that is split into multiple index’s. Not good…&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Easy ssh configuration with .ssh/config file</title>
      <link>/2011/04/11/easy-ssh-configuration-with-sshconfig-file/</link>
      <pubDate>Mon, 11 Apr 2011 06:30:00 +0000</pubDate>
      
      <guid>/2011/04/11/easy-ssh-configuration-with-sshconfig-file/</guid>
      <description>&lt;!--[ad#ad-2]--&gt;
&lt;p&gt;If you &lt;a class=&#34;zem_slink&#34; title=&#34;Secure Shell&#34; rel=&#34;wikipedia&#34; href=&#34;http://en.wikipedia.org/wiki/Secure_Shell&#34;&gt;ssh&lt;/a&gt; to many hosts then you are aware of the pain that it takes to ssh with different username and &lt;a class=&#34;zem_slink&#34; title=&#34;Hostname&#34; rel=&#34;wikipedia&#34; href=&#34;http://en.wikipedia.org/wiki/Hostname&#34;&gt;hostname&lt;/a&gt;. There is an alias that you can creat with native ssh though. Here I will show you the same with an example.&lt;/p&gt;
&lt;div class=&#34;codecolorer-container text solarized-light&#34; style=&#34;overflow:auto;white-space:nowrap;width:550px;&#34;&gt;
  &lt;table cellspacing=&#34;0&#34; cellpadding=&#34;0&#34;&gt;
    &lt;tr&gt;
      &lt;td class=&#34;line-numbers&#34;&gt;
        &lt;div&gt;
          1&lt;br /&gt;2&lt;br /&gt;3&lt;br /&gt;4&lt;br /&gt;5&lt;br /&gt;
        &lt;/div&gt;
      &lt;/td&gt;
&lt;pre&gt;&lt;code&gt;  &amp;lt;td&amp;gt;
    &amp;lt;div class=&amp;quot;text codecolorer&amp;quot;&amp;gt;
      cat &amp;lt;&amp;lt;EOF &amp;gt;&amp;gt;~/.ssh/config&amp;lt;br /&amp;gt; Host &amp;lt;alias&amp;gt;&amp;lt;br /&amp;gt; Username &amp;lt;user name&amp;gt;&amp;lt;br /&amp;gt; Port &amp;lt;port number&amp;gt;&amp;lt;br /&amp;gt; Hostname &amp;lt;hostname&amp;gt;
    &amp;lt;/div&amp;gt;
  &amp;lt;/td&amp;gt;
&amp;lt;/tr&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
  &lt;/table&gt;
&lt;/div&gt;
&lt;p&gt;You can optionally omit the parameters that you do not require explicitly. For example, if your port number is default then you can simply ignore the parameter.&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>using wordpress CLI to post to wordpress</title>
      <link>/2011/03/24/using-wordpress-cli-to-post-to-wordpress/</link>
      <pubDate>Thu, 24 Mar 2011 15:31:10 +0000</pubDate>
      
      <guid>/2011/03/24/using-wordpress-cli-to-post-to-wordpress/</guid>
      <description>&lt;!--[ad#ad-2]--&gt;
&lt;p&gt;There is a very nice post here: &lt;a title=&#34;How to post content to a WordPress blog from the command line&#34; href=&#34;http://freesoftware.zona-m.net/how-to-post-content-to-a-wordpress-blog-from-the-command-line/&#34; target=&#34;_blank&#34;&gt;How to post content to a WordPress blog from the command line&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I tried this in &lt;a class=&#34;zem_slink&#34; title=&#34;Fedora (operating system)&#34; rel=&#34;homepage&#34; href=&#34;http://www.fedoraproject.org/&#34;&gt;Fedora&lt;/a&gt; 14 and here is the way to get this working in Fedora&lt;/p&gt;
&lt;div class=&#34;codecolorer-container text solarized-light&#34; style=&#34;overflow:auto;white-space:nowrap;width:550px;&#34;&gt;
  &lt;table cellspacing=&#34;0&#34; cellpadding=&#34;0&#34;&gt;
    &lt;tr&gt;
      &lt;td class=&#34;line-numbers&#34;&gt;
        &lt;div&gt;
          1&lt;br /&gt;2&lt;br /&gt;3&lt;br /&gt;4&lt;br /&gt;5&lt;br /&gt;
        &lt;/div&gt;
      &lt;/td&gt;
&lt;pre&gt;&lt;code&gt;  &amp;lt;td&amp;gt;
    &amp;lt;div class=&amp;quot;text codecolorer&amp;quot;&amp;gt;
      su -&amp;lt;br /&amp;gt; &amp;lt;br /&amp;gt; cpan&amp;lt;br /&amp;gt; &amp;lt;br /&amp;gt; install WordPress::CLI WordPress::Post
    &amp;lt;/div&amp;gt;
  &amp;lt;/td&amp;gt;
&amp;lt;/tr&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
  &lt;/table&gt;
&lt;/div&gt;
&lt;p&gt;Now, once the above completes make sure that the path /usr/local/bin is in you path.&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Try all colors in xterm with script before setting the color</title>
      <link>/2011/03/18/try-all-colors-in-xterm-with-script-before-setting-the-color/</link>
      <pubDate>Fri, 18 Mar 2011 07:41:39 +0000</pubDate>
      
      <guid>/2011/03/18/try-all-colors-in-xterm-with-script-before-setting-the-color/</guid>
      <description>&lt;!--[ad#ad-2]--&gt;
&lt;p&gt;If you are looking for testing the &lt;a class=&#34;zem_slink&#34; title=&#34;Color&#34; rel=&#34;wikipedia&#34; href=&#34;http://en.wikipedia.org/wiki/Color&#34;&gt;colors&lt;/a&gt; on how they would look like in the &lt;a class=&#34;zem_slink&#34; title=&#34;Xterm&#34; rel=&#34;homepage&#34; href=&#34;http://invisible-island.net/xterm/&#34;&gt;xterm&lt;/a&gt; before you set the color then here is a small script for you.&lt;/p&gt;
&lt;div class=&#34;codecolorer-container text solarized-light&#34; style=&#34;overflow:auto;white-space:nowrap;width:550px;&#34;&gt;
  &lt;table cellspacing=&#34;0&#34; cellpadding=&#34;0&#34;&gt;
    &lt;tr&gt;
      &lt;td class=&#34;line-numbers&#34;&gt;
        &lt;div&gt;
          1&lt;br /&gt;2&lt;br /&gt;3&lt;br /&gt;4&lt;br /&gt;5&lt;br /&gt;6&lt;br /&gt;7&lt;br /&gt;8&lt;br /&gt;9&lt;br /&gt;10&lt;br /&gt;11&lt;br /&gt;12&lt;br /&gt;13&lt;br /&gt;14&lt;br /&gt;15&lt;br /&gt;16&lt;br /&gt;17&lt;br /&gt;18&lt;br /&gt;19&lt;br /&gt;20&lt;br /&gt;21&lt;br /&gt;22&lt;br /&gt;23&lt;br /&gt;24&lt;br /&gt;25&lt;br /&gt;26&lt;br /&gt;27&lt;br /&gt;28&lt;br /&gt;29&lt;br /&gt;30&lt;br /&gt;
        &lt;/div&gt;
      &lt;/td&gt;
&lt;pre&gt;&lt;code&gt;  &amp;lt;td&amp;gt;
    &amp;lt;div class=&amp;quot;text codecolorer&amp;quot;&amp;gt;
      #!/bin/bash -&amp;lt;br /&amp;gt; #===============================================================================&amp;lt;br /&amp;gt; #&amp;lt;br /&amp;gt; #          FILE:  xterm_colors-test.sh&amp;lt;br /&amp;gt; #&amp;lt;br /&amp;gt; #         USAGE:  ./xterm_colors-test.sh&amp;lt;br /&amp;gt; #&amp;lt;br /&amp;gt; #   DESCRIPTION:  Test all the colors for xterm bg&amp;lt;br /&amp;gt; #&amp;lt;br /&amp;gt; #       OPTIONS:  ---&amp;lt;br /&amp;gt; #  REQUIREMENTS:  ---&amp;lt;br /&amp;gt; #          BUGS:  ---&amp;lt;br /&amp;gt; #         NOTES:  ---&amp;lt;br /&amp;gt; #        AUTHOR:   Amit Agarwal (amit.agarwal@amit-agarwal.co.in), aka&amp;lt;br /&amp;gt; #       COMPANY:  Individual&amp;lt;br /&amp;gt; #       VERSION:  1.0&amp;lt;br /&amp;gt; #       CREATED:  02/18/2011 01:02:51 PM IST&amp;lt;br /&amp;gt; #      REVISION:  1.0&amp;lt;br /&amp;gt; #===============================================================================&amp;lt;br /&amp;gt; &amp;lt;br /&amp;gt; cat /usr/share/X11/rgb.txt |sed &#39;s/\([0-9]\{1,3\}[ \t]*\)\{3\}//&#39;|sed &#39;s/^ *//&#39; &amp;gt;~/rgb.txt&amp;lt;br /&amp;gt; while read line&amp;lt;br /&amp;gt; do&amp;lt;br /&amp;gt; bg=$(echo $line)&amp;lt;br /&amp;gt; echo $line&amp;lt;br /&amp;gt; echo &amp;quot;Trying $bg color&amp;quot;&amp;lt;br /&amp;gt; xterm -bg &amp;quot;$bg&amp;quot;&amp;amp;&amp;lt;br /&amp;gt; sleep 5&amp;lt;br /&amp;gt; kill -9 $!&amp;lt;br /&amp;gt; done &amp;lt; ~/rgb.txt
    &amp;lt;/div&amp;gt;
  &amp;lt;/td&amp;gt;
&amp;lt;/tr&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
  &lt;/table&gt;
&lt;/div&gt;
&lt;p&gt;This can be used in various ways but I will leave the choice to you. One option that I should probably still tell is :&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>cd across parallel directories</title>
      <link>/2011/03/14/cd-across-parallel-directories/</link>
      <pubDate>Mon, 14 Mar 2011 15:37:55 +0000</pubDate>
      
      <guid>/2011/03/14/cd-across-parallel-directories/</guid>
      <description>&lt;div class=&#34;zemanta-img&#34; style=&#34;margin: 1em; display: block;&#34;&gt;
  &lt;p&gt;
    &lt;figure style=&#34;width: 300px&#34; class=&#34;wp-caption alignright&#34;&gt;&lt;a href=&#34;http://commons.wikipedia.org/wiki/File:Unix_history-simple.svg&#34;&gt;&lt;img title=&#34;A diagram showing the key Unix and Unix-like o...&#34; src=&#34;http://upload.wikimedia.org/wikipedia/commons/thumb/7/77/Unix_history-simple.svg/300px-Unix_history-simple.svg.png&#34; alt=&#34;A diagram showing the key Unix and Unix-like o...&#34; width=&#34;300&#34; height=&#34;189&#34; /&gt;&lt;/a&gt;&lt;figcaption class=&#34;wp-caption-text&#34;&gt;Image via Wikipedia&lt;/figcaption&gt;&lt;/figure&gt;
  &lt;/p&gt;
&lt;/div&gt;
&lt;!--[ad#ad-2]--&gt;
&lt;p&gt;Here is a simple and fast way to cd across parallel directory.&lt;/p&gt;
&lt;div class=&#34;codecolorer-container text solarized-light&#34; style=&#34;overflow:auto;white-space:nowrap;width:550px;&#34;&gt;
  &lt;table cellspacing=&#34;0&#34; cellpadding=&#34;0&#34;&gt;
    &lt;tr&gt;
      &lt;td class=&#34;line-numbers&#34;&gt;
        &lt;div&gt;
          1&lt;br /&gt;
        &lt;/div&gt;
      &lt;/td&gt;
&lt;pre&gt;&lt;code&gt;  &amp;lt;td&amp;gt;
    &amp;lt;div class=&amp;quot;text codecolorer&amp;quot;&amp;gt;
      cd ${PWD/test/actual}
    &amp;lt;/div&amp;gt;
  &amp;lt;/td&amp;gt;
&amp;lt;/tr&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
  &lt;/table&gt;
&lt;/div&gt;
&lt;h6 class=&#34;zemanta-related-title&#34; style=&#34;font-size: 1em;&#34;&gt;
  Related articles
&lt;/h6&gt;
&lt;ul class=&#34;zemanta-article-ul&#34;&gt;
  &lt;li class=&#34;zemanta-article-ul-li&#34;&gt;
    &lt;a href=&#34;http://www.ghacks.net/2011/03/04/linux-command-line-tips-wget/&#34;&gt;Linux command line tips: wget&lt;/a&gt; (ghacks.net)
  &lt;/li&gt;
  &lt;li class=&#34;zemanta-article-ul-li&#34;&gt;
    &lt;a href=&#34;http://tjantunen.com/2011/03/12/article-directory-submissions/&#34;&gt;Article Directory Submissions&lt;/a&gt; (tjantunen.com)
  &lt;/li&gt;
  &lt;li class=&#34;zemanta-article-ul-li&#34;&gt;
    &lt;a href=&#34;http://cash-bandit.com/2011/03/11/article-directory-submissions/&#34;&gt;Article Directory Submissions&lt;/a&gt; (cash-bandit.com)
  &lt;/li&gt;
  &lt;li class=&#34;zemanta-article-ul-li&#34;&gt;
    &lt;a href=&#34;http://annupandey.wordpress.com/2011/01/30/create-a-repository-from-your-fedora-dvd/&#34;&gt;Create a repository from your fedora DVD&lt;/a&gt; (annupandey.wordpress.com)
  &lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&#34;zemanta-pixie&#34; style=&#34;margin-top: 10px; height: 15px;&#34;&gt;
  &lt;a class=&#34;zemanta-pixie-a&#34; title=&#34;Enhanced by Zemanta&#34; href=&#34;http://www.zemanta.com/&#34;&gt;&lt;img class=&#34;zemanta-pixie-img&#34; style=&#34;border: medium none; float: right;&#34; src=&#34;https://i1.wp.com/img.zemanta.com/zemified_e.png?w=688&#34; alt=&#34;Enhanced by Zemanta&#34; data-recalc-dims=&#34;1&#34; /&gt;&lt;/a&gt;&lt;span class=&#34;zem-script more-related pretty-attribution&#34;&gt;&lt;/span&gt;
&lt;/div&gt;</description>
    </item>
    
    <item>
      <title>All in one solution for all the scripts of vim from vim.org</title>
      <link>/2011/03/09/all-in-one-solution-for-all-the-scripts-of-vim-from-vim-org/</link>
      <pubDate>Wed, 09 Mar 2011 16:39:52 +0000</pubDate>
      
      <guid>/2011/03/09/all-in-one-solution-for-all-the-scripts-of-vim-from-vim-org/</guid>
      <description>&lt;!--[ad#ad-2]--&gt;
&lt;p&gt;For quite sometime now, I was looking for some console based program which would help me get the scripts from vim.org. A simple solution would have been to do a wget for the scripts. But since there are so many scripts coming up daily and with a need to search based on script ID and name of the script, I thought better to write a script that can do all of those things. Now, what was required was that the script should be either able to download this or add to the &lt;a title=&#34;GLVS&#34; href=&#34;http://www.vim.org/scripts/script.php?script_id=2444&#34; target=&#34;_blank&#34;&gt;GLVS&lt;/a&gt; script. Also note that, I had done something similar in the past &lt;a title=&#34;vim – get the list of all the scripts available.&#34; href=&#34;http://blog.amit-agarwal.co.in/2010/05/28/vim-get-the-list-of-all-the-scripts-available/&#34; target=&#34;_blank&#34;&gt;here&lt;/a&gt;. There are some additions in the below script. You can download a copy of the script &lt;a href=&#34;http://blog.amit-agarwal.co.in/wp-content/uploads/2011/03/get_vim_scripts.txt&#34;&gt;get_vim_scripts&lt;/a&gt;. Or you can copy the script from below:&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>print every nth line</title>
      <link>/2011/03/01/print-every-nth-line/</link>
      <pubDate>Tue, 01 Mar 2011 13:17:30 +0000</pubDate>
      
      <guid>/2011/03/01/print-every-nth-line/</guid>
      <description>&lt;!--[ad#ad-2]--&gt;
&lt;p&gt;Some time back I was working with lot of data and wanted to analyze only the every 10 line sometimes and sometimes every 20th line. I had to keep doing these changes in vim or otherwise so finally I wrote a program to do this for me. If you need such a program then here it is:&lt;/p&gt;
&lt;div class=&#34;codecolorer-container text solarized-light&#34; style=&#34;overflow:auto;white-space:nowrap;width:550px;&#34;&gt;
  &lt;table cellspacing=&#34;0&#34; cellpadding=&#34;0&#34;&gt;
    &lt;tr&gt;
      &lt;td class=&#34;line-numbers&#34;&gt;
        &lt;div&gt;
          1&lt;br /&gt;2&lt;br /&gt;3&lt;br /&gt;4&lt;br /&gt;5&lt;br /&gt;6&lt;br /&gt;7&lt;br /&gt;8&lt;br /&gt;9&lt;br /&gt;10&lt;br /&gt;11&lt;br /&gt;12&lt;br /&gt;13&lt;br /&gt;14&lt;br /&gt;15&lt;br /&gt;16&lt;br /&gt;17&lt;br /&gt;18&lt;br /&gt;19&lt;br /&gt;20&lt;br /&gt;21&lt;br /&gt;22&lt;br /&gt;23&lt;br /&gt;24&lt;br /&gt;25&lt;br /&gt;26&lt;br /&gt;27&lt;br /&gt;28&lt;br /&gt;29&lt;br /&gt;30&lt;br /&gt;31&lt;br /&gt;
        &lt;/div&gt;
      &lt;/td&gt;
&lt;pre&gt;&lt;code&gt;  &amp;lt;td&amp;gt;
    &amp;lt;div class=&amp;quot;text codecolorer&amp;quot;&amp;gt;
      #!/bin/bash -&amp;lt;br /&amp;gt; #===============================================================================&amp;lt;br /&amp;gt; #&amp;lt;br /&amp;gt; #          FILE:  print_nth_line.sh&amp;lt;br /&amp;gt; #&amp;lt;br /&amp;gt; #         USAGE:  ./print_nth_line.sh&amp;lt;br /&amp;gt; #&amp;lt;br /&amp;gt; #   DESCRIPTION:  Print every nth line&amp;lt;br /&amp;gt; #&amp;lt;br /&amp;gt; #       OPTIONS:  ---&amp;lt;br /&amp;gt; #  REQUIREMENTS:  ---&amp;lt;br /&amp;gt; #          BUGS:  ---&amp;lt;br /&amp;gt; #         NOTES:  ---&amp;lt;br /&amp;gt; #        AUTHOR:   (),&amp;lt;br /&amp;gt; #       COMPANY:&amp;lt;br /&amp;gt; #       VERSION:  1.0&amp;lt;br /&amp;gt; #       CREATED:  12/08/2010 05:36:53 PM IST&amp;lt;br /&amp;gt; #      REVISION:  ---&amp;lt;br /&amp;gt; #===============================================================================&amp;lt;br /&amp;gt; &amp;lt;br /&amp;gt; if [ x&amp;quot;$1&amp;quot; == &amp;quot;x&amp;quot; ]&amp;lt;br /&amp;gt; then&amp;lt;br /&amp;gt; echo &amp;quot;Please provide the line numbers to print .. .ex 3 will print 3,6,9&amp;quot;&amp;lt;br /&amp;gt; exit -1;&amp;lt;br /&amp;gt; fi&amp;lt;br /&amp;gt; if [ x&amp;quot;$2&amp;quot; == &amp;quot;x&amp;quot; ]&amp;lt;br /&amp;gt; then&amp;lt;br /&amp;gt; echo &amp;quot;Please provide the filename&amp;quot;&amp;lt;br /&amp;gt; exit -2;&amp;lt;br /&amp;gt; fi&amp;lt;br /&amp;gt; awk &#39;temp++ { if ( temp % &#39;$1&#39; == 0) print $1};&#39; $2
    &amp;lt;/div&amp;gt;
  &amp;lt;/td&amp;gt;
&amp;lt;/tr&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
  &lt;/table&gt;
&lt;/div&gt;
&lt;div class=&#34;zemanta-pixie&#34; style=&#34;margin-top: 10px; height: 15px;&#34;&gt;
  &lt;a class=&#34;zemanta-pixie-a&#34; title=&#34;Enhanced by Zemanta&#34; href=&#34;http://www.zemanta.com/&#34;&gt;&lt;img class=&#34;zemanta-pixie-img&#34; style=&#34;border: medium none; float: right;&#34; src=&#34;https://i1.wp.com/img.zemanta.com/zemified_e.png?w=688&#34; alt=&#34;Enhanced by Zemanta&#34; data-recalc-dims=&#34;1&#34; /&gt;&lt;/a&gt;&lt;span class=&#34;zem-script more-related pretty-attribution&#34;&gt;&lt;/span&gt;
&lt;/div&gt;</description>
    </item>
    
    <item>
      <title>/bash debugger</title>
      <link>/2011/02/27/bash-debugger/</link>
      <pubDate>Sun, 27 Feb 2011 13:09:48 +0000</pubDate>
      
      <guid>/2011/02/27/bash-debugger/</guid>
      <description>&lt;!--[ad#ad-2]--&gt;
&lt;h3 id=&#34;span-stylefont-size-medium92-a-a-classzem_slink-titlebash-unix-shell-relhomepage-hrefhttptiswwwcaseeduphpchetbashbashtophtmlbasha-a-classzem_slink-titledebugger-relwikipedia-hrefhttpenwikipediaorgwikidebuggerdebuggeraspan&#34;&gt;&lt;strong&gt;&lt;span style=&#34;font-size: medium;&#34;&gt;9.2. A &lt;a class=&#34;zem_slink&#34; title=&#34;Bash (Unix shell)&#34; rel=&#34;homepage&#34; href=&#34;http://tiswww.case.edu/php/chet/bash/bashtop.html&#34;&gt;bash&lt;/a&gt; &lt;a class=&#34;zem_slink&#34; title=&#34;Debugger&#34; rel=&#34;wikipedia&#34; href=&#34;http://en.wikipedia.org/wiki/Debugger&#34;&gt;Debugger&lt;/a&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/h3&gt;
&lt;p&gt;In this section we’ll develop a very basic debugger for bash.&lt;a href=&#34;http://book.chinaunix.net/special/ebook/oreilly/Learning_bash_Shell/0596009658/bash3-CHP-9-SECT-2.html#bash3-CHP-9-FNOTE-10&#34;&gt;[10]&lt;/a&gt; Most debuggers have numerous sophisticated features that help a programmer in dissecting a program, but just about all of them include the ability to step through a running program, stop it at selected places, and examine the values of variables. These simple features are what we will concentrate on providing in our debugger. Specifically, we’ll provide the ability to:&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>some bash exercise for you</title>
      <link>/2011/02/15/some-bash-exercise-for-you/</link>
      <pubDate>Tue, 15 Feb 2011 16:17:38 +0000</pubDate>
      
      <guid>/2011/02/15/some-bash-exercise-for-you/</guid>
      <description>&lt;!--[ad#ad-2]--&gt;
&lt;p&gt;Here is some teaser for you, can you figure out how this works:&lt;/p&gt;
&lt;div class=&#34;codecolorer-container text solarized-light&#34; style=&#34;overflow:auto;white-space:nowrap;width:550px;&#34;&gt;
  &lt;table cellspacing=&#34;0&#34; cellpadding=&#34;0&#34;&gt;
    &lt;tr&gt;
      &lt;td class=&#34;line-numbers&#34;&gt;
        &lt;div&gt;
          1&lt;br /&gt;2&lt;br /&gt;3&lt;br /&gt;
        &lt;/div&gt;
      &lt;/td&gt;
&lt;pre&gt;&lt;code&gt;  &amp;lt;td&amp;gt;
    &amp;lt;div class=&amp;quot;text codecolorer&amp;quot;&amp;gt;
      echo ls&amp;lt;br /&amp;gt; &amp;lt;br /&amp;gt; !!:1-$
    &amp;lt;/div&amp;gt;
  &amp;lt;/td&amp;gt;
&amp;lt;/tr&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
  &lt;/table&gt;
&lt;/div&gt;
&lt;h6 class=&#34;zemanta-related-title&#34; style=&#34;font-size: 1em;&#34;&gt;
  Related articles
&lt;/h6&gt;
&lt;ul class=&#34;zemanta-article-ul&#34;&gt;
  &lt;li class=&#34;zemanta-article-ul-li&#34;&gt;
    &lt;a href=&#34;http://bashshell.net/&#34;&gt;ovigia: #tips: #Bash Shell Scripts and Tutorials | BashShell.net&lt;/a&gt; (bashshell.net)
  &lt;/li&gt;
  &lt;li class=&#34;zemanta-article-ul-li&#34;&gt;
    &lt;a href=&#34;http://blog.amit-agarwal.co.in/2011/01/12/perl-faster-bash-cases/&#34;&gt;perl is faster than bash in some cases.&lt;/a&gt; (amit-agarwal.co.in)
  &lt;/li&gt;
  &lt;li class=&#34;zemanta-article-ul-li&#34;&gt;
    &lt;a href=&#34;http://blog.amit-agarwal.co.in/2011/01/30/bash-math/&#34;&gt;bash math&lt;/a&gt; (amit-agarwal.co.in)
  &lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&#34;zemanta-pixie&#34; style=&#34;margin-top: 10px; height: 15px;&#34;&gt;
  &lt;a class=&#34;zemanta-pixie-a&#34; title=&#34;Enhanced by Zemanta&#34; href=&#34;http://www.zemanta.com/&#34;&gt;&lt;img class=&#34;zemanta-pixie-img&#34; style=&#34;border: medium none; float: right;&#34; src=&#34;https://i1.wp.com/img.zemanta.com/zemified_e.png?w=688&#34; alt=&#34;Enhanced by Zemanta&#34; data-recalc-dims=&#34;1&#34; /&gt;&lt;/a&gt;&lt;span class=&#34;zem-script more-related pretty-attribution&#34;&gt;&lt;/span&gt;
&lt;/div&gt;</description>
    </item>
    
    <item>
      <title>bash regular expressions</title>
      <link>/2011/02/06/bash-regular-expressions/</link>
      <pubDate>Sun, 06 Feb 2011 15:18:15 +0000</pubDate>
      
      <guid>/2011/02/06/bash-regular-expressions/</guid>
      <description>&lt;!--[ad#ad-2]--&gt;
&lt;p&gt;Here are some quick links on bash &lt;a class=&#34;zem_slink&#34; title=&#34;Regular expression&#34; rel=&#34;wikipedia&#34; href=&#34;http://en.wikipedia.org/wiki/Regular_expression&#34;&gt;regular expressions&lt;/a&gt;, pretty good links to bookmark, if you use, regular expressions in bash regularly. I especially like the tldp link at number 3.&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;http://www.linuxjournal.com/content/bash-regular-expressions&#34; target=&#34;_blank&#34;&gt;&lt;a href=&#34;http://www.linuxjournal.com/content/bash-regular-expressions&#34;&gt;http://www.linuxjournal.com/content/bash-regular-expressions&lt;/a&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href=&#34;http://www.ibm.com/developerworks/library/l-bash.html&#34; target=&#34;_blank&#34;&gt;&lt;a href=&#34;http://www.ibm.com/developerworks/library/l-bash.html&#34;&gt;http://www.ibm.com/developerworks/library/l-bash.html&lt;/a&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href=&#34;http://tldp.org/LDP/abs/html/parameter-substitution.html#VARMATCH&#34; target=&#34;_blank&#34;&gt;&lt;a href=&#34;http://tldp.org/LDP/abs/html/parameter-substitution.html#VARMATCH&#34;&gt;http://tldp.org/LDP/abs/html/parameter-substitution.html#VARMATCH&lt;/a&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href=&#34;http://wellington.pm.org/archive/200005/codegen/index9.htm&#34; target=&#34;_blank&#34;&gt;&lt;a href=&#34;http://wellington.pm.org/archive/200005/codegen/index9.htm&#34;&gt;http://wellington.pm.org/archive/200005/codegen/index9.htm&lt;/a&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h6 class=&#34;zemanta-related-title&#34; style=&#34;font-size: 1em;&#34;&gt;
  Related articles
&lt;/h6&gt;
&lt;ul class=&#34;zemanta-article-ul&#34;&gt;
  &lt;li class=&#34;zemanta-article-ul-li&#34;&gt;
    &lt;a href=&#34;http://ask.metafilter.com/172940/Renaming-a-whole-bunch-of-files-at-once-in-bash&#34;&gt;Renaming a whole bunch of files at once, in bash&lt;/a&gt; (ask.metafilter.com)
  &lt;/li&gt;
  &lt;li class=&#34;zemanta-article-ul-li&#34;&gt;
    &lt;a href=&#34;http://blog.amit-agarwal.co.in/2011/01/30/bash-math/&#34;&gt;bash math&lt;/a&gt; (amit-agarwal.co.in)
  &lt;/li&gt;
  &lt;li class=&#34;zemanta-article-ul-li&#34;&gt;
    &lt;a href=&#34;http://www.johndcook.com/blog/2011/01/20/efficiency-of-regular-expressions/&#34;&gt;Efficiency of regular expressions&lt;/a&gt; (johndcook.com)
  &lt;/li&gt;
  &lt;li class=&#34;zemanta-article-ul-li&#34;&gt;
    &lt;a href=&#34;http://www.readwriteweb.com/hack/2011/01/regex-generator.php&#34;&gt;Autogenerate Regular Expressions with txt2re&lt;/a&gt; (readwriteweb.com)
  &lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&#34;zemanta-pixie&#34; style=&#34;margin-top: 10px; height: 15px;&#34;&gt;
  &lt;a class=&#34;zemanta-pixie-a&#34; title=&#34;Enhanced by Zemanta&#34; href=&#34;http://www.zemanta.com/&#34;&gt;&lt;img class=&#34;zemanta-pixie-img&#34; style=&#34;border: medium none; float: right;&#34; src=&#34;https://i1.wp.com/img.zemanta.com/zemified_e.png?w=688&#34; alt=&#34;Enhanced by Zemanta&#34; data-recalc-dims=&#34;1&#34; /&gt;&lt;/a&gt;&lt;span class=&#34;zem-script more-related pretty-attribution&#34;&gt;&lt;/span&gt;
&lt;/div&gt;</description>
    </item>
    
    <item>
      <title>bash mathematical calculators.</title>
      <link>/2011/01/26/bash-mathematical-calculators/</link>
      <pubDate>Tue, 25 Jan 2011 21:46:34 +0000</pubDate>
      
      <guid>/2011/01/26/bash-mathematical-calculators/</guid>
      <description>&lt;!--[ad#ad-2]--&gt;
&lt;p&gt;To start with , the most simple and easy to use should be “bc”. but just for some guys who want to be more experimental, here are few more bash calulator programs. These are completely command line and thus you can completely integrate them in your shell script or use them in shell script to do some really crazy maths calculations.&lt;/p&gt;
&lt;div class=&#34;codecolorer-container text solarized-light&#34; style=&#34;overflow:auto;white-space:nowrap;width:550px;&#34;&gt;
  &lt;table cellspacing=&#34;0&#34; cellpadding=&#34;0&#34;&gt;
    &lt;tr&gt;
      &lt;td class=&#34;line-numbers&#34;&gt;
        &lt;div&gt;
          1&lt;br /&gt;
        &lt;/div&gt;
      &lt;/td&gt;
&lt;pre&gt;&lt;code&gt;  &amp;lt;td&amp;gt;
    &amp;lt;div class=&amp;quot;text codecolorer&amp;quot;&amp;gt;
      sudo yum install calc clac
    &amp;lt;/div&amp;gt;
  &amp;lt;/td&amp;gt;
&amp;lt;/tr&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
  &lt;/table&gt;
&lt;/div&gt;
&lt;p&gt;Lets start with installing these. Before we start, don’t blame and flame me if your favourite is not there in the list. If it is not, better is you drop me  a comment or email, and I will see, if I can include it in the list above, but remember this is only for console based calculators.&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>shopt causes bash completion to stop working.</title>
      <link>/2011/01/25/shopt-bash-completion-stop-working/</link>
      <pubDate>Tue, 25 Jan 2011 02:35:15 +0000</pubDate>
      
      <guid>/2011/01/25/shopt-bash-completion-stop-working/</guid>
      <description>&lt;!--[ad#ad-2]--&gt;
&lt;p&gt;Couple of days, I added some scripts to my &lt;a class=&#34;zem_slink&#34; title=&#34;Bash (Unix shell)&#34; rel=&#34;homepage&#34; href=&#34;http://tiswww.case.edu/php/chet/bash/bashtop.html&#34;&gt;bash&lt;/a&gt; startup and suddenly realized that bash completions stopped working. This is tricky situation in bash to figure out what went wrong. So, I set my foot down to make sure that I find out the &lt;a class=&#34;zem_slink&#34; title=&#34;Culprit&#34; rel=&#34;wikipedia&#34; href=&#34;http://en.wikipedia.org/wiki/Culprit&#34;&gt;culprit&lt;/a&gt;. Thus I started with method of elimination. So, I started with nothing in .bashrc and kept adding my stuff in batches, until the said feature was broken. Once that happened I started removing the added ones, one by one, until my completion started working again.&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Find all the missing paths in the PATH variable in bash script</title>
      <link>/2011/01/20/find-missing-paths-path-variable-bash-script/</link>
      <pubDate>Thu, 20 Jan 2011 02:36:00 +0000</pubDate>
      
      <guid>/2011/01/20/find-missing-paths-path-variable-bash-script/</guid>
      <description>&lt;!--[ad#ad-2]--&gt;
&lt;p&gt;Here is a simple script that will list out all the paths in the PATH variable that do not exist.&lt;/p&gt;
&lt;div class=&#34;codecolorer-container text solarized-light&#34; style=&#34;overflow:auto;white-space:nowrap;width:550px;&#34;&gt;
  &lt;table cellspacing=&#34;0&#34; cellpadding=&#34;0&#34;&gt;
    &lt;tr&gt;
      &lt;td class=&#34;line-numbers&#34;&gt;
        &lt;div&gt;
          1&lt;br /&gt;2&lt;br /&gt;3&lt;br /&gt;4&lt;br /&gt;5&lt;br /&gt;6&lt;br /&gt;7&lt;br /&gt;8&lt;br /&gt;9&lt;br /&gt;10&lt;br /&gt;11&lt;br /&gt;12&lt;br /&gt;13&lt;br /&gt;14&lt;br /&gt;15&lt;br /&gt;16&lt;br /&gt;17&lt;br /&gt;18&lt;br /&gt;19&lt;br /&gt;20&lt;br /&gt;21&lt;br /&gt;22&lt;br /&gt;23&lt;br /&gt;
        &lt;/div&gt;
      &lt;/td&gt;
&lt;pre&gt;&lt;code&gt;  &amp;lt;td&amp;gt;
    &amp;lt;div class=&amp;quot;text codecolorer&amp;quot;&amp;gt;
      #!/bin/bash -&amp;lt;br /&amp;gt; #===============================================================================&amp;lt;br /&amp;gt; #&amp;lt;br /&amp;gt; #          FILE:  wrong_path.sh&amp;lt;br /&amp;gt; #&amp;lt;br /&amp;gt; #         USAGE:  ./wrong_path.sh&amp;lt;br /&amp;gt; #&amp;lt;br /&amp;gt; #   DESCRIPTION:  Show Directories in the PATH Which does NOT Exist&amp;lt;br /&amp;gt; #&amp;lt;br /&amp;gt; #       OPTIONS:  ---&amp;lt;br /&amp;gt; #  REQUIREMENTS:  ---&amp;lt;br /&amp;gt; #          BUGS:  ---&amp;lt;br /&amp;gt; #         NOTES:  ---&amp;lt;br /&amp;gt; #        AUTHOR:  Amit Agarwal (AKA), amit.agarwal@amit-agarwal.co.in&amp;lt;br /&amp;gt; #       COMPANY:  Individual&amp;lt;br /&amp;gt; #       VERSION:  1.0&amp;lt;br /&amp;gt; #       CREATED:  09/20/2009 09:15:48 AM IST&amp;lt;br /&amp;gt; #      REVISION:  ---&amp;lt;br /&amp;gt; #===============================================================================&amp;lt;br /&amp;gt; &amp;lt;br /&amp;gt; set -o nounset                              # Treat unset variables as an error&amp;lt;br /&amp;gt; &amp;lt;br /&amp;gt; (IFS=:;for p in $PATH; do test -d $p || echo $p; done)
    &amp;lt;/div&amp;gt;
  &amp;lt;/td&amp;gt;
&amp;lt;/tr&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
  &lt;/table&gt;
&lt;/div&gt;</description>
    </item>
    
    <item>
      <title>bash 4.0 –  new feature mapfile</title>
      <link>/2011/01/15/bash-40-feature-mapfile/</link>
      <pubDate>Fri, 14 Jan 2011 22:27:15 +0000</pubDate>
      
      <guid>/2011/01/15/bash-40-feature-mapfile/</guid>
      <description>&lt;!--[ad#ad-2]--&gt;
&lt;p&gt;Recently I encountered a problem where I had to create couple of arrays in bash and these were quite dynamic in nature. This script was supposed to be used by couple of guys whom I did not trust too much in opening the script and modifyikng the array. So, the solution was to put these in different files and then put them in array using bash script itself. This is when I went through the bash man page again and found an interesting new inbuilt &lt;strong&gt;&lt;em&gt;mapfile&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>perl is faster than bash in some cases.</title>
      <link>/2011/01/12/perl-faster-bash-cases/</link>
      <pubDate>Tue, 11 Jan 2011 21:45:47 +0000</pubDate>
      
      <guid>/2011/01/12/perl-faster-bash-cases/</guid>
      <description>&lt;!--[ad#ad-2]--&gt;
&lt;p&gt;Some days back, I had to generate some &lt;a class=&#34;zem_slink&#34; title=&#34;Data&#34; rel=&#34;wikipedia&#34; href=&#34;http://en.wikipedia.org/wiki/Data&#34;&gt;data&lt;/a&gt; to be uploaded to a database. As usual I assumed that bash should be faster and hence wrote the script to create the files in bash. But I found that even after 5 hours I was only 10% done with the data generation. Now that would mean that it would take around 50 hours to complete the data generation. Something did not look correct to me and I asked one of my colleague. He suggested I do a &lt;a class=&#34;zem_slink&#34; title=&#34;Strace&#34; rel=&#34;homepage&#34; href=&#34;http://sourceforge.net/projects/strace/&#34;&gt;strace&lt;/a&gt;.&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Shell Scripting</title>
      <link>/2011/01/05/shell-scripting/</link>
      <pubDate>Wed, 05 Jan 2011 15:08:44 +0000</pubDate>
      
      <guid>/2011/01/05/shell-scripting/</guid>
      <description>&lt;!--[ad#ad-2]--&gt;
&lt;p&gt;Here are some links for bash programming that you may find useful.&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;http://tips-linux.net/en/content/pro-bash-programming&#34;&gt;http://tips-linux.net/en/content/pro-bash-programming&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;http://tips-linux.net/en/content/expert-shell-scripting&#34;&gt;http://tips-linux.net/en/content/expert-shell-scripting&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;http://tips-linux.net/en/content/beginning-linux-command-line&#34;&gt;http://tips-linux.net/en/content/beginning-linux-command-line&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;http://tips-linux.net/en/content/bash-pocket-reference&#34;&gt;http://tips-linux.net/en/content/bash-pocket-reference&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;http://tips-linux.net/en/content/linux-command-line-and-shell-scripting-bible&#34;&gt;http://tips-linux.net/en/content/linux-command-line-and-shell-scripting-bible&lt;/a&gt;&lt;/p&gt;
&lt;h6 class=&#34;zemanta-related-title&#34; style=&#34;font-size: 1em;&#34;&gt;
  Related articles
&lt;/h6&gt;
&lt;ul class=&#34;zemanta-article-ul&#34;&gt;
  &lt;li class=&#34;zemanta-article-ul-li&#34;&gt;
    &lt;a href=&#34;http://www.edugeek.net/forums/nix/63944-linux-learning-shell.html&#34;&gt;Linux &amp;#8211; Learning the Shell&lt;/a&gt; (edugeek.net)
  &lt;/li&gt;
  &lt;li class=&#34;zemanta-article-ul-li&#34;&gt;
    &lt;a href=&#34;http://maketecheasier.com/10-useful-tools-websites-tricks-to-master-linux-command/2010/11/09&#34;&gt;10 Useful Tools, Websites And Tricks to Help You Master Linux Command&lt;/a&gt; (maketecheasier.com)
  &lt;/li&gt;
  &lt;li class=&#34;zemanta-article-ul-li&#34;&gt;
    &lt;a href=&#34;http://blog.yjl.im/2010/12/lf-submitsh-bash-mplayer-lastfm.html&#34;&gt;lf-submit.sh &amp;#8211; Bash mplayer Last.fm scrobbler&lt;/a&gt; (yjl.im)
  &lt;/li&gt;
  &lt;li class=&#34;zemanta-article-ul-li&#34;&gt;
    &lt;a href=&#34;http://blog.interstellr.com/linux-command-line-tricks-you-need-to-know-io&#34;&gt;Linux command line tricks you need to know: IO redirection and piping&lt;/a&gt; (interstellr.com)
  &lt;/li&gt;
  &lt;li class=&#34;zemanta-article-ul-li&#34;&gt;
    &lt;a href=&#34;http://houcemhachicha.blogspot.com/2010/07/my-top-ten-shellbash-tricks.html&#34;&gt;imabonehead: Houcem HACHICHA&amp;#8217;s Blog: My top ten shell/bash tricks!&lt;/a&gt; (houcemhachicha.blogspot.com)
  &lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&#34;zemanta-pixie&#34; style=&#34;margin-top: 10px; height: 15px;&#34;&gt;
  &lt;a class=&#34;zemanta-pixie-a&#34; title=&#34;Enhanced by Zemanta&#34; href=&#34;http://www.zemanta.com/&#34;&gt;&lt;img class=&#34;zemanta-pixie-img&#34; style=&#34;border: medium none; float: right;&#34; src=&#34;https://i1.wp.com/img.zemanta.com/zemified_e.png?w=688&#34; alt=&#34;Enhanced by Zemanta&#34; data-recalc-dims=&#34;1&#34; /&gt;&lt;/a&gt;&lt;span class=&#34;zem-script more-related pretty-attribution&#34;&gt;&lt;/span&gt;
&lt;/div&gt;</description>
    </item>
    
    <item>
      <title>Execute a command with a timeout</title>
      <link>/2010/12/29/execute-command-timeout/</link>
      <pubDate>Wed, 29 Dec 2010 15:03:18 +0000</pubDate>
      
      <guid>/2010/12/29/execute-command-timeout/</guid>
      <description>&lt;div class=&#34;zemanta-img&#34; style=&#34;margin: 1em; display: block;&#34;&gt;
  &lt;div&gt;
    &lt;dl class=&#34;wp-caption alignright&#34; style=&#34;width: 310px;&#34;&gt;
      &lt;dt class=&#34;wp-caption-dt&#34;&gt;
        &lt;a href=&#34;http://commons.wikipedia.org/wiki/File:Ubuntu_logo.svg&#34;&gt;&lt;img title=&#34;Official Ubuntu circle with wordmark. Replace ...&#34; src=&#34;http://upload.wikimedia.org/wikipedia/commons/thumb/9/9d/Ubuntu_logo.svg/300px-Ubuntu_logo.svg.png&#34; alt=&#34;Official Ubuntu circle with wordmark. Replace ...&#34; width=&#34;300&#34; height=&#34;70&#34; /&gt;&lt;/a&gt;
      &lt;/dt&gt;
&lt;pre&gt;&lt;code&gt;  &amp;lt;dd class=&amp;quot;wp-caption-dd zemanta-img-attribution&amp;quot; style=&amp;quot;font-size: 0.8em;&amp;quot;&amp;gt;
    Image via &amp;lt;a href=&amp;quot;http://commons.wikipedia.org/wiki/File:Ubuntu_logo.svg&amp;quot;&amp;gt;Wikipedia&amp;lt;/a&amp;gt;
  &amp;lt;/dd&amp;gt;
&amp;lt;/dl&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;!--[ad#ad-2]--&gt;
&lt;p&gt;Execute a command with a timeout&lt;/p&gt;
&lt;div class=&#34;codecolorer-container text solarized-light&#34; style=&#34;overflow:auto;white-space:nowrap;width:550px;&#34;&gt;
  &lt;table cellspacing=&#34;0&#34; cellpadding=&#34;0&#34;&gt;
    &lt;tr&gt;
      &lt;td class=&#34;line-numbers&#34;&gt;
        &lt;div&gt;
          1&lt;br /&gt;
        &lt;/div&gt;
      &lt;/td&gt;
&lt;pre&gt;&lt;code&gt;  &amp;lt;td&amp;gt;
    &amp;lt;div class=&amp;quot;text codecolorer&amp;quot;&amp;gt;
      &amp;amp;nbsp;timelimit -t100 somecommand
    &amp;lt;/div&amp;gt;
  &amp;lt;/td&amp;gt;
&amp;lt;/tr&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
  &lt;/table&gt;
&lt;/div&gt;
&lt;p&gt;I found this in &lt;a class=&#34;zem_slink&#34; title=&#34;Ubuntu (operating system)&#34; rel=&#34;homepage&#34; href=&#34;http://www.ubuntu.com/&#34;&gt;Ubuntu&lt;/a&gt; repos, and consider it better than timeout.&lt;/p&gt;
&lt;p&gt;* View this command to comment, vote or add to favourites * View all commands by CodSpirit&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>write the output of a command to /var/log/user.log… each line will contain $USER, making this easy to grep for.</title>
      <link>/2010/12/28/write-output-command-varloguserlog-line-user-making-easy-grep/</link>
      <pubDate>Tue, 28 Dec 2010 15:00:24 +0000</pubDate>
      
      <guid>/2010/12/28/write-output-command-varloguserlog-line-user-making-easy-grep/</guid>
      <description>&lt;!--[ad#ad-2]--&gt;
&lt;p&gt;write the &lt;a class=&#34;zem_slink&#34; title=&#34;Output&#34; rel=&#34;wikipedia&#34; href=&#34;http://en.wikipedia.org/wiki/Output&#34;&gt;output&lt;/a&gt; of a &lt;a class=&#34;zem_slink&#34; title=&#34;Command (computing)&#34; rel=&#34;wikipedia&#34; href=&#34;http://en.wikipedia.org/wiki/Command_%28computing%29&#34;&gt;command&lt;/a&gt; to /var/log/user.log… each line will contain $USER, making this easy to &lt;a class=&#34;zem_slink&#34; title=&#34;Grep&#34; rel=&#34;wikipedia&#34; href=&#34;http://en.wikipedia.org/wiki/Grep&#34;&gt;grep&lt;/a&gt; for.&lt;/p&gt;
&lt;div class=&#34;codecolorer-container text solarized-light&#34; style=&#34;overflow:auto;white-space:nowrap;width:550px;&#34;&gt;
  &lt;table cellspacing=&#34;0&#34; cellpadding=&#34;0&#34;&gt;
    &lt;tr&gt;
      &lt;td class=&#34;line-numbers&#34;&gt;
        &lt;div&gt;
          1&lt;br /&gt;
        &lt;/div&gt;
      &lt;/td&gt;
&lt;pre&gt;&lt;code&gt;  &amp;lt;td&amp;gt;
    &amp;lt;div class=&amp;quot;text codecolorer&amp;quot;&amp;gt;
      &amp;amp;nbsp;log() { (echo &amp;quot;$ $@&amp;quot;;$@) | logger -t $USER; }
    &amp;lt;/div&amp;gt;
  &amp;lt;/td&amp;gt;
&amp;lt;/tr&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
  &lt;/table&gt;
&lt;/div&gt;
&lt;p&gt;This command is useful if you want to copy the output of a series of commands to a file, for example if you want to pastebin the output from ‘&lt;a class=&#34;zem_slink&#34; title=&#34;Uname&#34; rel=&#34;wikipedia&#34; href=&#34;http://en.wikipedia.org/wiki/Uname&#34;&gt;uname&lt;/a&gt; -a’, ‘lspci -vvv’ and ‘lsmod’ for video driver trouble-shooting on your favorite &lt;a class=&#34;zem_slink&#34; title=&#34;Linux&#34; rel=&#34;homepage&#34; href=&#34;http://www.kernel.org/&#34;&gt;Linux&lt;/a&gt; forum.&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Bash Script Beautifier</title>
      <link>/2010/12/23/bash-script-beautifier/</link>
      <pubDate>Thu, 23 Dec 2010 14:51:01 +0000</pubDate>
      
      <guid>/2010/12/23/bash-script-beautifier/</guid>
      <description>&lt;div class=&#34;zemanta-img&#34; style=&#34;margin: 1em; display: block;&#34;&gt;
  &lt;div&gt;
    &lt;dl class=&#34;wp-caption alignright&#34; style=&#34;width: 266px;&#34;&gt;
      &lt;dt class=&#34;wp-caption-dt&#34;&gt;
        &lt;a href=&#34;http://en.wikipedia.org/wiki/File:Bash-org.png&#34;&gt;&lt;img title=&#34;Bash (Unix shell)&#34; src=&#34;http://upload.wikimedia.org/wikipedia/en/4/41/Bash-org.png&#34; alt=&#34;Bash (Unix shell)&#34; width=&#34;256&#34; height=&#34;108&#34; /&gt;&lt;/a&gt;
      &lt;/dt&gt;
&lt;pre&gt;&lt;code&gt;  &amp;lt;dd class=&amp;quot;wp-caption-dd zemanta-img-attribution&amp;quot; style=&amp;quot;font-size: 0.8em;&amp;quot;&amp;gt;
    Image via &amp;lt;a href=&amp;quot;http://en.wikipedia.org/wiki/File:Bash-org.png&amp;quot;&amp;gt;Wikipedia&amp;lt;/a&amp;gt;
  &amp;lt;/dd&amp;gt;
&amp;lt;/dl&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;!--[ad#ad-2]--&gt;
&lt;p&gt;Today I was working on a bash script written by someone else. And the script was maintained since long and had actually become quite big and there was no indentation followed. So, you can understand how difficult it was to understand the script. So, I set my foot forth to first find a beautifier for the bash script before I fixed it and my search ended here.&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Take a screenshot of the window the user clicks on and name the file the same as the window title</title>
      <link>/2010/12/19/screenshot-window-user-clicks-file-window-title/</link>
      <pubDate>Sun, 19 Dec 2010 14:45:06 +0000</pubDate>
      
      <guid>/2010/12/19/screenshot-window-user-clicks-file-window-title/</guid>
      <description>&lt;!--[ad#ad-2]--&gt;
&lt;p&gt;Take a screenshot of the window the user clicks on and name the file the same as the window title&lt;/p&gt;
&lt;div class=&#34;codecolorer-container text solarized-light&#34; style=&#34;overflow:auto;white-space:nowrap;width:550px;&#34;&gt;
  &lt;table cellspacing=&#34;0&#34; cellpadding=&#34;0&#34;&gt;
    &lt;tr&gt;
      &lt;td class=&#34;line-numbers&#34;&gt;
        &lt;div&gt;
          1&lt;br /&gt;
        &lt;/div&gt;
      &lt;/td&gt;
&lt;pre&gt;&lt;code&gt;  &amp;lt;td&amp;gt;
    &amp;lt;div class=&amp;quot;text codecolorer&amp;quot;&amp;gt;
      &amp;amp;nbsp;sleep 4; xwd &amp;gt;foo.xwd; mv foo.xwd &amp;quot;$(dd skip=100 if=foo.xwd bs=1 count=256 2&amp;gt;/dev/null | egrep -ao &#39;^[[:print:]]+&#39; | tr / :).xwd&amp;quot;
    &amp;lt;/div&amp;gt;
  &amp;lt;/td&amp;gt;
&amp;lt;/tr&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
  &lt;/table&gt;
&lt;/div&gt;
&lt;p&gt;In general, this is actually not better than the “scrot -d4” command I’m listing it as an alternative to, so please don’t vote it down for that. I’m adding this command because xwd (X window dumper) comes with X11, so it is already installed on your machine, whereas scrot probably is not. I’ve found xwd handy on boxen that I don’t want to (or am not allowed to) install packages on.&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>The Hidden PS</title>
      <link>/2010/11/27/hidden-ps/</link>
      <pubDate>Sat, 27 Nov 2010 03:54:37 +0000</pubDate>
      
      <guid>/2010/11/27/hidden-ps/</guid>
      <description>&lt;!--[ad#ad-2]--&gt;
&lt;div class=&#34;codecolorer-container text solarized-light&#34; style=&#34;overflow:auto;white-space:nowrap;width:550px;&#34;&gt;
  &lt;table cellspacing=&#34;0&#34; cellpadding=&#34;0&#34;&gt;
    &lt;tr&gt;
      &lt;td class=&#34;line-numbers&#34;&gt;
        &lt;div&gt;
          1&lt;br /&gt;
        &lt;/div&gt;
      &lt;/td&gt;
&lt;pre&gt;&lt;code&gt;  &amp;lt;td&amp;gt;
    &amp;lt;div class=&amp;quot;text codecolorer&amp;quot;&amp;gt;
      &amp;amp;nbsp;for p in `ps L|cut -d&#39; &#39; -f1`;do echo -e &amp;quot;`tput clear;read -p$p -n1 p`&amp;quot;;ps wwo pid:6,user:8,comm:10,$p kpid -A;done
    &amp;lt;/div&amp;gt;
  &amp;lt;/td&amp;gt;
&amp;lt;/tr&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
  &lt;/table&gt;
&lt;/div&gt;
&lt;p&gt;While going through the &lt;a class=&#34;zem_slink&#34; title=&#34;Source code&#34; rel=&#34;wikipedia&#34; href=&#34;http://en.wikipedia.org/wiki/Source_code&#34;&gt;source code&lt;/a&gt; for the well known ps command, I read about some interesting things.. Namely, that there are a bunch of different fields that ps can try and enumerate for you. These are fields I was not able to find in the &lt;a class=&#34;zem_slink&#34; title=&#34;Man page&#34; rel=&#34;wikipedia&#34; href=&#34;http://en.wikipedia.org/wiki/Man_page&#34;&gt;man pages&lt;/a&gt;, documentation, only in the source.&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Make any command read line enabled (on *nix)</title>
      <link>/2010/11/25/command-read-line-enabled-nix/</link>
      <pubDate>Thu, 25 Nov 2010 04:02:18 +0000</pubDate>
      
      <guid>/2010/11/25/command-read-line-enabled-nix/</guid>
      <description>&lt;!--[ad#ad-2]--&gt;
&lt;p&gt;Make any command read line enabled (on *nix)&lt;/p&gt;
&lt;div class=&#34;codecolorer-container text solarized-light&#34; style=&#34;overflow:auto;white-space:nowrap;width:550px;&#34;&gt;
  &lt;table cellspacing=&#34;0&#34; cellpadding=&#34;0&#34;&gt;
    &lt;tr&gt;
      &lt;td class=&#34;line-numbers&#34;&gt;
        &lt;div&gt;
          1&lt;br /&gt;
        &lt;/div&gt;
      &lt;/td&gt;
&lt;pre&gt;&lt;code&gt;  &amp;lt;td&amp;gt;
    &amp;lt;div class=&amp;quot;text codecolorer&amp;quot;&amp;gt;
      rlwrap sqlite3 database.db
    &amp;lt;/div&amp;gt;
  &amp;lt;/td&amp;gt;
&amp;lt;/tr&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
  &lt;/table&gt;
&lt;/div&gt;
&lt;p&gt;Enable &lt;a class=&#34;zem_slink&#34; title=&#34;GNU readline&#34; rel=&#34;homepage&#34; href=&#34;http://tiswww.tis.case.edu/%7Echet/readline/rltop.html&#34;&gt;readline&lt;/a&gt; even if the &lt;a class=&#34;zem_slink&#34; title=&#34;Command-line interface&#34; rel=&#34;wikipedia&#34; href=&#34;http://en.wikipedia.org/wiki/Command-line_interface&#34;&gt;command line&lt;/a&gt; application is not using it.&lt;/p&gt;
&lt;p&gt;* View this command to comment, vote or add to favourites * View all commands by pykler&lt;/p&gt;
&lt;p&gt;commandlinefu.com&lt;/p&gt;
&lt;p&gt;by David Winterbottom (codeinthehole.com)&lt;/p&gt;
&lt;p&gt;&lt;a class=&#34;zem_slink&#34; title=&#34;Uniform Resource Locator&#34; rel=&#34;wikipedia&#34; href=&#34;http://en.wikipedia.org/wiki/Uniform_Resource_Locator&#34;&gt;URL&lt;/a&gt;: &lt;a href=&#34;http://feedproxy.google.com/~r/Command-line-fu/~3/mKEgYoyHCMA/make-any-command-read-line-enabled-on-nix&#34;&gt;http://feedproxy.google.com/~r/Command-line-fu/~3/mKEgYoyHCMA/make-any-command-read-line-enabled-on-nix&lt;/a&gt;&lt;/p&gt;
&lt;h6 class=&#34;zemanta-related-title&#34; style=&#34;font-size: 1em;&#34;&gt;
  Related articles
&lt;/h6&gt;
&lt;ul class=&#34;zemanta-article-ul&#34;&gt;
  &lt;li class=&#34;zemanta-article-ul-li&#34;&gt;
    &lt;a href=&#34;http://blog.amit-agarwal.co.in/2010/09/01/commands-output-input-command-piping-bind-key-sequence-bash/&#34;&gt;Use the last command&amp;#8217;s output as input to a command without piping and bind to it to a key sequence in bash.&lt;/a&gt; (amit-agarwal.co.in)
  &lt;/li&gt;
  &lt;li class=&#34;zemanta-article-ul-li&#34;&gt;
    &lt;a href=&#34;http://www.kungfugrippe.com/post/929042234/dterm&#34;&gt;DTerm: A command line anywhere and everywhere Oh, man. DTerm =&amp;#8230;&lt;/a&gt; (kungfugrippe.com)
  &lt;/li&gt;
  &lt;li class=&#34;zemanta-article-ul-li&#34;&gt;
    &lt;a href=&#34;http://hackerz4u.com/python/python-command-line-linux-bash-command-line/&#34;&gt;Python command line = Linux Bash command line&lt;/a&gt; (hackerz4u.com)
  &lt;/li&gt;
  &lt;li class=&#34;zemanta-article-ul-li&#34;&gt;
    &lt;a href=&#34;http://infosthetics.com/archives/2010/10/data_hacks_ascii_bar_charts.html&#34;&gt;Data Hacks: Command Line ASCII Bar Charts&lt;/a&gt; (infosthetics.com)
  &lt;/li&gt;
  &lt;li class=&#34;zemanta-article-ul-li&#34;&gt;
    &lt;a href=&#34;http://www.readwriteweb.com/hack/2010/09/commandlinefu-linux-command-he.php&#34;&gt;Hack of the Day: commandlinefu &amp;#8211; Linux Command Heaven&lt;/a&gt; (readwriteweb.com)
  &lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&#34;zemanta-pixie&#34; style=&#34;margin-top: 10px; height: 15px;&#34;&gt;
  &lt;a class=&#34;zemanta-pixie-a&#34; title=&#34;Enhanced by Zemanta&#34; href=&#34;http://www.zemanta.com/&#34;&gt;&lt;img class=&#34;zemanta-pixie-img&#34; style=&#34;border: medium none; float: right;&#34; src=&#34;https://i1.wp.com/img.zemanta.com/zemified_e.png?w=688&#34; alt=&#34;Enhanced by Zemanta&#34; data-recalc-dims=&#34;1&#34; /&gt;&lt;/a&gt;&lt;span class=&#34;zem-script more-related pretty-attribution&#34;&gt;&lt;/span&gt;
&lt;/div&gt;</description>
    </item>
    
    <item>
      <title>intercept stdout/stderr of another process or disowned process</title>
      <link>/2010/11/23/intercept-stdoutstderr-process-disowned-process/</link>
      <pubDate>Tue, 23 Nov 2010 12:51:27 +0000</pubDate>
      
      <guid>/2010/11/23/intercept-stdoutstderr-process-disowned-process/</guid>
      <description>&lt;!--[ad#ad-2]--&gt;
&lt;p&gt;The command is definately going to save your day if you have &lt;a class=&#34;zem_slink&#34; title=&#34;Disownment&#34; rel=&#34;wikipedia&#34; href=&#34;http://en.wikipedia.org/wiki/Disownment&#34;&gt;disowned&lt;/a&gt; the process by mistake. Only uses &lt;a class=&#34;zem_slink&#34; title=&#34;Strace&#34; rel=&#34;homepage&#34; href=&#34;http://sourceforge.net/projects/strace/&#34;&gt;strace&lt;/a&gt; so might as &lt;a class=&#34;zem_slink&#34; title=&#34;Well intervention&#34; rel=&#34;wikipedia&#34; href=&#34;http://en.wikipedia.org/wiki/Well_intervention&#34;&gt;well work&lt;/a&gt; on &lt;a class=&#34;zem_slink&#34; title=&#34;Solaris (operating system)&#34; rel=&#34;homepage&#34; href=&#34;http://oracle.com/solaris&#34;&gt;Solaris&lt;/a&gt; also, though not tried it.&lt;/p&gt;
&lt;p&gt;intercept stdout/&lt;a class=&#34;zem_slink&#34; title=&#34;Standard streams&#34; rel=&#34;wikipedia&#34; href=&#34;http://en.wikipedia.org/wiki/Standard_streams&#34;&gt;stderr&lt;/a&gt; of another process or disowned process&lt;/p&gt;
&lt;div class=&#34;codecolorer-container text solarized-light&#34; style=&#34;overflow:auto;white-space:nowrap;width:550px;&#34;&gt;
  &lt;table cellspacing=&#34;0&#34; cellpadding=&#34;0&#34;&gt;
    &lt;tr&gt;
      &lt;td class=&#34;line-numbers&#34;&gt;
        &lt;div&gt;
          1&lt;br /&gt;
        &lt;/div&gt;
      &lt;/td&gt;
&lt;pre&gt;&lt;code&gt;  &amp;lt;td&amp;gt;
    &amp;lt;div class=&amp;quot;text codecolorer&amp;quot;&amp;gt;
      strace -e write=1,2 -p $PID 2&amp;gt;&amp;amp;1 | sed -un &amp;quot;/^ |/p&amp;quot; | sed -ue &amp;quot;s/^.{9 }(.{50}).+/1/g&amp;quot; -e &#39;s/ //g&#39; | xxd -r -p
    &amp;lt;/div&amp;gt;
  &amp;lt;/td&amp;gt;
&amp;lt;/tr&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
  &lt;/table&gt;
&lt;/div&gt;
&lt;p&gt;Useful to recover a output(stdout and stderr) “disown”ed or “&lt;a class=&#34;zem_slink&#34; title=&#34;Nohup&#34; rel=&#34;wikipedia&#34; href=&#34;http://en.wikipedia.org/wiki/Nohup&#34;&gt;nohup&lt;/a&gt;“ep process of other instance of ssh.&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Broadcast your shell thru port 5000</title>
      <link>/2010/11/20/broadcast-shell-port-5000/</link>
      <pubDate>Sat, 20 Nov 2010 12:47:31 +0000</pubDate>
      
      <guid>/2010/11/20/broadcast-shell-port-5000/</guid>
      <description>&lt;!--[ad#ad-2]--&gt;
&lt;p&gt;Broadcast your shell thru port 5000&lt;/p&gt;
&lt;div class=&#34;codecolorer-container text solarized-light&#34; style=&#34;overflow:auto;white-space:nowrap;width:550px;&#34;&gt;
  &lt;table cellspacing=&#34;0&#34; cellpadding=&#34;0&#34;&gt;
    &lt;tr&gt;
      &lt;td class=&#34;line-numbers&#34;&gt;
        &lt;div&gt;
          1&lt;br /&gt;
        &lt;/div&gt;
      &lt;/td&gt;
&lt;pre&gt;&lt;code&gt;  &amp;lt;td&amp;gt;
    &amp;lt;div class=&amp;quot;text codecolorer&amp;quot;&amp;gt;
      mkfifo /tmp/fifo;(nc -q0 -l 5000 &amp;lt; /tmp/fifo &amp;amp;);script -f /tmp/fifo
    &amp;lt;/div&amp;gt;
  &amp;lt;/td&amp;gt;
&amp;lt;/tr&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
  &lt;/table&gt;
&lt;/div&gt;
&lt;p&gt;run&lt;/p&gt;
&lt;div class=&#34;codecolorer-container text solarized-light&#34; style=&#34;overflow:auto;white-space:nowrap;width:550px;&#34;&gt;
  &lt;table cellspacing=&#34;0&#34; cellpadding=&#34;0&#34;&gt;
    &lt;tr&gt;
      &lt;td class=&#34;line-numbers&#34;&gt;
        &lt;div&gt;
          1&lt;br /&gt;
        &lt;/div&gt;
      &lt;/td&gt;
&lt;pre&gt;&lt;code&gt;  &amp;lt;td&amp;gt;
    &amp;lt;div class=&amp;quot;text codecolorer&amp;quot;&amp;gt;
      nc yourip 5000
    &amp;lt;/div&amp;gt;
  &amp;lt;/td&amp;gt;
&amp;lt;/tr&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
  &lt;/table&gt;
&lt;/div&gt;
&lt;p&gt;elsewhere will produce an exact same mirror of your shell. This is handy when you want to show someone else some amazing stuff in your shell without giving them control over it.&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Screen enable/disable logging in all windows</title>
      <link>/2010/11/19/screen-enabledisable-loggin-windows/</link>
      <pubDate>Fri, 19 Nov 2010 15:13:30 +0000</pubDate>
      
      <guid>/2010/11/19/screen-enabledisable-loggin-windows/</guid>
      <description>&lt;!--[ad#ad-2]--&gt;
&lt;p&gt;If you use screen command a lot then this is something that you will like 🙂&lt;/p&gt;
&lt;p&gt;Screen &lt;a class=&#34;zem_slink&#34; title=&#34;GUI widget&#34; rel=&#34;wikipedia&#34; href=&#34;http://en.wikipedia.org/wiki/GUI_widget&#34;&gt;enable/disable&lt;/a&gt; loggin in all windows&lt;/p&gt;
&lt;div class=&#34;codecolorer-container text solarized-light&#34; style=&#34;overflow:auto;white-space:nowrap;width:550px;&#34;&gt;
  &lt;table cellspacing=&#34;0&#34; cellpadding=&#34;0&#34;&gt;
    &lt;tr&gt;
      &lt;td class=&#34;line-numbers&#34;&gt;
        &lt;div&gt;
          1&lt;br /&gt;2&lt;br /&gt;3&lt;br /&gt;
        &lt;/div&gt;
      &lt;/td&gt;
&lt;pre&gt;&lt;code&gt;  &amp;lt;td&amp;gt;
    &amp;lt;div class=&amp;quot;text codecolorer&amp;quot;&amp;gt;
      bindkey ^l at &amp;quot;#&amp;quot; log on&amp;lt;br /&amp;gt; &amp;lt;br /&amp;gt; bindkey ^o at &amp;quot;#&amp;quot; log off
    &amp;lt;/div&amp;gt;
  &amp;lt;/td&amp;gt;
&amp;lt;/tr&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
  &lt;/table&gt;
&lt;/div&gt;
&lt;p&gt;The command when added in screenrc enables logging all open windows by using the C-l (control-l &lt;a class=&#34;zem_slink&#34; title=&#34;Keyboard shortcut&#34; rel=&#34;wikipedia&#34; href=&#34;http://en.wikipedia.org/wiki/Keyboard_shortcut&#34;&gt;key combination&lt;/a&gt;) and disable by C-o . The lines need to be added in separate lines .&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>function for copy files with progress bar (using pv – pipe viewer)</title>
      <link>/2010/11/11/function-copy-files-progress-bar-pv-pipe-viewer/</link>
      <pubDate>Thu, 11 Nov 2010 03:43:43 +0000</pubDate>
      
      <guid>/2010/11/11/function-copy-files-progress-bar-pv-pipe-viewer/</guid>
      <description>&lt;!--[ad#ad-2]--&gt;
&lt;p&gt;function for copy &lt;a class=&#34;zem_slink&#34; title=&#34;Computer file&#34; rel=&#34;wikipedia&#34; href=&#34;http://en.wikipedia.org/wiki/Computer_file&#34;&gt;files&lt;/a&gt; with &lt;a class=&#34;zem_slink&#34; title=&#34;Progress bar&#34; rel=&#34;wikipedia&#34; href=&#34;http://en.wikipedia.org/wiki/Progress_bar&#34;&gt;progress bar&lt;/a&gt; (using pv – pipe viewer)&lt;/p&gt;
&lt;div class=&#34;codecolorer-container text solarized-light&#34; style=&#34;overflow:auto;white-space:nowrap;width:550px;&#34;&gt;
  &lt;table cellspacing=&#34;0&#34; cellpadding=&#34;0&#34;&gt;
    &lt;tr&gt;
      &lt;td class=&#34;line-numbers&#34;&gt;
        &lt;div&gt;
          1&lt;br /&gt;
        &lt;/div&gt;
      &lt;/td&gt;
&lt;pre&gt;&lt;code&gt;  &amp;lt;td&amp;gt;
    &amp;lt;div class=&amp;quot;text codecolorer&amp;quot;&amp;gt;
      &amp;amp;nbsp;cp_p() { if [ `echo &amp;quot;$2&amp;quot; | grep &amp;quot;.*/$&amp;quot;` ]; then pv &amp;quot;$1&amp;quot; &amp;gt; &amp;quot;$2&amp;quot;&amp;quot;$1&amp;quot;; else pv &amp;quot;$1&amp;quot; &amp;gt; &amp;quot;$2&amp;quot;/&amp;quot;$1&amp;quot;; fi; }
    &amp;lt;/div&amp;gt;
  &amp;lt;/td&amp;gt;
&amp;lt;/tr&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
  &lt;/table&gt;
&lt;/div&gt;
&lt;p&gt;dont have to type new file name (it copy file under same name) and dont have to use ‘/’ in the end of destination folder (but you can if u want, its &lt;a class=&#34;zem_slink&#34; title=&#34;Idiot proof&#34; rel=&#34;wikipedia&#34; href=&#34;http://en.wikipedia.org/wiki/Idiot_proof&#34;&gt;idiot proof&lt;/a&gt;)&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Print all environment variables, including hidden ones</title>
      <link>/2010/11/09/print-environment-variables-including-hidden/</link>
      <pubDate>Tue, 09 Nov 2010 14:46:15 +0000</pubDate>
      
      <guid>/2010/11/09/print-environment-variables-including-hidden/</guid>
      <description>&lt;!--[ad#ad-2]--&gt;
&lt;p&gt;Print all &lt;a class=&#34;zem_slink&#34; title=&#34;Environment variable&#34; rel=&#34;wikipedia&#34; href=&#34;http://en.wikipedia.org/wiki/Environment_variable&#34;&gt;environment variables&lt;/a&gt;, including hidden ones&lt;/p&gt;
&lt;div class=&#34;codecolorer-container text solarized-light&#34; style=&#34;overflow:auto;white-space:nowrap;width:550px;&#34;&gt;
  &lt;table cellspacing=&#34;0&#34; cellpadding=&#34;0&#34;&gt;
    &lt;tr&gt;
      &lt;td class=&#34;line-numbers&#34;&gt;
        &lt;div&gt;
          1&lt;br /&gt;
        &lt;/div&gt;
      &lt;/td&gt;
&lt;pre&gt;&lt;code&gt;  &amp;lt;td&amp;gt;
    &amp;lt;div class=&amp;quot;text codecolorer&amp;quot;&amp;gt;
      for _a in {A..Z} {a..z};do _z=${!${_a}*};for _i in `eval echo &amp;quot;${_z}&amp;quot;`;do echo -e &amp;quot;$_i: ${!_i}&amp;quot;;done;done|cat -Tsv
    &amp;lt;/div&amp;gt;
  &amp;lt;/td&amp;gt;
&amp;lt;/tr&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
  &lt;/table&gt;
&lt;/div&gt;
&lt;p&gt;This uses some tricks I found while reading the bash &lt;a class=&#34;zem_slink&#34; title=&#34;Man page&#34; rel=&#34;wikipedia&#34; href=&#34;http://en.wikipedia.org/wiki/Man_page&#34;&gt;man page&lt;/a&gt; to enumerate and display all the current environment variables, including those not listed by the ‘&lt;a class=&#34;zem_slink&#34; title=&#34;Env&#34; rel=&#34;wikipedia&#34; href=&#34;http://en.wikipedia.org/wiki/Env&#34;&gt;env&lt;/a&gt;‘ command which according to the bash docs are more for internal use by &lt;a class=&#34;zem_slink&#34; title=&#34;Bash (Unix shell)&#34; rel=&#34;homepage&#34; href=&#34;http://tiswww.case.edu/php/chet/bash/bashtop.html&#34;&gt;BASH&lt;/a&gt;. The main trick is the way bash will list all environment variable names when performing expansion on ${!A*}. Then the eval builtin makes it work in a loop.&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>List all the rpms by size – quick way to find out what is eating your disk space in root partition</title>
      <link>/2010/10/13/list-rpms-size-quick-find-eating-disk-space-root-partition/</link>
      <pubDate>Wed, 13 Oct 2010 20:38:35 +0000</pubDate>
      
      <guid>/2010/10/13/list-rpms-size-quick-find-eating-disk-space-root-partition/</guid>
      <description>&lt;!--[ad#ad-2]--&gt;
&lt;p&gt;Here is a quick command to check the list of installed packages by their size in reverse order. Very useful if you want to remove unwanted rpms just to clean up some space on your disk:&lt;/p&gt;
&lt;div class=&#34;codecolorer-container text solarized-light&#34; style=&#34;overflow:auto;white-space:nowrap;width:550px;&#34;&gt;
  &lt;table cellspacing=&#34;0&#34; cellpadding=&#34;0&#34;&gt;
    &lt;tr&gt;
      &lt;td class=&#34;line-numbers&#34;&gt;
        &lt;div&gt;
          1&lt;br /&gt;
        &lt;/div&gt;
      &lt;/td&gt;
&lt;pre&gt;&lt;code&gt;  &amp;lt;td&amp;gt;
    &amp;lt;div class=&amp;quot;text codecolorer&amp;quot;&amp;gt;
      rpm -q -a --qf &amp;quot;%10{SIZE}\t%{NAME}\n&amp;quot; | sort -k1,1nr |more
    &amp;lt;/div&amp;gt;
  &amp;lt;/td&amp;gt;
&amp;lt;/tr&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
  &lt;/table&gt;
&lt;/div&gt;
&lt;p&gt;Sample output:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;78070452    kernel&lt;br&gt;
78060477    kernel&lt;br&gt;
50708634    jre&lt;br&gt;
50316408    libgcj&lt;br&gt;
48581593    wireshark&lt;br&gt;
47778643    gimp&lt;br&gt;
47674675    jre&lt;br&gt;
47303084    qt-x11&lt;br&gt;
45838912    otrs&lt;br&gt;
45657248    chromium-libs&lt;br&gt;
42070128    wxPython&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Quick tip on zipping logs in real time.</title>
      <link>/2010/10/13/quick-tip-zipping-logs-real-time/</link>
      <pubDate>Wed, 13 Oct 2010 17:57:53 +0000</pubDate>
      
      <guid>/2010/10/13/quick-tip-zipping-logs-real-time/</guid>
      <description>&lt;!--[ad#ad-2]--&gt;
&lt;p&gt;Sometimes, some small things that we don’t actually think can be useful are such useful. I faced this couple of days back when I was working on something and the amount of logs getting generated and the files getting rotated was too fast. If I had to use this for sometime, I needed some script, application or something to make sure that the logs are zipped every few seconds. Finding an application for this would take time and what good is bash if we need to find applications for this. So, a simple bash command did the trick. Most of us would know this but applying it and using it at the right time, was what saved my life. Thanks to bash. Here is the command:&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Resize all the images in directory.</title>
      <link>/2010/10/04/resize-images-directory/</link>
      <pubDate>Mon, 04 Oct 2010 13:17:41 +0000</pubDate>
      
      <guid>/2010/10/04/resize-images-directory/</guid>
      <description>&lt;div class=&#34;zemanta-img&#34; style=&#34;margin: 1em; display: block;&#34;&gt;
  &lt;div&gt;
    &lt;dl class=&#34;wp-caption alignright&#34; style=&#34;width: 310px;&#34;&gt;
      &lt;dt class=&#34;wp-caption-dt&#34;&gt;
        &lt;a href=&#34;http://commons.wikipedia.org/wiki/File:Solmeta_N2_auf_Nikon_D5000_Rueckansicht.JPG&#34;&gt;&lt;img title=&#34;Geotagger &amp;quot;Solmeta N2 Kompass&amp;quot; for N...&#34; src=&#34;http://upload.wikimedia.org/wikipedia/commons/thumb/7/79/Solmeta_N2_auf_Nikon_D5000_Rueckansicht.JPG/300px-Solmeta_N2_auf_Nikon_D5000_Rueckansicht.JPG&#34; alt=&#34;Geotagger &amp;quot;Solmeta N2 Kompass&amp;quot; for N...&#34; width=&#34;300&#34; height=&#34;225&#34; /&gt;&lt;/a&gt;
      &lt;/dt&gt;
&lt;pre&gt;&lt;code&gt;  &amp;lt;dd class=&amp;quot;wp-caption-dd zemanta-img-attribution&amp;quot; style=&amp;quot;font-size: 0.8em;&amp;quot;&amp;gt;
    Image via &amp;lt;a href=&amp;quot;http://commons.wikipedia.org/wiki/File:Solmeta_N2_auf_Nikon_D5000_Rueckansicht.JPG&amp;quot;&amp;gt;Wikipedia&amp;lt;/a&amp;gt;
  &amp;lt;/dd&amp;gt;
&amp;lt;/dl&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;!--[ad#ad-2]--&gt;
&lt;p&gt;When I take a photo with my &lt;a class=&#34;zem_slink&#34; title=&#34;Digital single-lens reflex camera&#34; rel=&#34;wikipedia&#34; href=&#34;http://en.wikipedia.org/wiki/Digital_single-lens_reflex_camera&#34;&gt;DSLR&lt;/a&gt; &lt;a class=&#34;zem_slink&#34; title=&#34;Nikon D5000&#34; rel=&#34;wikipedia&#34; href=&#34;http://en.wikipedia.org/wiki/Nikon_D5000&#34;&gt;Nikon D5000&lt;/a&gt;, the size of the &lt;a class=&#34;zem_slink&#34; title=&#34;Image&#34; rel=&#34;wikipedia&#34; href=&#34;http://en.wikipedia.org/wiki/Image&#34;&gt;image&lt;/a&gt; comes to around 5MB and I know that with my &lt;a class=&#34;zem_slink&#34; title=&#34;Point-and-shoot camera&#34; rel=&#34;wikipedia&#34; href=&#34;http://en.wikipedia.org/wiki/Point-and-shoot_camera&#34;&gt;point and shoot camera&lt;/a&gt; also it does not come to any lesser than 3MB. Definitely this is quite good to keep the images in the same size for use but when it comes to on-line sharing I don’t think this is the size that is required. I guess mosr of the time &lt;a class=&#34;zem_slink&#34; title=&#34;XGA&#34; rel=&#34;wikipedia&#34; href=&#34;http://en.wikipedia.org/wiki/XGA&#34;&gt;1024×768&lt;/a&gt; is sufficient. Even if you are sending the images in email, you cannot afford to send a lot of images of this size even with a gmail account.&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>[Solved] Abbreviations not working in vim</title>
      <link>/2010/10/02/solved-abbreviations-working-vim/</link>
      <pubDate>Sat, 02 Oct 2010 15:17:39 +0000</pubDate>
      
      <guid>/2010/10/02/solved-abbreviations-working-vim/</guid>
      <description>&lt;!--[ad#ad-2]--&gt;
&lt;p&gt;Today I found that abbreviations are not working in vim in my current login. I searched log of blog’s and sill did not find any solution so I decided to take the matters in my hand.&lt;/p&gt;
&lt;p&gt;To start with I &lt;a class=&#34;zem_slink&#34; title=&#34;Disability&#34; rel=&#34;wikipedia&#34; href=&#34;http://en.wikipedia.org/wiki/Disability&#34;&gt;disabled&lt;/a&gt; all the plugin’s by moving my &lt;a class=&#34;zem_slink&#34; title=&#34;WordPress Plugin Directory&#34; rel=&#34;homepage&#34; href=&#34;http://wordpress.org/extend/plugins/&#34;&gt;plugin directory&lt;/a&gt;. This did not help me solve the issue, so the only other option left was to now disable the vimrc file completely. Once I removed the vimrc file, the abbreviations started working.&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>bash script to run a command and take screenshot in every loop.</title>
      <link>/2010/09/24/bash-script-to-run-a-command-and-take-screenshot-in-every-loop/</link>
      <pubDate>Fri, 24 Sep 2010 16:02:14 +0000</pubDate>
      
      <guid>/2010/09/24/bash-script-to-run-a-command-and-take-screenshot-in-every-loop/</guid>
      <description>&lt;!--[ad#ad-2]--&gt;
&lt;p&gt;Couple of days back, I had posted a command to display a stop timer with bash and echo. There I had also put the following gif file:&lt;/p&gt;
&lt;p&gt;&amp;lt;img class=&amp;quot;size-medium wp-image-2555&amp;quot; title=&amp;quot;bash screenshot for the script output&amp;quot; src=&amp;quot;http://blog.amit-agarwal.co.in/wp-content/uploads/2010/09/temp-300x170.gif&amp;quot; alt=&amp;quot;bash screenshot for the script output&amp;quot; width=&amp;quot;300&amp;quot; height=&amp;quot;170&amp;quot; /&amp;gt;&lt;/p&gt;
&lt;p&gt;Here the tricky part was to capture the jpg&amp;amp;#8217;s to create the gif file.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Preparation:&lt;/strong&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Rename the terminal to aka – amit-capture&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Execute the command once with the import command and check the output and jpg&amp;amp;#8217;s&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>bash – echo command with option to display the output on the same line.</title>
      <link>/2010/09/21/bash-echo-command-with-option-to-display-the-output-on-the-same-line/</link>
      <pubDate>Tue, 21 Sep 2010 15:15:05 +0000</pubDate>
      
      <guid>/2010/09/21/bash-echo-command-with-option-to-display-the-output-on-the-same-line/</guid>
      <description>&lt;!--[ad#ad-2]--&gt;
&lt;p&gt;Here is a nice little trick to display the output in the same line :&lt;/p&gt;
&lt;div class=&#34;codecolorer-container bash solarized-light&#34; style=&#34;overflow:auto;white-space:nowrap;width:550px;&#34;&gt;
  &lt;table cellspacing=&#34;0&#34; cellpadding=&#34;0&#34;&gt;
    &lt;tr&gt;
      &lt;td class=&#34;line-numbers&#34;&gt;
        &lt;div&gt;
          1&lt;br /&gt;
        &lt;/div&gt;
      &lt;/td&gt;
&lt;pre&gt;&lt;code&gt;  &amp;lt;td&amp;gt;
    &amp;lt;div class=&amp;quot;bash codecolorer&amp;quot;&amp;gt;
      &amp;amp;nbsp;&amp;lt;span class=&amp;quot;kw3&amp;quot;&amp;gt;echo&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;re5&amp;quot;&amp;gt;-ne&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;st0&amp;quot;&amp;gt;&amp;quot;output\&amp;lt;span class=&amp;quot;es1&amp;quot;&amp;gt;\r&amp;lt;/span&amp;gt;&amp;quot;&amp;lt;/span&amp;gt;
    &amp;lt;/div&amp;gt;
  &amp;lt;/td&amp;gt;
&amp;lt;/tr&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
  &lt;/table&gt;
&lt;/div&gt;
&lt;p&gt;The trick here is simple, first we disable the &amp;lt;a class=&amp;quot;zem_slink&amp;quot; title=&amp;quot;Newline&amp;quot; rel=&amp;quot;wikipedia&amp;quot; href=&amp;quot;http://en.wikipedia.org/wiki/Newline&amp;quot;&amp;gt;newline&lt;/a&gt; printed by &amp;lt;a class=&amp;quot;zem_slink&amp;quot; title=&amp;quot;Echo (command)&amp;quot; rel=&amp;quot;wikipedia&amp;quot; href=&amp;quot;http://en.wikipedia.org/wiki/Echo_%28command%29&amp;quot;&amp;gt;echo command&lt;/a&gt; with the &amp;amp;#8221;&lt;strong&gt;-n&lt;/strong&gt;&amp;amp;#8221; option and then we enable the interpretation of the &amp;lt;a class=&amp;quot;zem_slink&amp;quot; title=&amp;quot;Backslash&amp;quot; rel=&amp;quot;wikipedia&amp;quot; href=&amp;quot;http://en.wikipedia.org/wiki/Backslash&amp;quot;&amp;gt;backslash&lt;/a&gt; characters with the &amp;amp;#8221;&lt;strong&gt;-e&lt;/strong&gt;&amp;amp;#8221; option. As the &amp;amp;#8221;\r&amp;amp;#8221; is used as &amp;lt;a class=&amp;quot;zem_slink&amp;quot; title=&amp;quot;Carriage return&amp;quot; rel=&amp;quot;wikipedia&amp;quot; href=&amp;quot;http://en.wikipedia.org/wiki/Carriage_return&amp;quot;&amp;gt;carriage return&lt;/a&gt; which brings you to the start of the line without the newline (like in &amp;lt;a class=&amp;quot;zem_slink&amp;quot; title=&amp;quot;Typewriter&amp;quot; rel=&amp;quot;wikipedia&amp;quot; href=&amp;quot;http://en.wikipedia.org/wiki/Typewriter&amp;quot;&amp;gt;typewriter&lt;/a&gt;), we will use the same to get the desired effect. So, if you wanted a stopwatch for a 100 seconds on the console then this simple bash &amp;lt;a class=&amp;quot;zem_slink&amp;quot; title=&amp;quot;For loop&amp;quot; rel=&amp;quot;wikipedia&amp;quot; href=&amp;quot;http://en.wikipedia.org/wiki/For_loop&amp;quot;&amp;gt;for loop&lt;/a&gt; would do the same:&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>cURL – Tutorial</title>
      <link>/2010/09/15/curl-tutorial/</link>
      <pubDate>Wed, 15 Sep 2010 07:22:57 +0000</pubDate>
      
      <guid>/2010/09/15/curl-tutorial/</guid>
      <description>&lt;!--[ad#ad-2]--&gt;
&lt;p&gt;Here are linkw to two nice tutorials on curl and how to use curl to login before we try to fetch a page. Hope you find them useful.&lt;br&gt;
&lt;a href=&#34;%5C&#34;&gt;http://curl.haxx.se/docs/httpscripting.html&lt;/a&gt; &lt;a href=&#34;%5C&#34;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;%5C&#34;&gt;http://www.youtube.com/watch?v=XcgQUsorF_8&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;%5C&#34;&gt;http://scriptasy.com/php_11/tutorial-curl-login_44.html&lt;/a&gt;&lt;/p&gt;
&lt;h6 id=&#34;related-articles-by-zemanta-zemanta-related-title&#34;&gt;Related articles by Zemanta {.&amp;quot;zemanta-related-title&amp;quot;}&lt;/h6&gt;
&lt;ul class=&#34;\&amp;quot;zemanta-article-ul\&amp;quot;&#34;&gt;
  &lt;li class=&#34;\&amp;quot;zemanta-article-ul-li\&amp;quot;&#34;&gt;
    &lt;a href=&#34;\&#34;&gt;How To Display Just The HTTP Response Code In CLI Curl&lt;/a&gt; (beerpla.net)
  &lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&#34;zemanta-pixie&#34; style=&#34;margin-top: 10px; height: 15px;&#34;&gt;
  &lt;a class=&#34;zemanta-pixie-a&#34; title=&#34;Enhanced by Zemanta&#34; href=&#34;http://www.zemanta.com/&#34;&gt;&lt;img class=&#34;zemanta-pixie-img&#34; style=&#34;border: medium none; float: right;&#34; src=&#34;https://i1.wp.com/img.zemanta.com/zemified_e.png?w=688&#34; alt=&#34;Enhanced by Zemanta&#34; data-recalc-dims=&#34;1&#34; /&gt;&lt;/a&gt;&lt;span class=&#34;zem-script more-related pretty-attribution&#34;&gt;&lt;/span&gt;
&lt;/div&gt;</description>
    </item>
    
    <item>
      <title>Handy one-liners for SED</title>
      <link>/2010/09/14/handy-oneliners-sed/</link>
      <pubDate>Tue, 14 Sep 2010 07:19:51 +0000</pubDate>
      
      <guid>/2010/09/14/handy-oneliners-sed/</guid>
      <description>&lt;div class=\&#34;zemanta-img\&#34; style=\&#34;margin: 1em; display: block;\&#34;&gt; 
&lt;div&gt;
  &lt;dl class=\&#34;wp-caption alignright\&#34; style=\&#34;width: 310px;\&#34;&gt; &lt;dt class=\&#34;wp-caption-dt\&#34;&gt;&lt;a href=\&#34;http://commons.wikipedia.org/wiki/File:Unix_history-simple.svg\&#34;&gt;&lt;img title=\&#34;A diagram showing the key Unix and Unix-like o...\&#34; src=\&#34;http://upload.wikimedia.org/wikipedia/commons/thumb/7/77/Unix_history-simple.svg/300px-Unix_history-simple.svg.png\&#34; alt=\&#34;A diagram showing the key Unix and Unix-like o...\&#34; width=\&#34;300\&#34; height=\&#34;193\&#34; /&gt;&lt;/a&gt;&lt;/dt&gt; &lt;dd class=\&#34;wp-caption-dd zemanta-img-attribution\&#34; style=\&#34;font-size: 0.8em;\&#34;&gt;Image via &lt;a href=\&#34;http://commons.wikipedia.org/wiki/File:Unix_history-simple.svg\&#34;&gt;Wikipedia&lt;/a&gt;&lt;/dd&gt; &lt;/dl&gt;
&lt;/div&gt;&lt;/div&gt; 
&lt;!--[ad#ad-2]--&gt;
&lt;p&gt;Here are some links to sed one liners, pretty useful if you want to use the power of sed.&lt;/p&gt;
&lt;p&gt;&amp;lt;a href=&amp;quot;http://www.freearchive.org/o/dd1ebea77f64bdef5982d50e868990202b0bf6f21b42e26ebb0ab1011d6ce546&amp;quot;&amp;gt;http://www.freearchive.org/o/dd1ebea77f64bdef5982d50e868990202b0bf6f21b42e26ebb0ab1011d6ce546&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;a href=&amp;quot;http://www.unixguide.net/unix/sedoneliner.shtml&amp;quot;&amp;gt;http://www.unixguide.net/unix/sedoneliner.shtml&lt;/a&gt;&lt;br&gt;
&amp;lt;a href=&amp;quot;http://sed.sourceforge.net/sed1line.txt&amp;quot;&amp;gt;http://sed.sourceforge.net/sed1line.txt&lt;/a&gt; &amp;lt;a href=&amp;quot;http://www.thegeekstuff.com/2010/06/bash-array-tutorial/&amp;quot;&amp;gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;a href=&amp;quot;http://www.thegeekstuff.com/2010/06/bash-array-tutorial/&amp;quot;&amp;gt;http://www.thegeekstuff.com/2010/06/bash-array-tutorial/&lt;/a&gt;&amp;lt;h6 class=&amp;quot;zemanta-related-title&amp;quot; style=&amp;quot;font-size: 1em;&amp;quot;&amp;gt;Related articles by Zemanta&lt;/h6&gt; &amp;lt;ul class=&amp;quot;zemanta-article-ul&amp;quot;&amp;gt; &amp;lt;li class=&amp;quot;zemanta-article-ul-li&amp;quot;&amp;gt;&amp;lt;a href=&amp;quot;http://www.ibm.com/developerworks/linux/library/l-sed1.html&amp;quot;&amp;gt;imabonehead: Common threads: Sed by example, Part 1&lt;/a&gt; (ibm.com)&lt;/li&gt; &amp;lt;li class=&amp;quot;zemanta-article-ul-li&amp;quot;&amp;gt;&amp;lt;a href=&amp;quot;http://www.thegeekstuff.com/2009/11/unix-sed-tutorial-append-insert-replace-and-count-file-lines/&amp;quot;&amp;gt;imabonehead: Unix Sed Tutorial: Append, Insert, Replace, and Count File Lines&lt;/a&gt; (thegeekstuff.com)&lt;/li&gt; &lt;/ul&gt; &amp;lt;div class=&amp;quot;zemanta-pixie&amp;quot; style=&amp;quot;margin-top: 10px; height: 15px;&amp;quot;&amp;gt;&amp;lt;a class=&amp;quot;zemanta-pixie-a&amp;quot; title=&amp;quot;Enhanced by Zemanta&amp;quot; href=&amp;quot;http://www.zemanta.com/&amp;quot;&amp;gt;&amp;lt;img class=&amp;quot;zemanta-pixie-img&amp;quot; style=&amp;quot;border: medium none; float: right;&amp;quot; src=&amp;quot;http://img.zemanta.com/zemified_e.png?x-id=be4d9a3b-c27c-46eb-8b76-2a1aa1900a4e&amp;quot; alt=&amp;quot;Enhanced by Zemanta&amp;quot; /&amp;gt;&lt;/a&gt;&amp;lt;span class=&amp;quot;zem-script more-related pretty-attribution&amp;quot;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Remove some path from the PATH variable temporarily.</title>
      <link>/2010/09/04/remove-path-path-variable-temporarily/</link>
      <pubDate>Sat, 04 Sep 2010 15:02:08 +0000</pubDate>
      
      <guid>/2010/09/04/remove-path-path-variable-temporarily/</guid>
      <description>&lt;!--[ad#ad-2]--&gt;
&lt;p&gt;How many times has it happened to you that you are working on some linux platform (like Fedora/Ubuntu/CentOS etc) and suddenly you see that you need to remove some path from the PATH variable so that a script is executed from some other path. It really difficult to do this if the path is too long and if you end up doing this couple of times. If that is the case, then the below script is for you 🙂&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>tee to a file descriptor</title>
      <link>/2010/08/13/tee-to-a-file-descriptor/</link>
      <pubDate>Fri, 13 Aug 2010 03:22:44 +0000</pubDate>
      
      <guid>/2010/08/13/tee-to-a-file-descriptor/</guid>
      <description>&lt;p&gt;tee to a file descriptor&lt;/a&gt;&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;$ tee &amp;gt;&lt;span class=&#34;o&#34;&gt;(&lt;/span&gt;cat &lt;span class=&#34;p&#34;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&#34;c1&#34;&gt;#8211; &amp;gt;&amp;amp;2)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;the tee command does fine with file names, but not so much with file descriptors, such as &amp;amp;2. This uses process redirection to tee to the specified descriptor.&lt;/p&gt;
&lt;p&gt;In the sample output, it&amp;rsquo;s being used to tee to stderr, which is connected with the terminal, and to wc -l, which is also outputting to the terminal. The result is the output of bash –version followed by the linecount&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Best Mobile Internet Browser (Opera Mini vs. SkyFire)</title>
      <link>/2010/08/07/best-mobile-internet-browser-opera-mini-vs-skyfire/</link>
      <pubDate>Sat, 07 Aug 2010 03:25:18 +0000</pubDate>
      
      <guid>/2010/08/07/best-mobile-internet-browser-opera-mini-vs-skyfire/</guid>
      <description>&lt;!--[ad#ad-2]--&gt;
&lt;p&gt;Showdown: Best Mobile &amp;lt;a class=&amp;quot;zem_slink&amp;quot; title=&amp;quot;Internet&amp;quot; rel=&amp;quot;wikipedia&amp;quot; href=&amp;quot;http://en.wikipedia.org/wiki/Internet&amp;quot;&amp;gt;Internet&lt;/a&gt; Browser (&amp;lt;a class=&amp;quot;zem_slink&amp;quot; title=&amp;quot;Opera Software&amp;quot; rel=&amp;quot;homepage&amp;quot; href=&amp;quot;http://www.opera.com&amp;quot;&amp;gt;Opera&lt;/a&gt; Mini vs. &amp;lt;a class=&amp;quot;zem_slink&amp;quot; title=&amp;quot;Skyfire&amp;quot; rel=&amp;quot;homepage&amp;quot; href=&amp;quot;http://www.skyfire.com&amp;quot;&amp;gt;SkyFire&lt;/a&gt;) mobile internet browsersDo you browse the web on your mobile device? As &amp;lt;a class=&amp;quot;zem_slink&amp;quot; title=&amp;quot;Mobile phone&amp;quot; rel=&amp;quot;wikipedia&amp;quot; href=&amp;quot;http://en.wikipedia.org/wiki/Mobile_phone&amp;quot;&amp;gt;cell phones&lt;/a&gt; get faster connection speeds, processors, bigger screens and better applications, it’s getting easier and easier to go online with them. Add in the fact that most websites have a mobile version now and it makes this an even simpler process.&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>when you press f9 &#39;paste&#39; is on , press f9 again and &#39;paste&#39; is off, and so forth (works in insert-mode and command-mode)</title>
      <link>/2010/08/02/when-you-press-f9-paste-is-on-press-f9-again-and-paste-is-off-and-so-forth-works-in-insert-mode-and-command-mode/</link>
      <pubDate>Mon, 02 Aug 2010 03:20:07 +0000</pubDate>
      
      <guid>/2010/08/02/when-you-press-f9-paste-is-on-press-f9-again-and-paste-is-off-and-so-forth-works-in-insert-mode-and-command-mode/</guid>
      <description>&lt;!--[ad#ad-2]--&gt;
&lt;p&gt;&amp;lt;a class=&amp;quot;zem_slink&amp;quot; title=&amp;quot;Vim (text editor)&amp;quot; rel=&amp;quot;homepage&amp;quot; href=&amp;quot;http://www.vim.org/&amp;quot;&amp;gt;vim&lt;/a&gt;&amp;amp;#8217;s pastetoggle: when you press f9 &amp;amp;#8217;paste&amp;amp;#8217; is on , press f9 again and &amp;amp;#8217;paste&amp;amp;#8217; is off, and so forth (works in &amp;lt;a class=&amp;quot;zem_slink&amp;quot; title=&amp;quot;Insert key&amp;quot; rel=&amp;quot;wikipedia&amp;quot; href=&amp;quot;http://en.wikipedia.org/wiki/Insert_key&amp;quot;&amp;gt;insert-mode&lt;/a&gt; and command-mode) $ nmap :set paste!:set paste? Sets as paste toggle, with visual confirmation of state&lt;/p&gt;
&lt;p&gt;* View this command to comment, vote or add to favourites * View all commands by Vilemirth&lt;/p&gt;
&lt;p&gt;commandlinefu.com&lt;/p&gt;
&lt;p&gt;by David Winterbottom (codeinthehole.com)&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Auto Key press fill forms through simulating key presses | Linux.com</title>
      <link>/2010/07/31/auto-key-press-fill-forms-simulating-key-presses-linuxcom/</link>
      <pubDate>Sat, 31 Jul 2010 03:16:33 +0000</pubDate>
      
      <guid>/2010/07/31/auto-key-press-fill-forms-simulating-key-presses-linuxcom/</guid>
      <description>&lt;!--[ad#ad-2]--&gt;
&lt;p&gt;This script can be used to repeatedly press &amp;lt;a class=&amp;quot;zem_slink&amp;quot; title=&amp;quot;Electronic keyboard&amp;quot; rel=&amp;quot;wikipedia&amp;quot; href=&amp;quot;http://en.wikipedia.org/wiki/Electronic_keyboard&amp;quot;&amp;gt;keys&lt;/a&gt; on the &amp;lt;a class=&amp;quot;zem_slink&amp;quot; title=&amp;quot;Keyboard (computing)&amp;quot; rel=&amp;quot;wikipedia&amp;quot; href=&amp;quot;http://en.wikipedia.org/wiki/Keyboard_%28computing%29&amp;quot;&amp;gt;keyboard&lt;/a&gt;, it was used to fill out 100 odd entries on a &amp;lt;a class=&amp;quot;zem_slink&amp;quot; title=&amp;quot;Web page&amp;quot; rel=&amp;quot;wikipedia&amp;quot; href=&amp;quot;http://en.wikipedia.org/wiki/Web_page&amp;quot;&amp;gt;web page&lt;/a&gt; while testing without having to physically enter the data.&lt;/p&gt;
&lt;p&gt;Save the code below some where like &amp;lt;a class=&amp;quot;zem_slink&amp;quot; title=&amp;quot;Filesystem Hierarchy Standard&amp;quot; rel=&amp;quot;wikipedia&amp;quot; href=&amp;quot;http://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard&amp;quot;&amp;gt;/usr/bin&lt;/a&gt;/ with what ever file name you like, set the file to be &amp;lt;a class=&amp;quot;zem_slink&amp;quot; title=&amp;quot;Executable&amp;quot; rel=&amp;quot;wikipedia&amp;quot; href=&amp;quot;http://en.wikipedia.org/wiki/Executable&amp;quot;&amp;gt;executable&lt;/a&gt; with &amp;lt;a class=&amp;quot;zem_slink&amp;quot; title=&amp;quot;Chmod&amp;quot; rel=&amp;quot;wikipedia&amp;quot; href=&amp;quot;http://en.wikipedia.org/wiki/Chmod&amp;quot;&amp;gt;chmod&lt;/a&gt; +x /usr/bin/keyrepeat&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>List of commands you use most often</title>
      <link>/2010/07/25/list-of-commands-you-use-most-often/</link>
      <pubDate>Sun, 25 Jul 2010 03:53:08 +0000</pubDate>
      
      <guid>/2010/07/25/list-of-commands-you-use-most-often/</guid>
      <description>&lt;!--[ad#ad-2]--&gt;
&lt;p&gt;&lt;tt&gt;$ history | &amp;lt;a class=&amp;quot;zem_slink&amp;quot; title=&amp;quot;AWK&amp;quot; rel=&amp;quot;homepage&amp;quot; href=&amp;quot;http://cm.bell-labs.com/cm/cs/awkbook/index.html&amp;quot;&amp;gt;awk&lt;/a&gt; &#39;{a[$2]++}END{for(i in a){print a[i] &amp;quot; &amp;quot; i}}&#39; | sort -rn | head &amp;gt; /tmp/cmds | &amp;lt;a class=&amp;quot;zem_slink&amp;quot; title=&amp;quot;Gnuplot&amp;quot; rel=&amp;quot;homepage&amp;quot; href=&amp;quot;http://www.gnuplot.info/&amp;quot;&amp;gt;gnuplot&lt;/a&gt; -persist &amp;lt;(echo &#39;plot &amp;quot;/tmp/cmds&amp;quot; using 1:xticlabels(2) with boxes&#39;)&lt;/tt&gt; Plot your most used commands with gnuplot.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&amp;lt;a href=&amp;quot;http://www.commandlinefu.com/commands/view/5845/list-of-commands-you-use-most-often&amp;quot;&amp;gt;View this command to comment, vote or add to favourites&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&amp;lt;a href=&amp;quot;http://feeds2.feedburner.com/commands/by/sthrs&amp;quot;&amp;gt;View all commands by &lt;/a&gt;&lt;strong&gt;&amp;lt;a href=&amp;quot;http://feeds2.feedburner.com/commands/by/sthrs&amp;quot;&amp;gt;sthrs&lt;/a&gt;&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&amp;lt;a href=&amp;quot;http://www.commandlinefu.com&amp;quot;&amp;gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;by David Winterbottom (&amp;lt;a href=&amp;quot;http://codeinthehole.com&amp;quot;&amp;gt;codeinthehole.com&lt;/a&gt;)&lt;/p&gt;
&lt;p&gt;&amp;lt;a href=&amp;quot;http://feedads.g.doubleclick.net/~a/qns5iNy&amp;ndash;6jXLRCLFY_jGnkB68s/0/da&amp;quot;&amp;gt;&lt;/a&gt;&lt;br&gt;
&amp;lt;a href=&amp;quot;http://feedads.g.doubleclick.net/~a/qns5iNy&amp;ndash;6jXLRCLFY_jGnkB68s/1/da&amp;quot;&amp;gt;&lt;/a&gt;&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Bash Examples – Mistakes to Avoid</title>
      <link>/2010/07/23/bash-examples-mistakes-to-avoid/</link>
      <pubDate>Fri, 23 Jul 2010 04:04:34 +0000</pubDate>
      
      <guid>/2010/07/23/bash-examples-mistakes-to-avoid/</guid>
      <description>&lt;!--[ad#ad-2]--&gt;
&lt;p&gt;A bash script is a text file containing a list of commands to be executed by the bash shell. A long time back, I had written a guide on Bash scripting which teaches you the basic syntax of bash scripts in a mere 10 seconds.&lt;/p&gt;
&lt;p&gt;&amp;lt;a href=&amp;quot;http://linuxhelp.blogspot.com/2009/10/bash-examples-mistakes-to-avoid.html&amp;quot; target=&amp;quot;_blank&amp;quot;&amp;gt;Rest here&lt;/a&gt;.&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Paste clipboard is bash or shell scripts with modification.</title>
      <link>/2010/07/20/paste-clipboard-is-bash-or-shell-scripts-with-modification/</link>
      <pubDate>Tue, 20 Jul 2010 03:47:10 +0000</pubDate>
      
      <guid>/2010/07/20/paste-clipboard-is-bash-or-shell-scripts-with-modification/</guid>
      <description>&lt;!--[ad#ad-2]--&gt;
&lt;p&gt;Today I had a issue where I wanted to paste the clipboard to a shell script after removing the spaces. So, I went hunting for a way to do this. Finally I came up with this:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;sudo yum install xclip&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Then you can paste the clipboard content using &amp;amp;#8221;xclip -o&amp;amp;#8221;. So now the problem is reduced to selecting the required info and doing :&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;xclip -o |sed &amp;amp;#8217;s/ //g&amp;amp;#8217;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;or&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Linux command to repeat a string n times - Super User</title>
      <link>/2010/07/20/linux-command-to-repeat-a-string-n-times-super-user/</link>
      <pubDate>Tue, 20 Jul 2010 03:47:09 +0000</pubDate>
      
      <guid>/2010/07/20/linux-command-to-repeat-a-string-n-times-super-user/</guid>
      <description>&lt;!--[ad#ad-2]--&gt;
&lt;p&gt;I was working on something and needed to output the string n times. I have required this even to print a line with &amp;amp;#8217;-&amp;amp;#8217; or &amp;amp;#8217;=&amp;amp;#8217; but this time I badly wanted it in bash. So I searched google and found this:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;printf &amp;amp;#8221;Amit Agarwal%.0s&amp;amp;#8221; {1..5}&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Explanations and other examples: &amp;lt;a href=&amp;quot;http://superuser.com/questions/86340/linux-command-to-repeat-a-string-n-times&amp;quot;&amp;gt;http://superuser.com/questions/86340/linux-command-to-repeat-a-string-n-times&lt;/a&gt;&amp;lt;h6 class=&amp;quot;zemanta-related-title&amp;quot; style=&amp;quot;font-size: 1em;&amp;quot;&amp;gt;Related articles by Zemanta&lt;/h6&gt; &amp;lt;ul class=&amp;quot;zemanta-article-ul&amp;quot;&amp;gt; &amp;lt;li class=&amp;quot;zemanta-article-ul-li&amp;quot;&amp;gt;&amp;lt;a href=&amp;quot;http://www.rateitall.com/i-3177235-flat-rate-us-terminations.aspx&amp;quot;&amp;gt;1 reviews of Flat-Rate US Terminations&lt;/a&gt; (rateitall.com)&lt;/li&gt; &amp;lt;li class=&amp;quot;zemanta-article-ul-li&amp;quot;&amp;gt;&amp;lt;a href=&amp;quot;http://www.brighthub.com/computing/linux/articles/75743.aspx&amp;quot;&amp;gt;Top Linux GUI&lt;/a&gt; (brighthub.com)&lt;/li&gt; &amp;lt;li class=&amp;quot;zemanta-article-ul-li&amp;quot;&amp;gt;&amp;lt;a href=&amp;quot;http://www.gnu.org/software/emacs/tour/&amp;quot;&amp;gt;A guided tour of Emacs&lt;/a&gt; (gnu.org)&lt;/li&gt; &lt;/ul&gt; &amp;lt;div class=&amp;quot;zemanta-pixie&amp;quot; style=&amp;quot;margin-top: 10px; height: 15px;&amp;quot;&amp;gt;&amp;lt;a class=&amp;quot;zemanta-pixie-a&amp;quot; title=&amp;quot;Enhanced by Zemanta&amp;quot; href=&amp;quot;http://www.zemanta.com/&amp;quot;&amp;gt;&amp;lt;img class=&amp;quot;zemanta-pixie-img&amp;quot; style=&amp;quot;border: medium none; float: right;&amp;quot; src=&amp;quot;http://blog.amit-agarwal.co.in/wp-content/uploads/2010/08/zemified_e6.png&amp;quot; alt=&amp;quot;Enhanced by Zemanta&amp;quot; /&amp;gt;&lt;/a&gt;&amp;lt;span class=&amp;quot;zem-script more-related pretty-attribution&amp;quot;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>concatenate compressed and uncompressed logs</title>
      <link>/2010/07/15/concatenate-compressed-and-uncompressed-logs/</link>
      <pubDate>Thu, 15 Jul 2010 02:10:28 +0000</pubDate>
      
      <guid>/2010/07/15/concatenate-compressed-and-uncompressed-logs/</guid>
      <description>&lt;!--[ad#ad-2]--&gt;
&lt;h1 id=&#34;span-stylefont-size-x-largea-hrefhttpfeedproxygooglecomrcommand-line-fu3iwfuyltygjmconcatenate-compressed-and-uncompressed-logsconcatenate-compressed-and-uncompressed-logsaspan&#34;&gt;&lt;strong&gt;&amp;lt;span style=&amp;quot;font-size: x-large;&amp;quot;&amp;gt;&amp;lt;a href=&amp;quot;http://feedproxy.google.com/~r/Command-line-fu/~3/iwFUyltYgjM/concatenate-compressed-and-uncompressed-logs&amp;quot;&amp;gt;concatenate compressed and uncompressed logs&lt;/a&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/h1&gt;
&lt;p&gt;&lt;tt&gt;$ find /var/log/apache2 -name &#39;access.log&lt;em&gt;gz&#39; -exec &amp;lt;a class=&amp;quot;zem_slink freebase/guid/9202a8c04000641f800000000001abd9&amp;quot; title=&amp;quot;Gzip&amp;quot; rel=&amp;quot;homepage&amp;quot; href=&amp;quot;http://www.gzip.org/&amp;quot;&amp;gt;zcat&lt;/a&gt; {} ; -or -name &#39;access.log&lt;/em&gt;&#39; -exec cat {} ;&lt;/tt&gt; This command allows you to stream your log files, including gziped files, into one stream which can be piped to &amp;lt;a class=&amp;quot;zem_slink freebase/guid/9202a8c04000641f800000000000584b&amp;quot; title=&amp;quot;AWK&amp;quot; rel=&amp;quot;homepage&amp;quot; href=&amp;quot;http://cm.bell-labs.com/cm/cs/awkbook/index.html&amp;quot;&amp;gt;awk&lt;/a&gt; or some other command for analysis.&lt;/p&gt;
&lt;p&gt;Note: if your version of &amp;amp;#8217;find&amp;amp;#8217; supports it, use:&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>CLI Color and bash prompt.. some colored fun with prompts in bash</title>
      <link>/2010/06/29/cli-color-and-bash-prompt-some-colored-fun-with-prompts-in-bash/</link>
      <pubDate>Tue, 29 Jun 2010 12:23:10 +0000</pubDate>
      
      <guid>/2010/06/29/cli-color-and-bash-prompt-some-colored-fun-with-prompts-in-bash/</guid>
      <description>&lt;!--[ad#ad-2]--&gt;
&lt;p&gt;There are two ways to do it, one is with tput command. We will see that some other time, today we will consider the escape sequence way.&lt;/p&gt;
&lt;p&gt;First we need to understand the colors as understood by bash. Some time back a fried of mine gave me this little script to find the colors. You can download it &amp;lt;a href=&amp;quot;http://blog.amit-agarwal.co.in/2009/03/bash_colors&amp;quot; target=&amp;quot;_blank&amp;quot;&amp;gt;Script bash colors&lt;/a&gt;. Here is the script&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;#!/bin/bash&lt;/p&gt;
&lt;p&gt;T=&amp;amp;#8217;amit agarwal&amp;amp;#8217;   # The test text&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Getting your wordpress self hosted stats on your console with bash script.</title>
      <link>/2010/06/29/wordpress-hosted-stats-console-bash-script/</link>
      <pubDate>Tue, 29 Jun 2010 12:23:05 +0000</pubDate>
      
      <guid>/2010/06/29/wordpress-hosted-stats-console-bash-script/</guid>
      <description>&lt;p&gt;Some time back I wrote a blog on how to get your site stats using curl in &amp;lt;a class=&amp;quot;zem_slink freebase/en/bash&amp;quot; title=&amp;quot;Bash&amp;quot; rel=&amp;quot;homepage&amp;quot; href=&amp;quot;http://tiswww.case.edu/php/chet/bash/bashtop.html&amp;quot;&amp;gt;bash shell&lt;/a&gt;. Today we will use the same script to get the stats every few seconds on the terminal on the same line, similar to progress meter.&lt;/p&gt;
&lt;p&gt;Here is the script and the description:&lt;/p&gt;
&lt;div class=&#34;codecolorer-container bash solarized-light&#34; style=&#34;overflow:auto;white-space:nowrap;width:550px;&#34;&gt;
  &lt;table cellspacing=&#34;0&#34; cellpadding=&#34;0&#34;&gt;
    &lt;tr&gt;
      &lt;td class=&#34;line-numbers&#34;&gt;
        &lt;div&gt;
          1&lt;br /&gt;2&lt;br /&gt;3&lt;br /&gt;4&lt;br /&gt;5&lt;br /&gt;6&lt;br /&gt;7&lt;br /&gt;8&lt;br /&gt;9&lt;br /&gt;10&lt;br /&gt;11&lt;br /&gt;12&lt;br /&gt;13&lt;br /&gt;14&lt;br /&gt;15&lt;br /&gt;16&lt;br /&gt;17&lt;br /&gt;18&lt;br /&gt;19&lt;br /&gt;20&lt;br /&gt;21&lt;br /&gt;22&lt;br /&gt;23&lt;br /&gt;24&lt;br /&gt;25&lt;br /&gt;26&lt;br /&gt;27&lt;br /&gt;28&lt;br /&gt;29&lt;br /&gt;30&lt;br /&gt;31&lt;br /&gt;
        &lt;/div&gt;
      &lt;/td&gt;
&lt;pre&gt;&lt;code&gt;  &amp;lt;td&amp;gt;
    &amp;lt;div class=&amp;quot;bash codecolorer&amp;quot;&amp;gt;
      &amp;lt;span class=&amp;quot;co0&amp;quot;&amp;gt;#!/bin/bash -&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;span class=&amp;quot;co0&amp;quot;&amp;gt;#===============================================================================&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;span class=&amp;quot;co0&amp;quot;&amp;gt;#&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;span class=&amp;quot;co0&amp;quot;&amp;gt;#          FILE:  update_stats.sh&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;span class=&amp;quot;co0&amp;quot;&amp;gt;#&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;span class=&amp;quot;co0&amp;quot;&amp;gt;#         USAGE:  ./update_stats.sh&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;span class=&amp;quot;co0&amp;quot;&amp;gt;#&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;span class=&amp;quot;co0&amp;quot;&amp;gt;#   DESCRIPTION:  Update the stats inline in shell every $1 seconds.&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;span class=&amp;quot;co0&amp;quot;&amp;gt;#&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;span class=&amp;quot;co0&amp;quot;&amp;gt;#       OPTIONS:  ---&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;span class=&amp;quot;co0&amp;quot;&amp;gt;#  REQUIREMENTS:  ---&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;span class=&amp;quot;co0&amp;quot;&amp;gt;#          BUGS:  ---&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;span class=&amp;quot;co0&amp;quot;&amp;gt;#         NOTES:  ---&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;span class=&amp;quot;co0&amp;quot;&amp;gt;#        AUTHOR:  &amp;lt;a class=&amp;quot;zem_slink&amp;quot; title=&amp;quot;Amit Agarwal&amp;quot; rel=&amp;quot;homepage&amp;quot; href=&amp;quot;http://amit-agarwal.co.in&amp;quot;&amp;gt;Amit Agarwal&amp;lt;/a&amp;gt; (AKA), amit.agarwal@amit-agarwal.co.in&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;span class=&amp;quot;co0&amp;quot;&amp;gt;#       COMPANY:  Individual&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;span class=&amp;quot;co0&amp;quot;&amp;gt;#       VERSION:  1.0&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;span class=&amp;quot;co0&amp;quot;&amp;gt;#       CREATED:  06/21/2010 11:27:16 PM IST&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;span class=&amp;quot;co0&amp;quot;&amp;gt;#      REVISION:  ---&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;span class=&amp;quot;co0&amp;quot;&amp;gt;#===============================================================================&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;br /&amp;gt; &amp;lt;span class=&amp;quot;re2&amp;quot;&amp;gt;sleep_time&amp;lt;/span&amp;gt;=&amp;lt;span class=&amp;quot;nu0&amp;quot;&amp;gt;30&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;co0&amp;quot;&amp;gt;#the time to wait between stats collection&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;span class=&amp;quot;re2&amp;quot;&amp;gt;run_stats&amp;lt;/span&amp;gt;=get_stats  &amp;lt;span class=&amp;quot;co0&amp;quot;&amp;gt;# the script to run to get the stats&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;span class=&amp;quot;re2&amp;quot;&amp;gt;filename&amp;lt;/span&amp;gt;=&amp;lt;span class=&amp;quot;sy0&amp;quot;&amp;gt;/&amp;lt;/span&amp;gt;tmp&amp;lt;span class=&amp;quot;sy0&amp;quot;&amp;gt;/&amp;lt;/span&amp;gt;statpress.html &amp;lt;span class=&amp;quot;co0&amp;quot;&amp;gt;# the filename where the script is storing the html file of your statpress page.&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;span class=&amp;quot;kw3&amp;quot;&amp;gt;eval&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;re1&amp;quot;&amp;gt;$run_stats&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;nu0&amp;quot;&amp;gt;2&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;sy0&amp;quot;&amp;gt;&amp;gt;&amp;lt;&amp;lt;/span&amp;gt;a &amp;lt;span class=&amp;quot;re2&amp;quot;&amp;gt;class&amp;lt;/span&amp;gt;=&amp;lt;span class=&amp;quot;st0&amp;quot;&amp;gt;&amp;quot;zem_slink freebase/en/dev_null&amp;quot;&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;re2&amp;quot;&amp;gt;title&amp;lt;/span&amp;gt;=&amp;lt;span class=&amp;quot;st0&amp;quot;&amp;gt;&amp;quot;/dev/null&amp;quot;&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;re2&amp;quot;&amp;gt;rel&amp;lt;/span&amp;gt;=&amp;lt;span class=&amp;quot;st0&amp;quot;&amp;gt;&amp;quot;wikipedia&amp;quot;&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;re2&amp;quot;&amp;gt;href&amp;lt;/span&amp;gt;=&amp;lt;span class=&amp;quot;st0&amp;quot;&amp;gt;&amp;quot;http://en.wikipedia.org/wiki//dev/null&amp;quot;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;sy0&amp;quot;&amp;gt;&amp;gt;/&amp;lt;/span&amp;gt;dev&amp;lt;span class=&amp;quot;sy0&amp;quot;&amp;gt;/&amp;lt;/span&amp;gt;null&amp;lt;span class=&amp;quot;sy0&amp;quot;&amp;gt;&amp;lt;/&amp;lt;/span&amp;gt;a&amp;lt;span class=&amp;quot;sy0&amp;quot;&amp;gt;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;span class=&amp;quot;kw1&amp;quot;&amp;gt;while&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;br0&amp;quot;&amp;gt;&amp;amp;#40;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;kw2&amp;quot;&amp;gt;true&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;br0&amp;quot;&amp;gt;&amp;amp;#41;&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;span class=&amp;quot;kw1&amp;quot;&amp;gt;do&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;span class=&amp;quot;sy0&amp;quot;&amp;gt;&amp;lt;!&amp;lt;/span&amp;gt;--loginview start--&amp;lt;span class=&amp;quot;sy0&amp;quot;&amp;gt;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;re2&amp;quot;&amp;gt;values&amp;lt;/span&amp;gt;=$&amp;lt;span class=&amp;quot;br0&amp;quot;&amp;gt;&amp;amp;#40;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;kw2&amp;quot;&amp;gt;cat&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;re1&amp;quot;&amp;gt;$filename&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;sy0&amp;quot;&amp;gt;|&amp;lt;/span&amp;gt; w3m &amp;lt;span class=&amp;quot;re5&amp;quot;&amp;gt;-dump&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;re5&amp;quot;&amp;gt;-T&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;sy0&amp;quot;&amp;gt;&amp;lt;&amp;lt;/span&amp;gt;a &amp;lt;span class=&amp;quot;re2&amp;quot;&amp;gt;class&amp;lt;/span&amp;gt;=&amp;lt;span class=&amp;quot;st0&amp;quot;&amp;gt;&amp;quot;zem_slink freebase/en/html&amp;quot;&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;re2&amp;quot;&amp;gt;title&amp;lt;/span&amp;gt;=&amp;lt;span class=&amp;quot;st0&amp;quot;&amp;gt;&amp;quot;HTML&amp;quot;&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;re2&amp;quot;&amp;gt;rel&amp;lt;/span&amp;gt;=&amp;lt;span class=&amp;quot;st0&amp;quot;&amp;gt;&amp;quot;wikipedia&amp;quot;&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;re2&amp;quot;&amp;gt;href&amp;lt;/span&amp;gt;=&amp;lt;span class=&amp;quot;st0&amp;quot;&amp;gt;&amp;quot;http://en.wikipedia.org/wiki/HTML&amp;quot;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;sy0&amp;quot;&amp;gt;&amp;gt;&amp;lt;/span&amp;gt;text&amp;lt;span class=&amp;quot;sy0&amp;quot;&amp;gt;/&amp;lt;/span&amp;gt;html&amp;lt;span class=&amp;quot;sy0&amp;quot;&amp;gt;&amp;lt;/&amp;lt;/span&amp;gt;a&amp;lt;span class=&amp;quot;sy0&amp;quot;&amp;gt;&amp;gt;&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;sy0&amp;quot;&amp;gt;|&amp;lt;&amp;lt;/span&amp;gt;a &amp;lt;span class=&amp;quot;re2&amp;quot;&amp;gt;class&amp;lt;/span&amp;gt;=&amp;lt;span class=&amp;quot;st0&amp;quot;&amp;gt;&amp;quot;zem_slink freebase/en/grep&amp;quot;&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;re2&amp;quot;&amp;gt;title&amp;lt;/span&amp;gt;=&amp;lt;span class=&amp;quot;st0&amp;quot;&amp;gt;&amp;quot;Grep&amp;quot;&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;re2&amp;quot;&amp;gt;rel&amp;lt;/span&amp;gt;=&amp;lt;span class=&amp;quot;st0&amp;quot;&amp;gt;&amp;quot;wikipedia&amp;quot;&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;re2&amp;quot;&amp;gt;href&amp;lt;/span&amp;gt;=&amp;lt;span class=&amp;quot;st0&amp;quot;&amp;gt;&amp;quot;http://en.wikipedia.org/wiki/Grep&amp;quot;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;sy0&amp;quot;&amp;gt;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;kw2&amp;quot;&amp;gt;grep&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;sy0&amp;quot;&amp;gt;&amp;lt;/&amp;lt;/span&amp;gt;a&amp;lt;span class=&amp;quot;sy0&amp;quot;&amp;gt;&amp;gt;&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;st0&amp;quot;&amp;gt;&amp;quot;^Visitor\\|^Pageviews&amp;quot;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;sy0&amp;quot;&amp;gt;|&amp;lt;&amp;lt;/span&amp;gt;a &amp;lt;span class=&amp;quot;re2&amp;quot;&amp;gt;class&amp;lt;/span&amp;gt;=&amp;lt;span class=&amp;quot;st0&amp;quot;&amp;gt;&amp;quot;zem_slink freebase/en/awk&amp;quot;&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;re2&amp;quot;&amp;gt;title&amp;lt;/span&amp;gt;=&amp;lt;span class=&amp;quot;st0&amp;quot;&amp;gt;&amp;quot;AWK&amp;quot;&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;re2&amp;quot;&amp;gt;rel&amp;lt;/span&amp;gt;=&amp;lt;span class=&amp;quot;st0&amp;quot;&amp;gt;&amp;quot;homepage&amp;quot;&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;re2&amp;quot;&amp;gt;href&amp;lt;/span&amp;gt;=&amp;lt;span class=&amp;quot;st0&amp;quot;&amp;gt;&amp;quot;http://cm.bell-labs.com/cm/cs/awkbook/index.html&amp;quot;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;sy0&amp;quot;&amp;gt;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;kw2&amp;quot;&amp;gt;awk&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;sy0&amp;quot;&amp;gt;&amp;lt;/&amp;lt;/span&amp;gt;a&amp;lt;span class=&amp;quot;sy0&amp;quot;&amp;gt;&amp;gt;&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;co3&amp;quot;&amp;gt;\&#39;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;br0&amp;quot;&amp;gt;&amp;amp;#123;&amp;lt;/span&amp;gt;print &amp;lt;span class=&amp;quot;re4&amp;quot;&amp;gt;$1&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;nu0&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;br0&amp;quot;&amp;gt;&amp;amp;#125;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;co3&amp;quot;&amp;gt;\&#39;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;sy0&amp;quot;&amp;gt;|&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;kw2&amp;quot;&amp;gt;tr&amp;lt;/span&amp;gt;  &amp;lt;span class=&amp;quot;st0&amp;quot;&amp;gt;&amp;quot;\&amp;lt;span class=&amp;quot;es1&amp;quot;&amp;gt;\n&amp;lt;/span&amp;gt;&amp;quot;&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;st0&amp;quot;&amp;gt;&amp;quot; &amp;quot;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;br0&amp;quot;&amp;gt;&amp;amp;#41;&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;span class=&amp;quot;re2&amp;quot;&amp;gt;time&amp;lt;/span&amp;gt;=$&amp;lt;span class=&amp;quot;br0&amp;quot;&amp;gt;&amp;amp;#40;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;kw2&amp;quot;&amp;gt;date&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;br0&amp;quot;&amp;gt;&amp;amp;#41;&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;span class=&amp;quot;kw3&amp;quot;&amp;gt;printf&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;st0&amp;quot;&amp;gt;&amp;quot;&amp;lt;span class=&amp;quot;es2&amp;quot;&amp;gt;$time&amp;lt;/span&amp;gt; --&amp;gt; &amp;lt;span class=&amp;quot;es2&amp;quot;&amp;gt;$values&amp;lt;/span&amp;gt; \&amp;lt;span class=&amp;quot;es1&amp;quot;&amp;gt;\r&amp;lt;/span&amp;gt;&amp;quot;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;sy0&amp;quot;&amp;gt;&amp;lt;!&amp;lt;/span&amp;gt;--loginview end--&amp;lt;span class=&amp;quot;sy0&amp;quot;&amp;gt;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;span class=&amp;quot;kw2&amp;quot;&amp;gt;sleep&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;re1&amp;quot;&amp;gt;$sleep_time&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;span class=&amp;quot;kw1&amp;quot;&amp;gt;done&amp;lt;/span&amp;gt;
    &amp;lt;/div&amp;gt;
  &amp;lt;/td&amp;gt;
&amp;lt;/tr&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
  &lt;/table&gt;
&lt;/div&gt;&lt;h6 class=\&#34;zemanta-related-title\&#34;&gt;Related articles by Zemanta&lt;/h6&gt; &lt;ul class=\&#34;zemanta-article-ul\&#34;&gt; &lt;li class=\&#34;zemanta-article-ul-li\&#34;&gt;&lt;a href=\&#34;http://blog.amit-agarwal.co.in/2010/06/11/for-loop-in-bash-script-on-solaris-without-seq/\&#34;&gt;for loop in bash script on solaris without seq&lt;/a&gt; (amit-agarwal.co.in)&lt;/li&gt; &lt;li class=\&#34;zemanta-article-ul-li\&#34;&gt;&lt;a href=\&#34;http://blog.amit-agarwal.co.in/2010/04/12/mappings-tex-file-vim-plugins/\&#34;&gt;Get the mappings from tex file for vim plugins&lt;/a&gt; (amit-agarwal.co.in)&lt;/li&gt; &lt;li class=\&#34;zemanta-article-ul-li\&#34;&gt;&lt;a href=\&#34;http://blog.amit-agarwal.co.in/2010/03/23/unbound-variable-bash-completion-not-working-and-having-issues-with-other-stuff-like-command-not-found/\&#34;&gt;unbound variable &amp;#8211; bash completion not working and having issues with other stuff like command not found.&lt;/a&gt; (amit-agarwal.co.in)&lt;/li&gt; &lt;li class=\&#34;zemanta-article-ul-li\&#34;&gt;&lt;a href=\&#34;http://almirkaric.com/2010/5/2/bash-builtins/\&#34;&gt;bash builtins&lt;/a&gt; (almirkaric.com)&lt;/li&gt; &lt;/ul&gt; &lt;div class=\&#34;zemanta-pixie\&#34;&gt;&lt;a class=\&#34;zemanta-pixie-a\&#34; title=\&#34;Enhanced by Zemanta\&#34; href=\&#34;http://www.zemanta.com/\&#34;&gt;&lt;img class=\&#34;zemanta-pixie-img\&#34; src=\&#34;http://blog.amit-agarwal.co.in/wp-content/uploads/2010/08/zemified_c11.gif\&#34; alt=\&#34;Enhanced by Zemanta\&#34; /&gt;&lt;/a&gt;&lt;span class=\&#34;zem-script more-related more-info pretty-attribution paragraph-reblog\&#34;&gt;&lt;/span&gt;&lt;/div&gt;</description>
    </item>
    
    <item>
      <title>wordpress blog stats monitoring from remote using curl and bash and send it in mail.</title>
      <link>/2010/06/25/wordpress-blog-stats-monitoring-from-remote-using-curl-and-bash-and-send-it-in-mail/</link>
      <pubDate>Fri, 25 Jun 2010 11:47:20 +0000</pubDate>
      
      <guid>/2010/06/25/wordpress-blog-stats-monitoring-from-remote-using-curl-and-bash-and-send-it-in-mail/</guid>
      <description>&lt;!--[ad#ad-2]--&gt;
&lt;p&gt;Here&amp;amp;#8217;s something that I had been planning to do for sometime now. I have my blog on wordpress and have Statpress plugin installed. The plugin does give me a good idea of the visits to my site. Now, I have to keep logging in every now and then to check the stats. Also since I did not want to spend some more amount 🙂 so I do not have the shell access to the server, too bad 🙁&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Delete Files older than 14 days</title>
      <link>/2010/06/25/delete-files-older-than-14-days/</link>
      <pubDate>Fri, 25 Jun 2010 11:47:17 +0000</pubDate>
      
      <guid>/2010/06/25/delete-files-older-than-14-days/</guid>
      <description>&lt;!--[ad#ad-2]--&gt;
&lt;p&gt;Taken from Dzone.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;tt&gt;@echo on &lt;/tt&gt;&lt;/p&gt;
&lt;p&gt;&lt;tt&gt;setlocal &lt;/tt&gt;&lt;/p&gt;
&lt;p&gt;&lt;tt&gt;set srcDir=. &lt;/tt&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;!--
&lt;tt&gt;REM the file mask, currently this will delete all *.mai files

&lt;tt&gt;set dirMask=*.mai &lt;/tt&gt;

&lt;tt&gt;if not \&#34;%1\&#34;==\&#34;\&#34; set srcDir=%1 &lt;/tt&gt;

&lt;tt&gt;if not exist \&#34;%srcDir%\&#34; echo Directory %srcDir% does not exist.&amp;goto; :EOF &lt;/tt&gt;

&lt;tt&gt;call :GETPARTS \&#34;%date% &lt;/tt&gt;

&lt;tt&gt;REM set the amount of days to subtract from the current date &lt;/tt&gt;

&lt;tt&gt;call :SUBTRACTDAYS 14 &lt;/tt&gt;

&lt;tt&gt;set cutoffDate=%yy%/%mm%/%dd% &lt;/tt&gt;

&lt;tt&gt;pushd. &lt;/tt&gt;

&lt;tt&gt;cd /D %srcDir% &lt;/tt&gt;

&lt;tt&gt;for /f \&#34;delims=\&#34; %%a in (\&#39;dir /b /a-d %dirMask%\&#39;) do call :PROCESS \&#34;%%a\&#34; %%~ta &lt;/tt&gt;

&lt;tt&gt;popd &lt;/tt&gt;

&lt;tt&gt;goto :EOF &lt;/tt&gt;

&lt;tt&gt;:PROCESS &lt;/tt&gt;

&lt;tt&gt;call :GETPARTS %2 &lt;/tt&gt;

&lt;tt&gt;REM task to perform, currently it deletes item %1 &lt;/tt&gt;
&lt;tt&gt;if /i \&#34;%cutoffDate%\&#34; GTR \&#34;%yy%/%mm%/%dd%\&#34; del %1 &lt;/tt&gt;

&lt;tt&gt;goto :EOF &lt;/tt&gt;

&lt;tt&gt;:SUBTRACTDAYS &lt;/tt&gt;

&lt;tt&gt;set dayCnt=%1 &lt;/tt&gt;

&lt;tt&gt;if \&#34;%dayCnt%\&#34;==\&#34;\&#34; set dayCnt=1 &lt;/tt&gt;

&lt;tt&gt;REM Substract your days here &lt;/tt&gt;
&lt;tt&gt;set /A dd=1%dd% - 100 - %dayCnt% &lt;/tt&gt;
&lt;tt&gt;set /A mm=1%mm% - 100 &lt;/tt&gt;

&lt;tt&gt;:CHKDAY &lt;/tt&gt;

&lt;tt&gt;if /I %dd% GTR 0 goto DONESUBTRACT &lt;/tt&gt;

&lt;tt&gt;set /A mm=%mm% - 1 &lt;/tt&gt;

&lt;tt&gt;if /I %mm% GTR 0 goto ADJUSTDAY &lt;/tt&gt;

&lt;tt&gt;set /A mm=12 &lt;/tt&gt;
&lt;tt&gt;set /A yy=%yy% - 1 &lt;/tt&gt;

&lt;tt&gt;:ADJUSTDAY &lt;/tt&gt;

&lt;tt&gt;if %mm%==1 goto SET31 &lt;/tt&gt;
&lt;tt&gt;if %mm%==2 goto LEAPCHK &lt;/tt&gt;
&lt;tt&gt;if %mm%==3 goto SET31 &lt;/tt&gt;
&lt;tt&gt;if %mm%==4 goto SET30 &lt;/tt&gt;
&lt;tt&gt;if %mm%==5 goto SET31 &lt;/tt&gt;
&lt;tt&gt;if %mm%==6 goto SET30 &lt;/tt&gt;
&lt;tt&gt;if %mm%==7 goto SET31 &lt;/tt&gt;
&lt;tt&gt;if %mm%==8 goto SET31 &lt;/tt&gt;
&lt;tt&gt;if %mm%==9 goto SET30 &lt;/tt&gt;
&lt;tt&gt;if %mm%==10 goto SET31 &lt;/tt&gt;
&lt;tt&gt;if %mm%==11 goto SET30 &lt;/tt&gt;
&lt;tt&gt;REM ** Month 12 falls through &lt;/tt&gt;

&lt;tt&gt;:SET31 &lt;/tt&gt;

&lt;tt&gt;set /A dd=31 + %dd% &lt;/tt&gt;

&lt;tt&gt;goto CHKDAY &lt;/tt&gt;

&lt;tt&gt;:SET30 &lt;/tt&gt;

&lt;tt&gt;set /A dd=30 + %dd% &lt;/tt&gt;

&lt;tt&gt;goto CHKDAY &lt;/tt&gt;

&lt;tt&gt;:LEAPCHK &lt;/tt&gt;

&lt;tt&gt;set /A tt=%yy% %% 4 &lt;/tt&gt;

&lt;tt&gt;if not %tt%==0 goto SET28 &lt;/tt&gt;

&lt;tt&gt;set /A tt=%yy% %% 100 &lt;/tt&gt;

&lt;tt&gt;if not %tt%==0 goto SET29 &lt;/tt&gt;

&lt;tt&gt;set /A tt=%yy% %% 400 &lt;/tt&gt;

&lt;tt&gt;if %tt%==0 goto SET29 &lt;/tt&gt;

&lt;tt&gt;:SET28 &lt;/tt&gt;

&lt;tt&gt;set /A dd=28 + %dd% &lt;/tt&gt;

&lt;tt&gt;goto CHKDAY &lt;/tt&gt;

&lt;tt&gt;:SET29 &lt;/tt&gt;

&lt;tt&gt;set /A dd=29 + %dd% &lt;/tt&gt;

&lt;tt&gt;goto CHKDAY &lt;/tt&gt;

&lt;tt&gt;:DONESUBTRACT &lt;/tt&gt;

&lt;tt&gt;if /I %mm% LSS 10 set mm=0%mm% &lt;/tt&gt;
&lt;tt&gt;if /I %dd% LSS 10 set dd=0%dd% &lt;/tt&gt;

&lt;tt&gt;goto :EOF &lt;/tt&gt;

&lt;tt&gt;:GETPARTS &lt;/tt&gt;

&lt;tt&gt;set dt=%~1 &lt;/tt&gt;
&lt;tt&gt;set tok=1-3 &lt;/tt&gt;

&lt;tt&gt;if \&#34;%dt:~0,1%\&#34; GTR \&#34;9\&#34; set tok=2-4 &lt;/tt&gt;

&lt;tt&gt;set yyyy= &lt;/tt&gt;

&lt;tt&gt;for /f \&#34;tokens=%tok% delims=.:/-, \&#34; %%a in (\&#39;echo %~1\&#39;) do ( &lt;/tt&gt;
&lt;tt&gt;for /f \&#34;skip=1 tokens=2-4 delims=/-,().\&#34; %%x in (\&#39;echo.^|date\&#39;) do set %%x=%%a&amp;set; %%y=%%b&amp;set; %%z=%%c &lt;/tt&gt;
&lt;tt&gt;) &lt;/tt&gt;

&lt;tt&gt;if not \&#34;%yyyy%\&#34;==\&#34;\&#34; set yy=%yyyy% &lt;/tt&gt;

&lt;tt&gt;if 1%yy% LSS 1000 (if %yy% LSS 70 (set yy=20%yy%) else (set yy=19%yy%)) &lt;/tt&gt;
&lt;tt&gt;if 1%mm% LSS 100 set mm=0%mm% &lt;/tt&gt;
&lt;tt&gt;if 1%dd% LSS 100 set dd=0%dd% &lt;/tt&gt;

&lt;tt&gt;goto :EOF &lt;/tt&gt;
--&gt;
&lt;p&gt;Read more: &amp;lt;a href=&amp;quot;http://snippets.dzone.com/posts/show/10441&amp;quot;&amp;gt;http://snippets.dzone.com/posts/show/10441&lt;/a&gt;&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Magic space on the current command line</title>
      <link>/2010/06/25/magic-space-on-the-current-command-line/</link>
      <pubDate>Fri, 25 Jun 2010 11:47:08 +0000</pubDate>
      
      <guid>/2010/06/25/magic-space-on-the-current-command-line/</guid>
      <description>&lt;!--[ad#ad-2]--&gt;
&lt;p&gt;# For how to set up magic space for Bash see:&lt;br&gt;
# – &lt;a href=&#34;http://www.ukuug.org/events/linux2003/papers/bash_tips/#slide15&#34;&gt;http://www.ukuug.org/events/linux2003/papers/bash_tips/#slide15&lt;/a&gt;&lt;br&gt;
# – &lt;a href=&#34;http://codesnippets.joyent.com/posts/show/1690&#34;&gt;http://codesnippets.joyent.com/posts/show/1690&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;man bash 2&amp;gt;/dev/null | less -p &amp;amp;#8217;magic-space&amp;amp;#8217;&lt;/p&gt;
&lt;p&gt;man bash 2&amp;gt;/dev/null | less -p &amp;amp;#8217;Event Designators&amp;amp;#8217;&lt;/p&gt;
&lt;p&gt;man bash 2&amp;gt;/dev/null | less -p &amp;amp;#8217;\!#&amp;amp;#8217; # &amp;amp;#8221;The entire &amp;lt;a class=&amp;quot;zem_slink&amp;quot; title=&amp;quot;Command-line interface&amp;quot; rel=&amp;quot;wikipedia&amp;quot; href=&amp;quot;http://en.wikipedia.org/wiki/Command-line_interface&amp;quot;&amp;gt;command line&lt;/a&gt; typed so far.&amp;amp;#8221;&lt;/p&gt;
&lt;p&gt;&amp;lt;a href=&amp;quot;http://snippets.dzone.com/posts/show/10265&amp;quot;&amp;gt;Read more :&lt;/a&gt;&amp;lt;h6 class=&amp;quot;zemanta-related-title&amp;quot; style=&amp;quot;font-size: 1em;&amp;quot;&amp;gt;Related articles by Zemanta&lt;/h6&gt; &amp;lt;ul class=&amp;quot;zemanta-article-ul&amp;quot;&amp;gt; &amp;lt;li class=&amp;quot;zemanta-article-ul-li&amp;quot;&amp;gt;&amp;lt;a href=&amp;quot;http://www.makeuseof.com/tag/trigger-wake-lan-mac-address/&amp;quot;&amp;gt;How To Trigger Wake On LAN Using The MAC Address&lt;/a&gt; (makeuseof.com)&lt;/li&gt; &amp;lt;li class=&amp;quot;zemanta-article-ul-li&amp;quot;&amp;gt;&amp;lt;a href=&amp;quot;http://smarterware.org/4271/projectview-lists-your-todo-txt-by-project&amp;quot;&amp;gt;Projectview Lists Your Todo.txt by Project&lt;/a&gt; (smarterware.org)&lt;/li&gt; &amp;lt;li class=&amp;quot;zemanta-article-ul-li&amp;quot;&amp;gt;&amp;lt;a href=&amp;quot;http://helpdeskgeek.com/linux-tips/shell-script-backup-directory-linux/&amp;quot;&amp;gt;Back Up a Directory in Linux using a Shell Script&lt;/a&gt; (helpdeskgeek.com)&lt;/li&gt; &lt;/ul&gt; &amp;lt;div class=&amp;quot;zemanta-pixie&amp;quot; style=&amp;quot;margin-top: 10px; height: 15px;&amp;quot;&amp;gt;&amp;lt;a class=&amp;quot;zemanta-pixie-a&amp;quot; title=&amp;quot;Reblog this post [with Zemanta]&amp;quot; href=&amp;quot;http://reblog.zemanta.com/zemified/038d79c3-59e6-41ad-a8ad-31d1af669509/&amp;quot;&amp;gt;&amp;lt;img class=&amp;quot;zemanta-pixie-img&amp;quot; style=&amp;quot;border: medium none; float: right;&amp;quot; src=&amp;quot;http://blog.amit-agarwal.co.in/wp-content/uploads/2010/08/reblog_e39.png&amp;quot; alt=&amp;quot;Reblog this post [with Zemanta]&amp;quot; /&amp;gt;&lt;/a&gt;&amp;lt;span class=&amp;quot;zem-script more-related pretty-attribution&amp;quot;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>bash one liner to change/remove test pattern from config file or text file.</title>
      <link>/2010/06/25/bash-one-liner-to-changeremove-test-pattern-from-config-file-or-text-file/</link>
      <pubDate>Fri, 25 Jun 2010 11:47:05 +0000</pubDate>
      
      <guid>/2010/06/25/bash-one-liner-to-changeremove-test-pattern-from-config-file-or-text-file/</guid>
      <description>&lt;!--[ad#ad-2]--&gt;
&lt;p&gt;Problem:&lt;/p&gt;
&lt;p&gt;I had a directory with a lot of config files in the ini file format, i.e. name and value separated by equals. Some/all of these contained some directory names and other values which had to be replaced. But there were other place where I should not not replace them, if there was no exact match. I also needed to have a backup copy of the file that I was modifying. Since the number of files that I needed to change was multiple so was quite difficult to do it without using some script.&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Quick one liner bash function to navigate parent directories quickly</title>
      <link>/2010/06/25/quick-one-liner-bash-function-to-navigate-parent-directories-quickly/</link>
      <pubDate>Fri, 25 Jun 2010 11:46:59 +0000</pubDate>
      
      <guid>/2010/06/25/quick-one-liner-bash-function-to-navigate-parent-directories-quickly/</guid>
      <description>&lt;!--[ad#ad-2]--&gt;
&lt;p&gt;up () { for i in $(seq 1 $1) ; do cd  ..; pushd +1 ; done; }&lt;br&gt;
— if you like the popd and pushd way ..&lt;/p&gt;
&lt;p&gt;up () { for i in $(seq 1 $1) ; do cd  ..; done; }&lt;br&gt;
— otherwise .. &amp;lt;div class=&amp;quot;zemanta-pixie&amp;quot;&amp;gt;&amp;lt;img class=&amp;quot;zemanta-pixie-img&amp;quot; src=&amp;quot;http://blog.amit-agarwal.co.in/wp-content/uploads/2010/08/pixy4.gif&amp;quot; /&amp;gt;&lt;/div&gt;&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>find duplicate entry in a list in bash with sed</title>
      <link>/2010/06/25/find-duplicate-entry-in-a-list-in-bash-with-sed/</link>
      <pubDate>Fri, 25 Jun 2010 11:46:58 +0000</pubDate>
      
      <guid>/2010/06/25/find-duplicate-entry-in-a-list-in-bash-with-sed/</guid>
      <description>&lt;!--[ad#ad-2]--&gt;
&lt;p&gt;Here I will take an example of rss2email list, but I guess I will be able to pass on the concept.&lt;/p&gt;
&lt;p&gt;Here is example of the output of the r2e list command:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;1: &lt;a href=&#34;http://blog.amit-agarwal.co.in/feed&#34;&gt;http://blog.amit-agarwal.co.in/feed&lt;/a&gt; (default: amitag@localhost)&lt;br&gt;
2: &lt;a href=&#34;http://feeds2.feedburner.com/AllAboutLinux&#34;&gt;http://feeds2.feedburner.com/AllAboutLinux&lt;/a&gt; (default: amitag@localhost)&lt;br&gt;
3: &lt;a href=&#34;http://feeds2.feedburner.com/Command-line-fu&#34;&gt;http://feeds2.feedburner.com/Command-line-fu&lt;/a&gt; (default: amitag@localhost)&lt;br&gt;
4: &lt;a href=&#34;http://blogs.members.freewebs.com/Members/Blogs/viewBlogRSS.jsp?userid=29731143&#34;&gt;http://blogs.members.freewebs.com/Members/Blogs/viewBlogRSS.jsp?userid=29731143&lt;/a&gt; (default: amitag@localhost)&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Target here is to get the list of all duplicate entries if any. So, first we need to remove the numbers from the begining and the email ID from the end.&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>remove/replace text/path in config file.</title>
      <link>/2010/06/25/removereplace-textpath-in-config-file/</link>
      <pubDate>Fri, 25 Jun 2010 11:46:55 +0000</pubDate>
      
      <guid>/2010/06/25/removereplace-textpath-in-config-file/</guid>
      <description>&lt;!--[ad#ad-2]--&gt;
&lt;p&gt;Lot of times I end up changing a particular text in config file to some other text. And when I have to do it for multiple files, all files having the text in multiple places, I end up opening the files in vim and then doing a globlal replace. But this is not efficient so I cam up with some one liners to do this for me. For removing any occurance of text in all files in the directory :&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>bash script to change the vim colorscheme from the list of locally available schemes</title>
      <link>/2010/06/25/bash-script-to-change-the-vim-colorscheme-from-the-list-of-locally-available-schemes/</link>
      <pubDate>Thu, 24 Jun 2010 20:51:35 +0000</pubDate>
      
      <guid>/2010/06/25/bash-script-to-change-the-vim-colorscheme-from-the-list-of-locally-available-schemes/</guid>
      <description>&lt;div class=\&#34;zemanta-img\&#34;&gt; 
&lt;div&gt;
  &lt;dl class=\&#34;wp-caption alignright\&#34;&gt; &lt;dt class=\&#34;wp-caption-dt\&#34;&gt;&lt;a href=\&#34;http://commons.wikipedia.org/wiki/Image:Vim_gloss_128.png\&#34;&gt;&lt;img title=\&#34;MacVim icon, glossy style\&#34; src=\&#34;http://blog.amit-agarwal.co.in/wp-content/uploads/2010/08/Vim_gloss_128.png\&#34; alt=\&#34;MacVim icon, glossy style\&#34; /&gt;&lt;/a&gt;&lt;/dt&gt; &lt;dd class=\&#34;wp-caption-dd zemanta-img-attribution\&#34;&gt;Image via &lt;a href=\&#34;http://commons.wikipedia.org/wiki/Image:Vim_gloss_128.png\&#34;&gt;Wikipedia&lt;/a&gt;&lt;/dd&gt; &lt;/dl&gt;
&lt;/div&gt;&lt;/div&gt; 
&lt;!--[ad#ad-2]--&gt;
&lt;p&gt;Today I was just wondering how good it would be to have a script to change the &amp;lt;a class=&amp;quot;zem_slink freebase/en/vim&amp;quot; title=&amp;quot;Vim (text editor)&amp;quot; rel=&amp;quot;homepage&amp;quot; href=&amp;quot;http://www.vim.org/&amp;quot;&amp;gt;vim&lt;/a&gt; colorscheme from the &amp;lt;a class=&amp;quot;zem_slink freebase/en/cmd_exe&amp;quot; title=&amp;quot;Command Prompt&amp;quot; rel=&amp;quot;wikipedia&amp;quot; href=&amp;quot;http://en.wikipedia.org/wiki/Command_Prompt&amp;quot;&amp;gt;command prompt&lt;/a&gt;. The plan for the script was simply to print the list of available schemes and then let the user select the actions from there on. So, here is the result:&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Script to add all the partitions to the fstab.</title>
      <link>/2010/06/25/script-add-partitions-fstab/</link>
      <pubDate>Thu, 24 Jun 2010 20:51:27 +0000</pubDate>
      
      <guid>/2010/06/25/script-add-partitions-fstab/</guid>
      <description>&lt;p&gt;I wrote a simple script today to get all the partitions on all the disks and then create &amp;lt;a class=&amp;quot;zem_slink freebase/en/fstab&amp;quot; title=&amp;quot;Fstab&amp;quot; rel=&amp;quot;wikipedia&amp;quot; href=&amp;quot;http://en.wikipedia.org/wiki/Fstab&amp;quot;&amp;gt;fstab&lt;/a&gt; entry with them. The script also gets the &amp;lt;a class=&amp;quot;zem_slink freebase/en/universally_unique_identifier&amp;quot; title=&amp;quot;Universally Unique Identifier&amp;quot; rel=&amp;quot;wikipedia&amp;quot; href=&amp;quot;http://en.wikipedia.org/wiki/Universally_Unique_Identifier&amp;quot;&amp;gt;UUID&lt;/a&gt; and uses the same to make the entry 🙂&lt;/p&gt;
&lt;div class=&#34;codecolorer-container bash solarized-light&#34; style=&#34;overflow:auto;white-space:nowrap;width:550px;height:900px;&#34;&gt;
  &lt;table cellspacing=&#34;0&#34; cellpadding=&#34;0&#34;&gt;
    &lt;tr&gt;
      &lt;td class=&#34;line-numbers&#34;&gt;
        &lt;div&gt;
          1&lt;br /&gt;2&lt;br /&gt;3&lt;br /&gt;4&lt;br /&gt;5&lt;br /&gt;6&lt;br /&gt;7&lt;br /&gt;8&lt;br /&gt;9&lt;br /&gt;10&lt;br /&gt;11&lt;br /&gt;12&lt;br /&gt;13&lt;br /&gt;14&lt;br /&gt;15&lt;br /&gt;16&lt;br /&gt;17&lt;br /&gt;18&lt;br /&gt;19&lt;br /&gt;20&lt;br /&gt;21&lt;br /&gt;22&lt;br /&gt;23&lt;br /&gt;24&lt;br /&gt;25&lt;br /&gt;26&lt;br /&gt;27&lt;br /&gt;28&lt;br /&gt;29&lt;br /&gt;30&lt;br /&gt;31&lt;br /&gt;32&lt;br /&gt;33&lt;br /&gt;34&lt;br /&gt;35&lt;br /&gt;36&lt;br /&gt;37&lt;br /&gt;38&lt;br /&gt;39&lt;br /&gt;40&lt;br /&gt;41&lt;br /&gt;42&lt;br /&gt;43&lt;br /&gt;44&lt;br /&gt;45&lt;br /&gt;46&lt;br /&gt;47&lt;br /&gt;48&lt;br /&gt;49&lt;br /&gt;50&lt;br /&gt;51&lt;br /&gt;52&lt;br /&gt;53&lt;br /&gt;54&lt;br /&gt;55&lt;br /&gt;56&lt;br /&gt;57&lt;br /&gt;58&lt;br /&gt;59&lt;br /&gt;60&lt;br /&gt;61&lt;br /&gt;62&lt;br /&gt;63&lt;br /&gt;64&lt;br /&gt;65&lt;br /&gt;66&lt;br /&gt;67&lt;br /&gt;68&lt;br /&gt;69&lt;br /&gt;70&lt;br /&gt;71&lt;br /&gt;72&lt;br /&gt;73&lt;br /&gt;74&lt;br /&gt;75&lt;br /&gt;76&lt;br /&gt;77&lt;br /&gt;78&lt;br /&gt;79&lt;br /&gt;80&lt;br /&gt;81&lt;br /&gt;82&lt;br /&gt;83&lt;br /&gt;84&lt;br /&gt;85&lt;br /&gt;86&lt;br /&gt;87&lt;br /&gt;88&lt;br /&gt;89&lt;br /&gt;90&lt;br /&gt;91&lt;br /&gt;92&lt;br /&gt;93&lt;br /&gt;94&lt;br /&gt;95&lt;br /&gt;96&lt;br /&gt;97&lt;br /&gt;98&lt;br /&gt;
        &lt;/div&gt;
      &lt;/td&gt;
&lt;pre&gt;&lt;code&gt;  &amp;lt;td&amp;gt;
    &amp;lt;div class=&amp;quot;bash codecolorer&amp;quot;&amp;gt;
      &amp;lt;span class=&amp;quot;co0&amp;quot;&amp;gt;#!/bin/bash -&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;span class=&amp;quot;co0&amp;quot;&amp;gt;#===============================================================================&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;span class=&amp;quot;co0&amp;quot;&amp;gt;#&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;span class=&amp;quot;co0&amp;quot;&amp;gt;# &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp;FILE: &amp;amp;nbsp;mount_add_all.sh&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;span class=&amp;quot;co0&amp;quot;&amp;gt;#&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;span class=&amp;quot;co0&amp;quot;&amp;gt;# &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; USAGE: &amp;amp;nbsp;./mount_add_all.sh&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;span class=&amp;quot;co0&amp;quot;&amp;gt;#&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;span class=&amp;quot;co0&amp;quot;&amp;gt;# &amp;amp;nbsp; DESCRIPTION: &amp;amp;nbsp;Find all the &amp;lt;a class=&amp;quot;zem_slink freebase/en/disk_partitioning&amp;quot; title=&amp;quot;Disk partitioning&amp;quot; rel=&amp;quot;wikipedia&amp;quot; href=&amp;quot;http://en.wikipedia.org/wiki/Disk_partitioning&amp;quot;&amp;gt;disk partitions&amp;lt;/a&amp;gt; and all those that are not present&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;span class=&amp;quot;co0&amp;quot;&amp;gt;# &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; in the fstab.&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;span class=&amp;quot;co0&amp;quot;&amp;gt;#&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;span class=&amp;quot;co0&amp;quot;&amp;gt;# &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; OPTIONS: &amp;amp;nbsp;---&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;span class=&amp;quot;co0&amp;quot;&amp;gt;# &amp;amp;nbsp;REQUIREMENTS: &amp;amp;nbsp;---&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;span class=&amp;quot;co0&amp;quot;&amp;gt;# &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp;BUGS: &amp;amp;nbsp;---&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;span class=&amp;quot;co0&amp;quot;&amp;gt;# &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; NOTES: &amp;amp;nbsp;---&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;span class=&amp;quot;co0&amp;quot;&amp;gt;# &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp;AUTHOR: &amp;amp;nbsp;&amp;lt;a class=&amp;quot;zem_slink&amp;quot; title=&amp;quot;Digital Inspiration&amp;quot; rel=&amp;quot;homepage&amp;quot; href=&amp;quot;http://amit-agarwal.co.in&amp;quot;&amp;gt;Amit Agarwal&amp;lt;/a&amp;gt; (AKA), amit.agarwal@amit-agarwal.co.in&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;span class=&amp;quot;co0&amp;quot;&amp;gt;# &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; COMPANY: &amp;amp;nbsp;Individual&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;span class=&amp;quot;co0&amp;quot;&amp;gt;# &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; VERSION: &amp;amp;nbsp;1.0&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;span class=&amp;quot;co0&amp;quot;&amp;gt;# &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; CREATED: &amp;amp;nbsp;06/19/2010 10:44:34 PM IST&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;span class=&amp;quot;co0&amp;quot;&amp;gt;# &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp;REVISION: &amp;amp;nbsp;0.1&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;span class=&amp;quot;co0&amp;quot;&amp;gt;#===============================================================================&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;span class=&amp;quot;re2&amp;quot;&amp;gt;file&amp;lt;/span&amp;gt;=&amp;lt;span class=&amp;quot;st0&amp;quot;&amp;gt;&amp;quot;/tmp/fstab&amp;quot;&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;span class=&amp;quot;re2&amp;quot;&amp;gt;disk_types&amp;lt;/span&amp;gt;=&amp;lt;span class=&amp;quot;br0&amp;quot;&amp;gt;&amp;amp;#40;&amp;lt;/span&amp;gt;hd sd&amp;lt;span class=&amp;quot;br0&amp;quot;&amp;gt;&amp;amp;#41;&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;span class=&amp;quot;re2&amp;quot;&amp;gt;count&amp;lt;/span&amp;gt;=&amp;lt;span class=&amp;quot;co1&amp;quot;&amp;gt;${#disk_types}&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;br /&amp;gt; find_disks &amp;lt;span class=&amp;quot;br0&amp;quot;&amp;gt;&amp;amp;#40;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;br0&amp;quot;&amp;gt;&amp;amp;#41;&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;span class=&amp;quot;br0&amp;quot;&amp;gt;&amp;amp;#123;&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;span class=&amp;quot;kw3&amp;quot;&amp;gt;echo&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;co1&amp;quot;&amp;gt;${#disk_types}&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;re1&amp;quot;&amp;gt;$count&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;span class=&amp;quot;kw1&amp;quot;&amp;gt;for&amp;lt;/span&amp;gt; i &amp;lt;span class=&amp;quot;kw1&amp;quot;&amp;gt;in&amp;lt;/span&amp;gt; $&amp;lt;span class=&amp;quot;br0&amp;quot;&amp;gt;&amp;amp;#40;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;kw2&amp;quot;&amp;gt;seq&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;nu0&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;re1&amp;quot;&amp;gt;$count&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;br0&amp;quot;&amp;gt;&amp;amp;#41;&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;span class=&amp;quot;kw1&amp;quot;&amp;gt;do&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;span class=&amp;quot;br0&amp;quot;&amp;gt;&amp;amp;#40;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;br0&amp;quot;&amp;gt;&amp;amp;#40;&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;re2&amp;quot;&amp;gt;j&amp;lt;/span&amp;gt;=i-&amp;lt;span class=&amp;quot;nu0&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;br0&amp;quot;&amp;gt;&amp;amp;#41;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;br0&amp;quot;&amp;gt;&amp;amp;#41;&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;span class=&amp;quot;kw3&amp;quot;&amp;gt;echo&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;re1&amp;quot;&amp;gt;$i&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;re1&amp;quot;&amp;gt;$j&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;span class=&amp;quot;kw3&amp;quot;&amp;gt;echo&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;re1&amp;quot;&amp;gt;$j&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;co1&amp;quot;&amp;gt;${disk_types[0]}&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;co1&amp;quot;&amp;gt;${disk_types[1]}&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt; disk_array&amp;lt;span class=&amp;quot;br0&amp;quot;&amp;gt;&amp;amp;#91;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;re1&amp;quot;&amp;gt;$j&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;br0&amp;quot;&amp;gt;&amp;amp;#93;&amp;lt;/span&amp;gt;=$&amp;lt;span class=&amp;quot;br0&amp;quot;&amp;gt;&amp;amp;#40;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;kw2&amp;quot;&amp;gt;ls&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;sy0&amp;quot;&amp;gt;&amp;lt;&amp;lt;/span&amp;gt;a &amp;lt;span class=&amp;quot;re2&amp;quot;&amp;gt;class&amp;lt;/span&amp;gt;=&amp;lt;span class=&amp;quot;st0&amp;quot;&amp;gt;&amp;quot;zem_slink freebase/en/device_file_system&amp;quot;&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;re2&amp;quot;&amp;gt;title&amp;lt;/span&amp;gt;=&amp;lt;span class=&amp;quot;st0&amp;quot;&amp;gt;&amp;quot;Device file&amp;quot;&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;re2&amp;quot;&amp;gt;rel&amp;lt;/span&amp;gt;=&amp;lt;span class=&amp;quot;st0&amp;quot;&amp;gt;&amp;quot;wikipedia&amp;quot;&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;re2&amp;quot;&amp;gt;href&amp;lt;/span&amp;gt;=&amp;lt;span class=&amp;quot;st0&amp;quot;&amp;gt;&amp;quot;http://en.wikipedia.org/wiki/Device_file&amp;quot;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;sy0&amp;quot;&amp;gt;&amp;gt;/&amp;lt;/span&amp;gt;dev&amp;lt;span class=&amp;quot;sy0&amp;quot;&amp;gt;&amp;lt;/&amp;lt;/span&amp;gt;a&amp;lt;span class=&amp;quot;sy0&amp;quot;&amp;gt;&amp;gt;/&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;co1&amp;quot;&amp;gt;${disk_types[$j]}&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;br0&amp;quot;&amp;gt;&amp;amp;#91;&amp;lt;/span&amp;gt;a-z&amp;lt;span class=&amp;quot;br0&amp;quot;&amp;gt;&amp;amp;#93;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;br0&amp;quot;&amp;gt;&amp;amp;#41;&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;span class=&amp;quot;kw3&amp;quot;&amp;gt;echo&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;co1&amp;quot;&amp;gt;${disk_array[$j]}&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;span class=&amp;quot;kw1&amp;quot;&amp;gt;done&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;span class=&amp;quot;br0&amp;quot;&amp;gt;&amp;amp;#125;&amp;lt;/span&amp;gt; &amp;amp;nbsp; &amp;amp;nbsp;&amp;lt;span class=&amp;quot;co0&amp;quot;&amp;gt;# ---------- &amp;amp;nbsp;end of function find_disks &amp;amp;nbsp;----------&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;br /&amp;gt; find_partitions &amp;lt;span class=&amp;quot;br0&amp;quot;&amp;gt;&amp;amp;#40;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;br0&amp;quot;&amp;gt;&amp;amp;#41;&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;span class=&amp;quot;br0&amp;quot;&amp;gt;&amp;amp;#123;&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;span class=&amp;quot;kw3&amp;quot;&amp;gt;echo&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;st0&amp;quot;&amp;gt;&amp;quot;In find_partitions&amp;quot;&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;span class=&amp;quot;re2&amp;quot;&amp;gt;l&amp;lt;/span&amp;gt;=&amp;lt;span class=&amp;quot;nu0&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;span class=&amp;quot;re2&amp;quot;&amp;gt;count&amp;lt;/span&amp;gt;=&amp;lt;span class=&amp;quot;co1&amp;quot;&amp;gt;${#disk_types}&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;span class=&amp;quot;kw1&amp;quot;&amp;gt;for&amp;lt;/span&amp;gt; i &amp;lt;span class=&amp;quot;kw1&amp;quot;&amp;gt;in&amp;lt;/span&amp;gt; $&amp;lt;span class=&amp;quot;br0&amp;quot;&amp;gt;&amp;amp;#40;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;kw2&amp;quot;&amp;gt;seq&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;nu0&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;re1&amp;quot;&amp;gt;$count&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;br0&amp;quot;&amp;gt;&amp;amp;#41;&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;span class=&amp;quot;kw1&amp;quot;&amp;gt;do&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;span class=&amp;quot;br0&amp;quot;&amp;gt;&amp;amp;#40;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;br0&amp;quot;&amp;gt;&amp;amp;#40;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;re2&amp;quot;&amp;gt;j&amp;lt;/span&amp;gt;=i-&amp;lt;span class=&amp;quot;nu0&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;br0&amp;quot;&amp;gt;&amp;amp;#41;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;br0&amp;quot;&amp;gt;&amp;amp;#41;&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;span class=&amp;quot;kw1&amp;quot;&amp;gt;for&amp;lt;/span&amp;gt; k &amp;lt;span class=&amp;quot;kw1&amp;quot;&amp;gt;in&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;co1&amp;quot;&amp;gt;${disk_array[$i]}&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;span class=&amp;quot;kw1&amp;quot;&amp;gt;do&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;span class=&amp;quot;kw3&amp;quot;&amp;gt;echo&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;re1&amp;quot;&amp;gt;$k&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;span class=&amp;quot;sy0&amp;quot;&amp;gt;&amp;lt;!&amp;lt;/span&amp;gt;--loginview start--&amp;lt;span class=&amp;quot;sy0&amp;quot;&amp;gt;&amp;gt;&amp;lt;/span&amp;gt;disk_partitions&amp;lt;span class=&amp;quot;br0&amp;quot;&amp;gt;&amp;amp;#91;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;re1&amp;quot;&amp;gt;$l&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;br0&amp;quot;&amp;gt;&amp;amp;#93;&amp;lt;/span&amp;gt;=&amp;lt;span class=&amp;quot;sy0&amp;quot;&amp;gt;`&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;kw2&amp;quot;&amp;gt;fdisk&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;re5&amp;quot;&amp;gt;-l&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;re1&amp;quot;&amp;gt;$k&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;sy0&amp;quot;&amp;gt;|&amp;lt;&amp;lt;/span&amp;gt;a &amp;lt;span class=&amp;quot;re2&amp;quot;&amp;gt;class&amp;lt;/span&amp;gt;=&amp;lt;span class=&amp;quot;st0&amp;quot;&amp;gt;&amp;quot;zem_slink freebase/en/grep&amp;quot;&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;re2&amp;quot;&amp;gt;title&amp;lt;/span&amp;gt;=&amp;lt;span class=&amp;quot;st0&amp;quot;&amp;gt;&amp;quot;Grep&amp;quot;&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;re2&amp;quot;&amp;gt;rel&amp;lt;/span&amp;gt;=&amp;lt;span class=&amp;quot;st0&amp;quot;&amp;gt;&amp;quot;wikipedia&amp;quot;&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;re2&amp;quot;&amp;gt;href&amp;lt;/span&amp;gt;=&amp;lt;span class=&amp;quot;st0&amp;quot;&amp;gt;&amp;quot;http://en.wikipedia.org/wiki/Grep&amp;quot;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;sy0&amp;quot;&amp;gt;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;kw2&amp;quot;&amp;gt;grep&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;sy0&amp;quot;&amp;gt;&amp;lt;/&amp;lt;/span&amp;gt;a&amp;lt;span class=&amp;quot;sy0&amp;quot;&amp;gt;&amp;gt;&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;st0&amp;quot;&amp;gt;&amp;quot;^/dev&amp;quot;&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;sy0&amp;quot;&amp;gt;|&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;kw2&amp;quot;&amp;gt;grep&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;re5&amp;quot;&amp;gt;-v&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;st0&amp;quot;&amp;gt;&amp;quot;Extended$&amp;quot;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;sy0&amp;quot;&amp;gt;|&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;kw2&amp;quot;&amp;gt;cut&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;re5&amp;quot;&amp;gt;-d&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;st0&amp;quot;&amp;gt;&amp;quot; &amp;quot;&amp;lt;/span&amp;gt; -f1&amp;lt;span class=&amp;quot;sy0&amp;quot;&amp;gt;`&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;span class=&amp;quot;kw3&amp;quot;&amp;gt;echo&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;co1&amp;quot;&amp;gt;${disk_partitions[$l]}&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;re1&amp;quot;&amp;gt;$l&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;sy0&amp;quot;&amp;gt;&amp;lt;!&amp;lt;/span&amp;gt;--loginview end--&amp;lt;span class=&amp;quot;sy0&amp;quot;&amp;gt;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;span class=&amp;quot;br0&amp;quot;&amp;gt;&amp;amp;#40;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;br0&amp;quot;&amp;gt;&amp;amp;#40;&amp;lt;/span&amp;gt;l++&amp;lt;span class=&amp;quot;br0&amp;quot;&amp;gt;&amp;amp;#41;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;br0&amp;quot;&amp;gt;&amp;amp;#41;&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;span class=&amp;quot;kw1&amp;quot;&amp;gt;done&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;span class=&amp;quot;kw1&amp;quot;&amp;gt;done&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;span class=&amp;quot;br0&amp;quot;&amp;gt;&amp;amp;#125;&amp;lt;/span&amp;gt; &amp;amp;nbsp; &amp;amp;nbsp;&amp;lt;span class=&amp;quot;co0&amp;quot;&amp;gt;# ---------- &amp;amp;nbsp;end of function find_partitions &amp;amp;nbsp;----------&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;br /&amp;gt; add_fat &amp;lt;span class=&amp;quot;br0&amp;quot;&amp;gt;&amp;amp;#40;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;br0&amp;quot;&amp;gt;&amp;amp;#41;&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;span class=&amp;quot;br0&amp;quot;&amp;gt;&amp;amp;#123;&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;span class=&amp;quot;kw3&amp;quot;&amp;gt;echo&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;st0&amp;quot;&amp;gt;&amp;quot;# Added with script for &amp;lt;span class=&amp;quot;es2&amp;quot;&amp;gt;$label&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;es2&amp;quot;&amp;gt;$k&amp;lt;/span&amp;gt;&amp;quot;&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;sy0&amp;quot;&amp;gt;&amp;gt;&amp;gt;&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;re1&amp;quot;&amp;gt;$file&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;span class=&amp;quot;kw3&amp;quot;&amp;gt;echo&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;st0&amp;quot;&amp;gt;&amp;quot;&amp;lt;span class=&amp;quot;es2&amp;quot;&amp;gt;$uuid&amp;lt;/span&amp;gt; /mnt/&amp;lt;span class=&amp;quot;es2&amp;quot;&amp;gt;$label&amp;lt;/span&amp;gt; vfat&amp;amp;nbsp; nosuid,nodev,uhelper=udisks,uid=500,gid=500,shortname=mixed,dmask=0077&amp;amp;nbsp; 0 0&amp;quot;&amp;lt;/span&amp;gt; &amp;amp;nbsp;&amp;lt;span class=&amp;quot;sy0&amp;quot;&amp;gt;&amp;gt;&amp;gt;&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;re1&amp;quot;&amp;gt;$file&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;span class=&amp;quot;br0&amp;quot;&amp;gt;&amp;amp;#125;&amp;lt;/span&amp;gt; &amp;amp;nbsp; &amp;amp;nbsp;&amp;lt;span class=&amp;quot;co0&amp;quot;&amp;gt;# ---------- &amp;amp;nbsp;end of function add_fat &amp;amp;nbsp;----------&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;br /&amp;gt; add_&amp;lt;span class=&amp;quot;sy0&amp;quot;&amp;gt;&amp;lt;&amp;lt;/span&amp;gt;a &amp;lt;span class=&amp;quot;re2&amp;quot;&amp;gt;class&amp;lt;/span&amp;gt;=&amp;lt;span class=&amp;quot;st0&amp;quot;&amp;gt;&amp;quot;zem_slink freebase/en/ext3&amp;quot;&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;re2&amp;quot;&amp;gt;title&amp;lt;/span&amp;gt;=&amp;lt;span class=&amp;quot;st0&amp;quot;&amp;gt;&amp;quot;Ext3&amp;quot;&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;re2&amp;quot;&amp;gt;rel&amp;lt;/span&amp;gt;=&amp;lt;span class=&amp;quot;st0&amp;quot;&amp;gt;&amp;quot;wikipedia&amp;quot;&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;re2&amp;quot;&amp;gt;href&amp;lt;/span&amp;gt;=&amp;lt;span class=&amp;quot;st0&amp;quot;&amp;gt;&amp;quot;http://en.wikipedia.org/wiki/Ext3&amp;quot;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;sy0&amp;quot;&amp;gt;&amp;gt;&amp;lt;/span&amp;gt;ext3&amp;lt;span class=&amp;quot;sy0&amp;quot;&amp;gt;&amp;lt;/&amp;lt;/span&amp;gt;a&amp;lt;span class=&amp;quot;sy0&amp;quot;&amp;gt;&amp;gt;&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;br0&amp;quot;&amp;gt;&amp;amp;#40;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;br0&amp;quot;&amp;gt;&amp;amp;#41;&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;span class=&amp;quot;br0&amp;quot;&amp;gt;&amp;amp;#123;&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;span class=&amp;quot;kw3&amp;quot;&amp;gt;echo&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;st0&amp;quot;&amp;gt;&amp;quot;# Added with script for &amp;lt;span class=&amp;quot;es2&amp;quot;&amp;gt;$label&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;es2&amp;quot;&amp;gt;$k&amp;lt;/span&amp;gt;&amp;quot;&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;sy0&amp;quot;&amp;gt;&amp;gt;&amp;gt;&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;re1&amp;quot;&amp;gt;$file&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;span class=&amp;quot;kw3&amp;quot;&amp;gt;echo&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;st0&amp;quot;&amp;gt;&amp;quot;&amp;lt;span class=&amp;quot;es2&amp;quot;&amp;gt;$uuid&amp;lt;/span&amp;gt; /mnt/&amp;lt;span class=&amp;quot;es2&amp;quot;&amp;gt;$label&amp;lt;/span&amp;gt; ext3     defaults     0 0&amp;quot;&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;sy0&amp;quot;&amp;gt;&amp;gt;&amp;gt;&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;re1&amp;quot;&amp;gt;$file&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;br /&amp;gt; &amp;lt;span class=&amp;quot;br0&amp;quot;&amp;gt;&amp;amp;#125;&amp;lt;/span&amp;gt; &amp;amp;nbsp; &amp;amp;nbsp;&amp;lt;span class=&amp;quot;co0&amp;quot;&amp;gt;# ---------- &amp;amp;nbsp;end of function add_ext3 &amp;amp;nbsp;----------&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;br /&amp;gt; find_UUID &amp;lt;span class=&amp;quot;br0&amp;quot;&amp;gt;&amp;amp;#40;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;br0&amp;quot;&amp;gt;&amp;amp;#41;&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;span class=&amp;quot;br0&amp;quot;&amp;gt;&amp;amp;#123;&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;span class=&amp;quot;kw3&amp;quot;&amp;gt;echo&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;st0&amp;quot;&amp;gt;&amp;quot;In find_UUID with &amp;lt;span class=&amp;quot;es2&amp;quot;&amp;gt;$l&amp;lt;/span&amp;gt;&amp;quot;&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;span class=&amp;quot;br0&amp;quot;&amp;gt;&amp;amp;#40;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;br0&amp;quot;&amp;gt;&amp;amp;#40;&amp;lt;/span&amp;gt;l--&amp;lt;span class=&amp;quot;br0&amp;quot;&amp;gt;&amp;amp;#41;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;br0&amp;quot;&amp;gt;&amp;amp;#41;&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;span class=&amp;quot;kw1&amp;quot;&amp;gt;for&amp;lt;/span&amp;gt; i &amp;lt;span class=&amp;quot;kw1&amp;quot;&amp;gt;in&amp;lt;/span&amp;gt; $&amp;lt;span class=&amp;quot;br0&amp;quot;&amp;gt;&amp;amp;#40;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;kw2&amp;quot;&amp;gt;seq&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;nu0&amp;quot;&amp;gt;&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;re1&amp;quot;&amp;gt;$l&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;br0&amp;quot;&amp;gt;&amp;amp;#41;&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;span class=&amp;quot;kw1&amp;quot;&amp;gt;do&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;span class=&amp;quot;kw3&amp;quot;&amp;gt;echo&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;co1&amp;quot;&amp;gt;${disk_partitions[$i]}&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;span class=&amp;quot;kw1&amp;quot;&amp;gt;for&amp;lt;/span&amp;gt; k &amp;lt;span class=&amp;quot;kw1&amp;quot;&amp;gt;in&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;co1&amp;quot;&amp;gt;${disk_partitions[$i]}&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;span class=&amp;quot;kw1&amp;quot;&amp;gt;do&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;span class=&amp;quot;kw3&amp;quot;&amp;gt;echo&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;re1&amp;quot;&amp;gt;$k&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;span class=&amp;quot;sy0&amp;quot;&amp;gt;&amp;lt;!&amp;lt;/span&amp;gt;--loginview start--&amp;lt;span class=&amp;quot;sy0&amp;quot;&amp;gt;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;re2&amp;quot;&amp;gt;temp&amp;lt;/span&amp;gt;=$&amp;lt;span class=&amp;quot;br0&amp;quot;&amp;gt;&amp;amp;#40;&amp;lt;/span&amp;gt;blkid &amp;lt;span class=&amp;quot;re1&amp;quot;&amp;gt;$k&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;br0&amp;quot;&amp;gt;&amp;amp;#41;&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;span class=&amp;quot;re2&amp;quot;&amp;gt;label&amp;lt;/span&amp;gt;=$&amp;lt;span class=&amp;quot;br0&amp;quot;&amp;gt;&amp;amp;#40;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;kw3&amp;quot;&amp;gt;echo&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;re1&amp;quot;&amp;gt;$temp&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;sy0&amp;quot;&amp;gt;|&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;kw2&amp;quot;&amp;gt;grep&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;st0&amp;quot;&amp;gt;&amp;quot;LABEL=&amp;quot;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;sy0&amp;quot;&amp;gt;|&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;kw2&amp;quot;&amp;gt;sed&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;co3&amp;quot;&amp;gt;\&#39;&amp;lt;/span&amp;gt;s&amp;lt;span class=&amp;quot;sy0&amp;quot;&amp;gt;/&amp;lt;/span&amp;gt;.&amp;lt;span class=&amp;quot;sy0&amp;quot;&amp;gt;*&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;re2&amp;quot;&amp;gt;LABEL&amp;lt;/span&amp;gt;=&amp;lt;span class=&amp;quot;st0&amp;quot;&amp;gt;&amp;quot;//\&#39;|sed \&#39;s/&amp;quot;&amp;lt;/span&amp;gt;.&amp;lt;span class=&amp;quot;sy0&amp;quot;&amp;gt;*//&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;co3&amp;quot;&amp;gt;\&#39;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;br0&amp;quot;&amp;gt;&amp;amp;#41;&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;span class=&amp;quot;re2&amp;quot;&amp;gt;uuid&amp;lt;/span&amp;gt;=$&amp;lt;span class=&amp;quot;br0&amp;quot;&amp;gt;&amp;amp;#40;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;kw3&amp;quot;&amp;gt;echo&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;re1&amp;quot;&amp;gt;$temp&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;sy0&amp;quot;&amp;gt;|&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;kw2&amp;quot;&amp;gt;grep&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;st0&amp;quot;&amp;gt;&amp;quot;UUID=&amp;quot;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;sy0&amp;quot;&amp;gt;|&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;kw2&amp;quot;&amp;gt;sed&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;co3&amp;quot;&amp;gt;\&#39;&amp;lt;/span&amp;gt;s&amp;lt;span class=&amp;quot;sy0&amp;quot;&amp;gt;/&amp;lt;/span&amp;gt;.&amp;lt;span class=&amp;quot;sy0&amp;quot;&amp;gt;*&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;re2&amp;quot;&amp;gt;UUID&amp;lt;/span&amp;gt;=&amp;lt;span class=&amp;quot;st0&amp;quot;&amp;gt;&amp;quot;//\&#39;|sed \&#39;s/&amp;quot;&amp;lt;/span&amp;gt;.&amp;lt;span class=&amp;quot;sy0&amp;quot;&amp;gt;*//&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;co3&amp;quot;&amp;gt;\&#39;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;br0&amp;quot;&amp;gt;&amp;amp;#41;&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;span class=&amp;quot;re2&amp;quot;&amp;gt;atype&amp;lt;/span&amp;gt;=$&amp;lt;span class=&amp;quot;br0&amp;quot;&amp;gt;&amp;amp;#40;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;kw3&amp;quot;&amp;gt;echo&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;re1&amp;quot;&amp;gt;$temp&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;sy0&amp;quot;&amp;gt;|&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;kw2&amp;quot;&amp;gt;grep&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;st0&amp;quot;&amp;gt;&amp;quot;TYPE=&amp;quot;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;sy0&amp;quot;&amp;gt;|&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;kw2&amp;quot;&amp;gt;sed&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;co3&amp;quot;&amp;gt;\&#39;&amp;lt;/span&amp;gt;s&amp;lt;span class=&amp;quot;sy0&amp;quot;&amp;gt;/&amp;lt;/span&amp;gt;.&amp;lt;span class=&amp;quot;sy0&amp;quot;&amp;gt;*&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;re2&amp;quot;&amp;gt;TYPE&amp;lt;/span&amp;gt;=&amp;lt;span class=&amp;quot;st0&amp;quot;&amp;gt;&amp;quot;//\&#39;|sed \&#39;s/&amp;quot;&amp;lt;/span&amp;gt;.&amp;lt;span class=&amp;quot;sy0&amp;quot;&amp;gt;*//&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;co3&amp;quot;&amp;gt;\&#39;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;br0&amp;quot;&amp;gt;&amp;amp;#41;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;sy0&amp;quot;&amp;gt;&amp;lt;!&amp;lt;/span&amp;gt;--loginview end--&amp;lt;span class=&amp;quot;sy0&amp;quot;&amp;gt;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;span class=&amp;quot;kw1&amp;quot;&amp;gt;if&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;br0&amp;quot;&amp;gt;&amp;amp;#91;&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;re1&amp;quot;&amp;gt;$atype&amp;lt;/span&amp;gt; = &amp;lt;span class=&amp;quot;st0&amp;quot;&amp;gt;&amp;quot;vfat&amp;quot;&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;br0&amp;quot;&amp;gt;&amp;amp;#93;&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;span class=&amp;quot;kw1&amp;quot;&amp;gt;then&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt; add_fat &amp;lt;span class=&amp;quot;re1&amp;quot;&amp;gt;$label&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;re1&amp;quot;&amp;gt;$uuid&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;re1&amp;quot;&amp;gt;$k&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;span class=&amp;quot;kw1&amp;quot;&amp;gt;fi&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;span class=&amp;quot;kw1&amp;quot;&amp;gt;if&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;br0&amp;quot;&amp;gt;&amp;amp;#91;&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;re1&amp;quot;&amp;gt;$atype&amp;lt;/span&amp;gt; = &amp;lt;span class=&amp;quot;st0&amp;quot;&amp;gt;&amp;quot;ext3&amp;quot;&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;br0&amp;quot;&amp;gt;&amp;amp;#93;&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;span class=&amp;quot;kw1&amp;quot;&amp;gt;then&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt; add_ext3 &amp;lt;span class=&amp;quot;re1&amp;quot;&amp;gt;$label&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;re1&amp;quot;&amp;gt;$uuid&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;re1&amp;quot;&amp;gt;$k&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;span class=&amp;quot;kw1&amp;quot;&amp;gt;fi&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;span class=&amp;quot;kw3&amp;quot;&amp;gt;echo&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;re1&amp;quot;&amp;gt;$label&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;re1&amp;quot;&amp;gt;$uuid&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;re1&amp;quot;&amp;gt;$atype&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;span class=&amp;quot;kw1&amp;quot;&amp;gt;done&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;span class=&amp;quot;kw1&amp;quot;&amp;gt;done&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;span class=&amp;quot;br0&amp;quot;&amp;gt;&amp;amp;#125;&amp;lt;/span&amp;gt; &amp;amp;nbsp; &amp;amp;nbsp;&amp;lt;span class=&amp;quot;co0&amp;quot;&amp;gt;# ---------- &amp;amp;nbsp;end of function find_UUID &amp;amp;nbsp;----------&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;br /&amp;gt; find_disks&amp;lt;br /&amp;gt; find_partitions&amp;lt;br /&amp;gt; find_UUID
    &amp;lt;/div&amp;gt;
  &amp;lt;/td&amp;gt;
&amp;lt;/tr&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
  &lt;/table&gt;
&lt;/div&gt;&lt;h6 class=\&#34;zemanta-related-title\&#34;&gt;Related articles by Zemanta&lt;/h6&gt; &lt;ul class=\&#34;zemanta-article-ul\&#34;&gt; &lt;li class=\&#34;zemanta-article-ul-li\&#34;&gt;&lt;a href=\&#34;http://blog.amit-agarwal.co.in/2010/03/11/fedora-11-mount-options-for-vfat-and-other-volumes-for-automount/\&#34;&gt;Fedora 11 &amp;#8211; Mount options for vfat and other volumes for automount.&lt;/a&gt; (amit-agarwal.co.in)&lt;/li&gt; &lt;li class=\&#34;zemanta-article-ul-li\&#34;&gt;&lt;a href=\&#34;http://www.edugeek.net/forums/thin-client-virtual-machines/58405-esx4-cannot-create-datastore.html\&#34;&gt;ESX4 cannot create datastore&lt;/a&gt; (edugeek.net)&lt;/li&gt; &lt;li class=\&#34;zemanta-article-ul-li\&#34;&gt;&lt;a href=\&#34;http://www.brighthub.com/computing/hardware/articles/74336.aspx\&#34;&gt;Creating a Partition on an External Hard Drive&lt;/a&gt; (brighthub.com)&lt;/li&gt; &lt;li class=\&#34;zemanta-article-ul-li\&#34;&gt;&lt;a href=\&#34;http://www.lockergnome.com/it/2010/06/02/partition-assistant-v2-1/\&#34;&gt;Partition Assistant v2.1&lt;/a&gt; (lockergnome.com)&lt;/li&gt; &lt;/ul&gt; &lt;div class=\&#34;zemanta-pixie\&#34;&gt;&lt;a class=\&#34;zemanta-pixie-a\&#34; title=\&#34;Enhanced by Zemanta\&#34; href=\&#34;http://www.zemanta.com/\&#34;&gt;&lt;img class=\&#34;zemanta-pixie-img\&#34; src=\&#34;http://blog.amit-agarwal.co.in/wp-content/uploads/2010/08/zemified_c10.gif\&#34; alt=\&#34;Enhanced by Zemanta\&#34; /&gt;&lt;/a&gt;&lt;span class=\&#34;zem-script more-related more-info pretty-attribution paragraph-reblog\&#34;&gt;&lt;/span&gt;&lt;/div&gt;</description>
    </item>
    
    <item>
      <title>Filename completion in Linux with mixed case and ignored case.</title>
      <link>/2010/06/23/filename-completion-in-linux-with-mixed-case-and-ignored-case/</link>
      <pubDate>Wed, 23 Jun 2010 04:33:19 +0000</pubDate>
      
      <guid>/2010/06/23/filename-completion-in-linux-with-mixed-case-and-ignored-case/</guid>
      <description>&lt;!--[ad#ad-2]--&gt;
&lt;p&gt;This is one of my favourites, alwahs keep it handy. Linux is case sensitive by nature but you will always find filenames jumbled up in the case. So what is the solution:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;bind &amp;amp;#8221;set completion-ignore-case on&amp;amp;#8221;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Just execute the above in your bash command and file/dir name will behave like Windows. Remember that this is per session setting and thus the names do not get changed internally, it only changes the way to access it (specifically completion only). So if you want this behaviour in all your sessions put this in the appropriate profile file.&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>cdargs – bash cd command with bookmarks and browser.</title>
      <link>/2010/06/22/cdargs-bash-cd-command-with-bookmarks-and-browser/</link>
      <pubDate>Tue, 22 Jun 2010 02:37:47 +0000</pubDate>
      
      <guid>/2010/06/22/cdargs-bash-cd-command-with-bookmarks-and-browser/</guid>
      <description>&lt;div class=\&#34;zemanta-img\&#34;&gt; 
&lt;div&gt;
  &lt;dl class=\&#34;wp-caption alignright\&#34;&gt; &lt;dt class=\&#34;wp-caption-dt\&#34;&gt;&lt;a href=\&#34;http://commons.wikipedia.org/wiki/Image:Bash_demo.png\&#34;&gt;&lt;img title=\&#34;Screenshot of a Bash 3.1 session demonstrating...\&#34; src=\&#34;http://blog.amit-agarwal.co.in/wp-content/uploads/2010/08/300px-Bash_demo.png\&#34; alt=\&#34;Screenshot of a Bash 3.1 session demonstrating...\&#34; /&gt;&lt;/a&gt;&lt;/dt&gt; &lt;dd class=\&#34;wp-caption-dd zemanta-img-attribution\&#34;&gt;Image via &lt;a href=\&#34;http://commons.wikipedia.org/wiki/Image:Bash_demo.png\&#34;&gt;Wikipedia&lt;/a&gt;&lt;/dd&gt; &lt;/dl&gt;
&lt;/div&gt;&lt;/div&gt; 
&lt;!--[ad#ad-2]--&gt;
&lt;p&gt;cdargs is a &amp;lt;a class=&amp;quot;zem_slink freebase/en/bash&amp;quot; title=&amp;quot;Bash&amp;quot; rel=&amp;quot;homepage&amp;quot; href=&amp;quot;http://tiswww.case.edu/php/chet/bash/bashtop.html&amp;quot;&amp;gt;bash shell&lt;/a&gt; cd with bookmarks and browser. Quite useful if you are developer or someone who use&amp;amp;#8217;s the bash shell very frequently&lt;/p&gt;
&lt;blockquote&gt;
&lt;pre&gt;Name       : cdargs
&lt;/blockquote&gt;
&lt;p&gt;Arch       : i686
Version    : 1.35
Release    : 5.fc12
Size       : 114 k
Repo       : installed
From repo  : fedora
Summary    : The shell cd with bookmarks and browser
URL        : &lt;a href=&#34;http://www.skamphausen.de/software/cdargs/&#34;&gt;http://www.skamphausen.de/software/cdargs/&lt;/a&gt;
License    : &amp;lt;a class=&amp;quot;zem_slink freebase/en/gnu_general_public_license&amp;quot; title=&amp;quot;GNU General Public License&amp;quot; rel=&amp;quot;wikipedia&amp;quot; href=&amp;quot;http://en.wikipedia.org/wiki/GNU_General_Public_License&amp;quot;&amp;gt;GPLv2&amp;lt;/a&amp;gt;+
Description: Enables the user to quickly change &amp;lt;a class=&amp;quot;zem_slink freebase/en/working_directory&amp;quot; title=&amp;quot;Working directory&amp;quot; rel=&amp;quot;wikipedia&amp;quot; href=&amp;quot;http://en.wikipedia.org/wiki/Working_directory&amp;quot;&amp;gt;working directory&amp;lt;/a&amp;gt; by navigating cd arguments
: and expanding the shell built-in cd with bookmarks and browser.&lt;/pre&gt;&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>concatenate compressed and uncompressed logs</title>
      <link>/2010/06/21/concatenate-compressed-uncompressed-logs/</link>
      <pubDate>Mon, 21 Jun 2010 12:58:46 +0000</pubDate>
      
      <guid>/2010/06/21/concatenate-compressed-uncompressed-logs/</guid>
      <description>&lt;h1 id=&#34;span-stylefont-size-x-largea-hrefhttpfeedproxygooglecomrcommand-line-fu3iwfuyltygjmconcatenate-compressed-and-uncompressed-logsconcatenate-compressed-and-uncompressed-logsaspan&#34;&gt;&lt;strong&gt;&amp;lt;span style=&amp;quot;font-size: x-large;&amp;quot;&amp;gt;&amp;lt;a href=&amp;quot;http://feedproxy.google.com/~r/Command-line-fu/~3/iwFUyltYgjM/concatenate-compressed-and-uncompressed-logs&amp;quot;&amp;gt;concatenate compressed and uncompressed logs&lt;/a&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/h1&gt;
&lt;p&gt;&lt;tt&gt;$ find /var/log/apache2 -name &#39;access.log&lt;em&gt;gz&#39; -exec &amp;lt;a class=&amp;quot;zem_slink freebase/en/gzip&amp;quot; title=&amp;quot;Gzip&amp;quot; rel=&amp;quot;homepage&amp;quot; href=&amp;quot;http://www.gzip.org/&amp;quot;&amp;gt;zcat&lt;/a&gt; {} ; -or -name &#39;access.log&lt;/em&gt;&#39; -exec cat {} ;&lt;/tt&gt; This command allows you to stream your log files, including gziped files, into one stream which can be piped to &amp;lt;a class=&amp;quot;zem_slink freebase/en/awk&amp;quot; title=&amp;quot;AWK&amp;quot; rel=&amp;quot;homepage&amp;quot; href=&amp;quot;http://cm.bell-labs.com/cm/cs/awkbook/index.html&amp;quot;&amp;gt;awk&lt;/a&gt; or some other command for analysis.&lt;/p&gt;
&lt;p&gt;Note: if your version of &amp;amp;#8217;find&amp;amp;#8217; supports it, use:&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Linux command to repeat a string n times</title>
      <link>/2010/06/17/linux-command-repeat-string-times/</link>
      <pubDate>Thu, 17 Jun 2010 15:56:50 +0000</pubDate>
      
      <guid>/2010/06/17/linux-command-repeat-string-times/</guid>
      <description>&lt;!--[ad#ad-2]--&gt;
&lt;p&gt;There are more than one situation where you wished that there was a simple way to print a character n number of times. At least I face that quite often, especially when you want to print a menu. I found this post today which has pretty good solution and also the way how it works :&lt;br&gt;
&amp;lt;a href=&amp;quot;http://superuser.com/questions/86340/linux-command-to-repeat-a-string-n-times&amp;quot;&amp;gt;http://superuser.com/questions/86340/linux-command-to-repeat-a-string-n-times&lt;/a&gt;&lt;/p&gt;
&lt;!-- printf \&#34;x%.0s\&#34; {1..20} --&gt;&lt;h6 class=\&#34;zemanta-related-title\&#34;&gt;Related articles by Zemanta&lt;/h6&gt; &lt;ul class=\&#34;zemanta-article-ul\&#34;&gt; &lt;li class=\&#34;zemanta-article-ul-li\&#34;&gt;&lt;a href=\&#34;http://techie-buzz.com/foss/linux-unreal-irc-servers-contained-trojans-since-2009.html\&#34;&gt;Linux Version Of Unreal IRC Servers Contained Trojans Since 2009&lt;/a&gt; (techie-buzz.com)&lt;/li&gt; &lt;li class=\&#34;zemanta-article-ul-li\&#34;&gt;&lt;a href=\&#34;http://www.ghacks.net/2010/06/07/does-linux-need-to-be-defragd/\&#34;&gt;Does Linux need to be defrag\&amp;#8217;d?&lt;/a&gt; (ghacks.net)&lt;/li&gt; &lt;li class=\&#34;zemanta-article-ul-li\&#34;&gt;&lt;a href=\&#34;http://www.slideshare.net/gjmghjmg/000856-exam-pdf-demo\&#34;&gt;000-856 Exam Pdf Demo&lt;/a&gt; (slideshare.net)&lt;/li&gt; &lt;li class=\&#34;zemanta-article-ul-li\&#34;&gt;&lt;a href=\&#34;http://blog.amit-agarwal.co.in/2010/05/24/the-power-of-find-command-in-linux-advanced/\&#34;&gt;The power of find command in Linux &amp;#8211; advanced.&lt;/a&gt; (amit-agarwal.co.in)&lt;/li&gt; &lt;li class=\&#34;zemanta-article-ul-li\&#34;&gt;&lt;a href=\&#34;http://www.omgubuntu.co.uk/2010/06/gnulinux-name-game.html\&#34;&gt;GNU/Linux: The Name Game&lt;/a&gt; (omgubuntu.co.uk)&lt;/li&gt; &lt;/ul&gt; &lt;div class=\&#34;zemanta-pixie\&#34;&gt;&lt;a class=\&#34;zemanta-pixie-a\&#34; title=\&#34;Enhanced by Zemanta\&#34; href=\&#34;http://www.zemanta.com/\&#34;&gt;&lt;img class=\&#34;zemanta-pixie-img\&#34; src=\&#34;http://blog.amit-agarwal.co.in/wp-content/uploads/2010/08/zemified_c1.gif\&#34; alt=\&#34;Enhanced by Zemanta\&#34; /&gt;&lt;/a&gt;&lt;span class=\&#34;zem-script more-related more-info pretty-attribution paragraph-reblog\&#34;&gt;&lt;/span&gt;&lt;/div&gt;</description>
    </item>
    
    <item>
      <title>Change pidgin status from the command line</title>
      <link>/2010/06/16/change-pidgin-status-from-the-command-line/</link>
      <pubDate>Wed, 16 Jun 2010 02:17:06 +0000</pubDate>
      
      <guid>/2010/06/16/change-pidgin-status-from-the-command-line/</guid>
      <description>&lt;!--[ad#ad-2]--&gt;
&lt;p&gt;&lt;tt&gt;$ purple-remote &amp;quot;setstatus?status=away&amp;amp;message=AFK&amp;quot;&lt;/tt&gt; Thanks for the comment oshazard, i wasn&amp;amp;#8217;t aware of purple-remote existence.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&amp;lt;a href=&amp;quot;http://www.commandlinefu.com/commands/view/4554/change-pidgin-status&amp;quot;&amp;gt;View this command to comment, vote or add to favourites&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&amp;lt;a href=&amp;quot;http://feeds2.feedburner.com/commands/by/unixApe&amp;quot;&amp;gt;View all commands by &lt;/a&gt;&lt;strong&gt;&amp;lt;a href=&amp;quot;http://feeds2.feedburner.com/commands/by/unixApe&amp;quot;&amp;gt;unixApe&lt;/a&gt;&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&amp;lt;a href=&amp;quot;http://www.commandlinefu.com&amp;quot;&amp;gt;&amp;lt;img src=&amp;quot;http://blog.amit-agarwal.co.in/wp-content/uploads/2010/08/header-logo.jpg&amp;quot; alt=&amp;quot;&amp;quot; align=&amp;quot;bottom&amp;quot; /&amp;gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;by David Winterbottom (&amp;lt;a href=&amp;quot;http://codeinthehole.com&amp;quot;&amp;gt;codeinthehole.com&lt;/a&gt;)&lt;/p&gt;
&lt;p&gt;&amp;lt;a href=&amp;quot;http://feedads.g.doubleclick.net/~a/xmocNuFfObClC-QnA38odl3AWt8/0/da&amp;quot;&amp;gt;&amp;lt;img src=&amp;quot;http://blog.amit-agarwal.com/wp-content/uploads/img.zemanta.com/~a/xmocNuFfObClC-QnA38odl3AWt8/0/di&amp;quot; alt=&amp;quot;&amp;quot; align=&amp;quot;bottom&amp;quot; /&amp;gt;&lt;/a&gt;&lt;br&gt;
&amp;lt;a href=&amp;quot;http://feedads.g.doubleclick.net/~a/xmocNuFfObClC-QnA38odl3AWt8/1/da&amp;quot;&amp;gt;&amp;lt;img src=&amp;quot;http://blog.amit-agarwal.com/wp-content/uploads/img.zemanta.com/~a/xmocNuFfObClC-QnA38odl3AWt8/1/di&amp;quot; alt=&amp;quot;&amp;quot; align=&amp;quot;bottom&amp;quot; /&amp;gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;img src=&amp;quot;http://blog.amit-agarwal.com/wp-content/uploads/img.zemanta.com/~r/Command-line-fu/~4/Ky02xAVnP7w&amp;quot; alt=&amp;quot;&amp;quot; width=&amp;quot;1&amp;quot; height=&amp;quot;1&amp;quot; align=&amp;quot;bottom&amp;quot; /&amp;gt;&lt;/p&gt;
&lt;p&gt;URL: &amp;lt;a href=&amp;quot;http://feedproxy.google.com/~r/Command-line-fu/~3/Ky02xAVnP7w/change-pidgin-status&amp;quot;&amp;gt;http://feedproxy.google.com/~r/Command-line-fu/~3/Ky02xAVnP7w/change-pidgin-status&lt;/a&gt;&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>List of commands you use most often</title>
      <link>/2010/06/16/list-commands/</link>
      <pubDate>Wed, 16 Jun 2010 02:17:01 +0000</pubDate>
      
      <guid>/2010/06/16/list-commands/</guid>
      <description>&lt;!--[ad#ad-2]--&gt;
&lt;h1 id=&#34;span-stylefont-size-x-largea-hrefhttpfeedproxygooglecomrcommand-line-fu36mxhisiindolist-of-commands-you-use-most-oftenlist-of-commands-you-use-most-oftenaspan&#34;&gt;&lt;strong&gt;&amp;lt;span style=&amp;quot;font-size: x-large;&amp;quot;&amp;gt;&amp;lt;a href=&amp;quot;http://feedproxy.google.com/~r/Command-line-fu/~3/6MxHiSiINdo/list-of-commands-you-use-most-often&amp;quot;&amp;gt;List of commands you use most often&lt;/a&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/h1&gt;
&lt;p&gt;&lt;tt&gt;$ history | &amp;lt;a class=&amp;quot;zem_slink freebase/en/awk&amp;quot; title=&amp;quot;AWK&amp;quot; rel=&amp;quot;homepage&amp;quot; href=&amp;quot;http://cm.bell-labs.com/cm/cs/awkbook/index.html&amp;quot;&amp;gt;awk&lt;/a&gt; &#39;{a[$2]++}END{for(i in a){print a[i] &amp;quot; &amp;quot; i}}&#39; | sort -rn | head &amp;gt; /tmp/cmds | gnuplot -persist &amp;lt;(echo &#39;plot &amp;quot;/tmp/cmds&amp;quot; using 1:xticlabels(2) with boxes&#39;)&lt;/tt&gt; Plot your most used commands with gnuplot.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&amp;lt;a href=&amp;quot;http://www.commandlinefu.com/commands/view/5845/list-of-commands-you-use-most-often&amp;quot;&amp;gt;View this command to comment, vote or add to favourites&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&amp;lt;a href=&amp;quot;http://feeds2.feedburner.com/commands/by/sthrs&amp;quot;&amp;gt;View all commands by &lt;/a&gt;&lt;strong&gt;&amp;lt;a href=&amp;quot;http://feeds2.feedburner.com/commands/by/sthrs&amp;quot;&amp;gt;sthrs&lt;/a&gt;&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&amp;lt;a href=&amp;quot;http://www.commandlinefu.com&amp;quot;&amp;gt;&amp;lt;img src=&amp;quot;http://blog.amit-agarwal.co.in/wp-content/uploads/2010/08/header-logo.jpg&amp;quot; alt=&amp;quot;commandlinefu.com&amp;quot; align=&amp;quot;bottom&amp;quot; /&amp;gt;&lt;/a&gt;&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>email with templates (with variables) from the command line with sendmail or any other MTA.</title>
      <link>/2010/06/09/email-with-templates-with-variables-from-the-command-line-with-sendmail-or-any-other-mta/</link>
      <pubDate>Wed, 09 Jun 2010 16:57:10 +0000</pubDate>
      
      <guid>/2010/06/09/email-with-templates-with-variables-from-the-command-line-with-sendmail-or-any-other-mta/</guid>
      <description>&lt;!--[ad#ad-2]--&gt;
&lt;p&gt;I was trying to get templates to work on evolution and found that although templates are there in evolution mail client, its not that efficient to use. What I thus wanted was to have something that could allow me to send mails to (and cc and bcc) to specified people with predefined template, only some values changed, like changelog and so on. So I wrote a set of files and below files to achieve the same. Hope it helps you too 🙂&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Biggest free shell account list</title>
      <link>/2010/06/09/biggest-free-shell-account-list/</link>
      <pubDate>Wed, 09 Jun 2010 16:57:07 +0000</pubDate>
      
      <guid>/2010/06/09/biggest-free-shell-account-list/</guid>
      <description>&lt;!--[ad#ad-2]--&gt;
&lt;p&gt;Biggest shell account list is &amp;lt;a href=&amp;quot;http://www.red-pill.eu/freeunix.shtml&amp;quot; target=&amp;quot;_blank&amp;quot;&amp;gt;here&lt;/a&gt;.&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Verify all the paths in the PATH directory</title>
      <link>/2010/06/08/verify-paths-path-directory/</link>
      <pubDate>Tue, 08 Jun 2010 09:13:35 +0000</pubDate>
      
      <guid>/2010/06/08/verify-paths-path-directory/</guid>
      <description>&lt;!--[ad#ad-2]--&gt;
&lt;p&gt;Here is the command to test that all the directories in your path actually exist.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;(&amp;lt;a class=&amp;quot;zem_slink freebase/en/internal_field_separator&amp;quot; title=&amp;quot;Internal field separator&amp;quot; rel=&amp;quot;wikipedia&amp;quot; href=&amp;quot;http://en.wikipedia.org/wiki/Internal_field_separator&amp;quot;&amp;gt;IFS&lt;/a&gt;=:;for p in $PATH; do test -d $p || echo $p; done)&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;And the explanation :&lt;/p&gt;
&lt;p&gt;Set the IFS to &amp;amp;#8221;:&amp;amp;#8221;&lt;/p&gt;
&lt;p&gt;now we loop through the PATH variable&lt;/p&gt;
&lt;p&gt;and test all the directories with &amp;amp;#8221;test -d&amp;amp;#8221;&lt;/p&gt;
&lt;p&gt;Here is another version without IFS:&lt;/p&gt;
&lt;!--loginview start--&gt;
&lt;blockquote&gt;
&lt;p&gt;for i in ${PATH//:/ };do test  -d $i || echo $i;done&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>bash completion not working on Fedora</title>
      <link>/2010/06/07/bash-completion-not-working-on-fedora/</link>
      <pubDate>Sun, 06 Jun 2010 20:58:13 +0000</pubDate>
      
      <guid>/2010/06/07/bash-completion-not-working-on-fedora/</guid>
      <description>&lt;!--[ad#ad-2]--&gt;
&lt;p&gt;I had bash completion installed and after that I had made huge changes to my bashrc and also installed bashstyle. After this the bash-completion stopped working.&lt;/p&gt;
&lt;p&gt;I had to spend a lot of time to figure out that the easiest solution was to source the bash-completion again in the end. 🙂&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;. /etc/bash_completion&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;</description>
    </item>
    
    <item>
      <title>colors in bash -- script to display all the possible colors.</title>
      <link>/2010/06/07/colors-bash-script-display-colors/</link>
      <pubDate>Sun, 06 Jun 2010 20:58:11 +0000</pubDate>
      
      <guid>/2010/06/07/colors-bash-script-display-colors/</guid>
      <description>&lt;!--[ad#ad-2]--&gt;
&lt;p&gt;If you wanted to have colors in the &lt;a class=&#34;zem_slink&#34; title=&#34;Bash (Unix shell)&#34; rel=&#34;homepage&#34; href=&#34;http://tiswww.case.edu/php/chet/bash/bashtop.html&#34;&gt;bash&lt;/a&gt; output (including the colors in PS1-4), don&amp;amp;#8217;t you keep wondering how the &lt;a class=&#34;\&amp;quot;zem_slink&#34; title=&#34;\&amp;quot;Color\&amp;quot;&#34; rel=&#34;\&amp;quot;wikipedia\&amp;quot;&#34; href=&#34;\&#34;&gt;color&lt;/a&gt; code would look on the terminal. So, I wrote this small script to show the complete color codes. This is how the output would look:&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;%5C&#34;&gt;&lt;img class=&#34;\&amp;quot;size-medium&#34; title=&#34;\&amp;quot;Bash&#34; src=&#34;\&#34; alt=&#34;\&amp;quot;Bash&#34; width=&#34;\&amp;quot;221\&amp;quot;&#34; height=&#34;\&amp;quot;300\&amp;quot;&#34; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;And here is the script:&lt;/p&gt;
&lt;div class=&#34;codecolorer-container text solarized-light&#34; style=&#34;overflow:auto;white-space:nowrap;width:550px;height:900px;&#34;&gt;
  &lt;table cellspacing=&#34;0&#34; cellpadding=&#34;0&#34;&gt;
    &lt;tr&gt;
      &lt;td class=&#34;line-numbers&#34;&gt;
        &lt;div&gt;
          1&lt;br /&gt;2&lt;br /&gt;3&lt;br /&gt;4&lt;br /&gt;5&lt;br /&gt;6&lt;br /&gt;7&lt;br /&gt;8&lt;br /&gt;9&lt;br /&gt;10&lt;br /&gt;11&lt;br /&gt;12&lt;br /&gt;13&lt;br /&gt;14&lt;br /&gt;15&lt;br /&gt;16&lt;br /&gt;17&lt;br /&gt;18&lt;br /&gt;19&lt;br /&gt;20&lt;br /&gt;21&lt;br /&gt;22&lt;br /&gt;23&lt;br /&gt;24&lt;br /&gt;25&lt;br /&gt;26&lt;br /&gt;27&lt;br /&gt;28&lt;br /&gt;29&lt;br /&gt;30&lt;br /&gt;31&lt;br /&gt;32&lt;br /&gt;33&lt;br /&gt;34&lt;br /&gt;35&lt;br /&gt;36&lt;br /&gt;37&lt;br /&gt;38&lt;br /&gt;39&lt;br /&gt;40&lt;br /&gt;41&lt;br /&gt;42&lt;br /&gt;43&lt;br /&gt;44&lt;br /&gt;45&lt;br /&gt;46&lt;br /&gt;47&lt;br /&gt;48&lt;br /&gt;49&lt;br /&gt;50&lt;br /&gt;51&lt;br /&gt;52&lt;br /&gt;
        &lt;/div&gt;
      &lt;/td&gt;
&lt;pre&gt;&lt;code&gt;  &amp;lt;td&amp;gt;
    &amp;lt;div class=&amp;quot;text codecolorer&amp;quot;&amp;gt;
      #!/bin/bash -&amp;lt;br /&amp;gt; #===============================================================================&amp;lt;br /&amp;gt; #&amp;lt;br /&amp;gt; # &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp;FILE: &amp;amp;nbsp;colors.sh&amp;lt;br /&amp;gt; #&amp;lt;br /&amp;gt; # &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; USAGE: &amp;amp;nbsp;./colors.sh&amp;lt;br /&amp;gt; #&amp;lt;br /&amp;gt; # &amp;amp;nbsp; DESCRIPTION: &amp;amp;nbsp;Bash colors&amp;lt;br /&amp;gt; #&amp;lt;br /&amp;gt; # &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; OPTIONS: &amp;amp;nbsp;---&amp;lt;br /&amp;gt; # &amp;amp;nbsp;REQUIREMENTS: &amp;amp;nbsp;---&amp;lt;br /&amp;gt; # &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp;BUGS: &amp;amp;nbsp;---&amp;lt;br /&amp;gt; # &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; NOTES: &amp;amp;nbsp;---&amp;lt;br /&amp;gt; # &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp;AUTHOR: &amp;amp;nbsp;Amit Agarwal (AKA), amit.agarwal@amit-agarwal.co.in&amp;lt;br /&amp;gt; # &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; COMPANY: &amp;amp;nbsp;Individual&amp;lt;br /&amp;gt; # &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; VERSION: &amp;amp;nbsp;1.0&amp;lt;br /&amp;gt; # &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; CREATED: &amp;amp;nbsp;09/21/2009 06:12:07 PM IST&amp;lt;br /&amp;gt; # &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp;REVISION: &amp;amp;nbsp;---&amp;lt;br /&amp;gt; #===============================================================================&amp;lt;br /&amp;gt; &amp;lt;br /&amp;gt; for c in `seq 0 255`;&amp;lt;br /&amp;gt; do&amp;lt;br /&amp;gt; t=5;&amp;lt;br /&amp;gt; [[ $c -lt 108 ]]&amp;amp;&amp;amp;t=0;&amp;lt;br /&amp;gt; for i in `seq $t 5`;&amp;lt;br /&amp;gt; do&amp;lt;br /&amp;gt; #Display the codes also for easier lookup in terminal&amp;lt;br /&amp;gt; &amp;lt;!--loginview start--&amp;gt;echo $i;${c}&amp;lt;!--loginview end--&amp;gt;&amp;lt;br /&amp;gt; echo -e &amp;quot;&amp;lt;a class=&amp;quot;zem_slink&amp;quot; title=&amp;quot;Path (computing)&amp;quot; rel=&amp;quot;wikipedia&amp;quot; href=&amp;quot;http://en.wikipedia.org/wiki/Path_%28computing%29&amp;quot;&amp;gt;\\&amp;lt;/a&amp;gt;\e[0;48;$i;${c}m|| $i:$c `seq -s+0 $(($COLUMNS/2))|tr -d \&#39;[0-9]\&#39;`\\e[0m&amp;quot;;&amp;lt;br /&amp;gt; done;&amp;lt;br /&amp;gt; done&amp;lt;br /&amp;gt; &amp;lt;br /&amp;gt; # setup_colors - Adds colors to array CC for global use&amp;lt;br /&amp;gt; # 30 - Black, 31 - Red, 32 - Green, 33 - Yellow, 34 - Blue,&amp;lt;br /&amp;gt; # 35 - Magenta, 36 - Blue/Green, 37 - White,&amp;lt;br /&amp;gt; # 30/42 - Black on Green \&#39;30\\;42\&#39;&amp;lt;br /&amp;gt; &amp;lt;!--loginview start--&amp;gt;function setup_colors(){&amp;lt;br /&amp;gt; declare -a CC;&amp;lt;br /&amp;gt; for i in `seq 0 7`;&amp;lt;br /&amp;gt; do&amp;lt;br /&amp;gt; ii=$(($i+7));&amp;lt;br /&amp;gt; CC[$i]=&amp;quot;\\033[1;3${i}m&amp;quot;;&amp;lt;br /&amp;gt; CC[$ii]=&amp;quot;\\033[0;3${i}m&amp;quot;;&amp;lt;br /&amp;gt; done;&amp;lt;br /&amp;gt; CC[15]=&amp;quot;\\033[30;42m&amp;quot;;&amp;lt;br /&amp;gt; R=$\&#39;\\033[0;00m\&#39;;&amp;lt;br /&amp;gt; X=$\&#39;\\033[1;37m\&#39;;&amp;lt;br /&amp;gt; export R X;&amp;lt;br /&amp;gt; }&amp;lt;br /&amp;gt; function display_colors(){&amp;lt;br /&amp;gt; for i in $(seq 0 $((${#CC[@]} - 1))); do echo -e &amp;quot;${CC[$i]}[$i]\\n$R&amp;quot;; done&amp;lt;br /&amp;gt; }
    &amp;lt;/div&amp;gt;
  &amp;lt;/td&amp;gt;
&amp;lt;/tr&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
  &lt;/table&gt;
&lt;/div&gt;
&lt;h6 id=&#34;related-articles-by-a-classzem_slink-titlezemanta-relhomepage-hrefhttpwwwzemantacomzemantaa-zemanta-related-title&#34;&gt;Related articles by &lt;a class=&#34;zem_slink&#34; title=&#34;Zemanta&#34; rel=&#34;homepage&#34; href=&#34;http://www.zemanta.com&#34;&gt;Zemanta&lt;/a&gt; {.&amp;quot;zemanta-related-title&amp;quot;}&lt;/h6&gt;
&lt;ul class=&#34;\&amp;quot;zemanta-article-ul\&amp;quot;&#34;&gt;
  &lt;li class=&#34;\&amp;quot;zemanta-article-ul-li\&amp;quot;&#34;&gt;
    &lt;a href=&#34;\&#34;&gt;unbound variable &amp;#8211; bash completion not working and having issues with other stuff like command not found.&lt;/a&gt; (amit-agarwal.co.in)
  &lt;/li&gt;
  &lt;li class=&#34;\&amp;quot;zemanta-article-ul-li\&amp;quot;&#34;&gt;
    &lt;a href=&#34;\&#34;&gt;Modifying the bashrc or bash startup files.&lt;/a&gt; (amit-agarwal.co.in)
  &lt;/li&gt;
  &lt;li class=&#34;\&amp;quot;zemanta-article-ul-li\&amp;quot;&#34;&gt;
    &lt;a href=&#34;\&#34;&gt;Nature-Inspired Colors for Home Interiors&lt;/a&gt; (interiordecorating.suite101.com)
  &lt;/li&gt;
  &lt;li class=&#34;\&amp;quot;zemanta-article-ul-li\&amp;quot;&#34;&gt;
    &lt;a href=&#34;\&#34;&gt;Dark and Light Blue Colors in Feng Shui&lt;/a&gt; (feng-shui-concepts.suite101.com)
  &lt;/li&gt;
  &lt;li class=&#34;\&amp;quot;zemanta-article-ul-li\&amp;quot;&#34;&gt;
    &lt;a href=&#34;\&#34;&gt;Delete all files in a folder that don\&amp;#8217;t match a certain file extension&lt;/a&gt; (amit-agarwal.co.in)
  &lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&#34;\&amp;quot;zemanta-pixie\&amp;quot;&#34;&gt;
  &lt;a class=&#34;\&amp;quot;zemanta-pixie-a\&amp;quot;&#34; title=&#34;\&amp;quot;Reblog&#34; href=&#34;\&#34;&gt;&lt;img class=&#34;\&amp;quot;zemanta-pixie-img\&amp;quot;&#34; src=&#34;\&#34; alt=&#34;\&amp;quot;Reblog&#34; /&gt;&lt;/a&gt;&lt;span class=&#34;\&amp;quot;zem-script&#34;&gt;&lt;/span&gt;
&lt;/div&gt;
&lt;div class=&#34;zemanta-pixie&#34; style=&#34;margin-top: 10px; height: 15px;&#34;&gt;
  &lt;a class=&#34;zemanta-pixie-a&#34; title=&#34;Enhanced by Zemanta&#34; href=&#34;http://www.zemanta.com/&#34;&gt;&lt;img class=&#34;zemanta-pixie-img&#34; style=&#34;border: medium none; float: right;&#34; src=&#34;https://i1.wp.com/img.zemanta.com/zemified_e.png?w=688&#34; alt=&#34;Enhanced by Zemanta&#34; data-recalc-dims=&#34;1&#34; /&gt;&lt;/a&gt;&lt;span class=&#34;zem-script more-related pretty-attribution&#34;&gt;&lt;/span&gt;
&lt;/div&gt;</description>
    </item>
    
    <item>
      <title>let a cow tell you your fortune</title>
      <link>/2010/06/03/cow-fortune/</link>
      <pubDate>Thu, 03 Jun 2010 02:00:23 +0000</pubDate>
      
      <guid>/2010/06/03/cow-fortune/</guid>
      <description>&lt;div id=\&#34;usernote\&#34; class=\&#34;note\&#34;&gt;&lt;!--[ad#ad-2]--&gt;&lt;/div&gt; &lt;div class=\&#34;note\&#34;&gt;Here\&amp;#8217;s something that I saw on commandlinefu yesterday. That sent me thinking about some command to have the cow file picked randomly 🙂 So, here\&amp;#8217;s the original command from the commandlinefu:&lt;/div&gt; &lt;div id=\&#34;header\&#34;&gt;
&lt;p&gt;&lt;strong&gt;let a cow tell you your fortune&lt;/strong&gt;&lt;/div&gt;&lt;/p&gt;
&lt;div&gt;
  &lt;div class=&#34;codecolorer-container text solarized-light&#34; style=&#34;overflow:auto;white-space:nowrap;width:550px;&#34;&gt;
    &lt;table cellspacing=&#34;0&#34; cellpadding=&#34;0&#34;&gt;
      &lt;tr&gt;
        &lt;td class=&#34;line-numbers&#34;&gt;
          &lt;div&gt;
            1&lt;br /&gt;
          &lt;/div&gt;
        &lt;/td&gt;
&lt;pre&gt;&lt;code&gt;    &amp;lt;td&amp;gt;
      &amp;lt;div class=&amp;quot;text codecolorer&amp;quot;&amp;gt;
        $ fortune | &amp;lt;a class=&amp;quot;zem_slink freebase/en/cowsay&amp;quot; title=&amp;quot;Cowsay&amp;quot; rel=&amp;quot;homepage&amp;quot; href=&amp;quot;http://www.nog.net/%7Etony/warez/cowsay.shtml&amp;quot;&amp;gt;cowsay&amp;lt;/a&amp;gt; -f tux
      &amp;lt;/div&amp;gt;
    &amp;lt;/td&amp;gt;
  &amp;lt;/tr&amp;gt;
&amp;lt;/table&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
  &lt;div&gt;
    &lt;p&gt;
      Let &lt;a class=\&#34;zem_slink freebase/en/tux\&#34; title=\&#34;Tux\&#34; rel=\&#34;wikipedia\&#34; href=\&#34;http://en.wikipedia.org/wiki/Tux\&#34;&gt;Tux&lt;/a&gt; bring the &lt;a class=\&#34;zem_slink freebase/en/fortune_cookie\&#34; title=\&#34;Fortune cookie\&#34; rel=\&#34;wikipedia\&#34; href=\&#34;http://en.wikipedia.org/wiki/Fortune_cookie\&#34;&gt;fortune cookie&lt;/a&gt;
    &lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Google\’s RE2 regular expression library</title>
      <link>/2010/05/30/googles-re2-regular-expression-library/</link>
      <pubDate>Sun, 30 May 2010 15:35:10 +0000</pubDate>
      
      <guid>/2010/05/30/googles-re2-regular-expression-library/</guid>
      <description>&lt;div class=\&#34;zemanta-img\&#34;&gt; 
&lt;div&gt;
  &lt;dl class=\&#34;wp-caption alignright\&#34;&gt; &lt;dt class=\&#34;wp-caption-dt\&#34;&gt;&lt;a href=\&#34;http://www.crunchbase.com/company/google\&#34;&gt;&lt;img title=\&#34;Image representing Google as depicted in Crunc...\&#34; src=\&#34;http://blog.amit-agarwal.co.in/wp-content/uploads/2010/08/29578v7-max-250x250.jpg\&#34; alt=\&#34;Image representing Google as depicted in Crunc...\&#34; /&gt;&lt;/a&gt;&lt;/dt&gt; &lt;dd class=\&#34;wp-caption-dd zemanta-img-attribution\&#34;&gt;Image via &lt;a href=\&#34;http://www.crunchbase.com\&#34;&gt;CrunchBase&lt;/a&gt;&lt;/dd&gt; &lt;/dl&gt;
&lt;/div&gt;&lt;/div&gt; 
&lt;p&gt;?&lt;!--[ad#ad-2]--&gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;a class=&amp;quot;zem_slink freebase/en/google&amp;quot; title=&amp;quot;Google&amp;quot; rel=&amp;quot;homepage&amp;quot; href=&amp;quot;http://google.com&amp;quot;&amp;gt;Google&lt;/a&gt; has announced the release of its RE2 library under a BSDish license. &amp;amp;#8221;At Google, we use &amp;lt;a class=&amp;quot;zem_slink freebase/en/regular_expression&amp;quot; title=&amp;quot;Regular expression&amp;quot; rel=&amp;quot;wikipedia&amp;quot; href=&amp;quot;http://en.wikipedia.org/wiki/Regular_expression&amp;quot;&amp;gt;regular expressions&lt;/a&gt; as part of the interface to many external and internal systems, including Code Search, &amp;lt;a class=&amp;quot;zem_slink freebase/en/sawzall&amp;quot; title=&amp;quot;Sawzall (programming language)&amp;quot; rel=&amp;quot;wikipedia&amp;quot; href=&amp;quot;http://en.wikipedia.org/wiki/Sawzall_%28programming_language%29&amp;quot;&amp;gt;Sawzall&lt;/a&gt;, and &amp;lt;a class=&amp;quot;zem_slink&amp;quot; title=&amp;quot;Bigtable&amp;quot; rel=&amp;quot;homepage&amp;quot; href=&amp;quot;http://labs.google.com/papers/bigtable.html&amp;quot;&amp;gt;Bigtable&lt;/a&gt;. Those systems process large amounts of &amp;lt;a class=&amp;quot;zem_slink freebase/en/data&amp;quot; title=&amp;quot;Data&amp;quot; rel=&amp;quot;wikipedia&amp;quot; href=&amp;quot;http://en.wikipedia.org/wiki/Data&amp;quot;&amp;gt;data&lt;/a&gt;; exponential &amp;lt;a class=&amp;quot;zem_slink freebase/en/runtime&amp;quot; title=&amp;quot;Run time (computing)&amp;quot; rel=&amp;quot;wikipedia&amp;quot; href=&amp;quot;http://en.wikipedia.org/wiki/Run_time_%28computing%29&amp;quot;&amp;gt;run time&lt;/a&gt; would be a serious problem. On a more practical note, these are &amp;lt;a class=&amp;quot;zem_slink freebase/en/thread&amp;quot; title=&amp;quot;Thread (computer science)&amp;quot; rel=&amp;quot;wikipedia&amp;quot; href=&amp;quot;http://en.wikipedia.org/wiki/Thread_%28computer_science%29&amp;quot;&amp;gt;multithreaded&lt;/a&gt; &amp;lt;a class=&amp;quot;zem_slink freebase/en/cplusplus&amp;quot; title=&amp;quot;C++&amp;quot; rel=&amp;quot;wikipedia&amp;quot; href=&amp;quot;http://en.wikipedia.org/wiki/C%2B%2B&amp;quot;&amp;gt;C++&lt;/a&gt; programs with fixed-size stacks: the unbounded stack usage in typical regular expression implementations leads to stack overflows and server crashes. To solve both problems, we&amp;amp;#8217;ve built a new regular expression engine, called RE2, which is based on &amp;lt;a class=&amp;quot;zem_slink freebase/en/automata_theory&amp;quot; title=&amp;quot;Automata theory&amp;quot; rel=&amp;quot;wikipedia&amp;quot; href=&amp;quot;http://en.wikipedia.org/wiki/Automata_theory&amp;quot;&amp;gt;automata theory&lt;/a&gt; and guarantees that searches complete in &amp;lt;a class=&amp;quot;zem_slink freebase/en/linear_time&amp;quot; title=&amp;quot;Linear time&amp;quot; rel=&amp;quot;wikipedia&amp;quot; href=&amp;quot;http://en.wikipedia.org/wiki/Linear_time&amp;quot;&amp;gt;linear time&lt;/a&gt; with respect to the size of the input and in a fixed amount of stack space.&amp;amp;#8221; More information can be found on the &amp;lt;a href=&amp;quot;http://code.google.com/p/re2/&amp;quot; target=&amp;quot;_blank&amp;quot;&amp;gt;RE2 project page&lt;/a&gt;.&amp;lt;h6 class=&amp;quot;zemanta-related-title&amp;quot;&amp;gt;Related articles by Zemanta&lt;/h6&gt; &amp;lt;ul class=&amp;quot;zemanta-article-ul&amp;quot;&amp;gt; &amp;lt;li class=&amp;quot;zemanta-article-ul-li&amp;quot;&amp;gt;&amp;lt;a href=&amp;quot;http://glinden.blogspot.com/2010/03/gfs-and-its-evolution.html&amp;quot;&amp;gt;GFS and its evolution&lt;/a&gt; (glinden.blogspot.com)&lt;/li&gt; &amp;lt;li class=&amp;quot;zemanta-article-ul-li&amp;quot;&amp;gt;&amp;lt;a href=&amp;quot;http://research.swtch.com/2010/03/regular-expression-article-3.html&amp;quot;&amp;gt;Regular Expression Article #3&lt;/a&gt; (research.swtch.com)&lt;/li&gt; &lt;/ul&gt; &amp;lt;div class=&amp;quot;zemanta-pixie&amp;quot;&amp;gt;&amp;lt;a class=&amp;quot;zemanta-pixie-a&amp;quot; title=&amp;quot;Reblog this post [with Zemanta]&amp;quot; href=&amp;quot;http://reblog.zemanta.com/zemified/456fa268-f416-4aec-ae05-4d1a9c9c2712/&amp;quot;&amp;gt;&amp;lt;img class=&amp;quot;zemanta-pixie-img&amp;quot; src=&amp;quot;http://blog.amit-agarwal.co.in/wp-content/uploads/2010/08/reblog_b65.png&amp;quot; alt=&amp;quot;Reblog this post [with Zemanta]&amp;quot; /&amp;gt;&lt;/a&gt;&amp;lt;span class=&amp;quot;zem-script more-related more-info pretty-attribution paragraph-reblog&amp;quot;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>prints line numbers</title>
      <link>/2010/05/28/prints-line-numbers/</link>
      <pubDate>Thu, 27 May 2010 20:26:34 +0000</pubDate>
      
      <guid>/2010/05/28/prints-line-numbers/</guid>
      <description>&lt;!--[ad#ad-2]--&gt;
&lt;p&gt;&lt;tt&gt;$ nl&lt;/tt&gt;&lt;filename&gt;&lt;/p&gt;
&lt;p&gt;others:&lt;br&gt;
perl -ne &amp;amp;#8217;print &amp;amp;#8221;$. – $_&amp;amp;#8221;&amp;amp;#8217; $1&lt;br&gt;
grep -n . $1&lt;br&gt;
perl -pe &amp;amp;#8217;print &amp;amp;#8221;$. &amp;amp;#8221;&amp;amp;#8217; $1&lt;br&gt;
cat -n $1&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&amp;lt;a href=&amp;quot;http://www.commandlinefu.com/commands/view/4273/prints-line-numbers&amp;quot;&amp;gt;View this command to comment, vote or add to favourites&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&amp;lt;a href=&amp;quot;http://feeds2.feedburner.com/commands/by/solarislackware&amp;quot;&amp;gt;View all commands by &lt;/a&gt;&lt;strong&gt;&amp;lt;a href=&amp;quot;http://feeds2.feedburner.com/commands/by/solarislackware&amp;quot;&amp;gt;solarislackware&lt;/a&gt;&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&amp;lt;a href=&amp;quot;http://www.commandlinefu.com&amp;quot;&amp;gt;&amp;lt;img src=&amp;quot;http://blog.amit-agarwal.co.in/wp-content/uploads/2010/08/header-logo.jpg&amp;quot; alt=&amp;quot;&amp;quot; align=&amp;quot;bottom&amp;quot; /&amp;gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;by David Winterbottom (&amp;lt;a href=&amp;quot;http://codeinthehole.com&amp;quot;&amp;gt;codeinthehole.com&lt;/a&gt;)&lt;/p&gt;
&lt;p&gt;&amp;lt;a href=&amp;quot;http://feedads.g.doubleclick.net/~a/J0FNu7gmMTrQGT61-3dKUYYmlBY/0/da&amp;quot;&amp;gt;&amp;lt;img src=&amp;quot;http://blog.amit-agarwal.com/wp-content/uploads/img.zemanta.com/~a/J0FNu7gmMTrQGT61-3dKUYYmlBY/0/di&amp;quot; alt=&amp;quot;&amp;quot; align=&amp;quot;bottom&amp;quot; /&amp;gt;&lt;/a&gt;&lt;br&gt;
&amp;lt;a href=&amp;quot;http://feedads.g.doubleclick.net/~a/J0FNu7gmMTrQGT61-3dKUYYmlBY/1/da&amp;quot;&amp;gt;&amp;lt;img src=&amp;quot;http://blog.amit-agarwal.com/wp-content/uploads/img.zemanta.com/~a/J0FNu7gmMTrQGT61-3dKUYYmlBY/1/di&amp;quot; alt=&amp;quot;&amp;quot; align=&amp;quot;bottom&amp;quot; /&amp;gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;img src=&amp;quot;http://blog.amit-agarwal.com/wp-content/uploads/img.zemanta.com/~r/Command-line-fu/~4/L6W6GZj7Dl8&amp;quot; alt=&amp;quot;&amp;quot; width=&amp;quot;1&amp;quot; height=&amp;quot;1&amp;quot; align=&amp;quot;bottom&amp;quot; /&amp;gt;&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Pimp your ls</title>
      <link>/2010/05/27/pimp-your-ls/</link>
      <pubDate>Thu, 27 May 2010 11:44:41 +0000</pubDate>
      
      <guid>/2010/05/27/pimp-your-ls/</guid>
      <description>&lt;!--[ad#ad-2]--&gt;
&lt;p&gt;Here are some of the things that you can do with your ls command.&lt;/p&gt;
&lt;p&gt;First off you can use alias&amp;amp;#8217;s to help you type the most typical ls commands. I will give you some examples:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;alias ls =&amp;amp;#8221;ls –color –classify&amp;amp;#8221;&lt;br&gt;
alias ls.=&amp;amp;#8221;ls -d .*&amp;amp;#8221;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Very commonly used :&lt;/p&gt;
&lt;blockquote&gt;
&lt;div class=&#34;codecolorer-container text solarized-light&#34; style=&#34;overflow:auto;white-space:nowrap;width:550px;&#34;&gt;
  &lt;table cellspacing=&#34;0&#34; cellpadding=&#34;0&#34;&gt;
    &lt;tr&gt;
      &lt;td class=&#34;line-numbers&#34;&gt;
        &lt;div&gt;
          1&lt;br /&gt;2&lt;br /&gt;
        &lt;/div&gt;
      &lt;/td&gt;
&lt;pre&gt;&lt;code&gt;  &amp;lt;td&amp;gt;
    &amp;lt;div class=&amp;quot;text codecolorer&amp;quot;&amp;gt;
      alias ll=&amp;quot;ls -lhvrt&amp;quot;&amp;lt;br /&amp;gt; lsd=&amp;quot;ls -lUd */&amp;quot; # List directories only
    &amp;lt;/div&amp;gt;
  &amp;lt;/td&amp;gt;
&amp;lt;/tr&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
  &lt;/table&gt;
&lt;/div&gt;
&lt;/blockquote&gt;
&lt;p&gt;And after all this you can download the l script from pixelbeat. Quite interesting:&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>more powerful grep – ack</title>
      <link>/2010/05/26/more-powerful-grep-ack/</link>
      <pubDate>Wed, 26 May 2010 11:41:56 +0000</pubDate>
      
      <guid>/2010/05/26/more-powerful-grep-ack/</guid>
      <description>&lt;!--[ad#ad-2]--&gt;
&lt;p&gt;For last couple of days, I have been using ack instead of grep. Here is description of ack:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Ack is designed as a replacement for grep.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;There are couple of reasons I am using ack. First and foremost being it does not require a filename. So, for seaching amit in all files recursively under the current directory I can simply use&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;ack amit&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;More reasons to use ack:&lt;/p&gt;
&lt;p&gt;It supports pager option and there can be a rc file that can be used to define the default options that needs to be used with ack. Here is the contents of my &lt;strong&gt;$HOME/.ackrc&lt;/strong&gt; file.&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>mussh - Multihost SSH wrapper</title>
      <link>/2010/05/25/mussh/</link>
      <pubDate>Tue, 25 May 2010 11:33:59 +0000</pubDate>
      
      <guid>/2010/05/25/mussh/</guid>
      <description>&lt;!--[ad#ad-2]--&gt;
&lt;p&gt;Description:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Mussh is a &amp;lt;a class=&amp;quot;zem_slink freebase/en/shell_script&amp;quot; title=&amp;quot;Shell script&amp;quot; rel=&amp;quot;wikipedia&amp;quot; href=&amp;quot;http://en.wikipedia.org/wiki/Shell_script&amp;quot;&amp;gt;shell script&lt;/a&gt; that allows you to execute a command or script over ssh on multiple hosts with one command. When possible mussh will use &amp;lt;a class=&amp;quot;zem_slink freebase/en/ssh-agent&amp;quot; title=&amp;quot;Ssh-agent&amp;quot; rel=&amp;quot;wikipedia&amp;quot; href=&amp;quot;http://en.wikipedia.org/wiki/Ssh-agent&amp;quot;&amp;gt;ssh-agent&lt;/a&gt; and RSA/DSA keys to minimize the need to enter your password more than once.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;It is a utility for &amp;lt;a class=&amp;quot;zem_slink freebase/en/system_administrator&amp;quot; title=&amp;quot;System administrator&amp;quot; rel=&amp;quot;wikipedia&amp;quot; href=&amp;quot;http://en.wikipedia.org/wiki/System_administrator&amp;quot;&amp;gt;system administrators&lt;/a&gt; maintaining more than one hosts. The utility will help the admin to execute the same command on multiple hosts with a single command.&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Menu driven ssh.</title>
      <link>/2010/05/24/menu-driven-ssh/</link>
      <pubDate>Mon, 24 May 2010 16:25:41 +0000</pubDate>
      
      <guid>/2010/05/24/menu-driven-ssh/</guid>
      <description>&lt;!--[ad#ad-2]--&gt;
&lt;p&gt;I have quite a lot of servers where I need to ssh at workplace and I generally don&amp;amp;#8217;t remember all of them, so I wrote a simple yet useful script. In all the servers I have already copied my key so I dont need a password to login. Without much ado, here is the script.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;echo &amp;amp;#8221;Enter the server name:&amp;amp;#8221;&lt;br&gt;
echo &amp;amp;#8221;1. redhat&amp;amp;#8221;&lt;br&gt;
echo &amp;amp;#8221;2. fedora&amp;amp;#8221;&lt;/p&gt;
&lt;p&gt;read server&lt;/p&gt;
&lt;p&gt;if [ &amp;amp;#8221;$server&amp;amp;#8221; = &amp;amp;#8221;1&amp;amp;#8221; ]; then&lt;br&gt;
ssh amit@redhat&lt;br&gt;
else if [ &amp;amp;#8221;$server&amp;amp;#8221; = &amp;amp;#8221;2&amp;amp;#8221; ]; then&lt;br&gt;
ssh amit@fedora&lt;br&gt;
else&lt;br&gt;
echo &amp;amp;#8221;Not a valid choice&amp;amp;#8221;&lt;br&gt;
fi&lt;br&gt;
fi&lt;br&gt;
&lt;span&gt;&lt;/span&gt;&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Display the history and optionally grep</title>
      <link>/2010/05/19/display-the-history-and-optionally-grep/</link>
      <pubDate>Wed, 19 May 2010 16:38:47 +0000</pubDate>
      
      <guid>/2010/05/19/display-the-history-and-optionally-grep/</guid>
      <description>&lt;!--[ad#ad-2]--&gt;
&lt;p&gt;Ever wondered how good it would be to have a command/function that would display the history or display the history with &amp;lt;a class=&amp;quot;zem_slink&amp;quot; title=&amp;quot;Grep&amp;quot; rel=&amp;quot;wikipedia&amp;quot; href=&amp;quot;http://en.wikipedia.org/wiki/Grep&amp;quot;&amp;gt;grep&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Would be really good right, well someone thought about this 🙂&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;$ h() { if [ -z &amp;amp;#8221;$1&amp;amp;#8221; ]; then history; else history | grep &amp;amp;#8221;$@&amp;amp;#8221;; fi; }&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Place this in your .bash_profile and you can use it two different ways. If you issue &amp;amp;#8217;h&amp;amp;#8217; on its own, then it acts like the history command. If you issue:&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Awk Introduction Tutorial – 7 Awk Print Examples</title>
      <link>/2010/05/19/awk-introduction-tutorial-%E2%80%93-7-awk-print-examples/</link>
      <pubDate>Wed, 19 May 2010 16:38:43 +0000</pubDate>
      
      <guid>/2010/05/19/awk-introduction-tutorial-%E2%80%93-7-awk-print-examples/</guid>
      <description>&lt;div class=\&#34;zemanta-img\&#34;&gt; 
&lt;div&gt;
  &lt;dl class=\&#34;wp-caption alignright\&#34;&gt; &lt;dt class=\&#34;wp-caption-dt\&#34;&gt;&lt;a href=\&#34;http://www.daylife.com/image/0fNM7HH9s1904?utm_source=zemanta&amp;utm_medium=p&amp;utm_content=0fNM7HH9s1904&amp;utm_campaign=z1\&#34;&gt;&lt;img title=\&#34;LAS VEGAS - JANUARY 23: Dick Robertson, Presi...\&#34; src=\&#34;http://blog.amit-agarwal.co.in/wp-content/uploads/2010/08/150x104.jpg\&#34; alt=\&#34;LAS VEGAS - JANUARY 23: Dick Robertson, Presi...\&#34; /&gt;&lt;/a&gt;&lt;/dt&gt; &lt;dd class=\&#34;wp-caption-dd zemanta-img-attribution\&#34;&gt;Image by &lt;a href=\&#34;http://www.daylife.com/source/Getty_Images\&#34;&gt;Getty Images&lt;/a&gt; via &lt;a href=\&#34;http://www.daylife.com\&#34;&gt;Daylife&lt;/a&gt;&lt;/dd&gt; &lt;/dl&gt;
&lt;/div&gt;&lt;/div&gt; 
&lt;!--[ad#ad-2]--&gt;
&lt;p&gt;awk examples&lt;/p&gt;
&lt;p&gt;Awk Introduction Tutorial – 7 Awk Print Examples This is the first article on the new awk tutorial series. We’ll be posting several articles on awk in the upcoming weeks that will cover all features of awk with practical examples. In this article, let us review the fundamental awk working methodology along with 7 practical awk print examples. Note: Make sure you review our earlier […]&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Mirror or download a website with a tool much better than wget</title>
      <link>/2010/05/19/mirror-download-website-tool-wget/</link>
      <pubDate>Wed, 19 May 2010 16:38:39 +0000</pubDate>
      
      <guid>/2010/05/19/mirror-download-website-tool-wget/</guid>
      <description>&lt;!--[ad#ad-2]--&gt;
&lt;p&gt;If you want to mirror a &amp;lt;a class=&amp;quot;zem_slink freebase/en/website&amp;quot; title=&amp;quot;Website&amp;quot; rel=&amp;quot;wikipedia&amp;quot; href=&amp;quot;http://en.wikipedia.org/wiki/Website&amp;quot;&amp;gt;website&lt;/a&gt;, the simplest tool I know if is &amp;lt;a class=&amp;quot;zem_slink freebase/en/wget&amp;quot; title=&amp;quot;Wget&amp;quot; rel=&amp;quot;homepage&amp;quot; href=&amp;quot;http://www.gnu.org/software/wget/&amp;quot;&amp;gt;wget&lt;/a&gt;. Once you have used wget, you know the troubles associated with it. You also get added couple of files as search html files, which are useless and wastage of bandwidth for you as well as the &amp;lt;a class=&amp;quot;zem_slink freebase/en/web_server&amp;quot; title=&amp;quot;Web server&amp;quot; rel=&amp;quot;wikipedia&amp;quot; href=&amp;quot;http://en.wikipedia.org/wiki/Web_server&amp;quot;&amp;gt;webserver&lt;/a&gt;.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;lftp -e &amp;amp;#8221;mirror -c&amp;amp;#8221;  &lt;URL&gt;&lt;/strong&gt;&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>List all the installed firefox addons from the bash script</title>
      <link>/2010/05/18/list-installed-firefox-addons-bash-script/</link>
      <pubDate>Tue, 18 May 2010 16:35:18 +0000</pubDate>
      
      <guid>/2010/05/18/list-installed-firefox-addons-bash-script/</guid>
      <description>&lt;!--[ad#ad-2]--&gt;
&lt;p&gt;Here is a one-line that would help you get the &amp;lt;a class=&amp;quot;zem_slink freebase/en/mozilla_firefox&amp;quot; title=&amp;quot;Firefox&amp;quot; rel=&amp;quot;homepage&amp;quot; href=&amp;quot;http://www.mozilla.com/en-US/firefox/&amp;quot;&amp;gt;Firefox&lt;/a&gt; addons in the bash script:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;grep -hIr \&amp;lt;em:name ~/.mozilla/firefox/*.default/extensions|sed &amp;amp;#8217;s#\s*##&amp;amp;#8217;|sed &amp;amp;#8217;s#.*\(&amp;gt;.*&amp;lt;\).*#\1#&amp;amp;#8217;|sed &amp;amp;#8217;s/[&amp;lt;\|&amp;gt;]//g&amp;amp;#8217;|sort -u&amp;lt;h6 class=&amp;quot;zemanta-related-title&amp;quot;&amp;gt;Related articles by Zemanta&lt;/h6&gt; &amp;lt;ul class=&amp;quot;zemanta-article-ul&amp;quot;&amp;gt; &amp;lt;li class=&amp;quot;zemanta-article-ul-li&amp;quot;&amp;gt;&amp;lt;a href=&amp;quot;http://www.ghacks.net/2010/05/16/firefox-3-6-4-build-4-released/&amp;quot;&amp;gt;Firefox 3.6.4 Build 4 Released&lt;/a&gt; (ghacks.net)&lt;/li&gt; &amp;lt;li class=&amp;quot;zemanta-article-ul-li&amp;quot;&amp;gt;&amp;lt;a href=&amp;quot;http://www.webmonkey.com/2010/05/first-look-firefox-4-preview-delivers-speed-revamped-interface/&amp;quot;&amp;gt;First Look: Firefox 4 Preview Delivers Speed, Revamped Interface&lt;/a&gt; (webmonkey.com)&lt;/li&gt; &amp;lt;li class=&amp;quot;zemanta-article-ul-li&amp;quot;&amp;gt;&amp;lt;a href=&amp;quot;http://www.ghacks.net/2010/05/15/protect-firefox-bookmarks-with-link-password/&amp;quot;&amp;gt;Protect Firefox Bookmarks With Link Password&lt;/a&gt; (ghacks.net)&lt;/li&gt; &amp;lt;li class=&amp;quot;zemanta-article-ul-li&amp;quot;&amp;gt;&amp;lt;a href=&amp;quot;http://www.huffingtonpost.com/2010/05/12/mozilla-firefox-4-upgrade_n_573062.html&amp;quot;&amp;gt;Firefox 4 Upgrade Offers Simpler Design, More Privacy Control&lt;/a&gt; (huffingtonpost.com)&lt;/li&gt; &amp;lt;li class=&amp;quot;zemanta-article-ul-li&amp;quot;&amp;gt;&amp;lt;a href=&amp;quot;http://www.readwriteweb.com/archives/mozilla_talks_firefox_4_sleeker_interface_better_privacy_controls.php&amp;quot;&amp;gt;Mozilla&amp;amp;#8217;s Plans for Firefox 4: Faster, Sleeker Interface, Better Privacy Controls&lt;/a&gt; (readwriteweb.com)&lt;/li&gt; &lt;/ul&gt; &amp;lt;div class=&amp;quot;zemanta-pixie&amp;quot;&amp;gt;&amp;lt;a class=&amp;quot;zemanta-pixie-a&amp;quot; title=&amp;quot;Reblog this post [with Zemanta]&amp;quot; href=&amp;quot;http://reblog.zemanta.com/zemified/6a3ffd4a-91cf-47e3-85ff-7dc3b27ffd7d/&amp;quot;&amp;gt;&amp;lt;img class=&amp;quot;zemanta-pixie-img&amp;quot; src=&amp;quot;http://blog.amit-agarwal.co.in/wp-content/uploads/2010/08/reblog_b89.png&amp;quot; alt=&amp;quot;Reblog this post [with Zemanta]&amp;quot; /&amp;gt;&lt;/a&gt;&amp;lt;span class=&amp;quot;zem-script more-related more-info pretty-attribution paragraph-reblog&amp;quot;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Get the most favourite commands from commandlinefu</title>
      <link>/2010/05/12/get-the-most-favourite-commands-from-commandlinefu/</link>
      <pubDate>Wed, 12 May 2010 17:01:22 +0000</pubDate>
      
      <guid>/2010/05/12/get-the-most-favourite-commands-from-commandlinefu/</guid>
      <description>&lt;!--[ad#ad-2]--&gt;
&lt;p&gt;For those of you who don&amp;amp;#8217;t know, commandlinefu should be one place you should watch to learn new things for command line. Everyday a lot of people post commands to better the previously posted commands. If you want to get the best voted commands from the archieves of commandlinefu then you can use the command:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;curl -O &amp;amp;#8221;&amp;lt;a rel=&amp;quot;nofollow&amp;quot; href=&amp;quot;http://www.commandlinefu.com/commands/browse/sort-by-votes/plaintext/%5B0-2400:25%5D&amp;quot;&amp;gt;http://www.commandlinefu.com/commands/browse/sort-by-votes/plaintext/[0-2400:25]&lt;/a&gt;&amp;amp;#8221;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Suggested by &lt;strong&gt;Dynetrekk&lt;/strong&gt; ****&amp;lt;a href=&amp;quot;http://www.commandlinefu.com/commands/view/2740/get-all-these-commands-in-a-text-file-with-description&amp;quot; target=&amp;quot;_blank&amp;quot;&amp;gt;here&lt;/a&gt;.&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Pipe stdout and stderr, etc., to separate commands</title>
      <link>/2010/05/11/pipe-stdout-and-stderr-etc-to-separate-commands/</link>
      <pubDate>Tue, 11 May 2010 16:27:49 +0000</pubDate>
      
      <guid>/2010/05/11/pipe-stdout-and-stderr-etc-to-separate-commands/</guid>
      <description>&lt;h1 id=&#34;heading&#34;&gt;&lt;/h1&gt;
&lt;!--[ad#ad-2]--&gt;
&lt;p&gt;&lt;tt&gt;$ some_command &amp;gt; &amp;gt;(/bin/cmd_for_stdout) 2&amp;gt; &amp;gt;(/bin/cmd_for_stderr)&lt;/tt&gt; You can use [n]&amp;gt; combined with &amp;gt;(cmd) to attach the various output file descriptors to be the input of different commands.&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Easier Reinstalls</title>
      <link>/2010/05/10/easier-reinstalls/</link>
      <pubDate>Mon, 10 May 2010 15:07:46 +0000</pubDate>
      
      <guid>/2010/05/10/easier-reinstalls/</guid>
      <description>&lt;!--[ad#ad-2]--&gt;
&lt;h1 id=&#34;span-stylefont-size-x-largea-hrefhttpwwwhowtoforgecomeasier-reinstallseaa-hrefhttpwwwhowtoforgecomeasier-reinstallsasier-reinstallsaspan&#34;&gt;&lt;strong&gt;&amp;lt;span style=&amp;quot;font-size: x-large;&amp;quot;&amp;gt;&amp;lt;a href=&amp;quot;http://www.howtoforge.com/easier-reinstalls&amp;quot;&amp;gt;E&lt;/a&gt;&amp;lt;a href=&amp;quot;http://www.howtoforge.com/easier-reinstalls&amp;quot;&amp;gt;asier Reinstalls&lt;/a&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/h1&gt;
&lt;p&gt;&lt;strong&gt;Easier Reinstalls&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;I typically reinstall my computer operating system every six months. The reasons for this are that it cleans out the system and reinstalls require me to be in front of the computer for a total of about ten minutes so it&amp;amp;#8217;s painless. Notice I said &amp;amp;#8221;in front of the computer&amp;amp;#8221;, the system does all of the work for me with some specially crafted bash scripts.&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>coproc help - a new feature in bash</title>
      <link>/2010/05/10/coproc-feature-bash/</link>
      <pubDate>Mon, 10 May 2010 15:07:45 +0000</pubDate>
      
      <guid>/2010/05/10/coproc-feature-bash/</guid>
      <description>&lt;!--[ad#ad-2]--&gt;&lt;div class=\&#34;zemanta-img\&#34;&gt; 
&lt;div&gt;
  &lt;dl class=\&#34;wp-caption alignright\&#34;&gt; &lt;dt class=\&#34;wp-caption-dt\&#34;&gt;&lt;a href=\&#34;http://commons.wikipedia.org/wiki/Image:Bash_demo.png\&#34;&gt;&lt;img title=\&#34;Screenshot of a Bash 3.1 session demonstrating...\&#34; src=\&#34;http://blog.amit-agarwal.co.in/wp-content/uploads/2010/08/300px-Bash_demo.png\&#34; alt=\&#34;Screenshot of a Bash 3.1 session demonstrating...\&#34; /&gt;&lt;/a&gt;&lt;/dt&gt; &lt;dd class=\&#34;wp-caption-dd zemanta-img-attribution\&#34;&gt;Image via &lt;a href=\&#34;http://commons.wikipedia.org/wiki/Image:Bash_demo.png\&#34;&gt;Wikipedia&lt;/a&gt;&lt;/dd&gt; &lt;/dl&gt;
&lt;/div&gt;&lt;/div&gt; 
&lt;p&gt;In the &amp;lt;a class=&amp;quot;zem_slink freebase/en/bash&amp;quot; title=&amp;quot;Bash&amp;quot; rel=&amp;quot;homepage&amp;quot; href=&amp;quot;http://tiswww.case.edu/php/chet/bash/bashtop.html&amp;quot;&amp;gt;bash&lt;/a&gt; version 4.0, there is a new concept called coproc. This is very useful for some of the daily tasks.&lt;/p&gt;
&lt;p&gt;co-&amp;lt;a class=&amp;quot;zem_slink freebase/guid/9202a8c04000641f800000000005a409&amp;quot; title=&amp;quot;Process (computing)&amp;quot; rel=&amp;quot;wikipedia&amp;quot; href=&amp;quot;http://en.wikipedia.org/wiki/Process_%28computing%29&amp;quot;&amp;gt;process&lt;/a&gt; starts a process in the background, optionally with a NAME, with which other processes can communicate. This can be a very &amp;lt;a class=&amp;quot;zem_slink freebase/en/substitute_good&amp;quot; title=&amp;quot;Substitute good&amp;quot; rel=&amp;quot;wikipedia&amp;quot; href=&amp;quot;http://en.wikipedia.org/wiki/Substitute_good&amp;quot;&amp;gt;good substitution&lt;/a&gt; for &amp;lt;a class=&amp;quot;zem_slink freebase/guid/9202a8c04000641f800000000048fac5&amp;quot; title=&amp;quot;Pipeline (Unix)&amp;quot; rel=&amp;quot;wikipedia&amp;quot; href=&amp;quot;http://en.wikipedia.org/wiki/Pipeline_%28Unix%29&amp;quot;&amp;gt;pipes&lt;/a&gt; in lots of cases. You can learn more about coproc in the link below:&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Download with browse with bash and wget</title>
      <link>/2010/05/09/download-with-browse-with-bash-and-wget/</link>
      <pubDate>Sun, 09 May 2010 13:34:18 +0000</pubDate>
      
      <guid>/2010/05/09/download-with-browse-with-bash-and-wget/</guid>
      <description>&lt;!--[ad#ad-2]--&gt;
&lt;p&gt;Been pretty busy for last couple of days. Will be busy for another few days, but here&amp;amp;#8217;s something to munch in the meantime (Script may need changes depending on the type of file you want to download or the site you are browsing, but the chnages should be minimal):&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;file=&amp;amp;#8221;/tmp/temp.dir&amp;amp;#8221;&lt;br&gt;
url=&amp;amp;#8221;URL Here&amp;amp;#8221;&lt;br&gt;
IFS=&amp;amp;#8217;&lt;br&gt;
&amp;amp;#8217;&lt;br&gt;
cont=&amp;amp;#8221;y&amp;amp;#8221;&lt;br&gt;
while [ $cont != &amp;amp;#8221;n&amp;amp;#8221; ]&lt;br&gt;
do&lt;br&gt;
name=&amp;amp;#8221;&amp;amp;#8221;&lt;br&gt;
wget &amp;amp;#8221;$url&amp;amp;#8221; -O $file -o /dev/null&lt;br&gt;
for i in $(grep href $file |grep -v Parent)&lt;br&gt;
do&lt;br&gt;
name=${i##&lt;em&gt;href=&amp;amp;#8221;}&lt;br&gt;
name=${name%%&amp;amp;#8221;&amp;gt;&lt;/em&gt;}&lt;br&gt;
echo $name&lt;br&gt;
if [[ $name == *gz ]]&lt;br&gt;
then&lt;br&gt;
cont=&amp;amp;#8221;n&amp;amp;#8221;&lt;br&gt;
fi&lt;br&gt;
done&lt;br&gt;
if [ ! $name ]&lt;br&gt;
then&lt;br&gt;
echo &amp;amp;#8221;No files here.. Exiting&amp;amp;#8221;&lt;br&gt;
exit -1&lt;br&gt;
fi&lt;br&gt;
echo&lt;br&gt;
if [ $cont == &amp;amp;#8221;n&amp;amp;#8221; ]&lt;br&gt;
then&lt;br&gt;
echo &amp;amp;#8221;Enter the filename for download :&amp;amp;#8221;&lt;br&gt;
read file&lt;br&gt;
fi&lt;br&gt;
echo &amp;amp;#8221;Select one of the options:&amp;amp;#8221;&lt;br&gt;
read product&lt;br&gt;
url=&amp;amp;#8221;$url/$product&amp;amp;#8221;&lt;br&gt;
echo &amp;amp;#8221;About to get $url&amp;amp;#8221;&lt;br&gt;
done&lt;br&gt;
wget &amp;amp;#8221;$url&amp;amp;#8221; -O $file -o /dev/null&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Delete all files in a folder that don&#39;t match a certain file extension</title>
      <link>/2010/04/30/delete-files-folder-match-file-extension/</link>
      <pubDate>Fri, 30 Apr 2010 14:01:52 +0000</pubDate>
      
      <guid>/2010/04/30/delete-files-folder-match-file-extension/</guid>
      <description>&lt;!--[ad#ad-2]--&gt;
&lt;p&gt;&lt;tt&gt;$ rm !(&lt;em&gt;.foo|&lt;/em&gt;.bar|*.baz)&lt;/tt&gt;&lt;/p&gt;
&lt;p&gt;Deletes all files in a folder that are NOT *.foo, *.bar or *.baz files. Edit the pattern inside the brackets as you like.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&amp;lt;a href=&amp;quot;http://www.commandlinefu.com/commands/view/5351/delete-all-files-in-a-folder-that-dont-match-a-certain-file-extension&amp;quot;&amp;gt;View this command to comment, vote or add to favourites&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&amp;lt;a href=&amp;quot;http://feeds2.feedburner.com/commands/by/hutch&amp;quot;&amp;gt;View all commands by &lt;/a&gt;&lt;strong&gt;&amp;lt;a href=&amp;quot;http://feeds2.feedburner.com/commands/by/hutch&amp;quot;&amp;gt;hutch&lt;/a&gt;&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&amp;lt;a href=&amp;quot;http://www.commandlinefu.com&amp;quot;&amp;gt;&amp;lt;img src=&amp;quot;http://blog.amit-agarwal.co.in/wp-content/uploads/2010/08/header-logo.jpg&amp;quot; alt=&amp;quot;&amp;quot; align=&amp;quot;bottom&amp;quot; /&amp;gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;by David Winterbottom (&amp;lt;a href=&amp;quot;http://codeinthehole.com&amp;quot;&amp;gt;codeinthehole.com&lt;/a&gt;)&lt;/p&gt;
&lt;p&gt;&amp;lt;a href=&amp;quot;http://feedads.g.doubleclick.net/~a/kewaFMgsXI4A1vQfeLscg2Vcv8o/0/da&amp;quot;&amp;gt;&amp;lt;img src=&amp;quot;http://blog.amit-agarwal.com/wp-content/uploads/img.zemanta.com/~a/kewaFMgsXI4A1vQfeLscg2Vcv8o/0/di&amp;quot; alt=&amp;quot;&amp;quot; align=&amp;quot;bottom&amp;quot; /&amp;gt;&lt;/a&gt;&lt;br&gt;
&amp;lt;a href=&amp;quot;http://feedads.g.doubleclick.net/~a/kewaFMgsXI4A1vQfeLscg2Vcv8o/1/da&amp;quot;&amp;gt;&amp;lt;img src=&amp;quot;http://blog.amit-agarwal.com/wp-content/uploads/img.zemanta.com/~a/kewaFMgsXI4A1vQfeLscg2Vcv8o/1/di&amp;quot; alt=&amp;quot;&amp;quot; align=&amp;quot;bottom&amp;quot; /&amp;gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;img src=&amp;quot;http://blog.amit-agarwal.com/wp-content/uploads/img.zemanta.com/~r/Command-line-fu/~4/TCRb2ku_V1Y&amp;quot; alt=&amp;quot;&amp;quot; width=&amp;quot;1&amp;quot; height=&amp;quot;1&amp;quot; align=&amp;quot;bottom&amp;quot; /&amp;gt;&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Convert decimal numbers to binary</title>
      <link>/2010/04/21/convert-decimal-numbers-to-binary/</link>
      <pubDate>Wed, 21 Apr 2010 15:47:07 +0000</pubDate>
      
      <guid>/2010/04/21/convert-decimal-numbers-to-binary/</guid>
      <description>&lt;div class=\&#34;zemanta-img\&#34;&gt; 
&lt;div&gt;
  &lt;dl class=\&#34;wp-caption alignright\&#34;&gt; &lt;dt class=\&#34;wp-caption-dt\&#34;&gt;&lt;a href=\&#34;http://www.daylife.com/image/0gzm1knf2eg67?utm_source=zemanta&amp;utm_medium=p&amp;utm_content=0gzm1knf2eg67&amp;utm_campaign=z1\&#34;&gt;&lt;img title=\&#34;SYDNEY, AUSTRALIA - OCTOBER 14: Australian ar...\&#34; src=\&#34;http://blog.amit-agarwal.co.in/wp-content/uploads/2010/08/150x100.jpg\&#34; alt=\&#34;SYDNEY, AUSTRALIA - OCTOBER 14: Australian ar...\&#34; /&gt;&lt;/a&gt;&lt;/dt&gt; &lt;dd class=\&#34;wp-caption-dd zemanta-img-attribution\&#34;&gt;Image by &lt;a href=\&#34;http://www.daylife.com/source/Getty_Images\&#34;&gt;Getty Images&lt;/a&gt; via &lt;a href=\&#34;http://www.daylife.com\&#34;&gt;Daylife&lt;/a&gt;&lt;/dd&gt; &lt;/dl&gt;
&lt;/div&gt;&lt;/div&gt; 
&lt;!--[ad#ad-2]--&gt;
&lt;p&gt;There is a calculator called bc that works in the command line. So if you need a quick calculator function in the command line then you could write some functions that will do the trcik for you. Here is an example:&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>recursively add directory and files to cvs from Linux.</title>
      <link>/2010/04/12/recursively-add-directory-and-files-to-cvs-from-linux/</link>
      <pubDate>Mon, 12 Apr 2010 02:37:59 +0000</pubDate>
      
      <guid>/2010/04/12/recursively-add-directory-and-files-to-cvs-from-linux/</guid>
      <description>&lt;!--[ad#ad-2]--&gt;
&lt;p&gt;Go to the directory which you want to add to cvs and execute the following:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;cvs login&lt;/p&gt;
&lt;p&gt;find . -type d -exec cvs add {} \;&lt;/p&gt;
&lt;p&gt;find . -type f -exec cvs add {} \;&lt;/p&gt;
&lt;p&gt;cvs commit&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;That was simple 🙂&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Afraid Dynamic DNS client in Fedora with Email indicating the changed to original IP.</title>
      <link>/2010/04/12/afraid-dynamic-dns-client-in-fedora-with-email-indicating-the-changed-to-original-ip/</link>
      <pubDate>Mon, 12 Apr 2010 02:37:54 +0000</pubDate>
      
      <guid>/2010/04/12/afraid-dynamic-dns-client-in-fedora-with-email-indicating-the-changed-to-original-ip/</guid>
      <description>&lt;div class=\&#34;zemanta-img\&#34; style=\&#34;margin: 1em; display: block;\&#34;&gt; 
&lt;div&gt;
  &lt;dl class=\&#34;wp-caption alignright\&#34; style=\&#34;width: 136px;\&#34;&gt; &lt;dt class=\&#34;wp-caption-dt\&#34;&gt;&lt;a href=\&#34;http://www.crunchbase.com/product/fedora\&#34;&gt;&lt;img title=\&#34;Image representing Fedora as depicted in Crunc...\&#34; src=\&#34;http://blog.amit-agarwal.co.in/wp-content/uploads/2010/08/21266v1-max-450x450.png\&#34; alt=\&#34;Image representing Fedora as depicted in Crunc...\&#34; width=\&#34;126\&#34; height=\&#34;41\&#34; /&gt;&lt;/a&gt;&lt;/dt&gt; &lt;dd class=\&#34;wp-caption-dd zemanta-img-attribution\&#34; style=\&#34;font-size: 0.8em;\&#34;&gt;Image via &lt;a href=\&#34;http://www.crunchbase.com\&#34;&gt;CrunchBase&lt;/a&gt;&lt;/dd&gt; &lt;/dl&gt;
&lt;/div&gt;&lt;/div&gt; 
&lt;!--[ad#ad-2]--&gt;
&lt;p&gt;If you have your domain in the Dynamic DNS located at : &amp;lt;a href=&amp;quot;http://freedns.afraid.org&amp;quot;&amp;gt;Freedns&lt;/a&gt; then you know how difficult it is to get the Dynamic DNS client to work with Fedora. Not that it does not work, but you need to configure it properly and there are lot of parameters. But not any more. Now you can install the afraid Dynamic DNS client and just put your Account Hash in the config file and you are ready with the setup to update the DNS entry whenever your IP changes. So lets get started:&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Quick notepad in bash without any editor</title>
      <link>/2010/04/12/quick-notepad-in-bash-without-any-editor/</link>
      <pubDate>Mon, 12 Apr 2010 02:37:52 +0000</pubDate>
      
      <guid>/2010/04/12/quick-notepad-in-bash-without-any-editor/</guid>
      <description>&lt;!--[ad#ad-2]--&gt;
&lt;p&gt;&lt;tt&gt;$ &amp;laquo;.&amp;gt;note&lt;/tt&gt; Bash internal quick note taker, avoiding calling external programs like cat&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&amp;lt;a href=&amp;quot;http://www.commandlinefu.com/commands/view/3939/quick-notepad&amp;quot;&amp;gt;View this command to comment, vote or add to favourites&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&amp;lt;a href=&amp;quot;http://feeds2.feedburner.com/commands/by/netizen&amp;quot;&amp;gt;View all commands by &lt;/a&gt;&lt;strong&gt;&amp;lt;a href=&amp;quot;http://feeds2.feedburner.com/commands/by/netizen&amp;quot;&amp;gt;netizen&lt;/a&gt;&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&amp;lt;a href=&amp;quot;http://www.commandlinefu.com&amp;quot;&amp;gt;&amp;lt;img src=&amp;quot;http://blog.amit-agarwal.co.in/wp-content/uploads/2010/08/header-logo.jpg&amp;quot; alt=&amp;quot;&amp;quot; align=&amp;quot;bottom&amp;quot; /&amp;gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;by David Winterbottom (&amp;lt;a href=&amp;quot;http://codeinthehole.com&amp;quot;&amp;gt;codeinthehole.com&lt;/a&gt;)&lt;/p&gt;
&lt;p&gt;&amp;lt;a href=&amp;quot;http://feedads.g.doubleclick.net/~a/aAyNWJ1rcV4brCukeWT51QSbCZs/0/da&amp;quot;&amp;gt;&amp;lt;img src=&amp;quot;http://blog.amit-agarwal.com/wp-content/uploads/img.zemanta.com/~a/aAyNWJ1rcV4brCukeWT51QSbCZs/0/di&amp;quot; alt=&amp;quot;&amp;quot; align=&amp;quot;bottom&amp;quot; /&amp;gt;&lt;/a&gt;&lt;br&gt;
&amp;lt;a href=&amp;quot;http://feedads.g.doubleclick.net/~a/aAyNWJ1rcV4brCukeWT51QSbCZs/1/da&amp;quot;&amp;gt;&amp;lt;img src=&amp;quot;http://blog.amit-agarwal.com/wp-content/uploads/img.zemanta.com/~a/aAyNWJ1rcV4brCukeWT51QSbCZs/1/di&amp;quot; alt=&amp;quot;&amp;quot; align=&amp;quot;bottom&amp;quot; /&amp;gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;img src=&amp;quot;http://blog.amit-agarwal.com/wp-content/uploads/img.zemanta.com/~r/Command-line-fu/~4/luL4fGyQxqk&amp;quot; alt=&amp;quot;&amp;quot; width=&amp;quot;1&amp;quot; height=&amp;quot;1&amp;quot; align=&amp;quot;bottom&amp;quot; /&amp;gt;&lt;/p&gt;
&lt;p&gt;URL: &amp;lt;a href=&amp;quot;http://feedproxy.google.com/~r/Command-line-fu/~3/luL4fGyQxqk/quick-notepad&amp;quot;&amp;gt;http://feedproxy.google.com/~r/Command-line-fu/~3/luL4fGyQxqk/quick-notepad&lt;/a&gt;&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Linux Shell Scripting Tutorial – A Beginner\’s handbook</title>
      <link>/2010/04/11/linux-shell-scripting-tutorial-a-beginners-handbook/</link>
      <pubDate>Sun, 11 Apr 2010 09:11:57 +0000</pubDate>
      
      <guid>/2010/04/11/linux-shell-scripting-tutorial-a-beginners-handbook/</guid>
      <description>&lt;div class=\&#34;zemanta-img\&#34;&gt; 
&lt;div&gt;
  &lt;dl class=\&#34;wp-caption alignright\&#34;&gt; &lt;dt class=\&#34;wp-caption-dt\&#34;&gt;&lt;a href=\&#34;http://commons.wikipedia.org/wiki/Image:Tux.png\&#34;&gt;&lt;img title=\&#34;Tux, the Linux mascot\&#34; src=\&#34;http://blog.amit-agarwal.co.in/wp-content/uploads/2010/08/Tux.png\&#34; alt=\&#34;Tux, the Linux mascot\&#34; /&gt;&lt;/a&gt;&lt;/dt&gt; &lt;dd class=\&#34;wp-caption-dd zemanta-img-attribution\&#34;&gt;Image via &lt;a href=\&#34;http://commons.wikipedia.org/wiki/Image:Tux.png\&#34;&gt;Wikipedia&lt;/a&gt;&lt;/dd&gt; &lt;/dl&gt;
&lt;/div&gt;&lt;/div&gt; 
&lt;!--[ad#ad-2]--&gt;
&lt;p&gt;&amp;lt;a class=&amp;quot;zem_slink freebase/en/unix_shell&amp;quot; title=&amp;quot;Unix shell&amp;quot; rel=&amp;quot;wikipedia&amp;quot; href=&amp;quot;http://en.wikipedia.org/wiki/Unix_shell&amp;quot;&amp;gt;Linux Shell&lt;/a&gt; Scripting Tutorial – A Beginner&amp;amp;#8217;s handbook —&lt;/p&gt;
&lt;p&gt;This book is for students and Linux System Administrators. It provides the skills to read, write, and debug &amp;lt;a title=&amp;quot;Linux&amp;quot; href=&amp;quot;http://bash.cyberciti.biz/guide/Linux&amp;quot;&amp;gt;Linux&lt;/a&gt; &amp;lt;a class=&amp;quot;zem_slink freebase/en/shell_script&amp;quot; title=&amp;quot;Shell script&amp;quot; rel=&amp;quot;wikipedia&amp;quot; href=&amp;quot;http://en.wikipedia.org/wiki/Shell_script&amp;quot;&amp;gt;shell scripts&lt;/a&gt; using &amp;lt;a title=&amp;quot;Bash&amp;quot; href=&amp;quot;http://bash.cyberciti.biz/guide/Bash&amp;quot;&amp;gt;bash&lt;/a&gt; &amp;lt;a title=&amp;quot;Shell&amp;quot; href=&amp;quot;http://bash.cyberciti.biz/guide/Shell&amp;quot;&amp;gt;shell&lt;/a&gt;. The book begins by describing &amp;lt;a title=&amp;quot;Linux&amp;quot; href=&amp;quot;http://bash.cyberciti.biz/guide/Linux&amp;quot;&amp;gt;Linux&lt;/a&gt; and simple scripts to automate frequently executed commands and continues by describing conditional logic, &amp;lt;a class=&amp;quot;zem_slink freebase/en/interactivity&amp;quot; title=&amp;quot;Interactivity&amp;quot; rel=&amp;quot;wikipedia&amp;quot; href=&amp;quot;http://en.wikipedia.org/wiki/Interactivity&amp;quot;&amp;gt;user interaction&lt;/a&gt;, loops, menus, traps, and functions. Finally, book covers various sys admin related scripts such as making a backup, using &amp;lt;a class=&amp;quot;zem_slink freebase/guid/9202a8c04000641f80000000045c9c5b&amp;quot; title=&amp;quot;Cron&amp;quot; rel=&amp;quot;wikipedia&amp;quot; href=&amp;quot;http://en.wikipedia.org/wiki/Cron&amp;quot;&amp;gt;cron&lt;/a&gt; jobs, writing interactive tools, web based tools, remote login, ftp and database backup related scripts. This book is intended for Linux &amp;lt;a class=&amp;quot;zem_slink freebase/en/system_administrator&amp;quot; title=&amp;quot;System administrator&amp;quot; rel=&amp;quot;wikipedia&amp;quot; href=&amp;quot;http://en.wikipedia.org/wiki/System_administrator&amp;quot;&amp;gt;system administrators&lt;/a&gt; or students who have mastered the basics of a Linux Operating System. You should be able to:&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Jokes – many to be downloaded once..</title>
      <link>/2010/04/11/jokes-many-to-be-downloaded-once/</link>
      <pubDate>Sun, 11 Apr 2010 09:11:55 +0000</pubDate>
      
      <guid>/2010/04/11/jokes-many-to-be-downloaded-once/</guid>
      <description>&lt;!--[ad#ad-2]--&gt;
&lt;p&gt;All work and no fun makes Jack dull boy. So lets do something for fun. Here is a one liner I wrote sometime back.  The original idea is not mine and I don&amp;amp;#8217;t remeber where I got the idea from but it was some other one liner that I was browsing for some oracle query. Anyway here&amp;amp;#8217;s the one liner to get lot of jokes in one file.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;#!/bin/bash&lt;br&gt;
for i in `echo 000{0..9} 00{10..99} 0{100..999} {1000..1600}` ; do links -dump &lt;a href=&#34;http://www.robsjokes.com/$i/index.html&#34;&gt;http://www.robsjokes.com/$i/index.html&lt;/a&gt; | sed &amp;amp;#8217;/Random Joke/,/Next Joke/!d&amp;amp;#8217; | sed &amp;amp;#8217;/^$/,/^$/!d&amp;amp;#8217; &amp;raquo; ~/Rob.jokes ; echo &amp;amp;#8217;%&amp;amp;#8217; &amp;raquo; ~/Rob.jokes ;echo $i; done&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>core dump checking script.</title>
      <link>/2010/04/11/core-dump-checking-script/</link>
      <pubDate>Sun, 11 Apr 2010 09:11:54 +0000</pubDate>
      
      <guid>/2010/04/11/core-dump-checking-script/</guid>
      <description>&lt;!--[ad#ad-2]--&gt;
&lt;p&gt;I was testing a program which crashing every now and then. It is very difficult in such scenarios to keep looking for the &amp;lt;a class=&amp;quot;zem_slink&amp;quot; title=&amp;quot;Core dump&amp;quot; rel=&amp;quot;wikipedia&amp;quot; href=&amp;quot;http://en.wikipedia.org/wiki/Core_dump&amp;quot;&amp;gt;core file&lt;/a&gt; or keep checking for the running process. So I wrote this simple script that can check for core file in the particular path and keep running until it finds one. You can hack this script to send a mail once the core is found. This is a very simple script. And this should work on solaris too..&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Bash completion error — quote_readline.</title>
      <link>/2010/04/11/bash-completion-error-quote_readline/</link>
      <pubDate>Sun, 11 Apr 2010 09:11:50 +0000</pubDate>
      
      <guid>/2010/04/11/bash-completion-error-quote_readline/</guid>
      <description>&lt;!--[ad#ad-2]--&gt;
&lt;p&gt;There is a problem with bash completion with quote_readline that causes the completion to fail. The problem is fixed in the bash completion package but there are still some other programs which are using the problematic code. Here is a way to find and resolve it.&lt;/p&gt;
&lt;p&gt;First find the problematic program, most likely the recent one after which you started having the problems. Once that is found, find the file containing the definition of the function &amp;amp;#8221;_filedirs()&amp;amp;#8221;. Now, delete this file and create a symbolic link to the bash_completion file in the /etc directory. If this file is not present then you need to install the bashcompletion package.&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Advanced Sed Substitution Examples</title>
      <link>/2010/04/11/advanced-sed-substitution-examples/</link>
      <pubDate>Sun, 11 Apr 2010 09:11:48 +0000</pubDate>
      
      <guid>/2010/04/11/advanced-sed-substitution-examples/</guid>
      <description>&lt;!--[ad#ad-2]--&gt;
&lt;p&gt;This article is part of the on-going Unix Sed Tips and Tricks series. In our previous sed articles we learned — sed printing, sed deletion, sed substitute , sed file write, and sed multiple commands. In this article, let us review some interesting workarounds with the “s” substitute command in sed with several practical examples. I. […]&lt;/p&gt;
&lt;p&gt;Read More: &amp;lt;a href=&amp;quot;http://www.thegeekstuff.com/2009/10/unix-sed-tutorial-advanced-sed-substitution-examples/&amp;quot;&amp;gt;Unix Sed Tutorial: Advanced Sed Substitution Examples&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;URL: &amp;lt;a href=&amp;quot;http://feedproxy.google.com/~r/TheGeekStuff/~3/uN-cE6UOvfA/&amp;quot;&amp;gt;http://feedproxy.google.com/~r/TheGeekStuff/~3/uN-cE6UOvfA/&lt;/a&gt;&amp;lt;h6 class=&amp;quot;zemanta-related-title&amp;quot; style=&amp;quot;font-size: 1em;&amp;quot;&amp;gt;Related articles by Zemanta&lt;/h6&gt; &amp;lt;ul class=&amp;quot;zemanta-article-ul&amp;quot;&amp;gt; &amp;lt;li class=&amp;quot;zemanta-article-ul-li&amp;quot;&amp;gt;&amp;lt;a href=&amp;quot;http://www.slumpedoverkeyboarddead.com/2009/08/06/vim-video-tutorial/&amp;quot;&amp;gt;VIM video tutorial&lt;/a&gt; (slumpedoverkeyboarddead.com)&lt;/li&gt; &amp;lt;li class=&amp;quot;zemanta-article-ul-li&amp;quot;&amp;gt;&amp;lt;a href=&amp;quot;http://www.slumpedoverkeyboarddead.com/2009/08/22/turn-vim-or-emacs-into-and-ide-with-exuberant-ctags/&amp;quot;&amp;gt;Turn Vim or Emacs Into and IDE With Exuberant-Ctags&lt;/a&gt; (slumpedoverkeyboarddead.com)&lt;/li&gt; &lt;/ul&gt; &amp;lt;div class=&amp;quot;zemanta-pixie&amp;quot; style=&amp;quot;margin-top: 10px; height: 15px;&amp;quot;&amp;gt;&amp;lt;a class=&amp;quot;zemanta-pixie-a&amp;quot; title=&amp;quot;Reblog this post [with Zemanta]&amp;quot; href=&amp;quot;http://reblog.zemanta.com/zemified/0d68ebaf-6fc5-419a-a31c-7d31bc55ab3f/&amp;quot;&amp;gt;&amp;lt;img class=&amp;quot;zemanta-pixie-img&amp;quot; style=&amp;quot;border: medium none; float: right;&amp;quot; src=&amp;quot;http://blog.amit-agarwal.co.in/wp-content/uploads/2010/08/reblog_e8.png&amp;quot; alt=&amp;quot;Reblog this post [with Zemanta]&amp;quot; /&amp;gt;&lt;/a&gt;&amp;lt;span class=&amp;quot;zem-script more-related pretty-attribution&amp;quot;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>PuTTY export client display on login for opening X application and terminal.</title>
      <link>/2010/04/11/putty-export-client-display-on-login-for-opening-x-application-and-terminal/</link>
      <pubDate>Sun, 11 Apr 2010 09:11:47 +0000</pubDate>
      
      <guid>/2010/04/11/putty-export-client-display-on-login-for-opening-x-application-and-terminal/</guid>
      <description>&lt;!--[ad#ad-2]--&gt;
&lt;blockquote&gt;
&lt;p&gt;export DISPLAY=$(echo $SSH_CLIENT |awk &#39;{print $1&amp;amp;#8221;:0.0&amp;amp;#8221;}&amp;amp;#8217;)&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Explanation:&lt;/p&gt;
&lt;p&gt;SSH_CLIENT contains the IP and the port of the client machine. So we need to export (Client IP):0.0 for the display on the client machine. If the above is put in .bashrc or .bash_profile or .profile, then the DISPLAY variable will be set based on the client machine.&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Detecting URLs in a Block of Text</title>
      <link>/2010/03/31/detecting-urls-in-a-block-of-text/</link>
      <pubDate>Wed, 31 Mar 2010 07:27:21 +0000</pubDate>
      
      <guid>/2010/03/31/detecting-urls-in-a-block-of-text/</guid>
      <description>&lt;p&gt;Jan Goyvaerts on &amp;lt;a href=&amp;quot;http://www.regex-guru.info/2008/11/detecting-urls-in-a-block-of-text/&amp;quot; target=&amp;quot;_blank&amp;quot;&amp;gt;Detecting URLs in a Block of Text&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;In his blog post &amp;lt;a href=&amp;quot;http://www.codinghorror.com/blog/archives/001181.html&amp;quot;&amp;gt;The Problem with URLs&lt;/a&gt; points out some of the issues with trying to detect URLs in a larger body of text using a regular expression.&lt;/p&gt;
&lt;p&gt;The short answer is that it &lt;strong&gt;can’t be done&lt;/strong&gt;. Pretty much &lt;strong&gt;any character is valid in URLs&lt;/strong&gt;. The very simplistic &amp;lt;span class=&amp;quot;regex&amp;quot;&amp;gt;\bhttp://\S+&lt;/span&gt; not only fails to differentiate between punctuation that’s part of the URL, and punctuation used to quote the URL. It also fails to match URLs with spaces in them. Yes, spaces are valid in URLs, and I’ve encountered quite a few web sites that use them over the years. It also forgets other protocols, such as https.&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Search &amp; replace with find &amp; ed</title>
      <link>/2010/03/28/search-replace-with-find-ed/</link>
      <pubDate>Sun, 28 Mar 2010 11:58:32 +0000</pubDate>
      
      <guid>/2010/03/28/search-replace-with-find-ed/</guid>
      <description>&lt;!--[ad#ad-2]--&gt;&lt;div class=\&#34;zemanta-img\&#34;&gt; 
&lt;div&gt;
  &lt;dl class=\&#34;wp-caption alignright\&#34;&gt; &lt;dt class=\&#34;wp-caption-dt\&#34;&gt;&lt;a href=\&#34;http://blog.amit-agarwal.co.in/wp-content/uploads/2010/03/Image:DirectoryListing1.png\&#34;&gt;&lt;img src=\&#34;http://blog.amit-agarwal.co.in/wp-content/uploads/2010/08/300px-DirectoryListing1.png\&#34; alt=\&#34;Computer directory listing\&#34; title=\&#34;Computer directory listing\&#34; /&gt;&lt;/a&gt;&lt;/dt&gt; &lt;dd class=\&#34;wp-caption-dd zemanta-img-attribution\&#34;&gt;Image via &lt;a href=\&#34;http://blog.amit-agarwal.co.in/wp-content/uploads/2010/03/Image:DirectoryListing1.png\&#34;&gt;Wikipedia&lt;/a&gt;&lt;/dd&gt; &lt;/dl&gt;
&lt;/div&gt;&lt;/div&gt; 
&lt;!--[ad#ad-2]--&gt;
&lt;p&gt;&lt;tt&gt;function sr() { &lt;/tt&gt;&lt;/p&gt;
&lt;p&gt;&lt;tt&gt;declare pattern replacement name usage &lt;/tt&gt;&lt;br&gt;
&lt;tt&gt;declare -i pvar=0 rvar=0 tvar=0 &lt;/tt&gt;&lt;/p&gt;
&lt;p&gt;&lt;tt&gt;usage=&#39;usage: sr [-t ] [-n name] [-p pattern] [-r replacement] [&amp;ndash; ] [dir1 dir2 &amp;hellip;]&#39; &lt;/tt&gt;&lt;/p&gt;
&lt;p&gt;&lt;tt&gt;# cf. &amp;lt;a href=&amp;quot;http://bsdpants.blogspot.com/2007/02/option-ize-your-shell-scripts.html&amp;quot;&amp;gt;http://bsdpants.blogspot.com/2007/02/option-ize-your-shell-scripts.html&lt;/a&gt; &lt;/tt&gt;&lt;/p&gt;
&lt;p&gt;&lt;tt&gt;while [[ &amp;quot;${1:0:1}&amp;quot; == &#39;-&#39; ]] ; do &lt;/tt&gt;&lt;/p&gt;
&lt;p&gt;&lt;tt&gt;[[ &amp;quot;${1}&amp;quot; == &#39;&amp;ndash;&#39; ]] &amp;amp;&amp;amp; { shift; break; } # &amp;ndash; marks end of options &lt;/tt&gt;&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Recursive Regular Expressions</title>
      <link>/2010/03/24/recursive-regular-expressions/</link>
      <pubDate>Wed, 24 Mar 2010 03:39:42 +0000</pubDate>
      
      <guid>/2010/03/24/recursive-regular-expressions/</guid>
      <description>&lt;p&gt;&amp;lt;img src=&amp;quot;http://blog.amit-agarwal.co.in/wp-content/uploads/2010/08/yo-dawg-regex.jpg&amp;quot; alt=&amp;quot;Yo dawg, I heard you liked regular expressions, so I put a regex in your regex so you can match while you match!&amp;quot; align=&amp;quot;bottom&amp;quot; /&amp;gt; The &amp;lt;a class=&amp;quot;zem_slink freebase/en/regular_expression&amp;quot; title=&amp;quot;Regular expression&amp;quot; rel=&amp;quot;wikipedia&amp;quot; href=&amp;quot;http://en.wikipedia.org/wiki/Regular_expression&amp;quot;&amp;gt;regular expressions&lt;/a&gt; we use in our daily lives are actually not that “regular.” Most of the languages support some kind of extended regular expressions that are computationally more powerful than the “&amp;lt;a href=&amp;quot;http://en.wikipedia.org/wiki/Regular_expression&amp;quot;&amp;gt;regular&lt;/a&gt;” regular expressions as defined by the &amp;lt;a href=&amp;quot;http://en.wikipedia.org/wiki/Formal_language&amp;quot;&amp;gt;formal language theory&lt;/a&gt;.&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>bash – change theme for gtk in gnome and take screenshot from script.</title>
      <link>/2010/03/24/bash-change-theme-for-gtk-in-gnome-and-take-screenshot-from-script/</link>
      <pubDate>Wed, 24 Mar 2010 03:39:41 +0000</pubDate>
      
      <guid>/2010/03/24/bash-change-theme-for-gtk-in-gnome-and-take-screenshot-from-script/</guid>
      <description>&lt;!--[ad#ad-2]--&gt;
&lt;p&gt;I wrote a blog on bash script to change the icon/cursor theme using a bash script. Lets extend the same concept a little more and use the script to change the gtk theme for gnome and at the same time take a screenshot also.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;#!/bin/bash&lt;br&gt;
path=&amp;amp;#8221;/tmp/screenshot&amp;amp;#8221;&lt;br&gt;
[[ &amp;amp;#8221;$1&amp;amp;#8221; == &amp;amp;#8221;&amp;amp;#8221; ]] &amp;amp;&amp;amp; time=5 || time=$1&lt;br&gt;
[[ &amp;amp;#8221;$2&amp;amp;#8221; == &amp;amp;#8221;&amp;amp;#8221; ]] &amp;amp;&amp;amp; (&lt;br&gt;
cd ~/.themes&lt;br&gt;
cont=&amp;amp;#8221;y&amp;amp;#8221;&lt;br&gt;
echo &amp;amp;#8221;Select one of the icon themes&amp;amp;#8221;&lt;br&gt;
echo &amp;amp;#8221;When you like some theme just press Ctrl+c&amp;amp;#8221;&lt;br&gt;
for i in *&lt;br&gt;
do&lt;br&gt;
[[ -d $i/cursors ]] || (&lt;br&gt;
echo &amp;amp;#8221;Now trying …. : $i&amp;amp;#8221;&lt;br&gt;
gconftool-2 –type string -s  /desktop/gnome/interface/gtk_theme &amp;amp;#8221;$i&amp;amp;#8221;&lt;br&gt;
sleep 1&lt;br&gt;
j=$(echo &amp;amp;#8221;$path/$i&amp;amp;#8221;).jpg&lt;br&gt;
import -window root -quality 95 &amp;amp;#8221;$j&amp;amp;#8221;&lt;br&gt;
sleep $time&lt;br&gt;
)&lt;br&gt;
done&lt;br&gt;
) || gconftool-2 –type string -s  /desktop/gnome/interface/gtk_theme &amp;amp;#8221;$2&amp;amp;#8221;&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>unbound variable – bash completion not working and having issues with other stuff like command not found.</title>
      <link>/2010/03/23/unbound-variable-bash-completion-not-working-and-having-issues-with-other-stuff-like-command-not-found/</link>
      <pubDate>Tue, 23 Mar 2010 03:29:09 +0000</pubDate>
      
      <guid>/2010/03/23/unbound-variable-bash-completion-not-working-and-having-issues-with-other-stuff-like-command-not-found/</guid>
      <description>&lt;!--[ad#ad-2]--&gt;
&lt;p&gt;I generally use vi/vim for all my practical purposes of working with text files. And I have all the vi/vim plugins required to work with the files. This causes the following to be in the skeleton for all the bash scripts that I create:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;set -o nounset                              # Treat unset variables as an error&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;With this all the unbound variables as errors and was problem with all the shell scripts that was being sourced in the startup of bash. So all I had to do was remove this from all the startup scripts and then from the skeleton of the bash script in vim :).&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Useless Linux Terminal Commands</title>
      <link>/2010/03/21/useless-linux-terminal-commands/</link>
      <pubDate>Sun, 21 Mar 2010 13:05:26 +0000</pubDate>
      
      <guid>/2010/03/21/useless-linux-terminal-commands/</guid>
      <description>&lt;p&gt;Useless Linux Terminal Commands Not long ago, I have listed here some useful Linux terminal commands and those that I described as deadly. This time, I decided to gather some commands that I think have no practical use. I know it sounds interesting but you may disagree with me on some of the commands that I&amp;amp;#8217;ll list here as you may find a few of them useful. We can however agree to disagree as long as you explain to us why or how you find them handy.&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>What is my ip?</title>
      <link>/2010/03/14/what-is-my-ip/</link>
      <pubDate>Sun, 14 Mar 2010 14:30:13 +0000</pubDate>
      
      <guid>/2010/03/14/what-is-my-ip/</guid>
      <description>&lt;!--[ad#ad-2]--&gt;
&lt;p&gt;&lt;tt&gt;$ alias whatismyip=&amp;quot;wget -q -O - &amp;lt;a href=&amp;quot;http://whatismyip.com/automation/n09230945.asp&amp;quot;&amp;quot;&amp;gt;http://whatismyip.com/automation/n09230945.asp&amp;quot;&lt;/a&gt;&lt;/tt&gt; The preferred way for scripts (and easier to parse)&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&amp;lt;a href=&amp;quot;http://www.commandlinefu.com/commands/view/3943/what-is-my-ip&amp;quot;&amp;gt;View this command to comment, vote or add to favourites&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&amp;lt;a href=&amp;quot;http://feeds2.feedburner.com/commands/by/gibboris&amp;quot;&amp;gt;View all commands by &lt;/a&gt;&lt;strong&gt;&amp;lt;a href=&amp;quot;http://feeds2.feedburner.com/commands/by/gibboris&amp;quot;&amp;gt;gibboris&lt;/a&gt;&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&amp;lt;a href=&amp;quot;http://www.commandlinefu.com&amp;quot;&amp;gt;&amp;lt;img src=&amp;quot;http://blog.amit-agarwal.co.in/wp-content/uploads/2010/08/header-logo.jpg&amp;quot; alt=&amp;quot;&amp;quot; align=&amp;quot;bottom&amp;quot; /&amp;gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;by David Winterbottom (&amp;lt;a href=&amp;quot;http://codeinthehole.com&amp;quot;&amp;gt;codeinthehole.com&lt;/a&gt;)&lt;/p&gt;
&lt;p&gt;&amp;lt;a href=&amp;quot;http://feedads.g.doubleclick.net/~a/Ytz2VmntW_MS33pd5-JeJzhnUZo/0/da&amp;quot;&amp;gt;&amp;lt;img src=&amp;quot;http://blog.amit-agarwal.com/wp-content/uploads/img.zemanta.com/~a/Ytz2VmntW_MS33pd5-JeJzhnUZo/0/di&amp;quot; alt=&amp;quot;&amp;quot; align=&amp;quot;bottom&amp;quot; /&amp;gt;&lt;/a&gt;&lt;br&gt;
&amp;lt;a href=&amp;quot;http://feedads.g.doubleclick.net/~a/Ytz2VmntW_MS33pd5-JeJzhnUZo/1/da&amp;quot;&amp;gt;&amp;lt;img src=&amp;quot;http://blog.amit-agarwal.com/wp-content/uploads/img.zemanta.com/~a/Ytz2VmntW_MS33pd5-JeJzhnUZo/1/di&amp;quot; alt=&amp;quot;&amp;quot; align=&amp;quot;bottom&amp;quot; /&amp;gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;img src=&amp;quot;http://blog.amit-agarwal.com/wp-content/uploads/img.zemanta.com/~r/Command-line-fu/~4/O6l8r0uDeTc&amp;quot; alt=&amp;quot;&amp;quot; width=&amp;quot;1&amp;quot; height=&amp;quot;1&amp;quot; align=&amp;quot;bottom&amp;quot; /&amp;gt;&lt;/p&gt;
&lt;p&gt;URL: &amp;lt;a href=&amp;quot;http://feedproxy.google.com/~r/Command-line-fu/~3/O6l8r0uDeTc/what-is-my-ip&amp;quot;&amp;gt;http://feedproxy.google.com/~r/Command-line-fu/~3/O6l8r0uDeTc/what-is-my-ip&lt;/a&gt;&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Some bashrc shorcuts for faster and profiecient directory browsing.</title>
      <link>/2010/03/10/some-bashrc-shorcuts-for-faster-and-profiecient-directory-browsing/</link>
      <pubDate>Wed, 10 Mar 2010 12:49:38 +0000</pubDate>
      
      <guid>/2010/03/10/some-bashrc-shorcuts-for-faster-and-profiecient-directory-browsing/</guid>
      <description>&lt;!--[ad#ad-2]--&gt;
&lt;p&gt;Here are some of the funtions that I have in my bashrc to make my life simple. They are not written by me but mostly taken from other places, but modified by me to some extent to suit my needs. If you know the original creator of these, let me know so I can add the attribution for the same.&lt;/p&gt;
&lt;p&gt;This one is &lt;strong&gt;very&lt;/strong&gt; useful.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;.. (){&lt;br&gt;
local arg=${1:-1};&lt;br&gt;
local dir=&amp;amp;#8221;&amp;amp;#8221;&lt;br&gt;
while [ $arg -gt 0 ]; do&lt;br&gt;
dir=&amp;amp;#8221;../$dir&amp;amp;#8221;&lt;br&gt;
arg=$(($arg – 1));&lt;br&gt;
done&lt;br&gt;
cd $dir &amp;gt;&amp;amp;/dev/null&lt;br&gt;
}&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Bash script to view log and config file in different server and paths.</title>
      <link>/2010/03/09/bash-script-to-view-log-and-config-file-in-different-server-and-paths/</link>
      <pubDate>Tue, 09 Mar 2010 03:52:04 +0000</pubDate>
      
      <guid>/2010/03/09/bash-script-to-view-log-and-config-file-in-different-server-and-paths/</guid>
      <description>&lt;!--[ad#ad-2]--&gt;
&lt;p&gt;I was working on a project, where I need to open file from different servers and different paths. I do it with the command:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;vim ftp://username@server/path/filename&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;This is okay when the path is short but when the path gets longer and I have different config files to open from the same path or their associated logs, then it becomes un-necessary typing. So, I did the following:&lt;/p&gt;
&lt;p&gt;Have a file with some aliase&amp;amp;#8217;s like the below and source it from the bashrc file:&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Bash histoy – common history in different terminals</title>
      <link>/2010/03/04/bash-histoy-common-history-in-different-terminals/</link>
      <pubDate>Thu, 04 Mar 2010 02:04:42 +0000</pubDate>
      
      <guid>/2010/03/04/bash-histoy-common-history-in-different-terminals/</guid>
      <description>&lt;p&gt;I have been looking to do this for sometime. The bash history is per&lt;br&gt;
session basis and the last session to quit overwrites the bash_history&lt;br&gt;
file and thus all other terminals started between the time last terminal&lt;br&gt;
lasted does not get to write the commands in the history file. Secondly&lt;br&gt;
the history gets cluttered with lot of duplicate entries and entries&lt;br&gt;
with ls and cd commands. So finally I added these to the bashrc file:&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Bash Sub Shells</title>
      <link>/2010/03/02/bash-sub-shells/</link>
      <pubDate>Tue, 02 Mar 2010 02:33:08 +0000</pubDate>
      
      <guid>/2010/03/02/bash-sub-shells/</guid>
      <description>&lt;p&gt;Taken from &amp;lt;a href=&amp;quot;http://www.linuxjournal.com/content/bash-sub-shells&amp;quot; target=&amp;quot;_blank&amp;quot;&amp;gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;blockquote&gt;
&lt;pre&gt;&amp;lt;span class=\&#34;c\&#34;&gt;#!/bin/bash&amp;lt;/span&gt;
&lt;/blockquote&gt;
&lt;p&gt;&amp;lt;span class=&amp;quot;nv&amp;quot;&amp;gt;server_cmd&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;o&amp;quot;&amp;gt;=&amp;lt;/span&amp;gt;server
&amp;lt;span class=&amp;quot;nv&amp;quot;&amp;gt;pid_file&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;o&amp;quot;&amp;gt;=&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;k&amp;quot;&amp;gt;$(&amp;lt;/span&amp;gt;basename &amp;lt;span class=&amp;quot;nv&amp;quot;&amp;gt;$server_cmd&amp;lt;/span&amp;gt; .sh&amp;lt;span class=&amp;quot;k&amp;quot;&amp;gt;)&amp;lt;/span&amp;gt;.pid
&amp;lt;span class=&amp;quot;nv&amp;quot;&amp;gt;log_file&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;o&amp;quot;&amp;gt;=&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;k&amp;quot;&amp;gt;$(&amp;lt;/span&amp;gt;basename &amp;lt;span class=&amp;quot;nv&amp;quot;&amp;gt;$server_cmd&amp;lt;/span&amp;gt; .sh&amp;lt;span class=&amp;quot;k&amp;quot;&amp;gt;)&amp;lt;/span&amp;gt;.log&lt;/p&gt;
&lt;p&gt;&amp;lt;span class=&amp;quot;o&amp;quot;&amp;gt;(&amp;lt;/span&amp;gt;
&amp;lt;span class=&amp;quot;nb&amp;quot;&amp;gt;echo&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;s2&amp;quot;&amp;gt;&amp;quot;Starting server&amp;quot;&amp;lt;/span&amp;gt;
&amp;lt;span class=&amp;quot;nb&amp;quot;&amp;gt;echo&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;s2&amp;quot;&amp;gt;&amp;quot;Doing some init work&amp;quot;&amp;lt;/span&amp;gt;
&amp;lt;span class=&amp;quot;nv&amp;quot;&amp;gt;$server_cmd&amp;lt;/span&amp;gt;   &amp;lt;span class=&amp;quot;c&amp;quot;&amp;gt;# server becomes a daemon&amp;lt;/span&amp;gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&amp;amp;lt;span class=\&amp;quot;k\&amp;quot;&amp;gt;while &amp;amp;lt;/span&amp;gt;&amp;amp;lt;span class=\&amp;quot;nb\&amp;quot;&amp;gt;true&amp;amp;lt;/span&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&amp;lt;span class=&amp;quot;nb&amp;quot;&amp;gt;    &amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;k&amp;quot;&amp;gt;do&amp;lt;/span&amp;gt;
&amp;lt;span class=&amp;quot;k&amp;quot;&amp;gt;        if&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;o&amp;quot;&amp;gt;[[&amp;lt;/span&amp;gt; -f &amp;lt;span class=&amp;quot;nv&amp;quot;&amp;gt;$pid_file&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;o&amp;quot;&amp;gt;]]&amp;lt;/span&amp;gt;; &amp;lt;span class=&amp;quot;k&amp;quot;&amp;gt;then&amp;lt;/span&amp;gt;
&amp;lt;span class=&amp;quot;k&amp;quot;&amp;gt;            &amp;lt;/span&amp;gt;sleep 15
&amp;lt;span class=&amp;quot;k&amp;quot;&amp;gt;else&amp;lt;/span&amp;gt;
&amp;lt;span class=&amp;quot;k&amp;quot;&amp;gt;            &amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;nb&amp;quot;&amp;gt;break&amp;lt;/span&amp;gt;
&amp;lt;span class=&amp;quot;nb&amp;quot;&amp;gt;        &amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;k&amp;quot;&amp;gt;fi&amp;lt;/span&amp;gt;
&amp;lt;span class=&amp;quot;k&amp;quot;&amp;gt;    done&amp;lt;/span&amp;gt;
&amp;lt;span class=&amp;quot;k&amp;quot;&amp;gt;    &amp;lt;/span&amp;gt;mail -s &amp;lt;span class=&amp;quot;s2&amp;quot;&amp;gt;&amp;quot;Server exitted&amp;quot;&amp;lt;/span&amp;gt; &lt;a href=&#34;mailto:joe@blow.com&#34;&gt;joe@blow.com&lt;/a&gt; &amp;lt;&amp;lt;&amp;lt;CRAP&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>bash script with sql to get the number of records from multiple tables.</title>
      <link>/2010/02/10/bash-script-with-sql-to-get-the-number-of-records-from-multiple-tables/</link>
      <pubDate>Wed, 10 Feb 2010 15:19:40 +0000</pubDate>
      
      <guid>/2010/02/10/bash-script-with-sql-to-get-the-number-of-records-from-multiple-tables/</guid>
      <description>&lt;!--[ad#ad-2]--&gt;
&lt;p&gt;Here is the bash script:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;#!/bin/sh&lt;br&gt;
names[1]=errorlog&lt;br&gt;
names[2]=amit1log&lt;br&gt;
names[3]=amit2log&lt;br&gt;
names[4]=amit3log&lt;br&gt;
names[5]=amit4log&lt;br&gt;
j=1&lt;br&gt;
echo $1&lt;br&gt;
for i in $( sqlplus amit/passwd@tns @get_count.sql |sed  -n &amp;amp;#8217;/COUNT/,/Disconnected/p&amp;amp;#8217;|sed &amp;amp;#8217;/COUNT/ d&amp;amp;#8217;|sed &amp;amp;#8217;/—/ d&amp;amp;#8217;|sed &amp;amp;#8217;/Disconnected/ d&amp;amp;#8217;|tr &amp;amp;#8217;n&amp;amp;#8217; &amp;amp;#8217; &amp;amp;#8217;  )&lt;br&gt;
do&lt;br&gt;
temp=${names[$j]}&lt;br&gt;
let count=30-${#temp}&lt;br&gt;
for ((I=1; I &amp;lt;= $count ; I++))&lt;br&gt;
do&lt;br&gt;
printf &amp;amp;#8221; &amp;amp;#8221;&lt;br&gt;
done&lt;br&gt;
echo  &amp;amp;#8221;${names[$j]}    : $i&amp;amp;#8221;&lt;br&gt;
# echo $j&lt;br&gt;
let j=j+1&lt;br&gt;
done&lt;br&gt;
echo&lt;br&gt;
echo&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;and the required sql script:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;select count(&lt;em&gt;) from errorlog;&lt;br&gt;
select count(&lt;/em&gt;) from amit1log;&lt;br&gt;
select count(&lt;em&gt;) from amit2log;&lt;br&gt;
select count(&lt;/em&gt;) from amit3log;&lt;br&gt;
select count(*) from amit4log;&lt;br&gt;
quit;&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Splitting strings with IFS</title>
      <link>/2010/02/04/splitting-strings-with-ifs/</link>
      <pubDate>Thu, 04 Feb 2010 15:58:43 +0000</pubDate>
      
      <guid>/2010/02/04/splitting-strings-with-ifs/</guid>
      <description>&lt;!--[ad#ad-2]--&gt;
&lt;p&gt;Today I want to discuss splitting strings into tokens or “words”. I previously discussed how to do this with the &amp;lt;a href=&amp;quot;http://bashcurescancer.com/reading-a-file-line-by-line.html&amp;quot;&amp;gt;IFS variable&lt;/a&gt; and promised a more in depth discussion. Today, I will make the case on WHY to use IFS to split strings as opposed to using a subshell combined with &amp;lt;a class=&amp;quot;zem_slink freebase/en/awk&amp;quot; title=&amp;quot;AWK&amp;quot; rel=&amp;quot;homepage&amp;quot; href=&amp;quot;http://cm.bell-labs.com/cm/cs/awkbook/index.html&amp;quot;&amp;gt;awk&lt;/a&gt; or cut.&lt;/p&gt;
&lt;p&gt;I wrote this script which reads the /etc/password file line-by-line and prints the &amp;lt;a class=&amp;quot;zem_slink freebase/en/user&amp;quot; title=&amp;quot;User (computing)&amp;quot; rel=&amp;quot;wikipedia&amp;quot; href=&amp;quot;http://en.wikipedia.org/wiki/User_%28computing%29&amp;quot;&amp;gt;username&lt;/a&gt; of any user which has a UID greater than 10 and has the shell of /sbin/nologin. Each test function performs this task 10 times to increase the length of the test:&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Color output from ls – based on file type</title>
      <link>/2010/02/04/color-output-from-ls-based-on-file-type/</link>
      <pubDate>Thu, 04 Feb 2010 15:58:29 +0000</pubDate>
      
      <guid>/2010/02/04/color-output-from-ls-based-on-file-type/</guid>
      <description>&lt;!--[ad#ad-2]--&gt;
&lt;p&gt;Threre are certain default variables which control the color of the output from the ls command, so we will talk about them today.&lt;/p&gt;
&lt;p&gt;The first one is to get the color output from the &amp;amp;#8221;ls&amp;amp;#8221; command. We will look at the various ways to do this:&lt;/p&gt;
&lt;p&gt;First is to use this with default colors:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;ls –color=auto&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Now this will use the default colors which might not go with your liking 🙂 So if you want to change the colors you can use the variable called LS_COLORS.&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Bash styling(themeing), the stylist way.</title>
      <link>/2010/02/04/bash-styling-themeing-the-stylist-way/</link>
      <pubDate>Thu, 04 Feb 2010 15:58:23 +0000</pubDate>
      
      <guid>/2010/02/04/bash-styling-themeing-the-stylist-way/</guid>
      <description>&lt;!--[ad#ad-2]--&gt;
&lt;p&gt;For last couple of days, I have been looking for solutions to make stlying my bash easier. So, first a screenshot of the effort:&lt;/p&gt;
&lt;p&gt;&amp;lt;img class=&amp;quot;size-full wp-image-703&amp;quot; title=&amp;quot;bash style&amp;quot; src=&amp;quot;http://blog.amit-agarwal.co.in/wp-content/uploads/2010/08/a.jpg&amp;quot; alt=&amp;quot;bash style&amp;quot; width=&amp;quot;511&amp;quot; height=&amp;quot;332&amp;quot; /&amp;gt;&lt;/p&gt;
&lt;p&gt;I was looking for the simplest solutions to do this. So, I installed two packages to make my life easier :  bashstyle and fortune.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;sudo yum install fortune\*&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;For bash-style you can download the source files &amp;lt;a href=&amp;quot;http://www.nanolx.org/bashstyle-ng/&amp;quot; target=&amp;quot;_blank&amp;quot;&amp;gt;here&lt;/a&gt;. Download the file, then do the following:&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>grep -v with multiple patterns.</title>
      <link>/2010/01/25/grep-v-with-multiple-patterns/</link>
      <pubDate>Mon, 25 Jan 2010 15:10:33 +0000</pubDate>
      
      <guid>/2010/01/25/grep-v-with-multiple-patterns/</guid>
      <description>&lt;!--[ad#ad-2]--&gt;
&lt;p&gt;&lt;tt&gt;$ sed &#39;/test/{/error|critical|warning/d}&#39; somefile&lt;/tt&gt; If you wanted to do all in one command, you could go w/ sed instead&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&amp;lt;a href=&amp;quot;http://www.commandlinefu.com/commands/view/3882/grep-v-with-multiple-patterns.&amp;quot;&amp;gt;View this command to comment, vote or add to favourites&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&amp;lt;a href=&amp;quot;http://feeds2.feedburner.com/commands/by/pipping&amp;quot;&amp;gt;View all commands by &lt;/a&gt;&lt;strong&gt;&amp;lt;a href=&amp;quot;http://feeds2.feedburner.com/commands/by/pipping&amp;quot;&amp;gt;pipping&lt;/a&gt;&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&amp;lt;a href=&amp;quot;http://www.commandlinefu.com&amp;quot;&amp;gt;&amp;lt;img src=&amp;quot;http://blog.amit-agarwal.co.in/wp-content/uploads/2010/08/header-logo.jpg&amp;quot; alt=&amp;quot;&amp;quot; align=&amp;quot;bottom&amp;quot; /&amp;gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;by David Winterbottom (&amp;lt;a href=&amp;quot;http://codeinthehole.com&amp;quot;&amp;gt;codeinthehole.com&lt;/a&gt;)&lt;/p&gt;
&lt;p&gt;&amp;lt;a href=&amp;quot;http://feedads.g.doubleclick.net/~a/J5B2Z5VTSlqhmd-2YMQ4ndmAu4U/0/da&amp;quot;&amp;gt;&amp;lt;img src=&amp;quot;http://blog.amit-agarwal.com/wp-content/uploads/img.zemanta.com/~a/J5B2Z5VTSlqhmd-2YMQ4ndmAu4U/0/di&amp;quot; alt=&amp;quot;&amp;quot; align=&amp;quot;bottom&amp;quot; /&amp;gt;&lt;/a&gt;&lt;br&gt;
&amp;lt;a href=&amp;quot;http://feedads.g.doubleclick.net/~a/J5B2Z5VTSlqhmd-2YMQ4ndmAu4U/1/da&amp;quot;&amp;gt;&amp;lt;img src=&amp;quot;http://blog.amit-agarwal.com/wp-content/uploads/img.zemanta.com/~a/J5B2Z5VTSlqhmd-2YMQ4ndmAu4U/1/di&amp;quot; alt=&amp;quot;&amp;quot; align=&amp;quot;bottom&amp;quot; /&amp;gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;img src=&amp;quot;http://blog.amit-agarwal.com/wp-content/uploads/img.zemanta.com/~r/Command-line-fu/~4/LjKzo7FpzDU&amp;quot; alt=&amp;quot;&amp;quot; width=&amp;quot;1&amp;quot; height=&amp;quot;1&amp;quot; align=&amp;quot;bottom&amp;quot; /&amp;gt;&lt;/p&gt;
&lt;p&gt;URL: &amp;lt;a href=&amp;quot;http://feedproxy.google.com/~r/Command-line-fu/~3/LjKzo7FpzDU/grep-v-with-multiple-patterns.&amp;quot;&amp;gt;http://feedproxy.google.com/~r/Command-line-fu/~3/LjKzo7FpzDU/grep-v-with-multiple-patterns.&lt;/a&gt;&amp;lt;h6 class=&amp;quot;zemanta-related-title&amp;quot; style=&amp;quot;font-size: 1em;&amp;quot;&amp;gt;Related articles by Zemanta&lt;/h6&gt; &amp;lt;ul class=&amp;quot;zemanta-article-ul&amp;quot;&amp;gt; &amp;lt;li class=&amp;quot;zemanta-article-ul-li&amp;quot;&amp;gt;&amp;lt;a href=&amp;quot;http://www.seroundtable.com/archives/020935.html&amp;quot;&amp;gt;Google&amp;amp;#8217;s &amp;amp;#8221;Show More Results&amp;amp;#8221; Plus Box&lt;/a&gt; (seroundtable.com)&lt;/li&gt; &amp;lt;li class=&amp;quot;zemanta-article-ul-li&amp;quot;&amp;gt;&amp;lt;a href=&amp;quot;http://www.macworld.com/article/143351/2009/10/netprocesses.html?lsrc=rss_main&amp;quot;&amp;gt;See which processes are using the Internet&lt;/a&gt; (macworld.com)&lt;/li&gt; &lt;/ul&gt; &amp;lt;div class=&amp;quot;zemanta-pixie&amp;quot; style=&amp;quot;margin-top: 10px; height: 15px;&amp;quot;&amp;gt;&amp;lt;a class=&amp;quot;zemanta-pixie-a&amp;quot; title=&amp;quot;Reblog this post [with Zemanta]&amp;quot; href=&amp;quot;http://reblog.zemanta.com/zemified/cc60245b-7397-4d48-83b2-7bfb345ae7a9/&amp;quot;&amp;gt;&amp;lt;img class=&amp;quot;zemanta-pixie-img&amp;quot; style=&amp;quot;border: medium none; float: right;&amp;quot; src=&amp;quot;http://blog.amit-agarwal.co.in/wp-content/uploads/2010/08/reblog_e20.png&amp;quot; alt=&amp;quot;Reblog this post [with Zemanta]&amp;quot; /&amp;gt;&lt;/a&gt;&amp;lt;span class=&amp;quot;zem-script more-related pretty-attribution&amp;quot;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Seders\’s grab bag – Tutorials</title>
      <link>/2010/01/24/sederss-grab-bag-tutorials/</link>
      <pubDate>Sun, 24 Jan 2010 15:45:56 +0000</pubDate>
      
      <guid>/2010/01/24/sederss-grab-bag-tutorials/</guid>
      <description>&lt;!--[ad#ad-2]--&gt;
&lt;p&gt;&amp;lt;a href=&amp;quot;http://sed.sourceforge.net/grabbag/tutorials/&amp;quot;&amp;gt;http://sed.sourceforge.net/grabbag/tutorials/&lt;/a&gt;&lt;/p&gt;
&lt;h1 id=&#34;span-stylefont-size-x-largea-hrefhttpsedsourceforgenetgrabbagseder8217saa-hrefhttpsedsourceforgenetgrabbag-grab-bagaspan&#34;&gt;&lt;strong&gt;&amp;lt;span style=&amp;quot;font-size: x-large;&amp;quot;&amp;gt;&amp;lt;a href=&amp;quot;http://sed.sourceforge.net/grabbag/&amp;quot;&amp;gt;seder&amp;amp;#8217;s&lt;/a&gt;&amp;lt;a href=&amp;quot;http://sed.sourceforge.net/grabbag/&amp;quot;&amp;gt; grab bag&lt;/a&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/h1&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&amp;lt;a href=&amp;quot;http://sed.sourceforge.net/grabbag/scripts/&amp;quot;&amp;gt;scripts&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&amp;lt;a href=&amp;quot;http://sed.sourceforge.net/grabbag/tutorials/&amp;quot;&amp;gt;tutorials&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&amp;lt;a href=&amp;quot;http://sed.sourceforge.net/grabbag/seders/&amp;quot;&amp;gt;seders&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&amp;lt;a href=&amp;quot;http://sed.sourceforge.net/grabbag/ssed/&amp;quot;&amp;gt;ssed&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&amp;lt;a href=&amp;quot;http://sed.sourceforge.net/grabbag/links/&amp;quot;&amp;gt;links&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&amp;lt;a href=&amp;quot;http://sed.sourceforge.net/grabbag/tutorials/#intros&amp;quot;&amp;gt;Intros&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&amp;lt;a href=&amp;quot;http://sed.sourceforge.net/grabbag/tutorials/#advanced&amp;quot;&amp;gt;Advanced&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&amp;lt;a href=&amp;quot;http://sed.sourceforge.net/grabbag/tutorials/#misc&amp;quot;&amp;gt;Miscellaneous&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;span-stylefont-size-largesed-tutorialsspan&#34;&gt;&lt;strong&gt;&amp;lt;span style=&amp;quot;font-size: large;&amp;quot;&amp;gt;Sed Tutorials&lt;/span&gt;&lt;/strong&gt;&lt;/h2&gt;
&lt;p&gt;If you have written anything about sed – whether an introduction, how sed got you out of a real-life situation, or perhaps an advanced technique you&amp;amp;#8217;ve discovered – you may like have your work published here. &amp;lt;a href=&amp;quot;mailto:bonzini@gnu.org&amp;quot;&amp;gt;Your contribution&lt;/a&gt; will be very welcome.&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>change the terminal title dynamically in X11</title>
      <link>/2010/01/09/change-the-terminal-title-dynamically-in-x11/</link>
      <pubDate>Sat, 09 Jan 2010 13:26:31 +0000</pubDate>
      
      <guid>/2010/01/09/change-the-terminal-title-dynamically-in-x11/</guid>
      <description>&lt;p&gt;I was actually looking for this for quite sometime. Some years back in my bashrc was the proper setting for setting the terminal title when I did a cd, and I had completely forgotten how to do it. So today I searched quite a few commands the environment variables for doing the same and found it again.&lt;/p&gt;
&lt;p&gt;Here it is (Just put this in your bashrc or bash_profile):&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;export PROMPT_COMMAND=&amp;amp;#8217;echo -ne &amp;amp;#8221;\033]0;`pwd`&amp;amp;#8221;; echo -ne &amp;amp;#8221;\007&amp;amp;#8221;&amp;amp;#8217;&lt;/strong&gt;&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>shell — one liner to selectively change case</title>
      <link>/2010/01/07/shell-one-liner-to-selectively-change-case/</link>
      <pubDate>Thu, 07 Jan 2010 02:31:15 +0000</pubDate>
      
      <guid>/2010/01/07/shell-one-liner-to-selectively-change-case/</guid>
      <description>&lt;!--[ad#ad-2]--&gt;
&lt;p&gt;Today I had a hard time, I had a herculian task of converting the case of file to upper case. Well that&amp;amp;#8217;s not difficult :), I know. What made it difficult was the fact that not the whole file had to be converted but only selective lines containing the work important. Okay now that too is not so difficult, I thought. But again the file size was huge, it had some 9 million lines. So, I just thought of trying my skills of shell programming (dont have much of it anyway). So here&amp;amp;#8217;s what I did:&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Display the output of a command from the first line until the first instance of a regular expression.</title>
      <link>/2010/01/05/display-the-output-of-a-command-from-the-first-line-until-the-first-instance-of-a-regular-expression/</link>
      <pubDate>Mon, 04 Jan 2010 22:46:55 +0000</pubDate>
      
      <guid>/2010/01/05/display-the-output-of-a-command-from-the-first-line-until-the-first-instance-of-a-regular-expression/</guid>
      <description>&lt;div class=\&#34;zemanta-img\&#34;&gt; 
&lt;div&gt;
  &lt;dl class=\&#34;wp-caption alignright\&#34;&gt; &lt;dt class=\&#34;wp-caption-dt\&#34;&gt;&lt;a href=\&#34;http://blog.amit-agarwal.co.in/wp-content/uploads/2010/01/Image:Bash_screenshot.png\&#34;&gt;&lt;img title=\&#34;Screenshot of a sample Bash session.\&#34; src=\&#34;http://blog.amit-agarwal.co.in/wp-content/uploads/2010/08/300px-Bash_screenshot.png\&#34; alt=\&#34;Screenshot of a sample Bash session.\&#34; /&gt;&lt;/a&gt;&lt;/dt&gt; &lt;dd class=\&#34;wp-caption-dd zemanta-img-attribution\&#34;&gt;Image via &lt;a href=\&#34;http://blog.amit-agarwal.co.in/wp-content/uploads/2010/01/Image:Bash_screenshot.png\&#34;&gt;Wikipedia&lt;/a&gt;&lt;/dd&gt; &lt;/dl&gt;
&lt;/div&gt;&lt;/div&gt; 
&lt;!--[ad#ad-2]--&gt;
&lt;p&gt;&lt;tt&gt;| perl -n -e &#39;print &amp;quot;$_&amp;quot; if 1 &amp;hellip; /&amp;laquo;a class=&amp;quot;zem_slink freebase/en/regular_expression&amp;quot; title=&amp;quot;Regular expression&amp;quot; rel=&amp;quot;wikipedia&amp;quot; href=&amp;quot;http://en.wikipedia.org/wiki/Regular_expression&amp;quot;&amp;gt;regex&lt;/a&gt;&amp;gt;/;#&lt;/tt&gt; This &amp;lt;a class=&amp;quot;zem_slink freebase/en/command_line_interface&amp;quot; title=&amp;quot;Command-line interface&amp;quot; rel=&amp;quot;wikipedia&amp;quot; href=&amp;quot;http://en.wikipedia.org/wiki/Command-line_interface&amp;quot;&amp;gt;command line&lt;/a&gt; will display the output of , from the first line of output, until the first time it sees a &amp;lt;a class=&amp;quot;zem_slink freebase/en/pattern_matching&amp;quot; title=&amp;quot;Pattern matching&amp;quot; rel=&amp;quot;wikipedia&amp;quot; href=&amp;quot;http://en.wikipedia.org/wiki/Pattern_matching&amp;quot;&amp;gt;pattern matching&lt;/a&gt; .&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Know when you will type :q in your term instead of vi(m), the alias will chewed you out.</title>
      <link>/2009/12/20/know-when-you-will-type-q-in-your-term-instead-of-vim-the-alias-will-chewed-you-out/</link>
      <pubDate>Sun, 20 Dec 2009 07:53:47 +0000</pubDate>
      
      <guid>/2009/12/20/know-when-you-will-type-q-in-your-term-instead-of-vim-the-alias-will-chewed-you-out/</guid>
      <description>&lt;!--[ad#ad-2]--&gt;
&lt;p&gt;most simple solution is to alias :q like so:&lt;br&gt;
alias :q=`echo &amp;amp;#8221;This is not vim&amp;amp;#8221;`&lt;/p&gt;
&lt;p&gt;but as someone suggested in commandlinefu, you can use tput to put some color and fun into this.&lt;br&gt;
alias :q=&amp;amp;#8217;tput setaf 1; echo &amp;gt;&amp;amp;2 &amp;amp;#8221;this is NOT vi(m) :/&amp;amp;#8221;; tput sgr0&amp;amp;#8217;&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Display a block of text with delineated by a start pattern and an end  pattern</title>
      <link>/2009/12/18/display-a-block-of-text-with-delineated-by-a-start-pattern-and-an-end-pattern/</link>
      <pubDate>Fri, 18 Dec 2009 07:43:41 +0000</pubDate>
      
      <guid>/2009/12/18/display-a-block-of-text-with-delineated-by-a-start-pattern-and-an-end-pattern/</guid>
      <description>&lt;!--[ad#ad-2]--&gt;
&lt;p&gt;Taken idea from commandlinefu.com&lt;/p&gt;
&lt;p&gt;The command will display a segment from the file from the start pattern to the end pattern.&lt;/p&gt;
&lt;p&gt;function viewsegment() { tail -n +`fgrep -n -m 1 &amp;ldquo;$1&amp;rdquo; $3 | head -`fgrep -n -m 1 &amp;ldquo;$2&amp;rdquo; $3 }&lt;br&gt;
Display a block of text with delineated by a start pattern and an end pattern&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>View the newest xkcd comic.</title>
      <link>/2009/12/07/view-the-newest-xkcd-comic/</link>
      <pubDate>Mon, 07 Dec 2009 10:47:07 +0000</pubDate>
      
      <guid>/2009/12/07/view-the-newest-xkcd-comic/</guid>
      <description>&lt;!--[ad#ad-2]--&gt;
&lt;p&gt;This function displays the latest comic from xkcd.com. One of the best things about xkcd is the title text when you hover over the comic, so this function also displays that after you close the comic.&lt;/p&gt;
&lt;p&gt;&lt;tt&gt;$ xkcd(){ local f=$(curl -s &amp;lt;a href=&amp;quot;http://xkcd.com/&amp;quot;&amp;gt;http://xkcd.com/&lt;/a&gt;);display $(echo &amp;quot;$f&amp;quot;|grep -Po &#39;(?&amp;lt;=&amp;quot;)http://imgs.xkcd.com/comics/[^&amp;quot;]+(png|jpg)&#39;);echo &amp;quot;$f&amp;quot;|awk &#39;/&amp;lt;img src=&amp;quot;http://imgs.xkcd.com/comics/.&lt;em&gt;?&amp;quot; title=.&lt;/em&gt;/{gsub(/^.&lt;em&gt;title=.|&amp;quot;.&lt;/em&gt;?$/,&amp;quot;&amp;quot;);print}&#39;;}&lt;/tt&gt;&lt;/p&gt;
&lt;p&gt;To get a random xkcd comic, I also use the following:&lt;/p&gt;
&lt;p&gt;&lt;tt&gt;xkcdrandom(){ local f=$(wget -q &amp;lt;a href=&amp;quot;http://dynamic.xkcd.com/comic/random/&amp;quot;&amp;gt;http://dynamic.xkcd.com/comic/random/&lt;/a&gt; -O -);display $(echo &amp;quot;$f&amp;quot;|grep -Po &#39;(?&amp;lt;=&amp;quot;)http://imgs.xkcd.com/comics/[^&amp;quot;]+(png|jpg)&#39;);echo &amp;quot;$f&amp;quot;|awk &#39;/&amp;lt;img src=&amp;quot;http://imgs.xkcd.com/comics/.&lt;em&gt;?&amp;quot; title=.&lt;/em&gt;/{gsub(/^.&lt;em&gt;title=.|&amp;quot;.&lt;/em&gt;?$/,&amp;quot;&amp;quot;);print}&#39;;}&lt;/tt&gt;&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Insert a comment on command line for reminder</title>
      <link>/2009/12/05/insert-a-comment-on-command-line-for-reminder/</link>
      <pubDate>Sat, 05 Dec 2009 15:22:12 +0000</pubDate>
      
      <guid>/2009/12/05/insert-a-comment-on-command-line-for-reminder/</guid>
      <description>&lt;!--[ad#ad-2]--&gt;
&lt;p&gt;&amp;lt;a href=&amp;quot;http://blog.amit-agarwal.co.in/category/linux/&amp;quot;&amp;gt;Bookmark this category&lt;/a&gt;&lt;br&gt;
Insert a comment on command line for reminder&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;$ ls -alh #mycomment&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Comments can be used directly on the command line so I can save in the history a brief description of what command does.&lt;/p&gt;
&lt;p&gt;* View this command to comment, vote or add to favourites * View all commands by vgagliardi&lt;/p&gt;
&lt;p&gt;commandlinefu.com&lt;/p&gt;
&lt;p&gt;by David Winterbottom (codeinthehole.com)&lt;/p&gt;
&lt;p&gt;URL: &amp;lt;a href=&amp;quot;http://feedproxy.google.com/~r/Command-line-fu/~3/_5hXsFUuAwc/insert-a-comment-on-command-line-for-reminder&amp;quot;&amp;gt;http://feedproxy.google.com/~r/Command-line-fu/~3/_5hXsFUuAwc/insert-a-comment-on-command-line-for-reminder&lt;/a&gt;&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>bash colors</title>
      <link>/2009/11/16/bash-colors/</link>
      <pubDate>Mon, 16 Nov 2009 14:14:23 +0000</pubDate>
      
      <guid>/2009/11/16/bash-colors/</guid>
      <description>&lt;div class=\&#34;zemanta-img\&#34; style=\&#34;margin: 1em; display: block;\&#34;&gt; 
&lt;div&gt;
  &lt;dl class=\&#34;wp-caption alignright\&#34; style=\&#34;width: 310px;\&#34;&gt; &lt;dt class=\&#34;wp-caption-dt\&#34;&gt;&lt;a href=\&#34;http://blog.amit-agarwal.co.in/wp-content/uploads/2009/11/Image:Luge_Schlucht.jpg\&#34;&gt;&lt;img title=\&#34;People participating in summer luge as a form ...\&#34; src=\&#34;http://blog.amit-agarwal.co.in/wp-content/uploads/2010/08/300px-Luge_Schlucht.jpg\&#34; alt=\&#34;People participating in summer luge as a form ...\&#34; width=\&#34;300\&#34; height=\&#34;225\&#34; /&gt;&lt;/a&gt;&lt;/dt&gt; &lt;dd class=\&#34;wp-caption-dd zemanta-img-attribution\&#34; style=\&#34;font-size: 0.8em;\&#34;&gt;Image via &lt;a href=\&#34;http://blog.amit-agarwal.co.in/wp-content/uploads/2009/11/Image:Luge_Schlucht.jpg\&#34;&gt;Wikipedia&lt;/a&gt;&lt;/dd&gt; &lt;/dl&gt;
&lt;/div&gt;&lt;/div&gt; 
&lt;!--[ad#ad-2]--&gt;
&lt;p&gt;For those of the terminal freaks, color is a bliss. But have you tried all the colors in the terminal. Today someone forwarded me a bash one liner for the same. Not sure where he got this from, anyway here is the one liner for you all:&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Get your external IP address</title>
      <link>/2009/11/04/get-your-external-ip-address/</link>
      <pubDate>Wed, 04 Nov 2009 14:12:04 +0000</pubDate>
      
      <guid>/2009/11/04/get-your-external-ip-address/</guid>
      <description>&lt;!--[ad#ad-2]--&gt;
&lt;p&gt;&lt;tt&gt;$ echo -e &amp;quot;GET /automation/n09230945.asp HTTP/1.0rnHost: whatismyip.comrn&amp;quot; | nc whatismyip.com 80 | tail -n1&lt;/tt&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&amp;lt;a href=&amp;quot;http://www.commandlinefu.com/commands/view/3962/get-your-external-ip-address&amp;quot;&amp;gt;View this command to comment, vote or add to favourites&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&amp;lt;a href=&amp;quot;http://feeds2.feedburner.com/commands/by/Marko&amp;quot;&amp;gt;View all commands by &lt;/a&gt;&lt;strong&gt;&amp;lt;a href=&amp;quot;http://feeds2.feedburner.com/commands/by/Marko&amp;quot;&amp;gt;Marko&lt;/a&gt;&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&amp;lt;a href=&amp;quot;http://www.commandlinefu.com&amp;quot;&amp;gt;&amp;lt;img src=&amp;quot;http://blog.amit-agarwal.co.in/wp-content/uploads/2010/08/header-logo.jpg&amp;quot; alt=&amp;quot;&amp;quot; align=&amp;quot;bottom&amp;quot; /&amp;gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;by David Winterbottom (&amp;lt;a href=&amp;quot;http://codeinthehole.com&amp;quot;&amp;gt;codeinthehole.com&lt;/a&gt;)&lt;/p&gt;
&lt;p&gt;&amp;lt;a href=&amp;quot;http://feedads.g.doubleclick.net/~a/JcVSM9r0yMSf6O0G2eSK5vyQGsU/0/da&amp;quot;&amp;gt;&amp;lt;img src=&amp;quot;http://blog.amit-agarwal.com/wp-content/uploads/img.zemanta.com/~a/JcVSM9r0yMSf6O0G2eSK5vyQGsU/0/di&amp;quot; alt=&amp;quot;&amp;quot; align=&amp;quot;bottom&amp;quot; /&amp;gt;&lt;/a&gt;&lt;br&gt;
&amp;lt;a href=&amp;quot;http://feedads.g.doubleclick.net/~a/JcVSM9r0yMSf6O0G2eSK5vyQGsU/1/da&amp;quot;&amp;gt;&amp;lt;img src=&amp;quot;http://blog.amit-agarwal.com/wp-content/uploads/img.zemanta.com/~a/JcVSM9r0yMSf6O0G2eSK5vyQGsU/1/di&amp;quot; alt=&amp;quot;&amp;quot; align=&amp;quot;bottom&amp;quot; /&amp;gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;img src=&amp;quot;http://blog.amit-agarwal.com/wp-content/uploads/img.zemanta.com/~r/Command-line-fu/~4/7xln2n56mnk&amp;quot; alt=&amp;quot;&amp;quot; width=&amp;quot;1&amp;quot; height=&amp;quot;1&amp;quot; align=&amp;quot;bottom&amp;quot; /&amp;gt;&lt;/p&gt;
&lt;p&gt;URL: &amp;lt;a href=&amp;quot;http://feedproxy.google.com/~r/Command-line-fu/~3/7xln2n56mnk/get-your-external-ip-address&amp;quot;&amp;gt;http://feedproxy.google.com/~r/Command-line-fu/~3/7xln2n56mnk/get-your-external-ip-address&lt;/a&gt;&amp;lt;h6 class=&amp;quot;zemanta-related-title&amp;quot; style=&amp;quot;font-size: 1em;&amp;quot;&amp;gt;Related articles by Zemanta&lt;/h6&gt; &amp;lt;ul class=&amp;quot;zemanta-article-ul&amp;quot;&amp;gt; &amp;lt;li class=&amp;quot;zemanta-article-ul-li&amp;quot;&amp;gt;&amp;lt;a href=&amp;quot;http://www.computer-realm.net/how-find-computers-ip/&amp;quot;&amp;gt;How to Find Out Your Computer&amp;amp;#8217;s IP&lt;/a&gt; (computer-realm.net)&lt;/li&gt; &lt;/ul&gt; &amp;lt;div class=&amp;quot;zemanta-pixie&amp;quot; style=&amp;quot;margin-top: 10px; height: 15px;&amp;quot;&amp;gt;&amp;lt;a class=&amp;quot;zemanta-pixie-a&amp;quot; title=&amp;quot;Reblog this post [with Zemanta]&amp;quot; href=&amp;quot;http://reblog.zemanta.com/zemified/42c8d78f-7105-47fc-9f21-6df9065a21a3/&amp;quot;&amp;gt;&amp;lt;img class=&amp;quot;zemanta-pixie-img&amp;quot; style=&amp;quot;border: medium none; float: right;&amp;quot; src=&amp;quot;http://blog.amit-agarwal.co.in/wp-content/uploads/2010/08/reblog_e29.png&amp;quot; alt=&amp;quot;Reblog this post [with Zemanta]&amp;quot; /&amp;gt;&lt;/a&gt;&amp;lt;span class=&amp;quot;zem-script more-related pretty-attribution&amp;quot;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Stop long commands wrapping around and over-writing itself in the Bash shell</title>
      <link>/2009/10/12/stop-long-commands-wrapping-around-and-over-writing-itself-in-the-bash-shell/</link>
      <pubDate>Mon, 12 Oct 2009 14:44:32 +0000</pubDate>
      
      <guid>/2009/10/12/stop-long-commands-wrapping-around-and-over-writing-itself-in-the-bash-shell/</guid>
      <description>&lt;!--[ad#ad-2]--&gt;
&lt;p&gt;Stop long commands wrapping around and over-writing itself in the Bash shell&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;shopt -s checkwinsize&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;add the command either in /etc/profile or ~/.bash_profile so that this is available to your shell.&lt;/p&gt;
&lt;p&gt;* View this command to comment, vote or add to favourites * View all commands by settermjd&lt;/p&gt;
&lt;p&gt;commandlinefu.com&lt;/p&gt;
&lt;p&gt;by David Winterbottom (codeinthehole.com)&lt;/p&gt;
&lt;p&gt;URL: &amp;lt;a href=&amp;quot;http://feedproxy.google.com/~r/Command-line-fu/~3/_0MaJbX9Jvo/stop-long-commands-wrapping-around-and-over-writing-itself-in-the-bash-shell&amp;quot;&amp;gt;http://feedproxy.google.com/~r/Command-line-fu/~3/_0MaJbX9Jvo/stop-long-commands-wrapping-around-and-over-writing-itself-in-the-bash-shell&lt;/a&gt;&amp;lt;h6 class=&amp;quot;zemanta-related-title&amp;quot; style=&amp;quot;font-size: 1em;&amp;quot;&amp;gt;Related articles by Zemanta&lt;/h6&gt; &amp;lt;ul class=&amp;quot;zemanta-article-ul&amp;quot;&amp;gt; &amp;lt;li class=&amp;quot;zemanta-article-ul-li&amp;quot;&amp;gt;&amp;lt;a href=&amp;quot;http://www.slumpedoverkeyboarddead.com/2009/08/22/reading-multiple-files-with-bash/&amp;quot;&amp;gt;Reading Multiple Files with Bash&lt;/a&gt; (slumpedoverkeyboarddead.com)&lt;/li&gt; &lt;/ul&gt; &amp;lt;div class=&amp;quot;zemanta-pixie&amp;quot; style=&amp;quot;margin-top: 10px; height: 15px;&amp;quot;&amp;gt;&amp;lt;a class=&amp;quot;zemanta-pixie-a&amp;quot; title=&amp;quot;Reblog this post [with Zemanta]&amp;quot; href=&amp;quot;http://reblog.zemanta.com/zemified/75f993fa-150b-4fdb-9cf5-d69437b87521/&amp;quot;&amp;gt;&amp;lt;img class=&amp;quot;zemanta-pixie-img&amp;quot; style=&amp;quot;border: medium none; float: right;&amp;quot; src=&amp;quot;http://blog.amit-agarwal.co.in/wp-content/uploads/2010/08/reblog_e13.png&amp;quot; alt=&amp;quot;Reblog this post [with Zemanta]&amp;quot; /&amp;gt;&lt;/a&gt;&amp;lt;span class=&amp;quot;zem-script more-related pretty-attribution&amp;quot;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Script to generate a html file with link to all files in directory</title>
      <link>/2009/09/26/script-to-generate-a-html-file-with-link-to-all-files-in-directory/</link>
      <pubDate>Sat, 26 Sep 2009 03:19:10 +0000</pubDate>
      
      <guid>/2009/09/26/script-to-generate-a-html-file-with-link-to-all-files-in-directory/</guid>
      <description>&lt;p&gt;&lt;strong&gt;ls -1 |awk -F&amp;amp;#8221;.&amp;amp;#8221; &#39;{print  &amp;amp;#8221;&lt;p&gt;&lt;a href=\&amp;#8221;\&amp;#8221;,$_,\&amp;#8221;\&amp;#8221;&gt; &amp;amp;#8221;,$2,&amp;amp;#8221;.&amp;amp;#8221;,$3,&amp;amp;#8221; &lt;/a&gt;&lt;/p&gt;&amp;amp;#8221; ;}&amp;amp;#8217; &amp;gt; index1.html&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;And if you want to do it recursively&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;ls -1R |awk -F&amp;amp;#8221;.&amp;amp;#8221; &#39;{print  &amp;amp;#8221;&lt;p&gt;&lt;a href=\&amp;#8221;\&amp;#8221;,$_,\&amp;#8221;\&amp;#8221;&gt; &amp;amp;#8221;,$2,&amp;amp;#8221;.&amp;amp;#8221;,$3,&amp;amp;#8221; &lt;/a&gt;&lt;/p&gt;&amp;amp;#8221; ;}&amp;amp;#8217; &amp;gt; index1.html&lt;/strong&gt;&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Database of vulnurability at milw0rm.com – udpate and makeindex with cron.</title>
      <link>/2009/09/08/database-of-vulnurability-at-milw0rm-com-udpate-and-makeindex-with-cron/</link>
      <pubDate>Tue, 08 Sep 2009 16:06:53 +0000</pubDate>
      
      <guid>/2009/09/08/database-of-vulnurability-at-milw0rm-com-udpate-and-makeindex-with-cron/</guid>
      <description>&lt;!--[ad#ad-2]--&gt;
&lt;p&gt;I am quite regular visitor of milw0rm and generally try to keep up with the vul&amp;amp;#8217;s. For doing this I wrote a small scripts rather set of scripts to keep myself update.  Here&amp;amp;#8217;s what we are going to do:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Get the latest tar from the site.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Extract it.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Make the index&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Have a shortcut to search the index.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Download the attached files for the first 2 points. &amp;lt;a href=&amp;quot;http://blog.amit-agarwal.co.in/wp-content/uploads/2009/09/makeindex-milw0rm.sh&amp;quot;&amp;gt;makeindex-milw0rm&lt;/a&gt; and &amp;lt;a href=&amp;quot;http://blog.amit-agarwal.co.in/wp-content/uploads/2009/09/udpate-milw0rm.sh&amp;quot;&amp;gt;udpate-milw0rm&lt;/a&gt;&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>bash tutorial for begineer and experienced.</title>
      <link>/2009/07/20/bash-tutorial-for-begineer-and-experienced/</link>
      <pubDate>Mon, 20 Jul 2009 15:42:22 +0000</pubDate>
      
      <guid>/2009/07/20/bash-tutorial-for-begineer-and-experienced/</guid>
      <description>&lt;!--[ad#ad-2]--&gt;
&lt;p&gt;I having been looking for something like this for sometime. Found &amp;lt;a href=&amp;quot;http://beginlinux.com/desktop_training/comm/shells/232-bash&amp;quot; target=&amp;quot;_blank&amp;quot;&amp;gt;this&lt;/a&gt; while searching.&lt;/p&gt;
&lt;p&gt;A very good thing about this tutorial is its comprehensiveness and the details. A lot of examples are gives which too are quite useful.&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Get you ip address like whatismyip.com</title>
      <link>/2008/12/01/get-you-ip-address-like-whatismyipcom/</link>
      <pubDate>Sun, 30 Nov 2008 18:41:54 +0000</pubDate>
      
      <guid>/2008/12/01/get-you-ip-address-like-whatismyipcom/</guid>
      <description>&lt;p&gt;For last couple of days, I was thinking of putting this. I was thinking of some way to get the IP address of the client directly rather than going through some site or parsing the content. So &amp;lt;a href=&amp;quot;http://amit-agarwal.co.in/mystuff/getip.php&amp;quot; target=&amp;quot;_blank&amp;quot;&amp;gt;here&lt;/a&gt; it is.&lt;/p&gt;
&lt;p&gt;Now the trick here is simple. There are two ways to get the IP address of the client in the php script and thus a simple script like the below would capture both of them.&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>parse and paste text</title>
      <link>/2020/06/08/parse-paste-text/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/2020/06/08/parse-paste-text/</guid>
      <description>&lt;p&gt;Lot of times, I copy the text but before pasting want to remove a word or make some other changes or add “wget” to the URL, quite common. So, I came up with this alias&lt;/p&gt;
&lt;pre class=&#34;brush:shell&#34;&gt;replace=&#39;echo $(xclip -i)|sed &#39;s/text//&#39;|xclip -o&#39;&lt;/pre&gt;
&lt;p&gt;and this depends on xlip, which you can install with&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;pre class=&#34;brush:shell&#34;&gt;dnf install xclip&lt;/pre&gt;</description>
    </item>
    
  </channel>
</rss>
