<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>jaredrobinson.com &#187; Programming</title>
	<atom:link href="http://jaredrobinson.com/blog/category/programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://jaredrobinson.com/blog</link>
	<description></description>
	<lastBuildDate>Wed, 25 Apr 2012 04:12:28 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Key stretching</title>
		<link>http://jaredrobinson.com/blog/key-stretching/</link>
		<comments>http://jaredrobinson.com/blog/key-stretching/#comments</comments>
		<pubDate>Mon, 27 Feb 2012 22:17:40 +0000</pubDate>
		<dc:creator>Jared</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tech]]></category>

		<guid isPermaLink="false">http://jaredrobinson.com/blog/?p=757</guid>
		<description><![CDATA[Last October, I learned about &#8220;key stretching&#8221; from Solar Designer&#8217;s &#8220;How to manage a PHP application&#8217;s users and passwords&#8221; &#8212; a concept that is applicable well beyond PHP. Combined with salting, it is effective at slowing down brute forcing attacks, &#8230; <a href="http://jaredrobinson.com/blog/key-stretching/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Last October, I learned about &#8220;key stretching&#8221; from Solar Designer&#8217;s &#8220;<a href="http://www.openwall.com/articles/PHP-Users-Passwords">How to manage a PHP application&#8217;s users and passwords</a>&#8221; &#8212; a concept that is applicable well beyond PHP. Combined with salting, it is effective at slowing down brute forcing attacks, and even against rainbow tables.</p>
]]></content:encoded>
			<wfw:commentRss>http://jaredrobinson.com/blog/key-stretching/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>When CTRL-C in gdb shuts down a program insted of interrupting it</title>
		<link>http://jaredrobinson.com/blog/when-ctrl-c-in-gdb-shuts-down-a-program-insted-of-interrupting-it/</link>
		<comments>http://jaredrobinson.com/blog/when-ctrl-c-in-gdb-shuts-down-a-program-insted-of-interrupting-it/#comments</comments>
		<pubDate>Mon, 27 Feb 2012 22:15:08 +0000</pubDate>
		<dc:creator>Jared</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tech]]></category>

		<guid isPermaLink="false">http://jaredrobinson.com/blog/?p=733</guid>
		<description><![CDATA[According to The Linux Programming Interface, a well-behaved multi-threaded UNIX program should use sigwait() or sigwaitinfo() instead of signal() or sigaction(). A linux-only program could even use signalfd(). Unfortunately, Linux/UNIX programs using sigwait() are hard to interrupt in the debugger. &#8230; <a href="http://jaredrobinson.com/blog/when-ctrl-c-in-gdb-shuts-down-a-program-insted-of-interrupting-it/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>According to The Linux Programming Interface, a well-behaved multi-threaded UNIX program should use sigwait() or sigwaitinfo() instead of signal() or sigaction(). A linux-only program could even use signalfd().</p>

<p>Unfortunately, Linux/UNIX programs using sigwait() are hard to interrupt in the debugger. Instead of interrupting the program, it terminates the program. How does one work around this problem? See <a href="http://stackoverflow.com/questions/5857300/gdb-ctrlc-doesnt-interrupt-process-as-it-usually-does">my answer on stackoverflow</a>.</p>

<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://jaredrobinson.com/blog/when-ctrl-c-in-gdb-shuts-down-a-program-insted-of-interrupting-it/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>C++ initializer lists</title>
		<link>http://jaredrobinson.com/blog/c-initializer-lists/</link>
		<comments>http://jaredrobinson.com/blog/c-initializer-lists/#comments</comments>
		<pubDate>Sat, 11 Feb 2012 13:55:34 +0000</pubDate>
		<dc:creator>Jared</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tech]]></category>

		<guid isPermaLink="false">http://jaredrobinson.com/blog/?p=745</guid>
		<description><![CDATA[One of the cool new features in C++ is initializer lists. Here&#8217;s an example from Wikipedia: struct Object { float first; int second; }; Object scalar = {0.43f, 10}; // One Object, with first=0.43f and second=10 Object anArray[] = {{13.4f, &#8230; <a href="http://jaredrobinson.com/blog/c-initializer-lists/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>One of the cool new features in C++ is initializer lists. Here&#8217;s an <a href="http://en.wikipedia.org/wiki/C%2B%2B11#Initializer_lists">example from Wikipedia</a>:</p>

<p><code>
struct Object
{
    float first;
    int second;
};</p>

<p>Object scalar = {0.43f, 10}; // One Object, with first=0.43f and second=10
Object anArray[] = {{13.4f, 3}, {43.28f, 29}, {5.934f, 17}}; // An array of three Objects
</code></p>

<p>There&#8217;s another <a href="http://stackoverflow.com/questions/907471/c0x-initializer-list-example">example over at stackoverflow</a>. </p>

<p>IBM has published the useful <a href="http://www.ibm.com/developerworks/aix/library/au-gcc/index.html">C++0x feature support in GCC 4.5</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://jaredrobinson.com/blog/c-initializer-lists/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Autojump: Faster than &#8216;cd&#8217;</title>
		<link>http://jaredrobinson.com/blog/autojump-faster-than-cd/</link>
		<comments>http://jaredrobinson.com/blog/autojump-faster-than-cd/#comments</comments>
		<pubDate>Sun, 05 Feb 2012 04:32:50 +0000</pubDate>
		<dc:creator>Jared</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tech]]></category>

		<guid isPermaLink="false">http://jaredrobinson.com/blog/?p=734</guid>
		<description><![CDATA[Here&#8217;s a cool tool: autojump, written by Joel Schaerer (thanks, Joel). I spend much of my day as a programmer navigating around in the linux filesystem. Built-in tools like &#8216;pushd&#8217; and &#8216;popd&#8217; are nice, as are subprocesses &#8212; e.g. (cd &#8230; <a href="http://jaredrobinson.com/blog/autojump-faster-than-cd/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a cool tool: <a title="Autojump as detailed on lifehacker.com" href="http://lifehacker.com/5583546/autojump-is-a-faster-way-to-browse-your-filesystem">autojump</a>, written by Joel Schaerer (thanks, Joel). I spend much of my day as a programmer navigating around in the linux filesystem. Built-in tools like &#8216;pushd&#8217; and &#8216;popd&#8217; are nice, as are subprocesses &#8212; e.g.
<pre> (cd ~/Download &amp;&amp; wget http://somewhere.com/path/to/file)</pre>
&#8230; and when it finishes downloading, I&#8217;m still in the directory I was in before the download was started.</p>

<p>Now there&#8217;s autojump to add in to the mix. After I &#8216;cd&#8217; to various directories, later, I can type &#8216;j Down&#8217; to cd to my Downloads directory. Very convenient. I just wish it were built into every distribution of linux.</p>
]]></content:encoded>
			<wfw:commentRss>http://jaredrobinson.com/blog/autojump-faster-than-cd/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Pitfalls of verifying signed jar files</title>
		<link>http://jaredrobinson.com/blog/pitfalls-of-verifying-signed-jar-files/</link>
		<comments>http://jaredrobinson.com/blog/pitfalls-of-verifying-signed-jar-files/#comments</comments>
		<pubDate>Mon, 12 Dec 2011 17:10:31 +0000</pubDate>
		<dc:creator>Jared</dc:creator>
				<category><![CDATA[java]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tech]]></category>

		<guid isPermaLink="false">http://jaredrobinson.com/blog/?p=715</guid>
		<description><![CDATA[In the Java world, it&#8217;s possible to digitally sign a jar file using &#8216;keytool&#8217; to generate or import a digital signature, and &#8216;jarsigner&#8217; to do the signing. What isn&#8217;t so obvious is that when we use &#8216;jarsigner&#8217; to verify a &#8230; <a href="http://jaredrobinson.com/blog/pitfalls-of-verifying-signed-jar-files/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>In the Java world, it&#8217;s possible to digitally sign a jar file using &#8216;keytool&#8217; to generate or import a digital signature, and &#8216;jarsigner&#8217; to do the signing. What isn&#8217;t so obvious is that when we use &#8216;jarsigner&#8217; to verify a signed jar, it doesn&#8217;t verify that we <em>trust</em> the signature that signed the file. It simply tells us whether the contents were signed by a public key that was <em>included with the jar file</em>.</p>

<p>Surprisingly, there&#8217;s no option to tell jarsigner to check for trusted signatures.</p>

<p>In code, we can use java.util.jar.JarFile to check the validity of a jar file. By default, the constructor to JarFile says we want to check the validity. Code must then iterate through each entry in the JarFile and seek to the end of each input stream, otherwise, the integrity isn&#8217;t checked. In other words, the java.util.jar.JarFile doesn&#8217;t give us the integrity checking with a simple method call such as isValid(), and it doesn&#8217;t give us an easy way to check that we <em>trust</em> the signature that the entries were signed with.</p>

<p>Anyone, anywhere, can create their own certificate, and sign a jar file &#8212; so if we want to establish trust for a signed jar, we get to do extra work. On <a href="http://stackoverflow.com/questions/1374170/how-to-verify-a-jar-signed-with-jarsigner-programmatically">stackoverflow.com</a>, Jarek Przygódzki linked to <a href="https://svn.cs.cf.ac.uk/projects/whip/trunk/whip-core/src/main/java/org/whipplugin/data/bundle/JarVerifier.java">code that shows how</a> to check for trusted signatures.</p>

<p>I wonder why establishing trust for a signed jar isn&#8217;t easier. Could it be that signed jar files originated in the bygone era when we ran Java applets in our web browsers? Did web browsers use their certificate authority database to verify some level of trust for the signature contained in a jar file?</p>

<p>Verifying trust is a delicate issue, as demonstrated by the <a href="https://www.google.com/search?q=hacked+certificate+authorities">recently hacked certificate authorities</a> including Diginotar and Comodo. Perhaps it&#8217;s a good thing that Java&#8217;s libraries and command line tools don&#8217;t make it deceptively simple to check jar files based on certificates trusted by Certificate Authorities.</p>

<p>Still, I wish the documentation for jarsigner and JarFile would shed more light on the limits of their default verification. I&#8217;d call it &#8220;hash checking&#8221; or &#8220;integrity checking based on hashing&#8221;.</p>

<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://jaredrobinson.com/blog/pitfalls-of-verifying-signed-jar-files/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ORM Solutions for C++ and sqlite: hiberlite, SOCI</title>
		<link>http://jaredrobinson.com/blog/orm-solutions-for-c-and-sqlite-hiberlite-soci/</link>
		<comments>http://jaredrobinson.com/blog/orm-solutions-for-c-and-sqlite-hiberlite-soci/#comments</comments>
		<pubDate>Fri, 05 Aug 2011 04:23:49 +0000</pubDate>
		<dc:creator>Jared</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tech]]></category>

		<guid isPermaLink="false">http://jaredrobinson.com/blog/?p=689</guid>
		<description><![CDATA[I think SQLite is a great database for a C/C++ application to use. It sure is easy to query the data that way, without intrinsic support from the application. When the application changes, the database is still accessible via standard &#8230; <a href="http://jaredrobinson.com/blog/orm-solutions-for-c-and-sqlite-hiberlite-soci/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I think SQLite is a great database for a C/C++ application to use. It sure is easy to query the data that way, without intrinsic support from the application. When the application changes, the database is still accessible via standard sqlite clients. Yet using SQLite in an application can require a lot of repetitive code to serialize objects to and from the database, so I wondered if there are ORM solutions for C/C++. It turns out that there are. I only had to turn to <a href="http://stackoverflow.com/questions/74141/good-orm-for-c-solutions">stackoverflow.com to find the following</a> (among many):
<ol>
    <li><a href="http://code.google.com/p/hiberlite/wiki/Tutorial">Hiberlite</a></li>
    <li><a href="http://soci.sourceforge.net/">SOCI</a></li>
</ol></p>
]]></content:encoded>
			<wfw:commentRss>http://jaredrobinson.com/blog/orm-solutions-for-c-and-sqlite-hiberlite-soci/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Teriffic Linux Books</title>
		<link>http://jaredrobinson.com/blog/teriffic-linux-books/</link>
		<comments>http://jaredrobinson.com/blog/teriffic-linux-books/#comments</comments>
		<pubDate>Tue, 08 Feb 2011 15:41:28 +0000</pubDate>
		<dc:creator>Jared</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tech]]></category>

		<guid isPermaLink="false">http://jaredrobinson.com/blog/?p=653</guid>
		<description><![CDATA[One of my QA coworkers had The Linux Phrasebook sitting on his desk. I noticed it was by Scott Granneman, and immediately thought, &#8220;if it&#8217;s by him, it&#8217;s got to be good.&#8221; As I thumbed through the pages of the &#8230; <a href="http://jaredrobinson.com/blog/teriffic-linux-books/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>One of my QA coworkers had <a href="http://www.amazon.com/gp/product/0672328380/">The Linux Phrasebook</a> sitting on his desk. I noticed it was by Scott Granneman, and immediately thought, &#8220;if it&#8217;s by him, it&#8217;s got to be good.&#8221; As I thumbed through the pages of the book, I was impressed at the practical coverage of command line utilities including yum and rpm, apt and deb, etc. I highly recommend this book. It&#8217;s small so it&#8217;s easy to keep on hand.</p>

<p>For anyone wishing to write applications that take advantage of all that Linux has to offer, I recommend <a href="http://nostarch.com/tlpi">The Linux Programming Interface</a> (also available from <a href="http://www.amazon.com/Linux-Programming-Interface-System-Handbook/dp/1593272200">Amazon</a>), aka TLPI. I used to recommend Stevens&#8217; Advanced Programming in the UNIX Environment, but now I recommend TLPI because it is more comprehensive and just as readable. It&#8217;s not a small book, so a PDF makes it easier to keep on hand. I purchased my copy through the publisher, <a href="http://nostarch.com/tlpi">NoStarch</a> with the coupon code &#8220;Mamaku&#8221; that gave me 30% off and a free PDF. The order total came to $80.00, including shipping.</p>
]]></content:encoded>
			<wfw:commentRss>http://jaredrobinson.com/blog/teriffic-linux-books/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Awesome Linux profiling tools: top -H and pstack</title>
		<link>http://jaredrobinson.com/blog/awesome-linux-profiling-tools-top-h-and-pstack/</link>
		<comments>http://jaredrobinson.com/blog/awesome-linux-profiling-tools-top-h-and-pstack/#comments</comments>
		<pubDate>Tue, 28 Dec 2010 05:47:21 +0000</pubDate>
		<dc:creator>Jared</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tech]]></category>

		<guid isPermaLink="false">http://jaredrobinson.com/blog/?p=648</guid>
		<description><![CDATA[When I needed to figure out where the performance bottlenecks were in some Linux software, I found helpful answers at http://stackoverflow.com in the form of two tools: 1. naming threads in combination with &#8220;top -Hp &#60;pid&#62;&#8221; and 2. &#8220;pstack &#60;pid&#62;&#8221;. &#8230; <a href="http://jaredrobinson.com/blog/awesome-linux-profiling-tools-top-h-and-pstack/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>When I needed to figure out where the performance bottlenecks were in some Linux software, I found helpful answers at http://stackoverflow.com in the form of two tools: 1. naming threads in combination with &#8220;top -Hp &lt;pid&gt;&#8221; and 2. &#8220;pstack &lt;pid&gt;&#8221;. The first was helpful in watching which threads were consuming the most CPU. The second was useful in sampling the application over time to find the hot spots and their stack traces.
<ul>
    <li><a href="http://stackoverflow.com/questions/778085/how-to-name-a-thread-in-linux">How to</a> name a thread in Linux (or a process) &#8212; use prctl().</li>
    <li><a href="http://stackoverflow.com/questions/1777556/alternatives-to-gprof/1779343#1779343">How to</a> use stack sampling to find performance problems &#8212; use pstack.</li>
</ul></p>
]]></content:encoded>
			<wfw:commentRss>http://jaredrobinson.com/blog/awesome-linux-profiling-tools-top-h-and-pstack/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Miscellaneous Linux tips and tricks</title>
		<link>http://jaredrobinson.com/blog/miscellaneous-linux-tips-and-tricks/</link>
		<comments>http://jaredrobinson.com/blog/miscellaneous-linux-tips-and-tricks/#comments</comments>
		<pubDate>Sun, 11 Jul 2010 04:51:03 +0000</pubDate>
		<dc:creator>Jared</dc:creator>
				<category><![CDATA[Fedora]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tech]]></category>

		<guid isPermaLink="false">http://jaredrobinson.com/blog/?p=602</guid>
		<description><![CDATA[Gnome Key Bindings and IntelliJ IDEA IntelliJ IDEA key bindings conflict with Gnome&#8217;s window manager. In IDEA, I can type CTRL-B to jump to a symbol definition. Normally, I&#8217;d type CTRL-ALT-LEFTARROW to navigate back to where I had come from. &#8230; <a href="http://jaredrobinson.com/blog/miscellaneous-linux-tips-and-tricks/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><strong>Gnome Key Bindings and IntelliJ IDEA</strong></p>

<p>IntelliJ IDEA key bindings conflict with Gnome&#8217;s window manager. In IDEA, I can type CTRL-B to jump to a symbol definition. Normally, I&#8217;d type CTRL-ALT-LEFTARROW to navigate back to where I had come from. Gnome&#8217;s MetaCity intercepts that key mapping before IDEA sees it, and tries to move my desktop to the left. There are several other Gnome/Metacity key bindings that conflict with IntelliJ IDEA. Rather than remap the keys in Gnome, I found that on Fedora, I could add the Windows key to the mix, and Gnome would ignore it, and pass it along to IDEA. This means that I can type CTRL-ALT-WINDOWS-LEFTARROW to navigate backward, and so forth.</p>

<p>Unfortunately, this doesn&#8217;t work in RHEL 5 and CentOS 5. The solution is to Go to the Gnome menu bar and select System > Preferences > Keyboard (not Keyboard Shortcuts). Then select the &#8220;Layout Options&#8221; tab, and expand the &#8220;Alt/Win key behavior&#8221;. Then I select &#8220;Super is mapped to the Win-keys&#8221;.</p>

<p>Every time I log in after that, Gnome tells me that my X keyboard settings conflict with my Gnome Keyboard settings, and it asks which I want to use. Selecting the Gnome settings is what I want.</p>

<p><strong>Bandwidth limiting downloads with &#8216;curl&#8217; or &#8216;wget&#8217;</strong></p>

<p>When downloading a large file, it&#8217;s nice to be polite to others on the network, so I use the <code>--limit-rate</code> option for curl and wget:</p>

<ul>
<li><code>curl -O --limit-rate 20k http://server.com/linux.iso</code></li>
<li><code>wget --limit-rate=20k http://server.com/linux.iso</code></li>
</ul>

<p><strong>GDB TUI (text user interface)</strong></p>

<p>After starting gdb, it&#8217;s possible to switch to its text user interface with CTRL-X, CTRL-A. Typing it a second time exits TUI mode.</p>

<p><strong>Vim C++ Auto completion with ctags</strong></p>

<p>I appreciate full blown IDEs in Linux, but I like the quick start up time of vim. Until recently though, I didn&#8217;t have C++ auto completion (also known as vim omni completion). </p>

<p>This got me up and running, and was a great resource:
<a href="http://vim.wikia.com/wiki/C%2B%2B_code_completion">http://vim.wikia.com/wiki/C%2B%2B<em>code</em>completion</a></p>

<p>This would have been useful if I was a new comer to vim and ctags:
<a href="http://www.justlinux.com/nhf/Programming/Introduction_to_C_Programming.html">http://www.justlinux.com/nhf/Programming/Introduction<em>to</em>C_Programming.html</a></p>

<p><strong>xdg-open, gnome-open, start, cygstart</strong></p>

<p>How to easily open files and URLs from the command line
<a href="http://www.dwheeler.com/essays/open-files-urls.html">http://www.dwheeler.com/essays/open-files-urls.html</a></p>

<ul>
    <li>Linux: <code>xdg-open filename_or_URL</code></li>

    <li>Linux:<code> gnome-open filename_or_URL</code></li>

    <li>Mac:  <code>open filename_or_URL</code></li>
    <li>
Windows:  <code>cmd /c start filename_or_URL</code></li>

    <li>Cygwin: <code>cygstart filename_or_URL</code></li>

</ul>

<p><strong>Nomachine NX and ALT-TAB</strong></p>

<p>I use the Nomachine NX client from time to time to get a remote-desktop like connection to a remote Linux machine. It&#8217;s faster than VNC, but it suffers from not forwarding all of my keyboard shortcuts to the remote end of the connection.</p>

<p>Usually, I start the nxlcient from within a Gnome login session. Gnome happily grabs ALT-TAB before the NX client gets to see it. That&#8217;s not what I want. To work around this limitation, I log into a virtual terminal, and start X manually as follows:</p>

<p>Type CTRL-ALT-F2
Login
Run: <code>startx -- :1 gnome-terminal</code></p>

<p>From the gnome-terminal, run: <code>nxclient</code></p>

<p>And then I connect to the remote machine in full screen mode. There&#8217;s no local window manager to interfere with my keyboard shortcuts.</p>

<p><strong>Remote desktop and dual screens</strong></p>

<p>I&#8217;ve been using Remote Desktop to connect to Windows XP, Vista and 7 machines. Until Windows 7, there was no way for a local computer having dual monitors to connect and have the remote end display across both monitors.</p>

<p>So I used linux&#8217;s &#8216;rdesktop&#8217; program to do it:</p>

<p><code>rdesktop -0 -a16 -f -rdisk:CLIENT=/home/jared/Desktop -r sound remote.host.com</code></p>

<p>I notice that in Windows 7, there are some new options in the Remote Desktop client (mstsc.exe): /multimon and /span. Or run <code>mstsc /?</code> to list all possible options.</p>

<p><strong>Editing windows registry files on Linux</strong></p>

<p>Use Gedit: <code>gedit --encoding=UTF-16LE myfile.reg</code></p>

<p>Gvim: <code>LANG=UTF-16LE gvim myfile.reg</code></p>

<p>If already in gvim:<code> :e! ++enc=utf-16le</code>
or  <code>:e ++enc=utf-16le myfile.reg</code></p>

<p>Convert, edit, convert:</p>

<p><code>iconv -f UTF-16LE -t utf-8 myfile.reg > myfile.reg.utf8</code></p>

<p>Edit myfile.reg.utf8, then convert it back</p>

<p><code> iconv -f utf-8 -t UTF-16LE myfile.reg.utf8 > myfile.reg</code></p>

<p><strong>
How Firefox opens files and mime types</strong></p>

<p>I needed to give Firefox some extra help knowing how to open a custom file type with a custom application. Here&#8217;s some helpful information.</p>

<p><a href="https://developer.mozilla.org/en/How_Mozilla_determines_MIME_Types">https://developer.mozilla.org/en/How<em>Mozilla</em>determines<em>MIME</em>Types</a></p>

<p>Firefox uses mime.types on Linux, as well as other things. I helped Firefox by the mime type to the link in the generated HTML file. Either one of the following seems to work:</p>

<ul>
<li>&lt;a href=&#8221;file:subdir/file1.cst&#8221; type=&#8221;application/octet-stream&#8221;&gt; open file &lt;/a&gt;</li>
<li>&lt;a href=&#8221;file:subdir/file1.cst&#8221; type=&#8221;application/x-extension-cst&#8221;&gt; open file  &lt;/a&gt;</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://jaredrobinson.com/blog/miscellaneous-linux-tips-and-tricks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Berkus: Five Steps to PostgreSQL Performance</title>
		<link>http://jaredrobinson.com/blog/berkus-five-steps-to-postgresql-performance/</link>
		<comments>http://jaredrobinson.com/blog/berkus-five-steps-to-postgresql-performance/#comments</comments>
		<pubDate>Fri, 12 Mar 2010 20:30:38 +0000</pubDate>
		<dc:creator>Jared</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tech]]></category>

		<guid isPermaLink="false">http://jaredrobinson.com/blog/?p=560</guid>
		<description><![CDATA[Five Steps to PostgreSQL Performance by Josh Berkus October 2009 I found this to be informative, and much of the advice applies to databases besides PostgreSQL.]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.pgexperts.com/document.html?id=36">Five Steps to PostgreSQL Performance</a> by Josh Berkus October 2009</p>

<p>I found this to be informative, and much of the advice applies to databases besides PostgreSQL.</p>
]]></content:encoded>
			<wfw:commentRss>http://jaredrobinson.com/blog/berkus-five-steps-to-postgresql-performance/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

