<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Debugging on Noetic Nought</title>
    <link>https://punchagan.muse-amuse.in/tags/debugging/</link>
    <description>Recent content in Debugging on Noetic Nought</description>
    <generator>Hugo</generator>
    <language>en-US</language>
    <copyright>© 2006-2026 CC-BY-SA-4.0</copyright>
    <lastBuildDate>Thu, 12 Apr 2018 11:09:00 +0530</lastBuildDate>
    <atom:link href="https://punchagan.muse-amuse.in/tags/debugging/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Weird ISP Issue</title>
      <link>https://punchagan.muse-amuse.in/blog/weird-isp-issue/</link>
      <pubDate>Thu, 12 Apr 2018 11:09:00 +0530</pubDate>
      <guid>https://punchagan.muse-amuse.in/blog/weird-isp-issue/</guid>
      <description>&lt;p&gt;I was trying to lookup the documentation for &lt;a href=&#34;http://click.pocoo.org/5/&#34;&gt;Click&lt;/a&gt; and I got redirected to a&#xA;page showing Werkzeug&amp;rsquo;s documentation. I&amp;rsquo;d assumed it was a broken configuration&#xA;on the server, because other subdomains like &lt;a href=&#34;http://lucumr.pocoo.org&#34;&gt;Armin&amp;rsquo;s blog&lt;/a&gt; also sent me to the&#xA;same page. I &lt;a href=&#34;https://twitter.com/punchagan/status/983885853343727616&#34;&gt;got in touch with Armin&lt;/a&gt; and he asked me if I was using &lt;a href=&#34;https://www.eff.org/https-everywhere&#34;&gt;https&#xA;everywhere&lt;/a&gt;, and that wasn&amp;rsquo;t supported by the server. But, I wasn&amp;rsquo;t. The next&#xA;thing to try was to switch my ISP and check, and viola it worked!&lt;/p&gt;&#xA;&lt;p&gt;I did some debugging and figured out that in some responses the HTTP status line&#xA;was not being sent, and the first line in the response contained &lt;code&gt;Date&lt;/code&gt;. Also,&#xA;the response seems to be correct, when I hit a hard refresh on the browser,&#xA;which sets the &lt;code&gt;Cache-Control&lt;/code&gt; header to &lt;code&gt;no-cache&lt;/code&gt;. So, it looks like some&#xA;cache in between me and the server is going nuts with this specific request.&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;$ nc click.pocoo.org &lt;span class=&#34;m&#34;&gt;80&lt;/span&gt; &amp;lt; input.txt&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;Date: Thu, &lt;span class=&#34;m&#34;&gt;12&lt;/span&gt; Apr &lt;span class=&#34;m&#34;&gt;2018&lt;/span&gt; 05:17:14 GMT&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;Last-Modified: Mon, &lt;span class=&#34;m&#34;&gt;07&lt;/span&gt; Apr &lt;span class=&#34;m&#34;&gt;2014&lt;/span&gt; 18:35:36 GMT&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;Connection: Keep-Alive&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;And the &lt;code&gt;input.txt&lt;/code&gt; file looks like this.&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;HEAD / HTTP/1.1&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;Host: click.pocoo.org&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;User-Agent: Mozilla/6.0 (X11; Ubuntu; Linux x86_64; rv:61.0) Gecko/20100101 Firefox/59.0&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;Accept: */*&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;Accept-Encoding: deflate, gzip&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Adding the line &lt;code&gt;Cache-Control: no-cache&lt;/code&gt; to this input causes the problem to go&#xA;away.&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;$ nc click.pocoo.org &lt;span class=&#34;m&#34;&gt;80&lt;/span&gt; &amp;lt; input.txt&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;HTTP/1.1 &lt;span class=&#34;m&#34;&gt;301&lt;/span&gt; Moved Permanently&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;Server: nginx&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;Date: Thu, &lt;span class=&#34;m&#34;&gt;12&lt;/span&gt; Apr &lt;span class=&#34;m&#34;&gt;2018&lt;/span&gt; 05:30:56 GMT&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;Content-Type: text/html&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;Content-Length: &lt;span class=&#34;m&#34;&gt;178&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;Connection: keep-alive&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;Location: http://sphinx-doc.org/&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Also, I&amp;rsquo;m able to reproduce this with all the subdomains on &lt;code&gt;pocoo.org&lt;/code&gt; -&#xA;&lt;code&gt;click&lt;/code&gt;, &lt;code&gt;sphinx&lt;/code&gt;, &lt;code&gt;lucumr&lt;/code&gt;, &amp;hellip; I&amp;rsquo;m not sure if it has something to do with the&#xA;server, or if it is entirely independent of that. But, the problem does go away&#xA;when I switch to a different network.&lt;/p&gt;&#xA;&lt;p&gt;I&amp;rsquo;m not sure what I can do next to narrow down the problem, even more. Any&#xA;hints/tips appreciated.&lt;/p&gt;&#xA;</description>
    </item>
    <item>
      <title>WiFi Channels &amp; my router&#39;s random invisibility</title>
      <link>https://punchagan.muse-amuse.in/blog/wifi-channels-my-routers-random-invisibility/</link>
      <pubDate>Wed, 22 Apr 2015 11:48:50 +0530</pubDate>
      <guid>https://punchagan.muse-amuse.in/blog/wifi-channels-my-routers-random-invisibility/</guid>
      <description>&lt;p&gt;To update some data plan changes, I had to restart my router today.  I did so&#xA;from the (web) admin interface, from my dad&amp;rsquo;s laptop. Guess what!  The router&#xA;goes invisible (to the laptop), after the restart!  Other devices were still&#xA;happily connected.&lt;/p&gt;&#xA;&lt;p&gt;There were a few occasions in the past when this laptop had failed to find our&#xA;home router.  The solution that worked for my dad before was to restart the&#xA;router; once, or may be a couple of times.  But, this time it didn&amp;rsquo;t work.&lt;/p&gt;&#xA;&lt;p&gt;I had a feeling this was something to do with &amp;ldquo;Channels&amp;rdquo;, but I had no idea&#xA;what was going on.&lt;/p&gt;&#xA;&lt;p&gt;I logged onto the router and started looking at the Wireless settings in the&#xA;hope of finding some clue, and there it was! &lt;code&gt;Wireless Channel: Auto Scan&lt;/code&gt;&lt;/p&gt;&#xA;&lt;figure&gt;&lt;img src=&#34;../../images/auto-scan.jpg&#34;&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&lt;p&gt;It was anybody&amp;rsquo;s guess that some channels that the router uses weren&amp;rsquo;t&#xA;supported by my dad&amp;rsquo;s laptop.  The restarts &lt;strong&gt;sometimes&lt;/strong&gt; helped because the&#xA;router would scan for channels that it thinks would work well, and end-up using&#xA;something that the laptop&amp;rsquo;s wifi card supported.&lt;/p&gt;&#xA;&lt;p&gt;The router only had options of channels from 1 to 13.  To see what channels a&#xA;wifi card supports, you can run the &lt;code&gt;iwlist freq&lt;/code&gt; command.&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#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;iwlist freq&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class=&#34;highlight&#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;eth1      &lt;span class=&#34;m&#34;&gt;26&lt;/span&gt; channels in total&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; available frequencies :&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;          Channel &lt;span class=&#34;m&#34;&gt;01&lt;/span&gt; : 2.412 GHz&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;          Channel &lt;span class=&#34;m&#34;&gt;02&lt;/span&gt; : 2.417 GHz&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;          Channel &lt;span class=&#34;m&#34;&gt;03&lt;/span&gt; : 2.422 GHz&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;          Channel &lt;span class=&#34;m&#34;&gt;04&lt;/span&gt; : 2.427 GHz&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;          Channel &lt;span class=&#34;m&#34;&gt;05&lt;/span&gt; : 2.432 GHz&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;          Channel &lt;span class=&#34;m&#34;&gt;06&lt;/span&gt; : 2.437 GHz&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;          Channel &lt;span class=&#34;m&#34;&gt;07&lt;/span&gt; : 2.442 GHz&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;          Channel &lt;span class=&#34;m&#34;&gt;08&lt;/span&gt; : 2.447 GHz&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;          Channel &lt;span class=&#34;m&#34;&gt;09&lt;/span&gt; : 2.452 GHz&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;          Channel &lt;span class=&#34;m&#34;&gt;10&lt;/span&gt; : 2.457 GHz&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;          Channel &lt;span class=&#34;m&#34;&gt;11&lt;/span&gt; : 2.462 GHz&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;          Channel &lt;span class=&#34;m&#34;&gt;12&lt;/span&gt; : 2.467 GHz&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;          Channel &lt;span class=&#34;m&#34;&gt;13&lt;/span&gt; : 2.472 GHz&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;          Channel &lt;span class=&#34;m&#34;&gt;14&lt;/span&gt; : 2.484 GHz&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;          Channel &lt;span class=&#34;m&#34;&gt;36&lt;/span&gt; : 5.18 GHz&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;          Channel &lt;span class=&#34;m&#34;&gt;38&lt;/span&gt; : 5.19 GHz&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;          Channel &lt;span class=&#34;m&#34;&gt;40&lt;/span&gt; : 5.2 GHz&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;          Channel &lt;span class=&#34;m&#34;&gt;42&lt;/span&gt; : 5.21 GHz&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;          Channel &lt;span class=&#34;m&#34;&gt;44&lt;/span&gt; : 5.22 GHz&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;          Channel &lt;span class=&#34;m&#34;&gt;46&lt;/span&gt; : 5.23 GHz&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;          Channel &lt;span class=&#34;m&#34;&gt;48&lt;/span&gt; : 5.24 GHz&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;          Channel &lt;span class=&#34;m&#34;&gt;149&lt;/span&gt; : 5.745 GHz&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;          Channel &lt;span class=&#34;m&#34;&gt;153&lt;/span&gt; : 5.765 GHz&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;          Channel &lt;span class=&#34;m&#34;&gt;157&lt;/span&gt; : 5.785 GHz&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;          Channel &lt;span class=&#34;m&#34;&gt;161&lt;/span&gt; : 5.805 GHz&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;          Channel &lt;span class=&#34;m&#34;&gt;165&lt;/span&gt; : 5.825 GHz&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;So, the laptop&amp;rsquo;s wifi card support all the channels that the router could use.&#xA;&lt;code&gt;iwlist freq&lt;/code&gt; also gives the current Channel if the device is already connected&#xA;to a router.  I ran this on my laptop and found that the router was using&#xA;&lt;code&gt;Channel 13&lt;/code&gt;.  Why the hell wouldn&amp;rsquo;t this work?!  I don&amp;rsquo;t know!&lt;/p&gt;&#xA;&lt;p&gt;I decided to set a channel manually, but how do I pick a channel?  The idea of&#xA;&amp;ldquo;Auto Scan&amp;rdquo; is to find a channel that has relatively low interference.  How do&#xA;we do this manually?  &lt;code&gt;sudo iwlist scan&lt;/code&gt; scans for all the WiFi access points&#xA;nearby and gives detailed information about them, which includes the Channel.&lt;/p&gt;&#xA;&lt;p&gt;It looked like most of the routers nearby used channels 1 and 6, with a few 3s&#xA;and 4s.  Assuming, most of the other routers aren&amp;rsquo;t doing this &amp;ldquo;Auto Scan&amp;rdquo;&#xA;business, I set my router to always use Channel 9, and the laptop seems to be&#xA;happily connected, now!&lt;/p&gt;&#xA;</description>
    </item>
  </channel>
</rss>
