<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"> <channel><title>David Andrzejewski</title> <link>http://www.davidandrzejewski.com</link> <description /> <lastBuildDate>Thu, 03 May 2012 22:43:36 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.2</generator> <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/davidandrzejewski" /><feedburner:info uri="davidandrzejewski" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item><title>Python – Enhance PyDev’s Code Completion</title><link>http://feedproxy.google.com/~r/davidandrzejewski/~3/NiyzhB-ZjEw/</link> <comments>http://www.davidandrzejewski.com/2012/05/03/python-enhance-pydevs-auto-complete/#comments</comments> <pubDate>Thu, 03 May 2012 22:43:36 +0000</pubDate> <dc:creator>David Andrzejewski</dc:creator> <category><![CDATA[Uncategorized]]></category> <guid isPermaLink="false">http://www.davidandrzejewski.com/?p=521</guid> <description><![CDATA[TweetBecause Python isn&#8217;t strongly typed, sometimes PyDev doesn&#8217;t know what type a variable is &#8211; and therefore it cannot give you accurate code completions. Here&#8217;s how to make that better. In simpler situations, PyDev works very well. For example: emp = Employee&#40;&#41; Typing &#8216;emp.&#8217; will get you a good autocomplete. Now, let&#8217;s say you have <a
href='http://www.davidandrzejewski.com/2012/05/03/python-enhance-pydevs-auto-complete/' class='excerpt-more'>[...]</a>]]></description> <content:encoded><![CDATA[<div
id="tweetbutton521" class="tw_button" style=""><a
href="http://twitter.com/share?url=http%3A%2F%2Fwww.davidandrzejewski.com%2F2012%2F05%2F03%2Fpython-enhance-pydevs-auto-complete%2F&amp;via=dandrzejewski&amp;text=Python%20%26%238211%3B%20Enhance%20PyDev%26%238217%3Bs%20Code%20Completion&amp;related=&amp;lang=en&amp;count=horizontal" class="twitter-share-button"  style="width:55px;height:22px;background:transparent url('http://cdn.davidandrzejewski.net/wp-content/plugins/wp-tweet-button/tweetn.png') no-repeat  0 0;text-align:left;text-indent:-9999px;display:block;">Tweet</a></div><p>Because Python isn&#8217;t strongly typed, sometimes PyDev doesn&#8217;t know what type a variable is &#8211; and therefore it cannot give you accurate code completions.  Here&#8217;s how to make that better.</p><p>In simpler situations, PyDev works very well.  For example:</p><div
class="wp_syntax"><div
class="code"><pre class="python" style="font-family:monospace;">emp = Employee<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span></pre></div></div><p>Typing &#8216;emp.&#8217; will get you a good autocomplete.</p><p>Now, let&#8217;s say you have something like this:</p><div
class="wp_syntax"><div
class="code"><pre class="python" style="font-family:monospace;">emp = something.<span style="color: black;">find_employee</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;dave&quot;</span><span style="color: black;">&#41;</span></pre></div></div><p>Then &#8216;emp.&#8217; won&#8217;t get you anything &#8211; PyDev doesn&#8217;t necessarily know what type is being returned.</p><p>If you use python&#8217;s assert method:</p><div
class="wp_syntax"><div
class="code"><pre class="python" style="font-family:monospace;">emp = something.<span style="color: black;">find_employee</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;dave&quot;</span><span style="color: black;">&#41;</span>
<span style="color: #ff7700;font-weight:bold;">assert</span> <span style="color: #008000;">isinstance</span><span style="color: black;">&#40;</span>emp, Employee<span style="color: black;">&#41;</span></pre></div></div><p>PyDev now knows what type the variable is, and you&#8217;ll get more effective code completions.</p><p>When running in production, you can pass the &#8220;-O&#8221; flag to the interpreter, and it will ignore the assert statements.</p><div
id="tweetbutton521" class="tw_button" style=""><a
href="http://twitter.com/share?url=http%3A%2F%2Fwww.davidandrzejewski.com%2F2012%2F05%2F03%2Fpython-enhance-pydevs-auto-complete%2F&amp;via=dandrzejewski&amp;text=Python%20%26%238211%3B%20Enhance%20PyDev%26%238217%3Bs%20Code%20Completion&amp;related=&amp;lang=en&amp;count=horizontal" class="twitter-share-button"  style="width:55px;height:22px;background:transparent url('http://cdn.davidandrzejewski.net/wp-content/plugins/wp-tweet-button/tweetn.png') no-repeat  0 0;text-align:left;text-indent:-9999px;display:block;">Tweet</a></div>
<p><a href="http://feedads.g.doubleclick.net/~a/RPmyo6QG5Xc3isbaeiQwm9gDxNs/0/da"><img src="http://feedads.g.doubleclick.net/~a/RPmyo6QG5Xc3isbaeiQwm9gDxNs/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/RPmyo6QG5Xc3isbaeiQwm9gDxNs/1/da"><img src="http://feedads.g.doubleclick.net/~a/RPmyo6QG5Xc3isbaeiQwm9gDxNs/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/davidandrzejewski/~4/NiyzhB-ZjEw" height="1" width="1"/>]]></content:encoded> <wfw:commentRss>http://www.davidandrzejewski.com/2012/05/03/python-enhance-pydevs-auto-complete/feed/</wfw:commentRss> <slash:comments>0</slash:comments> <feedburner:origLink>http://www.davidandrzejewski.com/2012/05/03/python-enhance-pydevs-auto-complete/</feedburner:origLink></item> <item><title>Python: Get XML Representation of an Object</title><link>http://feedproxy.google.com/~r/davidandrzejewski/~3/b4hKNe2oTt8/</link> <comments>http://www.davidandrzejewski.com/2011/11/18/python-get-xml-representation-of-an-object/#comments</comments> <pubDate>Fri, 18 Nov 2011 23:01:39 +0000</pubDate> <dc:creator>David Andrzejewski</dc:creator> <category><![CDATA[Computing]]></category> <category><![CDATA[Programming]]></category> <category><![CDATA[Python]]></category> <guid isPermaLink="false">http://www.davidandrzejewski.com/?p=510</guid> <description><![CDATA[TweetI needed to return all the members of an object as an XML document in Python. I used the ElementTree library to do this. The class in question is pretty basic: It has a constructor, member variables, getters and setters for the member variables, and now this new function. Every Python class has a built-in <a
href='http://www.davidandrzejewski.com/2011/11/18/python-get-xml-representation-of-an-object/' class='excerpt-more'>[...]</a>]]></description> <content:encoded><![CDATA[<div
id="tweetbutton510" class="tw_button" style=""><a
href="http://twitter.com/share?url=http%3A%2F%2Fwww.davidandrzejewski.com%2F2011%2F11%2F18%2Fpython-get-xml-representation-of-an-object%2F&amp;via=dandrzejewski&amp;text=Python%3A%20Get%20XML%20Representation%20of%20an%20Object&amp;related=&amp;lang=en&amp;count=horizontal" class="twitter-share-button"  style="width:55px;height:22px;background:transparent url('http://cdn.davidandrzejewski.net/wp-content/plugins/wp-tweet-button/tweetn.png') no-repeat  0 0;text-align:left;text-indent:-9999px;display:block;">Tweet</a></div><p>I needed to return all the members of an object as an XML document in Python. I used the ElementTree library to do this.</p><p>The class in question is pretty basic: It has a constructor, member variables, getters and setters for the member variables, and now this new function.</p><p>Every Python class has a built-in __dict__ member, which is a dictionary ({}) of key/value pairs for all of the member variables, so I use that to get all of the variables to add to the ElementTree.</p><p>This function returns an xml.etree.ElementTree.Element object, which can be turned into a string if needed by using ElementTree&#8217;s tostring() method.</p><div
class="wp_syntax"><div
class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">def</span> getXML<span style="color: black;">&#40;</span><span style="color: #008000;">self</span><span style="color: black;">&#41;</span>:
    <span style="color: #483d8b;">&quot;&quot;&quot; Returns an XML representation of the object &quot;&quot;&quot;</span>
    topElem = Element<span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;item&quot;</span><span style="color: black;">&#41;</span>
    <span style="color: #ff7700;font-weight:bold;">for</span> key <span style="color: #ff7700;font-weight:bold;">in</span> <span style="color: #008000;">self</span>.<span style="color: #0000cd;">__dict__</span>.<span style="color: black;">keys</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>:
        elem = SubElement<span style="color: black;">&#40;</span>topElem, key<span style="color: black;">&#41;</span>
        elem.<span style="color: black;">text</span> = <span style="color: #008000;">str</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span>.<span style="color: #0000cd;">__dict__</span><span style="color: black;">&#91;</span>key<span style="color: black;">&#93;</span><span style="color: black;">&#41;</span>
    <span style="color: #ff7700;font-weight:bold;">return</span> topElem</pre></div></div><div
id="tweetbutton510" class="tw_button" style=""><a
href="http://twitter.com/share?url=http%3A%2F%2Fwww.davidandrzejewski.com%2F2011%2F11%2F18%2Fpython-get-xml-representation-of-an-object%2F&amp;via=dandrzejewski&amp;text=Python%3A%20Get%20XML%20Representation%20of%20an%20Object&amp;related=&amp;lang=en&amp;count=horizontal" class="twitter-share-button"  style="width:55px;height:22px;background:transparent url('http://cdn.davidandrzejewski.net/wp-content/plugins/wp-tweet-button/tweetn.png') no-repeat  0 0;text-align:left;text-indent:-9999px;display:block;">Tweet</a></div>
<p><a href="http://feedads.g.doubleclick.net/~a/ymOc24SIP9b54MpcHVRM_2zGLbQ/0/da"><img src="http://feedads.g.doubleclick.net/~a/ymOc24SIP9b54MpcHVRM_2zGLbQ/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/ymOc24SIP9b54MpcHVRM_2zGLbQ/1/da"><img src="http://feedads.g.doubleclick.net/~a/ymOc24SIP9b54MpcHVRM_2zGLbQ/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/davidandrzejewski/~4/b4hKNe2oTt8" height="1" width="1"/>]]></content:encoded> <wfw:commentRss>http://www.davidandrzejewski.com/2011/11/18/python-get-xml-representation-of-an-object/feed/</wfw:commentRss> <slash:comments>0</slash:comments> <feedburner:origLink>http://www.davidandrzejewski.com/2011/11/18/python-get-xml-representation-of-an-object/</feedburner:origLink></item> <item><title>Squid: Bypass redirector for specific URL</title><link>http://feedproxy.google.com/~r/davidandrzejewski/~3/wZavNpbqBdw/</link> <comments>http://www.davidandrzejewski.com/2011/11/16/squid-bypass-redirector-for-specific-url/#comments</comments> <pubDate>Thu, 17 Nov 2011 02:51:57 +0000</pubDate> <dc:creator>David Andrzejewski</dc:creator> <category><![CDATA[Computing]]></category> <category><![CDATA[Software]]></category> <guid isPermaLink="false">http://www.davidandrzejewski.com/?p=503</guid> <description><![CDATA[TweetOften times, in your Squid proxy, you may have a redirector configured &#8211; such as SquidGuard: redirect_program /usr/local/bin/squidGuard -c /usr/local/etc/squid/squidGuard.conf I ran into a problem tonight with my Roku box where SquidGuard was seeing Roku&#8217;s NetFlix access as a security threat.  So, to make Squid bypass the redirector, add an ACL and a redirector-access rule: <a
href='http://www.davidandrzejewski.com/2011/11/16/squid-bypass-redirector-for-specific-url/' class='excerpt-more'>[...]</a>]]></description> <content:encoded><![CDATA[<div
id="tweetbutton503" class="tw_button" style=""><a
href="http://twitter.com/share?url=http%3A%2F%2Fwww.davidandrzejewski.com%2F2011%2F11%2F16%2Fsquid-bypass-redirector-for-specific-url%2F&amp;via=dandrzejewski&amp;text=Squid%3A%20Bypass%20redirector%20for%20specific%20URL&amp;related=&amp;lang=en&amp;count=horizontal" class="twitter-share-button"  style="width:55px;height:22px;background:transparent url('http://cdn.davidandrzejewski.net/wp-content/plugins/wp-tweet-button/tweetn.png') no-repeat  0 0;text-align:left;text-indent:-9999px;display:block;">Tweet</a></div><p>Often times, in your <a
href="http://www.squid-cache.org">Squid</a> proxy, you may have a redirector configured &#8211; such as <a
href="http://www.squidguard.org/">SquidGuard</a>:</p><pre>redirect_program /usr/local/bin/squidGuard -c /usr/local/etc/squid/squidGuard.conf</pre><p>I ran into a problem tonight with my Roku box where SquidGuard was seeing Roku&#8217;s NetFlix access as a security threat.  So, to make Squid bypass the redirector, add an ACL and a redirector-access rule:</p><pre>acl netflix dstdomain .netflix.com
redirector_access deny netflix</pre><p>There you have it &#8211; any requests to *.netflix.com will skip the redirector.</p><div
id="tweetbutton503" class="tw_button" style=""><a
href="http://twitter.com/share?url=http%3A%2F%2Fwww.davidandrzejewski.com%2F2011%2F11%2F16%2Fsquid-bypass-redirector-for-specific-url%2F&amp;via=dandrzejewski&amp;text=Squid%3A%20Bypass%20redirector%20for%20specific%20URL&amp;related=&amp;lang=en&amp;count=horizontal" class="twitter-share-button"  style="width:55px;height:22px;background:transparent url('http://cdn.davidandrzejewski.net/wp-content/plugins/wp-tweet-button/tweetn.png') no-repeat  0 0;text-align:left;text-indent:-9999px;display:block;">Tweet</a></div>
<p><a href="http://feedads.g.doubleclick.net/~a/6HzmBhEDM4KfmLwfHzymJj0MSyQ/0/da"><img src="http://feedads.g.doubleclick.net/~a/6HzmBhEDM4KfmLwfHzymJj0MSyQ/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/6HzmBhEDM4KfmLwfHzymJj0MSyQ/1/da"><img src="http://feedads.g.doubleclick.net/~a/6HzmBhEDM4KfmLwfHzymJj0MSyQ/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/davidandrzejewski/~4/wZavNpbqBdw" height="1" width="1"/>]]></content:encoded> <wfw:commentRss>http://www.davidandrzejewski.com/2011/11/16/squid-bypass-redirector-for-specific-url/feed/</wfw:commentRss> <slash:comments>0</slash:comments> <feedburner:origLink>http://www.davidandrzejewski.com/2011/11/16/squid-bypass-redirector-for-specific-url/</feedburner:origLink></item> <item><title>Squid Proxy: Make Outgoing Headers Anonymous</title><link>http://feedproxy.google.com/~r/davidandrzejewski/~3/Scj8ff8obYs/</link> <comments>http://www.davidandrzejewski.com/2011/11/06/squid-proxy-make-outgoing-headers-anonymous/#comments</comments> <pubDate>Sun, 06 Nov 2011 12:56:58 +0000</pubDate> <dc:creator>David Andrzejewski</dc:creator> <category><![CDATA[Computing]]></category> <category><![CDATA[Security]]></category> <category><![CDATA[Software]]></category> <guid isPermaLink="false">http://www.davidandrzejewski.com/?p=494</guid> <description><![CDATA[TweetBy default, Squid sends HTTP headers on every request that can give away information about your internal network. Here&#8217;s an example of these headers: HTTP_VIA:1.1 proxyserver.local (squid/3.1.16) HTTP_X_FORWARDED_FOR:192.168.0.123 That&#8217;s three pieces of information you may not want to give away: The host name of your proxy server, the version of Squid it&#8217;s running, and the <a
href='http://www.davidandrzejewski.com/2011/11/06/squid-proxy-make-outgoing-headers-anonymous/' class='excerpt-more'>[...]</a>]]></description> <content:encoded><![CDATA[<div
id="tweetbutton494" class="tw_button" style=""><a
href="http://twitter.com/share?url=http%3A%2F%2Fwww.davidandrzejewski.com%2F2011%2F11%2F06%2Fsquid-proxy-make-outgoing-headers-anonymous%2F&amp;via=dandrzejewski&amp;text=Squid%20Proxy%3A%20Make%20Outgoing%20Headers%20Anonymous&amp;related=&amp;lang=en&amp;count=horizontal" class="twitter-share-button"  style="width:55px;height:22px;background:transparent url('http://cdn.davidandrzejewski.net/wp-content/plugins/wp-tweet-button/tweetn.png') no-repeat  0 0;text-align:left;text-indent:-9999px;display:block;">Tweet</a></div><p>By default, Squid sends HTTP headers on every request that can give away information about your internal network. Here&#8217;s an example of these headers:</p><pre>HTTP_VIA:1.1 proxyserver.local (squid/3.1.16)
HTTP_X_FORWARDED_FOR:192.168.0.123</pre><p>That&#8217;s three pieces of information you may not want to give away: The host name of your proxy server, the version of Squid it&#8217;s running, and the IP address of the system that&#8217;s making the request via the proxy.</p><p>Fortunately, it&#8217;s simple (and does not apparently violate any standards) to make these headers more anonymous &#8211; just use these configuration directives in your squid.conf:</p><pre>
# Be more anonymous
forwarded_for off
visible_hostname proxy.local
httpd_suppress_version_string on
</pre><p>That will change the headers to look more like this:</p><pre>HTTP_VIA:1.1 proxy.local (squid)
HTTP_X_FORWARDED_FOR:unknown</pre><div
id="tweetbutton494" class="tw_button" style=""><a
href="http://twitter.com/share?url=http%3A%2F%2Fwww.davidandrzejewski.com%2F2011%2F11%2F06%2Fsquid-proxy-make-outgoing-headers-anonymous%2F&amp;via=dandrzejewski&amp;text=Squid%20Proxy%3A%20Make%20Outgoing%20Headers%20Anonymous&amp;related=&amp;lang=en&amp;count=horizontal" class="twitter-share-button"  style="width:55px;height:22px;background:transparent url('http://cdn.davidandrzejewski.net/wp-content/plugins/wp-tweet-button/tweetn.png') no-repeat  0 0;text-align:left;text-indent:-9999px;display:block;">Tweet</a></div>
<p><a href="http://feedads.g.doubleclick.net/~a/4r42O1elAHQB863OYPeNkfDsLNA/0/da"><img src="http://feedads.g.doubleclick.net/~a/4r42O1elAHQB863OYPeNkfDsLNA/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/4r42O1elAHQB863OYPeNkfDsLNA/1/da"><img src="http://feedads.g.doubleclick.net/~a/4r42O1elAHQB863OYPeNkfDsLNA/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/davidandrzejewski/~4/Scj8ff8obYs" height="1" width="1"/>]]></content:encoded> <wfw:commentRss>http://www.davidandrzejewski.com/2011/11/06/squid-proxy-make-outgoing-headers-anonymous/feed/</wfw:commentRss> <slash:comments>0</slash:comments> <feedburner:origLink>http://www.davidandrzejewski.com/2011/11/06/squid-proxy-make-outgoing-headers-anonymous/</feedburner:origLink></item> <item><title>CSS: Make an element unselectable</title><link>http://feedproxy.google.com/~r/davidandrzejewski/~3/YJUroFcQ76M/</link> <comments>http://www.davidandrzejewski.com/2011/10/28/css-make-an-element-unselectable/#comments</comments> <pubDate>Fri, 28 Oct 2011 23:31:12 +0000</pubDate> <dc:creator>David Andrzejewski</dc:creator> <category><![CDATA[Computing]]></category> <category><![CDATA[Programming]]></category> <guid isPermaLink="false">http://www.davidandrzejewski.com/?p=471</guid> <description><![CDATA[TweetApparently, it&#8217;s necessary to use separate CSS properties for each browser. .unselectable &#123; -webkit-user-select: none; -khtml-user-select: none; -moz-user-select: none; -o-user-select: none; user-select: none; &#125; Tweet]]></description> <content:encoded><![CDATA[<div
id="tweetbutton471" class="tw_button" style=""><a
href="http://twitter.com/share?url=http%3A%2F%2Fwww.davidandrzejewski.com%2F2011%2F10%2F28%2Fcss-make-an-element-unselectable%2F&amp;via=dandrzejewski&amp;text=CSS%3A%20Make%20an%20element%20unselectable&amp;related=&amp;lang=en&amp;count=horizontal" class="twitter-share-button"  style="width:55px;height:22px;background:transparent url('http://cdn.davidandrzejewski.net/wp-content/plugins/wp-tweet-button/tweetn.png') no-repeat  0 0;text-align:left;text-indent:-9999px;display:block;">Tweet</a></div><p>Apparently, it&#8217;s necessary to use separate CSS properties for each browser.</p><div
class="wp_syntax"><div
class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.unselectable</span> <span style="color: #00AA00;">&#123;</span>
	-webkit-user-select<span style="color: #00AA00;">:</span> <span style="color: #993333;">none</span><span style="color: #00AA00;">;</span>
	-khtml-user-select<span style="color: #00AA00;">:</span> <span style="color: #993333;">none</span><span style="color: #00AA00;">;</span>
	-moz-user-select<span style="color: #00AA00;">:</span> <span style="color: #993333;">none</span><span style="color: #00AA00;">;</span>
	-o-user-select<span style="color: #00AA00;">:</span> <span style="color: #993333;">none</span><span style="color: #00AA00;">;</span>
	user-select<span style="color: #00AA00;">:</span> <span style="color: #993333;">none</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div><div
id="tweetbutton471" class="tw_button" style=""><a
href="http://twitter.com/share?url=http%3A%2F%2Fwww.davidandrzejewski.com%2F2011%2F10%2F28%2Fcss-make-an-element-unselectable%2F&amp;via=dandrzejewski&amp;text=CSS%3A%20Make%20an%20element%20unselectable&amp;related=&amp;lang=en&amp;count=horizontal" class="twitter-share-button"  style="width:55px;height:22px;background:transparent url('http://cdn.davidandrzejewski.net/wp-content/plugins/wp-tweet-button/tweetn.png') no-repeat  0 0;text-align:left;text-indent:-9999px;display:block;">Tweet</a></div>
<p><a href="http://feedads.g.doubleclick.net/~a/Gr3770mowBxVZJzP-uuD4ArNbLM/0/da"><img src="http://feedads.g.doubleclick.net/~a/Gr3770mowBxVZJzP-uuD4ArNbLM/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/Gr3770mowBxVZJzP-uuD4ArNbLM/1/da"><img src="http://feedads.g.doubleclick.net/~a/Gr3770mowBxVZJzP-uuD4ArNbLM/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/davidandrzejewski/~4/YJUroFcQ76M" height="1" width="1"/>]]></content:encoded> <wfw:commentRss>http://www.davidandrzejewski.com/2011/10/28/css-make-an-element-unselectable/feed/</wfw:commentRss> <slash:comments>0</slash:comments> <feedburner:origLink>http://www.davidandrzejewski.com/2011/10/28/css-make-an-element-unselectable/</feedburner:origLink></item> <item><title>Configure VLANs on FreeBSD</title><link>http://feedproxy.google.com/~r/davidandrzejewski/~3/6gNLhYhCQ8w/</link> <comments>http://www.davidandrzejewski.com/2011/09/07/configure-vlans-on-freebsd/#comments</comments> <pubDate>Thu, 08 Sep 2011 03:46:43 +0000</pubDate> <dc:creator>David Andrzejewski</dc:creator> <category><![CDATA[Computing]]></category> <category><![CDATA[Security]]></category> <guid isPermaLink="false">http://www.davidandrzejewski.com/?p=461</guid> <description><![CDATA[TweetIf you have a switch, access point or other piece of network hardware that supports 802.1q VLAN tagging, and you&#8217;d like to your FreeBSD system to recognize them, it&#8217;s a pretty straight-forward configuration.  I&#8217;ll use examples from my network to illustrate.  My goal in this case, which I may write about in a separate post, <a
href='http://www.davidandrzejewski.com/2011/09/07/configure-vlans-on-freebsd/' class='excerpt-more'>[...]</a>]]></description> <content:encoded><![CDATA[<div
id="tweetbutton461" class="tw_button" style=""><a
href="http://twitter.com/share?url=http%3A%2F%2Fwww.davidandrzejewski.com%2F2011%2F09%2F07%2Fconfigure-vlans-on-freebsd%2F&amp;via=dandrzejewski&amp;text=Configure%20VLANs%20on%20FreeBSD&amp;related=&amp;lang=en&amp;count=horizontal" class="twitter-share-button"  style="width:55px;height:22px;background:transparent url('http://cdn.davidandrzejewski.net/wp-content/plugins/wp-tweet-button/tweetn.png') no-repeat  0 0;text-align:left;text-indent:-9999px;display:block;">Tweet</a></div><p>If you have a switch, access point or other piece of network hardware that supports 802.1q VLAN tagging, and you&#8217;d like to your FreeBSD system to recognize them, it&#8217;s a pretty straight-forward configuration.  I&#8217;ll use examples from my network to illustrate.  My goal in this case, which I may write about in a separate post, was to create two segmented wifi networks &#8211; one for my main network and one for guests to connect to.  I wanted the guest network to have access to the internet, but not to any of my other systems on the network.</p><p><br/>Read the rest of <a
href="http://www.davidandrzejewski.com/2011/09/07/configure-vlans-on-freebsd/">Configure VLANs on FreeBSD</a> (341 words)</p> 
<p><a href="http://feedads.g.doubleclick.net/~a/-AY7GWUS4c8N2j6XUwOlpR3JtxE/0/da"><img src="http://feedads.g.doubleclick.net/~a/-AY7GWUS4c8N2j6XUwOlpR3JtxE/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/-AY7GWUS4c8N2j6XUwOlpR3JtxE/1/da"><img src="http://feedads.g.doubleclick.net/~a/-AY7GWUS4c8N2j6XUwOlpR3JtxE/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/davidandrzejewski/~4/6gNLhYhCQ8w" height="1" width="1"/>]]></content:encoded> <wfw:commentRss>http://www.davidandrzejewski.com/2011/09/07/configure-vlans-on-freebsd/feed/</wfw:commentRss> <slash:comments>0</slash:comments> <feedburner:origLink>http://www.davidandrzejewski.com/2011/09/07/configure-vlans-on-freebsd/</feedburner:origLink></item> <item><title>FreeBSD – IPv6 Tunnel and Gateway Configuration</title><link>http://feedproxy.google.com/~r/davidandrzejewski/~3/-sJcuLCcE9k/</link> <comments>http://www.davidandrzejewski.com/2010/03/04/freebsd-ipv6-tunnel-and-gateway-configuration/#comments</comments> <pubDate>Thu, 04 Mar 2010 05:22:18 +0000</pubDate> <dc:creator>David Andrzejewski</dc:creator> <category><![CDATA[Computing]]></category> <category><![CDATA[Software]]></category> <category><![CDATA[administration]]></category> <category><![CDATA[freebsd]]></category> <category><![CDATA[networking]]></category> <guid isPermaLink="false">http://www.davidandrzejewski.com/?p=371</guid> <description><![CDATA[TweetMost of us don&#8217;t have native IPv6 Internet connections at home.  Fortunately, it&#8217;s easy (and free) to get connected to the IPv6 Internet.  Here&#8217;s how to get your FreeBSD box connected. Read the rest of FreeBSD &#8211; IPv6 Tunnel and Gateway Configuration (523 words)]]></description> <content:encoded><![CDATA[<div
id="tweetbutton371" class="tw_button" style=""><a
href="http://twitter.com/share?url=http%3A%2F%2Fwww.davidandrzejewski.com%2F2010%2F03%2F04%2Ffreebsd-ipv6-tunnel-and-gateway-configuration%2F&amp;via=dandrzejewski&amp;text=FreeBSD%20%26%238211%3B%20IPv6%20Tunnel%20and%20Gateway%20Configuration&amp;related=&amp;lang=en&amp;count=horizontal" class="twitter-share-button"  style="width:55px;height:22px;background:transparent url('http://cdn.davidandrzejewski.net/wp-content/plugins/wp-tweet-button/tweetn.png') no-repeat  0 0;text-align:left;text-indent:-9999px;display:block;">Tweet</a></div><p>Most of us don&#8217;t have native IPv6 Internet connections at home.  Fortunately, it&#8217;s easy (and free) to get connected to the IPv6 Internet.  Here&#8217;s how to get your FreeBSD box connected.</p><p><br/>Read the rest of <a
href="http://www.davidandrzejewski.com/2010/03/04/freebsd-ipv6-tunnel-and-gateway-configuration/">FreeBSD &#8211; IPv6 Tunnel and Gateway Configuration</a> (523 words)</p> 
<p><a href="http://feedads.g.doubleclick.net/~a/8ogWiA7og6P_ra-lUwJTawNoDeI/0/da"><img src="http://feedads.g.doubleclick.net/~a/8ogWiA7og6P_ra-lUwJTawNoDeI/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/8ogWiA7og6P_ra-lUwJTawNoDeI/1/da"><img src="http://feedads.g.doubleclick.net/~a/8ogWiA7og6P_ra-lUwJTawNoDeI/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/davidandrzejewski/~4/-sJcuLCcE9k" height="1" width="1"/>]]></content:encoded> <wfw:commentRss>http://www.davidandrzejewski.com/2010/03/04/freebsd-ipv6-tunnel-and-gateway-configuration/feed/</wfw:commentRss> <slash:comments>0</slash:comments> <feedburner:origLink>http://www.davidandrzejewski.com/2010/03/04/freebsd-ipv6-tunnel-and-gateway-configuration/</feedburner:origLink></item> <item><title>FreeBSD Backup Using dump and duplicity</title><link>http://feedproxy.google.com/~r/davidandrzejewski/~3/UeuoBw4_asA/</link> <comments>http://www.davidandrzejewski.com/2010/03/01/freebsd-backup-using-dump-and-duplicity/#comments</comments> <pubDate>Tue, 02 Mar 2010 03:35:13 +0000</pubDate> <dc:creator>David Andrzejewski</dc:creator> <category><![CDATA[Computing]]></category> <category><![CDATA[Software]]></category> <category><![CDATA[backup]]></category> <category><![CDATA[freebsd]]></category> <guid isPermaLink="false">http://www.davidandrzejewski.com/?p=299</guid> <description><![CDATA[TweetI spent some time thinking about backup strategy, and I decided for my purposes, I&#8217;d like to handle the staging process (getting all the files put together), and I&#8217;d like the backup solution itself to simply upload the files &#8211; but since I want to do nightly backups, I&#8217;d like the backup solution to have <a
href='http://www.davidandrzejewski.com/2010/03/01/freebsd-backup-using-dump-and-duplicity/' class='excerpt-more'>[...]</a>]]></description> <content:encoded><![CDATA[<div
id="tweetbutton299" class="tw_button" style=""><a
href="http://twitter.com/share?url=http%3A%2F%2Fwww.davidandrzejewski.com%2F2010%2F03%2F01%2Ffreebsd-backup-using-dump-and-duplicity%2F&amp;via=dandrzejewski&amp;text=FreeBSD%20Backup%20Using%20dump%20and%20duplicity&amp;related=&amp;lang=en&amp;count=horizontal" class="twitter-share-button"  style="width:55px;height:22px;background:transparent url('http://cdn.davidandrzejewski.net/wp-content/plugins/wp-tweet-button/tweetn.png') no-repeat  0 0;text-align:left;text-indent:-9999px;display:block;">Tweet</a></div><p>I spent some time thinking about backup strategy, and I decided for my purposes, I&#8217;d like to handle the staging process (getting all the files put together), and I&#8217;d like the backup solution itself to simply upload the files &#8211; but since I want to do nightly backups, I&#8217;d like the backup solution to have incremental capabilities.</p><p>I narrowed it down to two possible solutions &#8211; <a
href="http://www.tarsnap.com/">Tarsnap</a> and <a
href="http://www.nongnu.org/duplicity/">Duplicity</a>.  Both support incremental backups, both are command-line capable.  I decided to use Duplicity because it uploads directly to whichever back-end service you use &#8211; be it Amazon S3 or an SFTP server .  Tarsnap uses S3, but that&#8217;s your only option, and they do some processing for you, and because of that, it costs more.</p><p>Now, on to the details.</p><p><br/>Read the rest of <a
href="http://www.davidandrzejewski.com/2010/03/01/freebsd-backup-using-dump-and-duplicity/">FreeBSD Backup Using dump and duplicity</a> (1,786 words)</p> 
<p><a href="http://feedads.g.doubleclick.net/~a/a2RbxtTbo3_SvBRkT6sWnw-XFHU/0/da"><img src="http://feedads.g.doubleclick.net/~a/a2RbxtTbo3_SvBRkT6sWnw-XFHU/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/a2RbxtTbo3_SvBRkT6sWnw-XFHU/1/da"><img src="http://feedads.g.doubleclick.net/~a/a2RbxtTbo3_SvBRkT6sWnw-XFHU/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/davidandrzejewski/~4/UeuoBw4_asA" height="1" width="1"/>]]></content:encoded> <wfw:commentRss>http://www.davidandrzejewski.com/2010/03/01/freebsd-backup-using-dump-and-duplicity/feed/</wfw:commentRss> <slash:comments>0</slash:comments> <feedburner:origLink>http://www.davidandrzejewski.com/2010/03/01/freebsd-backup-using-dump-and-duplicity/</feedburner:origLink></item> <item><title>FreeBSD – Colorize Your Console</title><link>http://feedproxy.google.com/~r/davidandrzejewski/~3/pDIALqF3lQ4/</link> <comments>http://www.davidandrzejewski.com/2010/02/28/freebsd-colorize-your-console/#comments</comments> <pubDate>Sun, 28 Feb 2010 22:08:38 +0000</pubDate> <dc:creator>David Andrzejewski</dc:creator> <category><![CDATA[Computing]]></category> <category><![CDATA[freebsd]]></category> <guid isPermaLink="false">http://www.davidandrzejewski.com/?p=306</guid> <description><![CDATA[TweetThe FreeBSD console is colorless by default &#8211; but most terminals and SSH clients these days support color.  The benefits of colorizing your console should be pretty obvious.  It makes your life a little easier &#8211; you don&#8217;t have to do as much mental processing. Read the rest of FreeBSD &#8211; Colorize Your Console (154 <a
href='http://www.davidandrzejewski.com/2010/02/28/freebsd-colorize-your-console/' class='excerpt-more'>[...]</a>]]></description> <content:encoded><![CDATA[<div
id="tweetbutton306" class="tw_button" style=""><a
href="http://twitter.com/share?url=http%3A%2F%2Fwww.davidandrzejewski.com%2F2010%2F02%2F28%2Ffreebsd-colorize-your-console%2F&amp;via=dandrzejewski&amp;text=FreeBSD%20%26%238211%3B%20Colorize%20Your%20Console&amp;related=&amp;lang=en&amp;count=horizontal" class="twitter-share-button"  style="width:55px;height:22px;background:transparent url('http://cdn.davidandrzejewski.net/wp-content/plugins/wp-tweet-button/tweetn.png') no-repeat  0 0;text-align:left;text-indent:-9999px;display:block;">Tweet</a></div><p>The FreeBSD console is colorless by default &#8211; but most terminals and SSH clients these days support color.  The benefits of colorizing your console should be pretty obvious.  It makes your life a little easier &#8211; you don&#8217;t have to do as much mental processing.</p><p><br/>Read the rest of <a
href="http://www.davidandrzejewski.com/2010/02/28/freebsd-colorize-your-console/">FreeBSD &#8211; Colorize Your Console</a> (154 words)</p> 
<p><a href="http://feedads.g.doubleclick.net/~a/IoFvSeD5gOsMwG1zrMlCT5mq5gw/0/da"><img src="http://feedads.g.doubleclick.net/~a/IoFvSeD5gOsMwG1zrMlCT5mq5gw/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/IoFvSeD5gOsMwG1zrMlCT5mq5gw/1/da"><img src="http://feedads.g.doubleclick.net/~a/IoFvSeD5gOsMwG1zrMlCT5mq5gw/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/davidandrzejewski/~4/pDIALqF3lQ4" height="1" width="1"/>]]></content:encoded> <wfw:commentRss>http://www.davidandrzejewski.com/2010/02/28/freebsd-colorize-your-console/feed/</wfw:commentRss> <slash:comments>0</slash:comments> <feedburner:origLink>http://www.davidandrzejewski.com/2010/02/28/freebsd-colorize-your-console/</feedburner:origLink></item> <item><title>Python URLGrabber: Ignore System Proxy Settings</title><link>http://feedproxy.google.com/~r/davidandrzejewski/~3/AO9RtRpyaYk/</link> <comments>http://www.davidandrzejewski.com/2009/07/04/python-urlgrabber-ignore-system-proxy-settings/#comments</comments> <pubDate>Sat, 04 Jul 2009 18:41:36 +0000</pubDate> <dc:creator>David Andrzejewski</dc:creator> <category><![CDATA[Programming]]></category> <category><![CDATA[python]]></category> <category><![CDATA[urlgrabber]]></category> <category><![CDATA[urllib]]></category> <category><![CDATA[urllib2]]></category> <guid isPermaLink="false">http://www.davidandrzejewski.com/?p=269</guid> <description><![CDATA[TweetThe Duke URLGrabber package for Python makes it incredibly easy to retrieve files from remote servers, and it abstracts urllib2 for you in a protocol-independent way, so you can focus on your application instead of spending time working with Python&#8217;s built-in urllib2. On Windows and Mac OSX, by default, urllib2 (and therefore URLGrabber) will use <a
href='http://www.davidandrzejewski.com/2009/07/04/python-urlgrabber-ignore-system-proxy-settings/' class='excerpt-more'>[...]</a>]]></description> <content:encoded><![CDATA[<div
id="tweetbutton269" class="tw_button" style=""><a
href="http://twitter.com/share?url=http%3A%2F%2Fwww.davidandrzejewski.com%2F2009%2F07%2F04%2Fpython-urlgrabber-ignore-system-proxy-settings%2F&amp;via=dandrzejewski&amp;text=Python%20URLGrabber%3A%20Ignore%20System%20Proxy%20Settings&amp;related=&amp;lang=en&amp;count=horizontal" class="twitter-share-button"  style="width:55px;height:22px;background:transparent url('http://cdn.davidandrzejewski.net/wp-content/plugins/wp-tweet-button/tweetn.png') no-repeat  0 0;text-align:left;text-indent:-9999px;display:block;">Tweet</a></div><p>The <a
href="http://linux.duke.edu/projects/urlgrabber/">Duke URLGrabber</a> package for Python makes it incredibly easy to retrieve files from remote servers, and it abstracts <a
href="http://docs.python.org/library/urllib2.html">urllib2</a> for you in a protocol-independent way, so you can focus on your application instead of spending time working with Python&#8217;s built-in urllib2.</p><p>On Windows and Mac OSX, by default, urllib2 (and therefore URLGrabber) will use the built-in proxy settings of the system &#8211; but sometimes you don&#8217;t want that.  For example, let&#8217;s say you&#8217;re using a Windows box that&#8217;s on a domain, and proxy settings have been pushed down by group policy.  You want to access local network resources without needing to route through the proxy or authenticate to it.</p><p>With urllib2, you would simply add code like the following:</p><div
class="wp_syntax"><div
class="code"><pre class="python" style="font-family:monospace;">proxy_support = <span style="color: #dc143c;">urllib2</span>.<span style="color: black;">ProxyHandler</span><span style="color: black;">&#40;</span><span style="color: black;">&#123;</span><span style="color: black;">&#125;</span><span style="color: black;">&#41;</span></pre></div></div><p>Note the empty dictionary &#8220;{}&#8221; to specify no proxies.  Doing the same for URLGrabber was suggested on a mailing list post &#8211; and it apparently worked for the poster.  However, I wasn&#8217;t able to get it to work, so I came up with another way.  I just specified a dummy proxy for a dummy protocol, as follows:</p><div
class="wp_syntax"><div
class="code"><pre class="python" style="font-family:monospace;">kwargs<span style="color: black;">&#91;</span><span style="color: #483d8b;">&quot;proxies&quot;</span><span style="color: black;">&#93;</span> = <span style="color: black;">&#123;</span> <span style="color: #483d8b;">'nothing'</span>: <span style="color: #483d8b;">'http://nothing'</span> <span style="color: black;">&#125;</span></pre></div></div><p>Have fun!</p><div
id="tweetbutton269" class="tw_button" style=""><a
href="http://twitter.com/share?url=http%3A%2F%2Fwww.davidandrzejewski.com%2F2009%2F07%2F04%2Fpython-urlgrabber-ignore-system-proxy-settings%2F&amp;via=dandrzejewski&amp;text=Python%20URLGrabber%3A%20Ignore%20System%20Proxy%20Settings&amp;related=&amp;lang=en&amp;count=horizontal" class="twitter-share-button"  style="width:55px;height:22px;background:transparent url('http://cdn.davidandrzejewski.net/wp-content/plugins/wp-tweet-button/tweetn.png') no-repeat  0 0;text-align:left;text-indent:-9999px;display:block;">Tweet</a></div>
<p><a href="http://feedads.g.doubleclick.net/~a/wzjm9z7-XosSubbSIEc1JliEkNs/0/da"><img src="http://feedads.g.doubleclick.net/~a/wzjm9z7-XosSubbSIEc1JliEkNs/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/wzjm9z7-XosSubbSIEc1JliEkNs/1/da"><img src="http://feedads.g.doubleclick.net/~a/wzjm9z7-XosSubbSIEc1JliEkNs/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/davidandrzejewski/~4/AO9RtRpyaYk" height="1" width="1"/>]]></content:encoded> <wfw:commentRss>http://www.davidandrzejewski.com/2009/07/04/python-urlgrabber-ignore-system-proxy-settings/feed/</wfw:commentRss> <slash:comments>0</slash:comments> <feedburner:origLink>http://www.davidandrzejewski.com/2009/07/04/python-urlgrabber-ignore-system-proxy-settings/</feedburner:origLink></item> </channel> </rss><!-- Dynamic page generated in 1.069 seconds. --><!-- Cached page generated by WP-Super-Cache on 2012-05-03 17:52:29 --><!-- Compression = gzip -->

