<?xml version="1.0" encoding="UTF-8"?> <rss
version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
><channel><title>[protofusion] &#187; networking</title> <atom:link href="http://protofusion.org/wordpress/tag/networking/feed/" rel="self" type="application/rss+xml" /><link>http://protofusion.org/wordpress</link> <description>Generally Interesting</description> <lastBuildDate>Thu, 09 Feb 2012 19:23:09 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.1</generator> <item><title>Downloading wget Without wget: Use bash</title><link>http://protofusion.org/wordpress/2011/01/downloading-wget-with-bash/</link> <comments>http://protofusion.org/wordpress/2011/01/downloading-wget-with-bash/#comments</comments> <pubDate>Fri, 14 Jan 2011 07:16:59 +0000</pubDate> <dc:creator>Nathan Phillip Brink</dc:creator> <category><![CDATA[Linux]]></category> <category><![CDATA[Quick Tips]]></category> <category><![CDATA[Technology]]></category> <category><![CDATA[bash]]></category> <category><![CDATA[download]]></category> <category><![CDATA[from irc]]></category> <category><![CDATA[networking]]></category> <category><![CDATA[shell]]></category> <category><![CDATA[wget]]></category><guid
isPermaLink="false">http://protofusion.org/wordpress/?p=816</guid> <description><![CDATA[There are many ways to download and install wget without having wget itself installed. For example, one can use curl, ]]></description> <content:encoded><![CDATA[<p> There are many ways to download and install <a
href="http://www.gnu.org/software/wget/">wget</a> without having wget itself installed. For example, one can use <a
href="http://curl.haxx.se/">curl</a>, a sort of competitor to wget, or a package manager with <span
title="what is this lib's homepage?">libfetch or some other library-level downloader integrated (such as <a
href="http://archlinux.org/pacman/">pacman</a>). One may be able to use SSH&#8217;s scp or sftp utility or even use netcat to transfer a wget tarball over a network. But these methods of obtaining wget are not always feasible or even possible whereas a <a
href="http://gnu.org/software/bash/">bash</a> shell and a few core utilities are often readily available.<br
/> </span></p><p><span
id="more-816"></span></p><p> I was introduced to the bash builtin <tt>/dev/tcp</tt> by <a
href="http://forums.unrealircd.com/viewtopic.php?f=9&amp;t=6498#p32272" title="formerly known as aegis">warg</a> the other day on <a
href="irc://irc.x-tab.org/chat">x-tab#chat</a>. He explained a basic use of this device by demonstrating how to download wget&#8217;s compressed tarball. The download process itself can be done with pure bash, but some post-processing of the downloaded file must be done to remove HTTP headers. I document warg&#8217;s application of <tt>/dev/tcp</tt> here because I found the idea fascinating and want this documentation for myself <img
src='http://pf-wordpress.s3.amazonaws.com/wordpress/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> .</p><h2>Connecting and Downloading</h2><p> To read about the <tt>/dev/tcp</tt> builtin for yourself, check out the following:</p><p><code>$ info '<a
href="http://gnu.org/software/bash/manual/bash.html#Redirections">(bash) Redirections</a>'</code></p><p> With the <tt>exec</tt> line we initiate the connection, allocating a file descriptor and storing the numeic file descriptor into the HTTP_FD variable. Then, with the <tt>echo</tt> line, we send an HTTP request through the descriptor to the server. After sending the request, we process the server&#8217;s response with the <tt>sed</tt> line which skips over the HTTP headers sent by the server and stows the results into <tt>wget-latest.tar.gz</tt>. Note that this last command will sit around for a while. It is with this command that the builk of the data transfer is performed. And, since you&#8217;re using shell redirections to download the file, you cannot see the download progress. Instead, wait for the command to complete. This also involves waiting for the server to time out your connection since it supports pipelining. After this process is completed, the wget-latest.tar.gz file is as your disposal.</p><p><code><pre>
$ WGET_HOSTNAME='ftp.gnu.org'
$ exec {HTTP_FD}&lt;&gt;/dev/tcp/${WGET_HOSTNAME}/80
$ echo -ne 'GET /gnu/wget/wget-latest.tar.gz HTTP/1.1\r\nHost: '\
    ${WGET_HOSTNAME}'\r\nUser-Agent: '\
    'bash/'${BASH_VERSION}'\r\n\r\n'  &gt;&amp;${HTTP_FD}
$ sed -e '1,/^.$/d' &lt;&amp;${HTTP_FD} &gt;wget-latest.tar.gz
</pre><p></code></p><p> Now you have a wget source tarball on your machine. As long as you have tar and a compiler on the machine, you are well on your way to downloading stuff using a self-compiled wget. In the commands above, you may replace &#8220;gz&#8221; with &#8220;bz2&#8243; or &#8220;lzma&#8221; for smaller downloads if the machine you&#8217;re using has bzip2 or xz-utils installed. And, of course, it should not be too hard to repurpose the above code to download a particular version of wget or even a completely unrelated software package.</p><p> Please feel free to point out problems with this approach or give pointers on porting this to other environments <img
src='http://pf-wordpress.s3.amazonaws.com/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> .</p> ]]></content:encoded> <wfw:commentRss>http://protofusion.org/wordpress/2011/01/downloading-wget-with-bash/feed/</wfw:commentRss> <slash:comments>5</slash:comments> </item> <item><title>Insurgency: Access your linux box from anywhere</title><link>http://protofusion.org/wordpress/2009/12/insurgency-access-your-linux-box-from-anywhere/</link> <comments>http://protofusion.org/wordpress/2009/12/insurgency-access-your-linux-box-from-anywhere/#comments</comments> <pubDate>Sun, 13 Dec 2009 07:33:15 +0000</pubDate> <dc:creator>Ethan Zonca</dc:creator> <category><![CDATA[Linux]]></category> <category><![CDATA[Quick Tips]]></category> <category><![CDATA[insurgent]]></category> <category><![CDATA[networking]]></category> <category><![CDATA[port-forwarding]]></category> <category><![CDATA[ssh]]></category><guid
isPermaLink="false">http://protofusion.org/wordpress/?p=184</guid> <description><![CDATA[The problem: you have a computer sitting behind a firewall. You want to access it from a different location, but ]]></description> <content:encoded><![CDATA[<p><img
class="size-full   alignnone" title="Networking" src="http://pf-wordpress.s3.amazonaws.com/wordpress/wp-content/uploads/2009/12/3834148667_ceeeb12b4a_b.jpg" alt="Routers :: Credit: flicr user stars6" width="438" height="208" /></p><p>The problem: you have a computer sitting behind a firewall. You want to access it from a different location, but you don&#8217;t have the ability to forward any ports to it. The answer: SSH tunneling.<br
/> <span
id="more-184"></span><br
/><h2>The Solution</h2><p>Using an SSH tunnel, you can reverse-forward ports from one computer to another. To do this, you will need a computer running linux and <a
href="http://openssh.org/">sshd</a> to reverse-forward the ports to. It is very convenient if this is the computer you will be using to access the remote machine. Otherwise, additional steps must be taken.</p><h2>The Setup</h2><p>The easiest way to set up and maintain a reverse port-forwarding tunnel is with ohnobinki&#8217;s <a
href="http://ohnopublishing.net/hg/insurgent" target="_blank">insurgent</a> script. The script allows you to specify a remote host and the ports you want to reverse-forward. To start off, create a new user on your system, such as <tt>insurgent</tt>. Log in or start a shell as this user. Assuming you have <a
href="http://mercurial.selenic.com/">mercurial</a> installed, run:</p><blockquote><p><code>hg clone https://ohnopublishing.net/hg/insurgent</code></p></blockquote><p>Now cd to the newly created insurgent/bin directory. Finally, place the contents of insurgent/share/contab.txt into your crontab (use <tt>crontab -e</tt> to edit your crontab).</p><p>Now you simply need to configure the script. To do so, open insurgent.sh in your favorite editor, and update the REMOTE_HOST and other variables. The format for ports is [remoteport]:hostname:[localport] (<a
href="http://www.openbsd.org/cgi-bin/man.cgi?query=ssh&#038;sektion=1#TCP+FORWARDING">ssh(1)</a> ). I recommend starting with reverse-fowarding SSH (port 22), a vnc session (590x where x is the VNC display number), and nfs.</p><p>If you have not done so already, you need to set up <a
href="/wordpress/2009/12/quick-and-easy-passwordless-public-key-auth/">passwordless public key authentication</a> for the new <tt>insurgent</tt> user.</p><h2>You&#8217;re Done!</h2><p>If you&#8217;ve gotten this far, you may be ready to go. You should be able to access any port on your insurgent box via the corresponding port on your local box. Have any problems? Drop some comments below or pop into <a
href="irc://irc.ohnopub.net/protofusion">irc.ohnopub.net#protofusion</a> and speak to <tt>ohnobinki</tt> or <tt>normaldotcom</tt>.</p><h6>Image credit: <a
href="http://www.flickr.com/star6" target="_blank">star6</a>. Used under Creative Commons <a
rel="license" href="http://creativecommons.org/licenses/by-sa/2.0/">CC BY-SA 2.0</a></h6> ]]></content:encoded> <wfw:commentRss>http://protofusion.org/wordpress/2009/12/insurgency-access-your-linux-box-from-anywhere/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Idea: Powerline-networked Outlets/Switches</title><link>http://protofusion.org/wordpress/2009/09/idea-powerline-networked-outletsswitches/</link> <comments>http://protofusion.org/wordpress/2009/09/idea-powerline-networked-outletsswitches/#comments</comments> <pubDate>Fri, 04 Sep 2009 00:40:39 +0000</pubDate> <dc:creator>Ethan Zonca</dc:creator> <category><![CDATA[Ideas]]></category> <category><![CDATA[energy]]></category> <category><![CDATA[hardware]]></category> <category><![CDATA[idea]]></category> <category><![CDATA[networking]]></category><guid
isPermaLink="false">http://protofusion.org/wordpress/?p=81</guid> <description><![CDATA[With the advent of powerline LAN from various manufacturers for a steadily decreasing price, designing network-connected products becomes much easier. ]]></description> <content:encoded><![CDATA[<p
style="text-align: center;"><img
class="alignnone size-full wp-image-89" title="Power Outlet Cropped" src="http://pf-wordpress.s3.amazonaws.com/wordpress/wp-content/uploads/2009/09/4649947_15743ac8971.jpg" alt="Power Outlet Cropped" width="250" height="288" /></p><p>With the advent of powerline LAN from various manufacturers for a steadily decreasing price, designing network-connected products becomes much easier. Once the price of hardware for powerline networking drops due to wide acceptance, some standard &#8220;dumb&#8221; appliances and pieces of hardware could be easily and cheaply networked, allowing for a &#8220;home automation&#8221; of sorts, such as lightswitches and power outlets.<span
id="more-81"></span></p><p>We already have twittering &#8220;tweet-a-watts,&#8221; but powerline networking could extend this functionality and add control to every switch and outlet in one&#8217;s house. Just think&#8211;a house having all of its outlets and switches networked would be fully customizable, controllable, and monitorable. A homeowner could see power usage on a per-outlet (or even per-plug!) basis, which could make saving electricity much easier. In addition, power outlets and switches could be actively controlled over the network, allowing a computer to regulate power savings by, let&#8217;s say turning off or dimming a light, completely autonomously.</p><p>Despite many utility providers beginning to deploy &#8220;smart meters&#8221; (meters that let report, and often let you see, your power usage), monitoring power on a per-outlet basis still has great advantages. The &#8220;smart meter&#8221; can only report the energy usage of an entire household, and homeowners must unplug devices and check their energy usage monitor to determine how much power a device is using. With networked outlets and switches, users could see power usage on a per-outlet basis on a single screen, live. Networked outlets and switches could provide crucial energy-saving information to homeowners, saving them money and saving the earth from pollution.</p><p><em>Image Credit:<a
rel="cc:attributionURL" href="http://www.flickr.com/photos/kk/"> http://www.flickr.com/photos/kk/</a> / <a
rel="license" href="http://creativecommons.org/licenses/by-nc-sa/2.0/">CC BY-NC-SA 2.0</a></em></p> ]]></content:encoded> <wfw:commentRss>http://protofusion.org/wordpress/2009/09/idea-powerline-networked-outletsswitches/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced
Object Caching 458/507 objects using disk: basic
Content Delivery Network via Amazon Web Services: S3: pf-wordpress.s3.amazonaws.com

Served from: protofusion.org @ 2012-02-10 16:21:49 -->
