<?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: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>2012-01-05T11:25:39.869-08:00</updated><category term='Resize Browser'/><category term='Escape Parameter'/><category term='Multiple Copies'/><category term='LMOPX'/><category term='proxy'/><category term='Performance'/><category term='Table Formatting'/><category term='Technology'/><category term='Patch'/><category term='socks'/><category term='C'/><category term='Postgresql'/><category term='Economics'/><category term='PI Approximation'/><category term='monitor calibration'/><category term='MUHLX'/><category term='64bit linux'/><category term='Q'/><category term='Windows'/><category term='Remote Desktop'/><category term='Trim Spaces'/><category term='Constant'/><category term='Syntax Highlighting'/><category term='Strip Spaces'/><category term='Escape HTML'/><category term='Encode Parameter'/><category term='adobe air'/><category term='Testing'/><category term='C++'/><category term='download video'/><category term='Stock Market Valuation'/><category term='Encoding HTML'/><category term='Tobin&apos;s Q'/><category term='Tor'/><category term='HTTP::Proxy'/><category term='download youtube'/><category term='Ignore Visits'/><category term='Shell Function'/><category term='Query Parameter'/><category term='Mac'/><category term='Change Window Size'/><category term='iconv'/><category term='Multiple Instances'/><category term='Code Highlighting'/><category term='Indexes'/><category term='FreeNX'/><category term='LWP'/><category term='acos'/><category term='Dell 2408WFP'/><category term='LMVTX'/><category term='save youtube video'/><category term='LUKS Encryption'/><category term='Password Generator'/><category term='Escape URL'/><category term='SSH Tunnel'/><category term='pg_dump'/><category term='Browser Dimensions'/><category term='Exclude Visits'/><category term='HTML Entities'/><category term='Secure Password'/><category term='arccosine'/><category term='Ignore Me'/><category term='Strip Whitespace'/><category term='Decode Parameter'/><category term='HTML Literal'/><category term='test database'/><category term='Perl'/><category term='HTML Entity'/><category term='Make Password'/><category term='Blogger'/><category term='Blogspot'/><category term='Encode HTML'/><category term='Escaping HTML'/><category term='Unescape Parameter'/><category term='Google Analytics'/><category term='Legg Mason'/><category term='Trim Whitespace'/><category term='Firefox'/><category term='Muhlenkamp'/><category term='Multiple Profiles'/><category term='Post HTML'/><category term='Database'/><category term='Linux'/><category term='Encode URL'/><category term='Foreign Key'/><category term='HTML::Entities'/><category term='Q-Ratio'/><category term='Change Resolution'/><category term='VNC'/><category term='Ubuntu'/><category term='Encrypted Loop Device'/><category term='Bash'/><category term='libwww'/><category term='Encrypted Filesystem'/><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?max-results=100'/><link rel='alternate' type='text/html' href='http://mlawire.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>mla</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>33</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><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='Technology'/><category scheme='http://www.blogger.com/atom/ns#' term='test database'/><category scheme='http://www.blogger.com/atom/ns#' term='Postgresql'/><category scheme='http://www.blogger.com/atom/ns#' term='pg_dump'/><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="http://github.com/downloads/mla/pg_sample/pg_sample-0-01.tgz"&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'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's operation closely resembles that of &lt;a href="http://www.postgresql.org/docs/current/static/app-pgdump.html"&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="brush:text; gutter:false"&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'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="brush:text; gutter:false"&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'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="http://github.com/mla/pg_sample"&gt;pg_sample Github source repository&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2787250666802991949-63586772599371769?l=mlawire.blogspot.com' alt='' /&gt;&lt;/div&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.g?blogID=2787250666802991949&amp;postID=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>mla</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.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>2010-05-09T15:58:20.049-07:00</updated><title type='text'>ip2host 1.11 Release</title><content type='html'>A new release of ip2host is now available. It'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="http://github.com/mla/ip2host"&gt;http://github.com/mla/ip2host&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:text; gutter:false"&gt;&lt;br /&gt;DESCRIPTION&lt;br /&gt;&lt;br /&gt;    Resolves IPs to hostnames in web server logs. This is a faster, drop-in&lt;br /&gt;    replacement for the logresolve utility distributed with the Apache web&lt;br /&gt;    server.&lt;br /&gt;&lt;br /&gt;CHANGELOG&lt;br /&gt;&lt;br /&gt;ip2host 1.11&lt;br /&gt;&lt;br /&gt;  * Silence warnings thanks to Andrew McNaughton and Gunnar Wolf&lt;br /&gt;    http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=563129&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2787250666802991949-1215759401476611044?l=mlawire.blogspot.com' alt='' /&gt;&lt;/div&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.g?blogID=2787250666802991949&amp;postID=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>mla</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.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='Technology'/><category scheme='http://www.blogger.com/atom/ns#' term='64bit linux'/><category scheme='http://www.blogger.com/atom/ns#' term='Ubuntu'/><category scheme='http://www.blogger.com/atom/ns#' term='adobe air'/><title type='text'>Installing Adobe AIR on 64-bit Ubuntu 9.10 Linux</title><content type='html'>Adobe AIR isn't currently available for 64-bit Linux, but they provide &lt;a href="http://kb2.adobe.com/cps/408/kb408084.html"&gt;instructions on running the 32-bit version&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;I've converted the Ubuntu instructions into this shell script:&lt;br /&gt;&lt;a href="http://sites.google.com/site/mlawire/installing-adobe-air-1-5-on-64-bit-ubuntu-linux/install-adobe-air-ubuntu-64bit.sh"&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="brush:shell"&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&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2787250666802991949-3174758310153604285?l=mlawire.blogspot.com' alt='' /&gt;&lt;/div&gt;</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.g?blogID=2787250666802991949&amp;postID=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>mla</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.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="brush:bash; gutter:false"&gt;$ apt-get install doxygen&lt;/pre&gt;Next. enter the source directory of a project you're working on and run:&lt;br /&gt;&lt;pre class="brush:bash; gutter:false"&gt;$ doxygen -g&lt;/pre&gt;That will create a config file named Doxyfile in the current directory. You can customize it, but we'll accept the defaults for now.&lt;br /&gt;&lt;br /&gt;Now begin writing your documentation. Here's an example of documenting a simple C++ program:&lt;br /&gt;&lt;pre class="brush:cpp"&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="brush:bash; gutter:false"&gt;$ doxygen&lt;/pre&gt;For more details, see the &lt;a href="http://www.stack.nl/~dimitri/doxygen/"&gt;Doxygen homepage&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2787250666802991949-2431296936704433963?l=mlawire.blogspot.com' alt='' /&gt;&lt;/div&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.g?blogID=2787250666802991949&amp;postID=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>mla</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.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='C'/><category scheme='http://www.blogger.com/atom/ns#' term='Technology'/><category scheme='http://www.blogger.com/atom/ns#' term='arccosine'/><category scheme='http://www.blogger.com/atom/ns#' term='acos'/><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='C++'/><title type='text'>C++ Constant for PI</title><content type='html'>&lt;i&gt;Where's the definition for pi? Doesn't C++ provide a constant? What about C?&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;The C++ standard doesn't provide a value for pi but it's simple to define yourself:&lt;br /&gt;&lt;pre class="brush:cpp"&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="brush:shell"&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's a definition in C:&lt;pre class="brush:cpp"&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;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2787250666802991949-661304177539402228?l=mlawire.blogspot.com' alt='' /&gt;&lt;/div&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.g?blogID=2787250666802991949&amp;postID=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>mla</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.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>2009-08-05T21:12:41.844-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Technology'/><category scheme='http://www.blogger.com/atom/ns#' term='Foreign Key'/><category scheme='http://www.blogger.com/atom/ns#' term='Postgresql'/><category scheme='http://www.blogger.com/atom/ns#' term='Indexes'/><category scheme='http://www.blogger.com/atom/ns#' term='Performance'/><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="brush:sql"&gt;&lt;br /&gt;/*&lt;br /&gt;  Look for foreign key constraints that are missing indexes on the&lt;br /&gt;  referencing table.&lt;br /&gt;&lt;br /&gt;  Orders results by the size of the referencing table, largest first,&lt;br /&gt;  on the assumption that, all else being equal, they are the most likely&lt;br /&gt;  to benefit from the addition of indexes.&lt;br /&gt;&lt;br /&gt;  This is only meant as a starting point, and isn&amp;#39;t perfect.&lt;br /&gt;  It&amp;#39;s possible, for example, that it will report a missing index&lt;br /&gt;  when in fact one is available. e.g., it won&amp;#39;t realize that an index on&lt;br /&gt;  (f1, f2) could be used with a fk on (f1). However, it will recognize&lt;br /&gt;  that an index on (f1, f2) can be used with a fk on (f2, f1).&lt;br /&gt;&lt;br /&gt;  Usage: psql -q dbname -f pg-find-missing-fk-indexes.sql&lt;br /&gt;*/&lt;br /&gt;&lt;br /&gt;CREATE FUNCTION pg_temp.sortarray(int2[]) returns int2[] as &amp;#39;&lt;br /&gt;  SELECT ARRAY(&lt;br /&gt;      SELECT $1[i]&lt;br /&gt;        FROM generate_series(array_lower($1, 1), array_upper($1, 1)) i&lt;br /&gt;    ORDER BY 1&lt;br /&gt;  )&lt;br /&gt;&amp;#39; language sql;&lt;br /&gt;&lt;br /&gt;  SELECT conrelid::regclass&lt;br /&gt;         ,conname&lt;br /&gt;         ,reltuples::bigint&lt;br /&gt;    FROM pg_constraint&lt;br /&gt;         JOIN pg_class ON (conrelid = pg_class.oid)&lt;br /&gt;   WHERE contype = &amp;#39;f&amp;#39;&lt;br /&gt;         AND NOT EXISTS (&lt;br /&gt;           SELECT 1&lt;br /&gt;             FROM pg_index&lt;br /&gt;            WHERE indrelid = conrelid&lt;br /&gt;                  AND pg_temp.sortarray(conkey) = pg_temp.sortarray(indkey)&lt;br /&gt;         )&lt;br /&gt;ORDER BY reltuples DESC&lt;br /&gt;;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2787250666802991949-5543417816641294144?l=mlawire.blogspot.com' alt='' /&gt;&lt;/div&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.g?blogID=2787250666802991949&amp;postID=5543417816641294144' title='0 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>mla</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</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='save youtube video'/><category scheme='http://www.blogger.com/atom/ns#' term='Technology'/><category scheme='http://www.blogger.com/atom/ns#' term='download video'/><category scheme='http://www.blogger.com/atom/ns#' term='download youtube'/><title type='text'>Linux: Download YouTube Videos</title><content type='html'>Install the youtube-dl script. With Ubuntu:&lt;br /&gt;&lt;pre class="brush:text; gutter:false"&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="brush:text; gutter:false; auto-links:false"&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="brush:text; gutter:false"&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="http://bitbucket.org/rg3/youtube-dl/wiki/Home"&gt;youtube-dl Homepage&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2787250666802991949-3129962663272700317?l=mlawire.blogspot.com' alt='' /&gt;&lt;/div&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.g?blogID=2787250666802991949&amp;postID=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>mla</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.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>2009-08-01T15:00:53.450-07:00</updated><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 with standard programs and utilities.&lt;br /&gt;&lt;pre class="brush:text; gutter:false"&gt;&lt;br /&gt;#1 expand/unexpand utilities&lt;br /&gt;expand &amp;lt; input.txt &amp;gt; output.txt&lt;br /&gt;&lt;br /&gt;#2 Sed&lt;br /&gt;sed &amp;#39;s/\t/ /g&amp;#39; &amp;lt; input.txt &amp;gt; output.txt&lt;br /&gt;&lt;br /&gt;#3 Awk&lt;br /&gt;awk &amp;#39;{ gsub(/\t/, &amp;quot;  &amp;quot;); print }&amp;#39; &amp;lt; input.txt &amp;gt; output.txt&lt;br /&gt;&lt;br /&gt;#4 Perl&lt;br /&gt;perl -pe &amp;#39;s/\t/  /g&amp;#39; &amp;lt; input.txt &amp;gt; output.txt&lt;br /&gt;&lt;br /&gt;#5 Ruby&lt;br /&gt;ruby -pe &amp;#39;$_.gsub!(/\t/, &amp;quot;  &amp;quot;)&amp;#39; &amp;lt; input.txt &amp;gt; output.txt&lt;br /&gt;&lt;br /&gt;#6a Vim editor&lt;br /&gt;:set expandtab&lt;br /&gt;:%retab! &lt;br /&gt;&lt;br /&gt;#6b Vim editor&lt;br /&gt;:%s/\t/  /g&lt;br /&gt;&lt;br /&gt;#7 Emacs editor&lt;br /&gt;Set 'indent-tabs-mode' to nil to have tabs automatically converted to spaces.&lt;br /&gt;To convert a region, "M-x untabify" will change tabs to spaces and "M-x tabify" will do the inverse.&lt;br /&gt;&lt;br /&gt;#8 cut&lt;br /&gt;cut -f1- --output-delimiter='  ' &amp;lt; input.txt &amp;gt; output.txt&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2787250666802991949-4157015133764661598?l=mlawire.blogspot.com' alt='' /&gt;&lt;/div&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.g?blogID=2787250666802991949&amp;postID=4157015133764661598' title='0 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>mla</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</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='Post HTML'/><category scheme='http://www.blogger.com/atom/ns#' term='Technology'/><category scheme='http://www.blogger.com/atom/ns#' term='HTML Literal'/><category scheme='http://www.blogger.com/atom/ns#' term='HTML Entities'/><category scheme='http://www.blogger.com/atom/ns#' term='Escape HTML'/><category scheme='http://www.blogger.com/atom/ns#' term='Encode HTML'/><category scheme='http://www.blogger.com/atom/ns#' term='HTML Entity'/><title type='text'>Web: HTML Encoder</title><content type='html'>&lt;script type="text/javascript"&gt;function $(id){ return document.getElementById(id) } var char2entity = { "'" : '&amp;#39;', '"' : '&amp;quot;',  '&lt;' : '&amp;lt;', '&gt;' : '&amp;gt;',  '&amp;' : '&amp;amp;'}; function encode_entities(str) {   var rv = '';  for (var i = 0; i &lt; str.length; i++) {    var ch = str.charAt(i);    rv += char2entity[ch] || ch;  }   return rv;} function do_encode(e){  $('dst').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="margin: 1em 0"&gt;&lt;span style="color:red; font-weight: bold"&gt;This page requires Javascript. You currently have Javascript disabled.&lt;/span&gt;&lt;br /&gt;&lt;a href="http://mail.google.com/support/bin/answer.py?hl=en&amp;amp;answer=23852"&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="width:40em; height: 10em; font-family:monospace" cols="40" rows="10" onkeyup="do_encode(this)" onchange="do_encode(this)"&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="width:40em; height: 10em; font-family:monospace" cols="40" rows="10" id="dst" onfocus="this.select()" onclick="this.select()" readonly="readonly"&gt;&lt;/textarea&gt;&lt;p&gt;The HTML encoding is performed with this Javascript function:&lt;/p&gt;&lt;pre class="brush:js"&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="http://mlawire.blogspot.com/2009/07/alias-for-quickly-encodingdecoding-html.html"&gt;handy shell function for html encoding&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Keywords: html encoding, html encoder&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2787250666802991949-7425444738705001474?l=mlawire.blogspot.com' alt='' /&gt;&lt;/div&gt;</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.g?blogID=2787250666802991949&amp;postID=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>mla</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.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='Technology'/><category scheme='http://www.blogger.com/atom/ns#' term='Multiple Instances'/><category scheme='http://www.blogger.com/atom/ns#' term='Multiple Copies'/><category scheme='http://www.blogger.com/atom/ns#' term='Multiple Profiles'/><category scheme='http://www.blogger.com/atom/ns#' term='Firefox'/><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="brush:shell; gutter:false"&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="brush:text; gutter:false"&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;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2787250666802991949-3042097464401665939?l=mlawire.blogspot.com' alt='' /&gt;&lt;/div&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.g?blogID=2787250666802991949&amp;postID=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>mla</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.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='Technology'/><category scheme='http://www.blogger.com/atom/ns#' term='HTTP::Proxy'/><category scheme='http://www.blogger.com/atom/ns#' term='Perl'/><category scheme='http://www.blogger.com/atom/ns#' term='Patch'/><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="brush:text"&gt;&lt;br /&gt;t/50hopbyhop........1/28&lt;br /&gt;# Failed test 'Hop-by-hop Foo'&lt;br /&gt;# at t/50hopbyhop.t line 38.&lt;br /&gt;# got: undef&lt;br /&gt;# expected: 'foofoo'&lt;br /&gt;&lt;br /&gt;# Failed test 'Hop-by-hop Bar'&lt;br /&gt;# at t/50hopbyhop.t line 39.&lt;br /&gt;# got: undef&lt;br /&gt;# expected: 'barbar'&lt;br /&gt;&lt;br /&gt;# Failed test 'Connection header removed'&lt;br /&gt;# at t/50hopbyhop.t line 45.&lt;br /&gt;# got: 'foofoo'&lt;br /&gt;# expected: undef&lt;br /&gt;&lt;br /&gt;# Failed test 'Connection header removed'&lt;br /&gt;# at t/50hopbyhop.t line 46.&lt;br /&gt;# got: 'barbar'&lt;br /&gt;# expected: undef&lt;br /&gt;&lt;/pre&gt;I've &lt;a href="http://rt.cpan.org/Public/Bug/Display.html?id=43249"&gt;submitted a patch&lt;/a&gt; that'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.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2787250666802991949-6868885305645882318?l=mlawire.blogspot.com' alt='' /&gt;&lt;/div&gt;</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.g?blogID=2787250666802991949&amp;postID=6868885305645882318' title='0 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>mla</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</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='Technology'/><category scheme='http://www.blogger.com/atom/ns#' term='Blogger'/><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='Exclude Visits'/><category scheme='http://www.blogger.com/atom/ns#' term='Ignore Visits'/><category scheme='http://www.blogger.com/atom/ns#' term='Blogspot'/><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 "hidden" Web page to accomplish this, but that'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="http://analytics.blogspot.com/2009/06/back-to-basics-setting-up-google.html"&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's location bar and press return/enter:&lt;br /&gt;&lt;pre class="brush:js; gutter:false"&gt;javascript:pageTracker._setVar('notrack');alert('cookie set');&lt;/pre&gt;That will set a "notrack" cookie on your browser.&lt;br /&gt;&lt;br /&gt;Finally, sign into your Google Analytics account and &lt;a href="http://www.google.com/support/googleanalytics/bin/answer.py?answer=55492"&gt;create a custom filter&lt;/a&gt; to exclude all visitors that have the "notrack" cookie set. The filter values should be:&lt;br /&gt;&lt;pre class="brush:text; gutter:false"&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'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&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2787250666802991949-3393101033763312317?l=mlawire.blogspot.com' alt='' /&gt;&lt;/div&gt;</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.g?blogID=2787250666802991949&amp;postID=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>mla</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.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='Technology'/><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='Tor'/><category scheme='http://www.blogger.com/atom/ns#' term='socks'/><category scheme='http://www.blogger.com/atom/ns#' term='proxy'/><category scheme='http://www.blogger.com/atom/ns#' term='libwww'/><title type='text'>Perl: Using LWP with a SOCKS Proxy</title><content type='html'>For this example, we'll use LWP to connect through a SOCKS proxy to the &lt;a href="http://www.torproject.org/"&gt;Tor anonymizing network&lt;/a&gt;. Under Ubuntu/Debian, installation of Tor is as simple as:&lt;br /&gt;&lt;pre class="brush:shell; gutter:false"&gt;sudo apt-get install tor&lt;/pre&gt;Next, install the LWP::Protocol::socks Perl module to add support for the "socks" scheme. Installing from CPAN:&lt;br /&gt;&lt;pre class="brush:bash; gutter:false"&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="brush:perl"&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; 'socks://localhost:9050'); # Tor proxy&lt;br /&gt;$ua-&gt;cookie_jar({});&lt;br /&gt;my $rsp = $ua-&gt;get('http://www.yahoo.com/');&lt;br /&gt;print $rsp-&gt;content;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2787250666802991949-1223750795779958422?l=mlawire.blogspot.com' alt='' /&gt;&lt;/div&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.g?blogID=2787250666802991949&amp;postID=1223750795779958422' title='7 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>mla</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>7</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='Change Window Size'/><category scheme='http://www.blogger.com/atom/ns#' term='Technology'/><category scheme='http://www.blogger.com/atom/ns#' term='Testing'/><category scheme='http://www.blogger.com/atom/ns#' term='Change Resolution'/><category scheme='http://www.blogger.com/atom/ns#' term='Resize Browser'/><category scheme='http://www.blogger.com/atom/ns#' term='Browser Dimensions'/><title type='text'>Web: Resizing the Browser Window</title><content type='html'>&lt;style type="text/css"&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="brush:js; gutter:false"&gt;javascript:resizeTo(1024, 768)&lt;/pre&gt;Enter that into your browser'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="javascript:resizeTo(1024, 768)"&gt;Resize 1024x768&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="javascript:resizeTo(1280, 800)"&gt;Resize 1280x800&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="javascript:resizeTo(1280, 1024)"&gt;Resize 1280x1024&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="javascript:resizeTo(1440, 900)"&gt;Resize 1440x900&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="javascript:resizeTo(800, 600)"&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's &lt;a href="https://addons.mozilla.org/en-US/firefox/addon/60"&gt;Web Developer Toolbar&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2787250666802991949-1851015972478469826?l=mlawire.blogspot.com' alt='' /&gt;&lt;/div&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.g?blogID=2787250666802991949&amp;postID=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>mla</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.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 "special" variables $* and $@. The following script illustrates how those values are expanded.&lt;br /&gt;&lt;pre class="brush:bash"&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 "  param $idx: $arg"&lt;br /&gt;    let idx++&lt;br /&gt;  done&lt;br /&gt;  echo&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;echo "\$* - arguments with spaces are split"&lt;br /&gt;print_arguments $*&lt;br /&gt;&lt;br /&gt;echo "\$@ - same"&lt;br /&gt;print_arguments $@&lt;br /&gt;&lt;br /&gt;echo "\"\$*\" - expands to single value"&lt;br /&gt;print_arguments "$*"&lt;br /&gt;&lt;br /&gt;echo "\"\$@\" - preserves arguments exactly as passed"&lt;br /&gt;print_arguments "$@"&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Example output:&lt;br /&gt;&lt;pre class="brush:text; gutter:false"&gt;&lt;br /&gt;$ ./test-param-expansion orange 9 "Bringing Up Baby"&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;"$*" - expands to single value&lt;br /&gt;  param 1: orange 9 Bringing Up Baby&lt;br /&gt;&lt;br /&gt;"$@" - 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 "$@" 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="brush:bash"&gt;&lt;br /&gt;#!/bin/sh&lt;br /&gt;&lt;br /&gt;# loop over all args&lt;br /&gt;for arg in "$@"; 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="http://www.gnu.org/software/bash/manual/bashref.html#Special-Parameters" target="_blank"&gt;Bash Manual: Special Parameters&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2787250666802991949-1263236539378646450?l=mlawire.blogspot.com' alt='' /&gt;&lt;/div&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.g?blogID=2787250666802991949&amp;postID=1263236539378646450' title='0 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>mla</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</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>2009-07-25T18:49:25.587-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Encrypted Loop Device'/><category scheme='http://www.blogger.com/atom/ns#' term='Technology'/><category scheme='http://www.blogger.com/atom/ns#' term='LUKS Encryption'/><category scheme='http://www.blogger.com/atom/ns#' term='Encrypted Filesystem'/><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;h4&gt;Create the Encrypted Filesystem:&lt;/h4&gt;&lt;pre class="brush:bash; gutter:false"&gt;&lt;br /&gt;# create a 10M file&lt;br /&gt;$ dd if=/dev/urandom of=testfs bs=1M count=10&lt;br /&gt;&lt;br /&gt;# associate it with the loop device&lt;br /&gt;$ losetup /dev/loop0 testfs&lt;br /&gt;&lt;br /&gt;# encrypt it (will ask for password to use)&lt;br /&gt;$ cryptsetup luksFormat /dev/loop0&lt;br /&gt;&lt;br /&gt;# open the encrypted loop device&lt;br /&gt;$ cryptsetup luksOpen /dev/loop0 testfs&lt;br /&gt;&lt;br /&gt;# format it with ext2 (or whatever you prefer)&lt;br /&gt;$ mkfs.ext2 /dev/mapper/testfs&lt;br /&gt;&lt;br /&gt;# mount it&lt;br /&gt;$ mount /dev/mapper/testfs /mnt/test&lt;br /&gt;&lt;br /&gt;# confirm mount&lt;br /&gt;$ df -h /mnt/test&lt;br /&gt;Filesystem            Size  Used Avail Use% Mounted on&lt;br /&gt;/dev/mapper/testfs    9.2M   88K  8.7M   1% /mnt/test&lt;br /&gt;&lt;/pre&gt;&lt;h4&gt;Unmount the Filesystem:&lt;/h4&gt;&lt;pre class="brush:bash; gutter:false"&gt;&lt;br /&gt;# unmount it&lt;br /&gt;$ umount /mnt/test&lt;br /&gt;&lt;br /&gt;# close encryption&lt;br /&gt;$ cryptsetup luksClose /dev/mapper/testfs&lt;br /&gt;&lt;br /&gt;# release loop device&lt;br /&gt;$ losetup -d /dev/loop0&lt;br /&gt;&lt;/pre&gt;&lt;h4&gt;Mount an Encrypted Filesystem:&lt;/h4&gt;&lt;pre class="brush:bash; gutter:false"&gt;&lt;br /&gt;# associate file with the loop device&lt;br /&gt;$ losetup /dev/loop0 testfs&lt;br /&gt;&lt;br /&gt;# open the encrypted loop device&lt;br /&gt;$ cryptsetup luksOpen /dev/loop0 testfs&lt;br /&gt;&lt;br /&gt;# mount it&lt;br /&gt;$ mount /dev/mapper/testfs /mnt/test&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2787250666802991949-7870580306386756027?l=mlawire.blogspot.com' alt='' /&gt;&lt;/div&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.g?blogID=2787250666802991949&amp;postID=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>mla</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.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='Technology'/><category scheme='http://www.blogger.com/atom/ns#' term='Escape URL'/><category scheme='http://www.blogger.com/atom/ns#' term='Decode Parameter'/><category scheme='http://www.blogger.com/atom/ns#' term='Escape Parameter'/><category scheme='http://www.blogger.com/atom/ns#' term='Encode URL'/><category scheme='http://www.blogger.com/atom/ns#' term='Unescape Parameter'/><category scheme='http://www.blogger.com/atom/ns#' term='Encode Parameter'/><category scheme='http://www.blogger.com/atom/ns#' term='Query 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="brush:bash; gutter:false"&gt;&lt;br /&gt;alias urlencode="perl -MURI::Escape -ple '\$_=uri_escape(\$_); s/%20/+/g'"&lt;br /&gt;alias urldecode="perl -MURI::Escape -ple '\$_=uri_unescape(\$_); s/\+/ /'"&lt;br /&gt;&lt;/pre&gt;To escape/encode all unsafe characters in a query parameter:&lt;br /&gt;&lt;pre class="brush:bash; gutter:false"&gt;&lt;br /&gt;$ echo "blue socks?" | 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="brush:bash; gutter:false"&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.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2787250666802991949-3613630061935473156?l=mlawire.blogspot.com' alt='' /&gt;&lt;/div&gt;</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.g?blogID=2787250666802991949&amp;postID=3613630061935473156' title='0 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>mla</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</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='Shell Function'/><category scheme='http://www.blogger.com/atom/ns#' term='Technology'/><category scheme='http://www.blogger.com/atom/ns#' term='Secure Password'/><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='Bash'/><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="brush:bash; gutter:false"&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="brush:bash; gutter:false"&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="brush:bash; gutter:false"&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;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2787250666802991949-367427646587737392?l=mlawire.blogspot.com' alt='' /&gt;&lt;/div&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.g?blogID=2787250666802991949&amp;postID=367427646587737392' title='2 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>mla</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</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='Technology'/><category scheme='http://www.blogger.com/atom/ns#' term='Blogger'/><category scheme='http://www.blogger.com/atom/ns#' term='Syntax Highlighting'/><title type='text'>Blogger Syntax Highlighting</title><content type='html'>How to add syntax highlighting to Blogger with &lt;a href="http://alexgorbatchev.com/wiki/SyntaxHighlighter"&gt;Alex Gorbatchev's open-source SyntaxHighlighter&lt;/a&gt;.&lt;ul&gt;&lt;li&gt;Log into your blogspot account, select the "Layout" tab, and then click "Edit HTML."&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Click "Download Full Template" 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="brush:xml"&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 "add brushes here," add the languages you plan to use. For example, I'm using brushes for Javascript, Bash, SQL, XML/HTML, and C++:&lt;br /&gt;&lt;pre class="brush:xml"&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="http://alexgorbatchev.com/wiki/SyntaxHighlighter:Brushes" target="_blank"&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="brush:sql"&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's how that looks when rendered:&lt;br /&gt;&lt;pre class="brush:sql"&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're formatting should be &lt;a href="http://mlawire.blogspot.com/2009/07/html-encoder-encode-html-entities.html"&gt;HTML encoded&lt;/a&gt; first. Also note that the Blogger preview won't show the formatting; you'll need to either go ahead and publish it or post it to a test blog first.&lt;br /&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2787250666802991949-212257739096729030?l=mlawire.blogspot.com' alt='' /&gt;&lt;/div&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.g?blogID=2787250666802991949&amp;postID=212257739096729030' title='16 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>mla</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>16</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='Technology'/><category scheme='http://www.blogger.com/atom/ns#' term='Syntax Highlighting'/><category scheme='http://www.blogger.com/atom/ns#' term='Code Highlighting'/><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="http://alexgorbatchev.com/wiki/SyntaxHighlighter"&gt;SyntaxHighlighter&lt;/a&gt; by Alex Gorbatchev. See the instructions on &lt;a href="http://mlawire.blogspot.com/2009/07/blogger-syntax-highlighting.html"&gt;configuring syntax highlighting with Blogger&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2787250666802991949-577782393823611721?l=mlawire.blogspot.com' alt='' /&gt;&lt;/div&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.g?blogID=2787250666802991949&amp;postID=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>mla</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.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='Encoding HTML'/><category scheme='http://www.blogger.com/atom/ns#' term='Technology'/><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='Escape HTML'/><category scheme='http://www.blogger.com/atom/ns#' term='Encode HTML'/><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="brush:bash; gutter:false"&gt;&lt;br /&gt;alias htmlencode="perl -MHTML::Entities -pe 'encode_entities(\$_)'"&lt;br /&gt;alias htmldecode="perl -MHTML::Entities -pe 'decode_entities(\$_)'"&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="brush:bash; gutter:false"&gt;&lt;br /&gt;$ echo "This is &amp;lt;b&amp;gt;bold&amp;lt;/b&amp;gt;" | 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="brush:bash; gutter:false"&gt;&lt;br /&gt;$ echo "This is &amp;amp;lt;b&amp;amp;gt;bold&amp;amp;lt;/b&amp;amp;gt;" | 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="http://mlawire.blogspot.com/2009/07/html-encoder-encode-html-entities.html"&gt;Web-based HTML encoder&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2787250666802991949-5711624975975475367?l=mlawire.blogspot.com' alt='' /&gt;&lt;/div&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.g?blogID=2787250666802991949&amp;postID=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>mla</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.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='Technology'/><category scheme='http://www.blogger.com/atom/ns#' term='Trim Spaces'/><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='Trim Whitespace'/><category scheme='http://www.blogger.com/atom/ns#' term='Strip 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="brush:cpp"&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="brush:cpp"&gt;&lt;br /&gt;#include "btrim.hpp"&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="brush:cpp"&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 "btrim.hpp"&lt;br /&gt;&lt;br /&gt;using namespace std;&lt;br /&gt;&lt;br /&gt;int main () {&lt;br /&gt;  string s = "   zort   ";&lt;br /&gt;  btrim(s); /* trim spaces, both leading and trailing */&lt;br /&gt;  cout &lt;&lt; "Trimmed string: |" &lt;&lt; s &lt;&lt; "|" &lt;&lt; endl;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2787250666802991949-5932710928801125854?l=mlawire.blogspot.com' alt='' /&gt;&lt;/div&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.g?blogID=2787250666802991949&amp;postID=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>mla</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2787250666802991949.post-8996419567370693715</id><published>2009-07-04T14:00:00.000-07:00</published><updated>2009-07-14T12:31:35.859-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Technology'/><category scheme='http://www.blogger.com/atom/ns#' term='SSH Tunnel'/><category scheme='http://www.blogger.com/atom/ns#' term='FreeNX'/><title type='text'>SSH Tunnel with FreeNX</title><content type='html'>To use FreeNX to access a machine that's behind a firewall, you can tunnel an SSH connection:&lt;br /&gt;&lt;pre class="brush:bash; gutter:false"&gt;ssh -L 2222:desktop:22 user@firewall&lt;/pre&gt;Configure FreeNX to connect to port 2222 on localhost, and log in as normal.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2787250666802991949-8996419567370693715?l=mlawire.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mlawire.blogspot.com/feeds/8996419567370693715/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2787250666802991949&amp;postID=8996419567370693715' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2787250666802991949/posts/default/8996419567370693715'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2787250666802991949/posts/default/8996419567370693715'/><link rel='alternate' type='text/html' href='http://mlawire.blogspot.com/2009/07/ssh-tunnel-with-freenx.html' title='SSH Tunnel with FreeNX'/><author><name>mla</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2787250666802991949.post-6181193260966673850</id><published>2009-06-28T22:25:00.000-07:00</published><updated>2009-07-21T16:13:54.084-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Technology'/><category scheme='http://www.blogger.com/atom/ns#' term='VNC'/><category scheme='http://www.blogger.com/atom/ns#' term='Mac'/><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><category scheme='http://www.blogger.com/atom/ns#' term='Windows'/><category scheme='http://www.blogger.com/atom/ns#' term='FreeNX'/><category scheme='http://www.blogger.com/atom/ns#' term='Remote Desktop'/><title type='text'>Access Linux From Windows with FreeNX</title><content type='html'>FreeNX is a cross-platform remote desktop application. It's similar to VNC but is faster and leverages SSH for security. Installation on Ubuntu is simple (I'm using Jaunty).&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Edit /etc/apt/sources.list and add the FreeNX repository:&lt;br /&gt;&lt;pre class="brush:bash"&gt;&lt;br /&gt;# Ubuntu FreeNX Repository for Jaunty&lt;br /&gt;# sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 2a8e3034d018a4ce&lt;br /&gt;deb http://ppa.launchpad.net/freenx-team/ppa/ubuntu jaunty main&lt;br /&gt;deb-src http://ppa.launchpad.net/freenx-team/ppa/ubuntu jaunty main&lt;br /&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;Update your packages list: &lt;code&gt;sudo apt-get update&lt;/code&gt;&lt;/li&gt;&lt;li&gt;Install the FreeNX server: &lt;code&gt;sudo apt-get install freenx-server&lt;/code&gt;&lt;/li&gt;&lt;li&gt;Install the appropriate &lt;a href="http://www.nomachine.com/download.php"&gt;FreeNX client software&lt;/a&gt; for Windows or Mac, and try logging into your Linux machine remotely.&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2787250666802991949-6181193260966673850?l=mlawire.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mlawire.blogspot.com/feeds/6181193260966673850/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2787250666802991949&amp;postID=6181193260966673850' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2787250666802991949/posts/default/6181193260966673850'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2787250666802991949/posts/default/6181193260966673850'/><link rel='alternate' type='text/html' href='http://mlawire.blogspot.com/2009/06/access-linux-from-windows-with-freenx.html' title='Access Linux From Windows with FreeNX'/><author><name>mla</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2787250666802991949.post-1167731744316578377</id><published>2008-12-28T14:55:00.000-08:00</published><updated>2009-08-04T21:02:17.641-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='monitor calibration'/><category scheme='http://www.blogger.com/atom/ns#' term='Technology'/><category scheme='http://www.blogger.com/atom/ns#' term='Dell 2408WFP'/><title type='text'>Dell 2408WFP Calibration Settings</title><content type='html'>Recommended settings for the Dell 2408WFP monitor:&lt;br /&gt;&lt;br /&gt;Color Model: AdobeRGB (not sRGB)&lt;br /&gt;Brightness: 7-8&lt;br /&gt;Contrast: 50%&lt;br /&gt;R = 96, G = 92, B = 100&lt;br /&gt;&lt;br /&gt;Values taken from these &lt;a href="http://monitortest.blogspot.com/"&gt;calibration results&lt;/a&gt;. The author notes "this is by no means a universal recipe as models vary," but I don't have the equipment to run my own tests and these settings look excellent to me.&lt;br /&gt;&lt;br /&gt;If you want to calibrate the monitor yourself, see &lt;a href="http://simplestation.com/locomotion/calibrating-a-dell-2408wfp-with-spyder-elite-3/"&gt;calibrating a Dell 2408WFP with Spyder Elite 3&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2787250666802991949-1167731744316578377?l=mlawire.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mlawire.blogspot.com/feeds/1167731744316578377/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2787250666802991949&amp;postID=1167731744316578377' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2787250666802991949/posts/default/1167731744316578377'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2787250666802991949/posts/default/1167731744316578377'/><link rel='alternate' type='text/html' href='http://mlawire.blogspot.com/2008/12/dell-2408wfp-calibration-settings.html' title='Dell 2408WFP Calibration Settings'/><author><name>mla</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2787250666802991949.post-5784160559295936382</id><published>2007-11-14T02:16:00.000-08:00</published><updated>2009-06-28T23:27:41.497-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Muhlenkamp'/><category scheme='http://www.blogger.com/atom/ns#' term='Economics'/><category scheme='http://www.blogger.com/atom/ns#' term='MUHLX'/><title type='text'>Muhlenkamp (MUHLX) Conference Call</title><content type='html'>Listen to the &lt;a href="http://www.muhlenkamp.com/fund/investor%20conference%20calls/20071018/Advisor%20Call%202007_10_18.mp3"&gt;Muhlenkamp October 18, 2007 Advisers Conference Call&lt;/a&gt; (in mp3 format).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2787250666802991949-5784160559295936382?l=mlawire.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mlawire.blogspot.com/feeds/5784160559295936382/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2787250666802991949&amp;postID=5784160559295936382' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2787250666802991949/posts/default/5784160559295936382'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2787250666802991949/posts/default/5784160559295936382'/><link rel='alternate' type='text/html' href='http://mlawire.blogspot.com/2007/11/muhlenkamp-muhlx-conference-call.html' title='Muhlenkamp (MUHLX) Conference Call'/><author><name>mla</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2787250666802991949.post-2430416095727950878</id><published>2007-08-20T13:29:00.000-07:00</published><updated>2009-06-28T23:28:00.733-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Technology'/><category scheme='http://www.blogger.com/atom/ns#' term='iconv'/><category scheme='http://www.blogger.com/atom/ns#' term='Database'/><category scheme='http://www.blogger.com/atom/ns#' term='Postgresql'/><title type='text'>iconv: file too large</title><content type='html'>The iconv utility is used to convert file encodings. I'm using it to convert a Postgresql database from LATIN1 to UTF8.&lt;br /&gt;&lt;br /&gt;However, the standard iconv program slurps the entire file into memory, which doesn't work for large data sets (such as database exports). You'll see errors like:&lt;br /&gt;&lt;br /&gt; &lt;code&gt;iconv: unable to allocate buffer for input: Cannot allocate memory&lt;br /&gt; iconv: cannot open input file `database.txt': File too large&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;This script is just a wrapper that processes the input file in manageable chunks and writes it to standard output: &lt;a href="http://maurice.aubrey.googlepages.com/iconv-chunks.txt"&gt;iconv-chunks&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2787250666802991949-2430416095727950878?l=mlawire.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mlawire.blogspot.com/feeds/2430416095727950878/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2787250666802991949&amp;postID=2430416095727950878' title='8 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2787250666802991949/posts/default/2430416095727950878'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2787250666802991949/posts/default/2430416095727950878'/><link rel='alternate' type='text/html' href='http://mlawire.blogspot.com/2007/08/iconv-file-too-large.html' title='iconv: file too large'/><author><name>mla</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>8</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2787250666802991949.post-7777394654756210252</id><published>2007-04-29T20:50:00.000-07:00</published><updated>2009-06-28T23:28:59.331-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Q-Ratio'/><category scheme='http://www.blogger.com/atom/ns#' term='Economics'/><category scheme='http://www.blogger.com/atom/ns#' term='Stock Market Valuation'/><category scheme='http://www.blogger.com/atom/ns#' term='Q'/><category scheme='http://www.blogger.com/atom/ns#' term='Tobin&apos;s Q'/><title type='text'>The Q-Ratio</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_gUHtQFbTst0/Rt-iucIvFjI/AAAAAAAAAAU/oBob5uQbMDw/s1600-h/q-ratio-vs-avg.png"&gt;&lt;img style="display: block; text-align: center; cursor: pointer;" src="http://2.bp.blogspot.com/_gUHtQFbTst0/Rt-iucIvFjI/AAAAAAAAAAU/oBob5uQbMDw/s400/q-ratio-vs-avg.png" alt="" id="BLOGGER_PHOTO_ID_5106979421171947058" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;The q-ratio is a method of estimating the fair value of the stock market, and is argued for in the book &lt;a href="http://www.valuingwallstreet.com/"&gt;Valuing Wall Street&lt;/a&gt;, by Andrew Smithers and Stephen Wright.&lt;br /&gt;&lt;br /&gt;They indicate that the data need for Q from 1952 onward is in the Z1 Flow of Funds report from the Federal Reserve. I'm trying to &lt;a href="http://mla.homeunix.com/q-ratio/"&gt;independently recreate the graphs from that source&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2787250666802991949-7777394654756210252?l=mlawire.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mlawire.blogspot.com/feeds/7777394654756210252/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2787250666802991949&amp;postID=7777394654756210252' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2787250666802991949/posts/default/7777394654756210252'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2787250666802991949/posts/default/7777394654756210252'/><link rel='alternate' type='text/html' href='http://mlawire.blogspot.com/2007/04/q-ratio.html' title='The Q-Ratio'/><author><name>mla</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_gUHtQFbTst0/Rt-iucIvFjI/AAAAAAAAAAU/oBob5uQbMDw/s72-c/q-ratio-vs-avg.png' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2787250666802991949.post-8206525432148086620</id><published>2007-04-26T21:10:00.000-07:00</published><updated>2009-06-28T23:29:13.087-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Technology'/><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><category scheme='http://www.blogger.com/atom/ns#' term='Ubuntu'/><title type='text'>Favorite Ubuntu Linux Tips</title><content type='html'>&lt;ul&gt;&lt;li&gt;&lt;a href="http://ubuntuforums.org/showthread.php?t=25685" target="_blank"&gt;Inline/embed PDFs in Firefox&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;To view PDFs, Firefox normally runs Acroread as an external helper application. Use this to display them directly in the browser window instead.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;img style="border: medium none ; float: right;" src="http://2.bp.blogspot.com/_gUHtQFbTst0/Seq3FTdkeeI/AAAAAAAAACo/Oy41OKX3X7A/s400/icon-ubuntu.png" alt="" border="0" /&gt;&lt;a href="http://lifehacker.com/software/ubuntu/hack-attack-top-10-ubuntu-apps-and-tweaks-195437.php" target="_blank"&gt;Lifehacker - Top Ten Ubuntu Apps and Tweaks&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2787250666802991949-8206525432148086620?l=mlawire.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mlawire.blogspot.com/feeds/8206525432148086620/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2787250666802991949&amp;postID=8206525432148086620' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2787250666802991949/posts/default/8206525432148086620'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2787250666802991949/posts/default/8206525432148086620'/><link rel='alternate' type='text/html' href='http://mlawire.blogspot.com/2007/04/favorite-ubuntu-linux-tips.html' title='Favorite Ubuntu Linux Tips'/><author><name>mla</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_gUHtQFbTst0/Seq3FTdkeeI/AAAAAAAAACo/Oy41OKX3X7A/s72-c/icon-ubuntu.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2787250666802991949.post-8360050262917224985</id><published>2007-04-22T00:11:00.000-07:00</published><updated>2009-06-28T23:29:53.112-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='LMOPX'/><category scheme='http://www.blogger.com/atom/ns#' term='Economics'/><category scheme='http://www.blogger.com/atom/ns#' term='LMVTX'/><category scheme='http://www.blogger.com/atom/ns#' term='Legg Mason'/><title type='text'>Moving Back to Legg Mason</title><content type='html'>I've been a longtime shareholder of several Legg Mason funds. In 2005, Legg Mason &lt;a href="http://www.washingtonpost.com/wp-dyn/content/article/2005/06/24/AR2005062401804.html"&gt;sold their brokerage operation to Smith Barney&lt;/a&gt; (Citigroup) and my account was transferred.&lt;br /&gt;&lt;br /&gt;I've been very disappointed with Smith Barney. Their account fees are much higher ($50/year for taxable accounts, $40/year for IRAs). You can access your account through their website but in order to actually do anything (e.g., sell or buy funds) you need an "FMA Account," which costs extra. They're even taking a cut of reinvested dividends and capital gains now. In short, Smith Barney nickels and dimes you for everything and provides no value.&lt;br /&gt;&lt;br /&gt;But...I thought I didn't have any options. Unlike most funds, you can't buy Legg Mason funds through most brokers, so I couldn't just transfer the accounts to a different firm. I could liquidate, but I really didn't want to do that.&lt;br /&gt;&lt;br /&gt;Turns out there is another option though: you can transfer your account right back to Legg Mason! Maybe I missed it, but they didn't seem to advertise that option very prominently.&lt;br /&gt;&lt;br /&gt;In order to do the transfer you need to complete a new account application (either the "Retail" or "IRA" form as appropriate), and then the "Direct Transfer" form:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.leggmason.com/individualinvestors/resources/manage-existing-account.aspx"&gt;Legg Mason Transfer Forms &amp;raquo;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Legg Mason has no fees except for the typical IRA custodial fee ($10/year), and it looks like you can actually buy and sell through the Legg Mason website.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2787250666802991949-8360050262917224985?l=mlawire.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mlawire.blogspot.com/feeds/8360050262917224985/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2787250666802991949&amp;postID=8360050262917224985' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2787250666802991949/posts/default/8360050262917224985'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2787250666802991949/posts/default/8360050262917224985'/><link rel='alternate' type='text/html' href='http://mlawire.blogspot.com/2007/04/moving-back-to-legg-mason.html' title='Moving Back to Legg Mason'/><author><name>mla</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2787250666802991949.post-4731769945164363900</id><published>2007-01-13T16:01:00.001-08:00</published><updated>2009-07-20T14:11:18.793-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Technology'/><category scheme='http://www.blogger.com/atom/ns#' term='Blogger'/><category scheme='http://www.blogger.com/atom/ns#' term='Table Formatting'/><category scheme='http://www.blogger.com/atom/ns#' term='Blogspot'/><title type='text'>Table Formatting in Blogger</title><content type='html'>&lt;style type="text/css"&gt;.nobr br { display: none }&lt;/style&gt;I'm pretty new to Blogger but one of the first snags I hit was with formatting tables due to the way Blogger automatically inserts line breaks. You can disable that behavior under Settings but it's a global option so it affects all posts. Another option is to write your tables without line breaks, but that's a maintenance problem.&lt;br /&gt;&lt;br /&gt;Here's another approach that works (tested with Firefox 1.5 and IE 6; anyone have other browser results?). At the top of your post add this:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&amp;lt;style type=&amp;quot;text/css&amp;quot;&amp;gt;.nobr br { display: none }&amp;lt;/style&amp;gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Then place your table within that class:&lt;br /&gt;&lt;code&gt;&lt;pre&gt;&amp;lt;div class=&amp;quot;nobr&amp;quot;&amp;gt;&lt;br /&gt;&amp;lt;table border=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;  &amp;lt;tr&amp;gt;&lt;br /&gt;    &amp;lt;td&amp;gt;GOOG&amp;lt;/td&amp;gt;&lt;br /&gt;    &amp;lt;td&amp;gt;505.00&amp;lt;/td&amp;gt;&lt;br /&gt;    &amp;lt;td&amp;gt;2006-01-12&amp;lt;/td&amp;gt;&lt;br /&gt;  &amp;lt;/tr&amp;gt;&lt;br /&gt;  &amp;lt;tr&amp;gt;&lt;br /&gt;    &amp;lt;td&amp;gt;BRK-A&amp;lt;/td&amp;gt;&lt;br /&gt;    &amp;lt;td&amp;gt;110,000.00&amp;lt;/td&amp;gt;&lt;br /&gt;    &amp;lt;td&amp;gt;2006-01-12&amp;lt;/td&amp;gt;&lt;br /&gt;  &amp;lt;/tr&amp;gt;&lt;br /&gt;&amp;lt;/table&amp;gt;&lt;br /&gt;&amp;lt;/div&amp;gt;&lt;/pre&gt;&lt;/code&gt;That has the effect of turning off the display of the Blogger-generated line breaks within the div, causing the table to be rendered properly.&lt;br /&gt;&lt;br /&gt;Here's how that table looks in your browser:&lt;br /&gt;&lt;br /&gt;&lt;div class="nobr"&gt;&lt;br /&gt;&lt;table border="1"&gt;&lt;br /&gt;  &lt;tr&gt;&lt;br /&gt;    &lt;td&gt;GOOG&lt;/td&gt;&lt;br /&gt;    &lt;td&gt;505.00&lt;/td&gt;&lt;br /&gt;    &lt;td&gt;2006-01-12&lt;/td&gt;&lt;br /&gt;  &lt;/tr&gt;&lt;br /&gt;  &lt;tr&gt;&lt;br /&gt;    &lt;td&gt;BRK-A&lt;/td&gt;&lt;br /&gt;    &lt;td&gt;110,000.00&lt;/td&gt;&lt;br /&gt;    &lt;td&gt;2006-01-12&lt;/td&gt;&lt;br /&gt;  &lt;/tr&gt;&lt;br /&gt;&lt;/table&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;I think it should be possible to move the CSS declaration into the template so you don't have to repeat it in each post.&lt;br /&gt;&lt;br /&gt;&lt;i&gt;Note from reader &lt;a href="http://blog.retire45.com/"&gt;S.B.&lt;/a&gt;:&lt;/i&gt;&lt;br /&gt;&lt;blockquote&gt;Unfortunately, both the "Compose" and "Preview" views of a post still render incorrectly, but when you actually publish, the table does come out right!&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2787250666802991949-4731769945164363900?l=mlawire.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mlawire.blogspot.com/feeds/4731769945164363900/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2787250666802991949&amp;postID=4731769945164363900' title='38 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2787250666802991949/posts/default/4731769945164363900'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2787250666802991949/posts/default/4731769945164363900'/><link rel='alternate' type='text/html' href='http://mlawire.blogspot.com/2007/01/table-formatting-in-blogger.html' title='Table Formatting in Blogger'/><author><name>mla</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>38</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2787250666802991949.post-1381979364987031112</id><published>2007-01-07T01:19:00.000-08:00</published><updated>2009-06-28T23:30:41.469-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Technology'/><category scheme='http://www.blogger.com/atom/ns#' term='Database'/><category scheme='http://www.blogger.com/atom/ns#' term='Postgresql'/><title type='text'>Postgresql Performance Tips for Data Loads</title><content type='html'>&lt;ul&gt;&lt;br /&gt;  &lt;li&gt;Turn off fsync in postgresql.conf. This can make a huge difference.&lt;/li&gt;&lt;br /&gt;  &lt;li&gt;Temporarily disable triggers.&lt;br /&gt;&lt;br /&gt;      &lt;a href="http://www.postgresql.org/docs/8.2/interactive/sql-altertable.html" target="_blank"&gt;Postgresql 8.x supports an ALTER statement:&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;      &lt;code&gt;ALTER TABLE foo DISABLE TRIGGER ALL;&lt;/code&gt;&lt;br /&gt;      &lt;code&gt;ALTER TABLE foo ENABLE TRIGGER ALL;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;      With Postgresql 7.x you need to modify the system tables directly:&lt;br /&gt;      &lt;code&gt;&lt;pre&gt;UPDATE pg_class&lt;br /&gt;   SET reltriggers = 0&lt;br /&gt; WHERE relname = 'foo';&lt;/pre&gt;&lt;/code&gt;To re-enable:&lt;br /&gt;      &lt;code&gt;&lt;pre&gt;UPDATE pg_class&lt;br /&gt;   SET reltriggers = (&lt;br /&gt;         SELECT count(*)&lt;br /&gt;           FROM pg_trigger&lt;br /&gt;          WHERE pg_class.oid = tgrelid&lt;br /&gt;       )&lt;br /&gt; WHERE relname = 'foo';&lt;/pre&gt;&lt;/code&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.postgresql.org/docs/8.2/interactive/populate.html" target="_blank"&gt;Postgresql docs on efficient data loads&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2787250666802991949-1381979364987031112?l=mlawire.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mlawire.blogspot.com/feeds/1381979364987031112/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2787250666802991949&amp;postID=1381979364987031112' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2787250666802991949/posts/default/1381979364987031112'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2787250666802991949/posts/default/1381979364987031112'/><link rel='alternate' type='text/html' href='http://mlawire.blogspot.com/2007/01/postgresql-performance-tips-for-data.html' title='Postgresql Performance Tips for Data Loads'/><author><name>mla</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2787250666802991949.post-4772238828801409462</id><published>2007-01-06T14:48:00.000-08:00</published><updated>2009-06-28T23:31:08.850-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Technology'/><category scheme='http://www.blogger.com/atom/ns#' term='Database'/><category scheme='http://www.blogger.com/atom/ns#' term='Postgresql'/><title type='text'>Creating a Postgresql Development Database</title><content type='html'>&lt;span style="font-style: italic;"&gt;Notes on how to restore a Pg database for a dev environment to make it simple to create additional copies or revert back to the production schema.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Drop and restore your db from a recent backup. Include a datestamp in the database name to keep track of the version you're restoring from. The specifics of this commands will vary depending on your permissions, backup method, etc.&lt;br /&gt;&lt;code&gt;&lt;br /&gt;$ dropdb mydevdb_20070106&lt;br /&gt;$ createdb -U postgres -E LATIN1 mydevdb_20070106&lt;br /&gt;$ pg_restore -U postgres -d mydevdb_20070106 ~/db-backup.2007-01-06&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;If you're restoring from production data, be sure to munge it at this point to remove all valuable/sensitive information, and delete the backup file so your dev environment isn't a target.&lt;br /&gt;&lt;br /&gt;Now with this restored version of the database you can create any number of additional copies to actually work on. Leave the initial restore untouched  so you can always revert back to it.&lt;br /&gt;&lt;code&gt;&lt;br /&gt;$ psql mydevdb_20070106&lt;br /&gt;mydevdb_20070106=# CREATE DATABASE mydevdb WITH TEMPLATE mydevdb_20070106;&lt;br /&gt;CREATE DATABASE&lt;br /&gt;mydevdb_20070106=# CREATE DATABASE toms_devdb WITH TEMPLATE mydevdb_20070106;&lt;br /&gt;CREATE DATABASE&lt;br /&gt;&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2787250666802991949-4772238828801409462?l=mlawire.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mlawire.blogspot.com/feeds/4772238828801409462/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2787250666802991949&amp;postID=4772238828801409462' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2787250666802991949/posts/default/4772238828801409462'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2787250666802991949/posts/default/4772238828801409462'/><link rel='alternate' type='text/html' href='http://mlawire.blogspot.com/2007/01/creating-postgresql-development.html' title='Creating a Postgresql Development Database'/><author><name>mla</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
