<?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>things &#38; stuff &#187; Windows</title>
	<atom:link href="http://www.curlybrace.com/words/category/technology/windows-technology/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.curlybrace.com/words</link>
	<description>Pictures.  Now with more words!</description>
	<lastBuildDate>Fri, 03 Sep 2010 10:02:20 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Cygwin:  No Output from Rsync</title>
		<link>http://www.curlybrace.com/words/2010/07/05/cygwin-no-output-from-rsync/</link>
		<comments>http://www.curlybrace.com/words/2010/07/05/cygwin-no-output-from-rsync/#comments</comments>
		<pubDate>Mon, 05 Jul 2010 21:47:28 +0000</pubDate>
		<dc:creator>Jeff Fitzsimons</dc:creator>
				<category><![CDATA[Cygwin]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://www.curlybrace.com/words/?p=1192</guid>
		<description><![CDATA[I experienced a very strange situation where rsync simply stopped working. It wouldn&#8217;t even output anything for rsync --help or even plain rsync. which showed it to be in /usr/bin/rsync as expected. A closer look revealed something odd: $ ls &#8230; <a href="http://www.curlybrace.com/words/2010/07/05/cygwin-no-output-from-rsync/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I experienced a very strange situation where rsync simply stopped working.  It wouldn&#8217;t even output anything for <tt>rsync --help</tt> or even plain <tt>rsync</tt>.  <tt>which</tt> showed it to be in <tt>/usr/bin/rsync</tt> as expected.  A closer look revealed something odd:</p>
<blockquote><pre class="bash">$ ls -lah /usr/bin/rs*
-rwxr-xr-x 1 fitzsimj None    0 2010-01-11 13:40 /usr/bin/rsync
-rwxr-xr-x 1 fitzsimj root 349K 2010-02-19 11:20 /usr/bin/rsync.exe</pre>
</blockquote>
<p><b>I had a mysterious, empty <tt>rsync</tt> file next to <tt>rsync.exe</tt> in my <tt>/usr/bin</tt> folder</b>.  Deleting the <tt>rsync</tt> file fixed my problem.  I have no idea where this came from.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.curlybrace.com/words/2010/07/05/cygwin-no-output-from-rsync/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IME Functions Fail From Separate Process</title>
		<link>http://www.curlybrace.com/words/2010/02/13/ime-functions-fail-from-separate-process/</link>
		<comments>http://www.curlybrace.com/words/2010/02/13/ime-functions-fail-from-separate-process/#comments</comments>
		<pubDate>Sun, 14 Feb 2010 05:42:38 +0000</pubDate>
		<dc:creator>Jeff Fitzsimons</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.curlybrace.com/words/?p=928</guid>
		<description><![CDATA[I wanted to change the behavior of the Microsoft IME bar using AutoHotkeys, a utility which can be used to create macros, remap keys, or do any of a variety of other related tasks. This led me to ime_func.ahk, which &#8230; <a href="http://www.curlybrace.com/words/2010/02/13/ime-functions-fail-from-separate-process/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I wanted to change the behavior of the Microsoft IME bar using <a href="http://www.autohotkey.com/">AutoHotkeys</a>, a utility which can be used to create macros, remap keys, or do any of a variety of other related tasks.</p>
<p>This led me to <a href="http://fw.ampll.org/index.php?AutoHotKey">ime_func.ahk</a>, which appears to be an AutoHotkeys script which uses DllCall to access Imm32.dll, the Input Method Manager library.  I believe that this script was intended to manipulate the state of the IME language bar.</p>
<p>As near as I can tell, this AutoHotkeys script targets an older implementation of the IMM library.  Some of the methods used are now only listed for Windows Mobile platforms.</p>
<p>I began experimenting with ImmGetContext and ImmGetConversionStatus.  ImmGetContext always returned a hIMC value of NULL.</p>
<p>On the <a href="http://msdn.microsoft.com/en-us/library/dd317789(VS.85).aspx">Developing IME-Aware Multiple-thread Applications MSDN page</a>, the following is stated (bold highlight added):</p>
<blockquote><p>The IMM includes thread identification checking that determines if a calling thread is the creator of a specified input method context handle (HIMC type) or window handle (HWND type). <b>If the thread is not the creator of the handle, the called IMM function fails and a subsequent call to GetLastError returns ERROR_INVALID_ACCESS.</b></p></blockquote>
<p>Additionally:</p>
<blockquote><ul>
<li />A thread should not access the input context created by another thread.</p>
<li />A thread should not associate an input context with a window created by another thread, and vice versa.</ul>
</blockquote>
<p>So, it appears that cross-process IME manipulation is forbidden.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.curlybrace.com/words/2010/02/13/ime-functions-fail-from-separate-process/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>GnuPG Not Working Under Cygwin</title>
		<link>http://www.curlybrace.com/words/2010/02/09/gnupg-not-working-under-cygwin/</link>
		<comments>http://www.curlybrace.com/words/2010/02/09/gnupg-not-working-under-cygwin/#comments</comments>
		<pubDate>Tue, 09 Feb 2010 12:43:51 +0000</pubDate>
		<dc:creator>Jeff Fitzsimons</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.curlybrace.com/words/?p=905</guid>
		<description><![CDATA[I was having trouble using the GnuPG plugin for vim under Cygwin. The GnuPG plugin allows seamlessly integrated decryption, editing, and re-encryption of GPG-encrypted content within vim. However, on my Windows 7 box, it just showed gibberish. Attempting to edit &#8230; <a href="http://www.curlybrace.com/words/2010/02/09/gnupg-not-working-under-cygwin/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I was having trouble using the <a href="http://www.vim.org/scripts/script.php?script_id=661">GnuPG plugin for vim</a> under Cygwin.  The GnuPG plugin allows seamlessly integrated decryption, editing, and re-encryption of GPG-encrypted content within vim.  However, on my Windows 7 box, it just showed gibberish.  Attempting to edit my encrypted password file resulted in a rather vague error message:</p>
<blockquote><pre class="bash">$ vim Documents/passwords.gpg

"Documents/passwords.gpg" [Incomplete last line][converted] 7 lines,
2547 characters
Press ENTER or type command to continue</pre>
</blockquote>
<p>Pressing enter simply resulted in gibberish, likely the raw data of the encrypted file.</p>
<p>The solution was to turn on vim&#8217;s filetype plugin processing:</p>
<blockquote><pre class="bash">:filetype plugin on</pre>
</blockquote>
<p>To make this setting persistent, add it to your <tt>~/.vimrc</tt> file.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.curlybrace.com/words/2010/02/09/gnupg-not-working-under-cygwin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Converting MP3 to AAC</title>
		<link>http://www.curlybrace.com/words/2010/02/05/converting-mp3-to-aac/</link>
		<comments>http://www.curlybrace.com/words/2010/02/05/converting-mp3-to-aac/#comments</comments>
		<pubDate>Sat, 06 Feb 2010 07:27:21 +0000</pubDate>
		<dc:creator>Jeff Fitzsimons</dc:creator>
				<category><![CDATA[Scripting]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.curlybrace.com/words/?p=895</guid>
		<description><![CDATA[Here is a Windows command shell script I wrote to convert MP3 files to AAC for my Softbank 821SC phone. The script uses FFmpeg, which I downloaded from here. @echo off REM --------------------------------------------------------------------------- REM Set the following variable to the &#8230; <a href="http://www.curlybrace.com/words/2010/02/05/converting-mp3-to-aac/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Here is a Windows command shell script I wrote to convert MP3 files to AAC for my Softbank 821SC phone.  The script uses FFmpeg, which I downloaded from <a href="http://ffmpeg.arrozcru.org/autobuilds/">here</a>.</p>
<blockquote>
<pre class="DOS">
@echo off

REM ---------------------------------------------------------------------------
REM  Set the following variable to the ffmpeg.exe path on your system.
REM ---------------------------------------------------------------------------
set FFMPEG_PATH="c:\tools\FFmpeg\ffmpeg.exe"

REM make sure the user provided an argument.
if NOT "%~1" == "" goto ARGS_OK

REM bad arguments, print error and exit.
echo.
echo    Usage examples:
echo       mp3toaac.bat file_to_convert.mp3
echo       mp3toaac.bat *.mp3
echo       mp3toaac.bat some_directory\*.mp3
exit /b 1

:ARGS_OK

REM use for/in so that we can accept individual files or wildcards.
for %%i in ("%~1") do %FFMPEG_PATH% -i "%%~i" "%%~ni.aac"

echo.
echo Done.

exit /b 0
</pre>
</blockquote>
<p>Interesting elements of this batch file:</p>
<ul>
<li />Use of <tt>for</tt>/<tt>in</tt> in order to accept both filenames and wildcards.
<li />Use of <tt>%~<i>X</i></tt> to strip parentheses from a filename variable.
<li />Use of <tt>%~n<i>X</i></tt> to strip the extension from a filename variable (i.e. retrieve the basename).
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.curlybrace.com/words/2010/02/05/converting-mp3-to-aac/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SSH Tunneling Windows RDC</title>
		<link>http://www.curlybrace.com/words/2009/07/05/ssh-port-forwarding-windows-rdc/</link>
		<comments>http://www.curlybrace.com/words/2009/07/05/ssh-port-forwarding-windows-rdc/#comments</comments>
		<pubDate>Sun, 05 Jul 2009 22:26:17 +0000</pubDate>
		<dc:creator>Jeff Fitzsimons</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.curlybrace.com/words/?p=740</guid>
		<description><![CDATA[This article explains how to securely port-forward Windows Remote Desktop (Terminal Services) over SSH, using standard SSH command line syntax. If you prefer to use GUI SSH tools, such as PuTTY, there are other guides for that. Terminology Notes My &#8230; <a href="http://www.curlybrace.com/words/2009/07/05/ssh-port-forwarding-windows-rdc/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>This article explains how to securely port-forward Windows Remote Desktop (Terminal Services) over SSH, using standard SSH command line syntax.  If you prefer to use GUI SSH tools, such as PuTTY, <a href="http://theillustratednetwork.mvps.org/Ssh/RemoteDesktopSSH.html">there are other guides for that</a>.</p>
<h4>Terminology Notes</h4>
<p>My terminology assumes that you are connecting to a machine on your home network, which is protected by a firewall.  However, the diagrams and commands are valid regardless of whether the remote network is at home or not.</p>
<p>Additionally, I use <tt><i>RDCHOST</i></tt> to represent the local name or IP of your RDC server <b>within the home network</b>, and <tt><i>my_home_ip</i></tt> to represent your home IP address as visible from the Internet.</p>
<h3>Prerequisites</h3>
<ul>
<li />Depending on network configuration, port-forwarding may have to be configured on the firewall.
<li />An SSH client (e.g. <a href="http://www.cygwin.com/">Cygwin&#8217;s OpenSSH</a> for Windows) must be installed on the local machine.
<li />An SSH server (e.g. <a href="http://www.cygwin.com/">Cygwin&#8217;s OpenSSHD</a> for Windows) must be present on some machine within the home network.
<li />SSH keys must be generated and deployed appropriately.
</ul>
<h3>SSH Command Syntax</h3>
<blockquote><p><tt>ssh -C -N -L <i>localPort</i>:<i>destinationHost</i>:3389 <i>proxyHost</i></tt></p>
<p />
<ul>
<li /><i>localPort</i> is the port on localhost through which you wish to connect.
<li /><i>destinationHost</i> is the Remote Desktop host, <b>as it appears on the home network</b>.
<li /><i>proxyHost</i> is the host running SSHD, through which you will tunnel.
</ul>
</blockquote>
<h3>Configuration 1:  Discrete Servers</h3>
<p>This configuration has the firewall port-forward SSH to a server on the home network, which proxies the connection to the RDC server:</p>
<blockquote><pre>                       +-----------[ Home Network ]---------------+
                       |                                          |
localhost <----> Home Firewall <---> SSH Server <---> RDC Server  |
                       |                                          |
                       +------------------------------------------+</pre>
</blockquote>
<p>Command line:</p>
<blockquote><p><tt>ssh -C -N -L 6009:<i>RDCHOST</i>:3389 <i>my_home_ip</i></tt></p></blockquote>
<h3>Configuration 2:  Combined RDC &#038; SSH Servers</h3>
<p>In this configuration, the RDC server also has an SSH server, and the firewall port-forwards directly to it:</p>
<blockquote><pre>                       +------[ Home Network ]-----+
                       |                           |
localhost <----> Home Firewall <-----> RDC &#038; SSH   |
                       |                Server     |
                       +---------------------------+</pre>
</blockquote>
<p>Command line:</p>
<blockquote><p><tt>ssh -C -N -L 6009:localhost:3389 <i>my_home_ip</i></tt></p></blockquote>
<h3>Configuration 3:  Firewall as SSH Server</h3>
<p>In this configuration, the firewall acts as the SSH server, proxying the connection directly to the RDC server on the home network:</p>
<blockquote><pre>                       +----[ Home Network ]----+
                       |                        |
localhost <----> Home Firewall <---> RDC Server |
                  &#038; SSH Server                  |
                       |                        |
                       +------------------------+
</pre>
</blockquote>
<p>Command line:</p>
<blockquote><p><tt>ssh -C -N -L 6009:<i>RDCHOST</i>:3389 <i>my_home_ip</i></tt></p></blockquote>
<h3>Additional Suggestions</h3>
<p>Rather than specifying the IP address of your home firewall, I suggest using <a href="http://www.dyndns.com/">DynDNS</a> to get a dynamic DNS entry.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.curlybrace.com/words/2009/07/05/ssh-port-forwarding-windows-rdc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
