Execute a command with a timeout

2010-12-29 1 min read bash Learning
<dd class="wp-caption-dd zemanta-img-attribution" style="font-size: 0.8em;"> Image via <a href="http://commons.wikipedia.org/wiki/File:Ubuntu_logo.svg">Wikipedia</a> </dd> </dl> Execute a command with a timeout 1 <td> <div class="text codecolorer"> &nbsp;timelimit -t100 somecommand </div> </td> </tr> I found this in Ubuntu repos, and consider it better than timeout. * View this command to comment, vote or add to favourites * View all commands by CodSpirit commandlinefu.com by David Winterbottom (codeinthehole.com) URL: http://feedproxy.google.com/~r/Command-line-fu/~3/h72xZsssE4o/execute-a-command-with-a-timeout

\[Solution\] Solaris issue with wget not resolving Domain name (DNS name lookup failure)

2010-08-09 2 min read Solaris
Today I was working with <a class="zem_slink" title="Solaris (operating system)" rel="homepage" href="http://oracle.com/solaris">Solaris and after I had set up the <a class="zem_slink" title="NIS+" rel="wikipedia" href="http://en.wikipedia.org/wiki/NIS%2B">NIS+, <a class="zem_slink" title="Name server" rel="wikipedia" href="http://en.wikipedia.org/wiki/Name_server">DNS server, IP Address and completing the basic setting. I was using the pkg-get util from the freesunware.com The utility was using wget and it was failing constantly. From the looks of it, it was very clear that the wget utility was unable to find the <a class="zem_slink" title="IP address" rel="wikipedia" href="http://en. Continue reading

vim – get the list of all the scripts available.

2010-05-27 1 min read Learning Linux Vim Tips
To get a list of all the scripts in the vim.sf.net project, you can run the following command. This will list all the scripts with the script id. wget -O – &#8217;http://www.vim.org/scripts/script_search_results.php?&show_me=4000&result_ptr=0&#8217; -o /dev/null | <a class="zem_slink freebase/en/grep" title="Grep" rel="wikipedia" href="http://en.wikipedia.org/wiki/Grep">grep width| grep script_id= |<a class="zem_slink freebase/en/sed" title="Sed" rel="wikipedia" href="http://en.wikipedia.org/wiki/Sed">sed &#8217;s/.*script_id=//&#8217;|tr -d &#8221;&#8221;&#8221;|tr &#8221;>&#8221; &#8221; &#8221;|sed &#8217;s/< .*//&#8217; | tr -d &#8217;\001&#8217;-&#8217;\011&#8217;&#8217;\013&#8217;&#8217;\014&#8217;&#8217;\016&#8217;-&#8217;\037&#8217;&#8217;\200&#8217;-&#8217;\377&#8217; |sort -n<h6 class="zemanta-related-title">Related articles by Zemanta <ul class="zemanta-article-ul"> <li class="zemanta-article-ul-li"><a href="http://www. Continue reading

Mirror or download a website with a tool much better than wget

2010-05-19 1 min read bash Fedora Linux
If you want to mirror a <a class="zem_slink freebase/en/website" title="Website" rel="wikipedia" href="http://en.wikipedia.org/wiki/Website">website, the simplest tool I know if is <a class="zem_slink freebase/en/wget" title="Wget" rel="homepage" href="http://www.gnu.org/software/wget/">wget. 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 <a class="zem_slink freebase/en/web_server" title="Web server" rel="wikipedia" href="http://en.wikipedia.org/wiki/Web_server">webserver. lftp -e &#8221;mirror -c&#8221; This will mirror the website for you and will not leave with all those un-necessary files. Continue reading

Download with browse with bash and wget

2010-05-09 1 min read bash Fedora
Been pretty busy for last couple of days. Will be busy for another few days, but here&#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): file=&#8221;/tmp/temp.dir&#8221; url=&#8221;URL Here&#8221; IFS=&#8217; &#8217; cont=&#8221;y&#8221; while [ $cont != &#8221;n&#8221; ] do name=&#8221;&#8221; wget &#8221;$url&#8221; -O $file -o /dev/null Continue reading