<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Wget on Amit Agarwal Linux Blog</title>
    <link>/tags/wget/</link>
    <description>Recent content in Wget on Amit Agarwal Linux Blog</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en</language>
    <lastBuildDate>Wed, 29 Dec 2010 15:03:18 +0000</lastBuildDate>
    
	<atom:link href="/tags/wget/index.xml" rel="self" type="application/rss+xml" />
    
    
    <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>\[Solution\] Solaris issue with wget not resolving Domain name (DNS name lookup failure)</title>
      <link>/2010/08/09/solution-solaris-issue-wget-resolving-domain-dns-lookup-failure/</link>
      <pubDate>Mon, 09 Aug 2010 16:02:51 +0000</pubDate>
      
      <guid>/2010/08/09/solution-solaris-issue-wget-resolving-domain-dns-lookup-failure/</guid>
      <description>&lt;!--[ad#ad-2]--&gt;
&lt;p&gt;Today I was working with &amp;lt;a class=&amp;quot;zem_slink&amp;quot; title=&amp;quot;Solaris (operating system)&amp;quot; rel=&amp;quot;homepage&amp;quot; href=&amp;quot;http://oracle.com/solaris&amp;quot;&amp;gt;Solaris&lt;/a&gt; and after I had set up the &amp;lt;a class=&amp;quot;zem_slink&amp;quot; title=&amp;quot;NIS+&amp;quot; rel=&amp;quot;wikipedia&amp;quot; href=&amp;quot;http://en.wikipedia.org/wiki/NIS%2B&amp;quot;&amp;gt;NIS+&lt;/a&gt;, &amp;lt;a class=&amp;quot;zem_slink&amp;quot; title=&amp;quot;Name server&amp;quot; rel=&amp;quot;wikipedia&amp;quot; href=&amp;quot;http://en.wikipedia.org/wiki/Name_server&amp;quot;&amp;gt;DNS server&lt;/a&gt;, IP Address and completing the basic setting. I was using the pkg-get util from the freesunware.com&lt;/p&gt;
&lt;p&gt;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 &amp;lt;a class=&amp;quot;zem_slink&amp;quot; title=&amp;quot;IP address&amp;quot; rel=&amp;quot;wikipedia&amp;quot; href=&amp;quot;http://en.wikipedia.org/wiki/IP_address&amp;quot;&amp;gt;IP address&lt;/a&gt; from the name. &amp;lt;a class=&amp;quot;zem_slink&amp;quot; title=&amp;quot;Name resolution&amp;quot; rel=&amp;quot;wikipedia&amp;quot; href=&amp;quot;http://en.wikipedia.org/wiki/Name_resolution&amp;quot;&amp;gt;Name resolution&lt;/a&gt; was not happening, while dig and &amp;lt;a class=&amp;quot;zem_slink&amp;quot; title=&amp;quot;Nslookup&amp;quot; rel=&amp;quot;wikipedia&amp;quot; href=&amp;quot;http://en.wikipedia.org/wiki/Nslookup&amp;quot;&amp;gt;nslookup&lt;/a&gt; was able to do the DNS lookup.&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>vim – get the list of all the scripts available.</title>
      <link>/2010/05/28/vim-get-the-list-of-all-the-scripts-available/</link>
      <pubDate>Thu, 27 May 2010 20:26:35 +0000</pubDate>
      
      <guid>/2010/05/28/vim-get-the-list-of-all-the-scripts-available/</guid>
      <description>&lt;!--[ad#ad-2]--&gt;
&lt;p&gt;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.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;wget -O – &amp;amp;#8217;http://www.vim.org/scripts/script_search_results.php?&amp;amp;show_me=4000&amp;amp;result_ptr=0&amp;amp;#8217; -o /dev/null | &amp;lt;a class=&amp;quot;zem_slink freebase/en/grep&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; width| grep script_id= |&amp;lt;a class=&amp;quot;zem_slink freebase/en/sed&amp;quot; title=&amp;quot;Sed&amp;quot; rel=&amp;quot;wikipedia&amp;quot; href=&amp;quot;http://en.wikipedia.org/wiki/Sed&amp;quot;&amp;gt;sed&lt;/a&gt; &amp;amp;#8217;s/.*script_id=//&amp;amp;#8217;|tr -d &amp;amp;#8221;&amp;amp;#8221;&amp;amp;#8221;|tr &amp;amp;#8221;&amp;gt;&amp;amp;#8221; &amp;amp;#8221; &amp;amp;#8221;|sed &amp;amp;#8217;s/&amp;lt; .*//&amp;amp;#8217; | tr -d &amp;amp;#8217;\001&amp;amp;#8217;-&amp;amp;#8217;\011&amp;amp;#8217;&amp;amp;#8217;\013&amp;amp;#8217;&amp;amp;#8217;\014&amp;amp;#8217;&amp;amp;#8217;\016&amp;amp;#8217;-&amp;amp;#8217;\037&amp;amp;#8217;&amp;amp;#8217;\200&amp;amp;#8217;-&amp;amp;#8217;\377&amp;amp;#8217; |sort -n&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.slumpedoverkeyboarddead.com/2009/09/17/use-curl-to-monitor-your-vonage-phone-bill/&amp;quot;&amp;gt;Use curl to Monitor Your Vonage Phone Bill&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://securewebs.com/yum-updates/&amp;quot;&amp;gt;Yum Updates&lt;/a&gt; (securewebs.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.gubatron.com/blog/2009/10/10/ubuntudebian-quick-reference-how-to-change-your-servers-utc-timezone-on-the-command-line/&amp;quot;&amp;gt;Ubuntu/Debian Quick Reference: How To Change Your Server&amp;amp;#8217;s UTC Timezone on the command line&lt;/a&gt; (gubatron.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://blog.amit-agarwal.co.in/2009/11/22/short-information-about-loaded-kernel-modules/&amp;quot;&amp;gt;Short Information about loaded kernel modules&lt;/a&gt; (amit-agarwal.co.in)&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/b22b2e85-8107-4f9b-9130-85a8e8ae370b/&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_b52.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>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>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>
    
  </channel>
</rss>
