{"id":118,"date":"2010-07-23T02:58:23","date_gmt":"2010-07-23T02:58:23","guid":{"rendered":"http:\/\/fatsquirrel.org\/bologs\/vng\/fixtehinternets\/"},"modified":"2010-07-23T02:58:23","modified_gmt":"2010-07-23T02:58:23","slug":"fixtehinternets","status":"publish","type":"post","link":"https:\/\/fatsquirrel.org\/oldfartsalmanac\/fixtehinternets\/","title":{"rendered":"fixtehinternets"},"content":{"rendered":"<p>My wife&#8217;s laptop runs Debian, and it&#8217;s pretty stable. But there is one issue that is proving to be a real pain: the wireless adapter &#8211; an Intel job &#8211; occasionally detatches itself from the AP for no apparent reason. Obviously this is not a good scenario and something I had to address; I hate getting support calls from home.<br \/>\nMy &#8220;solution&#8221; was to write a little script for her that fixes the problem by taking the interface down and bringing it up again. Now all she has to do is type &#8220;fixtehinternets&#8221; and it&#8217;ll come back up.<br \/>\nEarlier today I was telling my work colleagues about this little hack, and their reaction was totally unexpected; they wanted a copy for their wives! Mr K even suggested I publish the script for the benefit of the google. So, with the caveat that it&#8217;s a piece of crap, here is the valuable code:<\/p>\n<pre>\n#!\/bin\/sh\necho \"O HAI! I CAN HAS UR PASSWORDZ ?\"\necho \"AHM IN UR WIREZ, FIXING UR INTERNETS\"\nsudo ifconfig wlan0 down\nsudo ifconfig wlan0 up\nsudo iwconfig wlan0 essid \"myssid\"\nsleep 2\nsudo route add default gw 192.168.x.x\nping 158.x.x.x -c 1 >\/dev\/null 2>&amp;1\n[ $? -eq 0 ] &amp;&amp; echo \"YAY U HAVE ALL TEH INTERNETS!!!\" || echo \"O NOES! IT ARE BROKE STILL\"\necho KTHXBYE\n<\/pre>\n<p>Now, you&#8217;ll either not understand a word of that, or you&#8217;ll recognise it as the quality piece of genius that it is.<br \/>\nUse it wisely, and not for evil.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>My wife&#8217;s laptop runs Debian, and it&#8217;s pretty stable. But there is one issue that is proving to be a real pain: the wireless adapter &#8211; an Intel job &#8211; occasionally detatches itself from the AP for no apparent reason. Obviously this is not a good scenario and something I had to address; I hate [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-118","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/fatsquirrel.org\/oldfartsalmanac\/wp-json\/wp\/v2\/posts\/118","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fatsquirrel.org\/oldfartsalmanac\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fatsquirrel.org\/oldfartsalmanac\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fatsquirrel.org\/oldfartsalmanac\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fatsquirrel.org\/oldfartsalmanac\/wp-json\/wp\/v2\/comments?post=118"}],"version-history":[{"count":0,"href":"https:\/\/fatsquirrel.org\/oldfartsalmanac\/wp-json\/wp\/v2\/posts\/118\/revisions"}],"wp:attachment":[{"href":"https:\/\/fatsquirrel.org\/oldfartsalmanac\/wp-json\/wp\/v2\/media?parent=118"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fatsquirrel.org\/oldfartsalmanac\/wp-json\/wp\/v2\/categories?post=118"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fatsquirrel.org\/oldfartsalmanac\/wp-json\/wp\/v2\/tags?post=118"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}