<?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>George&#039;s weblog</title>
	<atom:link href="http://www.helyar.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.helyar.net</link>
	<description>From the desktop of George Helyar</description>
	<lastBuildDate>Thu, 26 Aug 2010 14:27:45 +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>Compiling zlib.lib on Windows</title>
		<link>http://www.helyar.net/2010/compiling-zlib-lib-on-windows/</link>
		<comments>http://www.helyar.net/2010/compiling-zlib-lib-on-windows/#comments</comments>
		<pubDate>Thu, 26 Aug 2010 14:25:59 +0000</pubDate>
		<dc:creator>George Helyar</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[zlib]]></category>

		<guid isPermaLink="false">http://www.helyar.net/?p=553</guid>
		<description><![CDATA[zlib is the standard for lossless data compression. The DEFLATE compression algorithm is the basis for just about every lossless compression format out there, including &#8220;zip&#8221; and &#8220;gzip&#8221;, which is itself part of zlib. There are two ways that it can be used from C/C++ projects in Windows. Firstly, it can be used by dynamic [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://zlib.net/">zlib</a> is the standard for lossless data compression. The DEFLATE compression algorithm is the basis for just about every lossless compression format out there, including &#8220;zip&#8221; and &#8220;gzip&#8221;, which is itself part of zlib.</p>
<p>There are two ways that it can be used from C/C++ projects in Windows.</p>
<p>Firstly, it can be used by dynamic linking (dll). This means using zdll.lib and shipping the appropriate version of zlib1.dll with your project. This is not a problem, as Windows versions of both of these files are provided.</p>
<p>The second way is to use static linking. That is, having all of the code in one .lib file and compiling it into your exe so that you do not have to distribute zlib1.dll. This means compiling zlib.lib.</p>
<p>In version 1.2.4 of zlib, a &#8220;projects&#8221; directory was provided, with a Microsoft Visual C++ 6 project. However, it seems that version 1.2.5 has not included this project. This means that the best solution is to go and get the 1.2.4 source and compile it yourself. However, the zlib project seems to be kept inside the <a href="https://sourceforge.net/projects/libpng/files/">libpng</a> project on sourceforge.net, so it is not immediately obvious where to find older versions of the zlib source code.</p>
<p><a href="https://sourceforge.net/projects/libpng/files/zlib/1.2.4/zlib124.zip/download">zlib 1.2.4 source (zip)</a></p>
<p>Extract the zip, open projects\visualc6\zlib.dsp in Visual Studio (I used 2005) and compile &#8220;LIB Release&#8221; (and optionally &#8220;LIB Debug&#8221;)</p>
<p>Copy zlib.h and zconf.h from &#8220;include&#8221; to your Visual Studio &#8220;include&#8221; directory, and zlib.lib (and zlibd.lib if you made it) to your Visual Studio &#8220;lib&#8221; directory.</p>
<p>On 64 bit Windows, with Visual Studio 2005, this is &#8220;C:\Program Files (x86)\Microsoft Visual Studio 8\VC\&#8221; so adjust for your version of Visual Studio.</p>
<p>You now just need to add &#8220;zlib.lib&#8221; to your &#8220;Linker -> Input -> Additional Dependencies&#8221; line in your C++ project configuration to use it (and optionally zlibd.lib for the debug version).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.helyar.net/2010/compiling-zlib-lib-on-windows/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fix Windows 7 MBR after GRUB</title>
		<link>http://www.helyar.net/2010/fix-windows-7-mbr-after-grub/</link>
		<comments>http://www.helyar.net/2010/fix-windows-7-mbr-after-grub/#comments</comments>
		<pubDate>Tue, 24 Aug 2010 12:58:37 +0000</pubDate>
		<dc:creator>George Helyar</dc:creator>
				<category><![CDATA[Other]]></category>
		<category><![CDATA[grub]]></category>
		<category><![CDATA[master boot record]]></category>
		<category><![CDATA[mbr]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://www.helyar.net/?p=545</guid>
		<description><![CDATA[During a Linux install to my 2nd hard drive, GRUB was automatically installed to the wrong MBR (master boot record). The files were on the /boot of the Linux drive, but the Windows&#8217; drive&#8217;s MBR was used. This meant without both drives, I could not boot either operating system. So I installed GRUB manually with [...]]]></description>
			<content:encoded><![CDATA[<p>During a Linux install to my 2nd hard drive, GRUB was automatically installed to the wrong MBR (master boot record). The files were on the /boot of the Linux drive, but the Windows&#8217; drive&#8217;s MBR was used. This meant without both drives, I could not boot either operating system.</p>
<p>So I installed GRUB manually with grub-install /dev/sdb. Now I needed to restore the original Windows 7 MBR so that it didn&#8217;t require GRUB to boot it.</p>
<p>The Windows 7 &#8220;startup repair&#8221; from the installation disc detected the OS but didn&#8217;t find any boot problems with it, so I went to the command prompt on the disc.</p>
<p>There are several commands for this. A lot of pages suggest using &#8220;bootsect&#8221;. However, this did not fix anything. The fact that it was for use on individual partitions was probably a clue on that. Some pages even used &#8220;bootcfg&#8221; which is for older Windows installs such as XP (it affects your boot.ini), but is still included on the Windows 7 disc to add to the confusion.</p>
<p>The command that did work was:</p>

<div class="wp_syntax"><div class="code"><pre class="batch" style="font-family:monospace;color: black;">bootrec /fixmbr</pre></div></div>

<p>Afterwards,  for good measure, I also ran:</p>

<div class="wp_syntax"><div class="code"><pre class="batch" style="font-family:monospace;color: black;">bootrec /fixboot</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.helyar.net/2010/fix-windows-7-mbr-after-grub/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to compile ffmpeg from source</title>
		<link>http://www.helyar.net/2010/how-to-compile-ffmpeg-from-source/</link>
		<comments>http://www.helyar.net/2010/how-to-compile-ffmpeg-from-source/#comments</comments>
		<pubDate>Wed, 09 Jun 2010 13:15:43 +0000</pubDate>
		<dc:creator>George Helyar</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[compile]]></category>
		<category><![CDATA[ffmpeg]]></category>

		<guid isPermaLink="false">http://www.helyar.net/?p=512</guid>
		<description><![CDATA[ffmpeg is a free and very powerful video encoding tool that is the basis of many other popular video encoding tools, with a command line interface. Because of the frequent updates to ffmpeg and the codecs it uses, it is often best to download the latest source and compile it yourself. These updates usually include [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://ffmpeg.org/">ffmpeg</a> is a free and very powerful video encoding tool that is the basis of many other popular video encoding tools, with a command line interface.</p>
<p>Because of the frequent updates to ffmpeg and the codecs it uses, it is often best to download the latest source and compile it yourself. These updates usually include new features, bug fixes, support for new codecs and noticeable speed improvements. Most Linux distributions have outdated packages in their repositories so being able to compile the latest code from source is very useful</p>
<p>I use ffmpeg to output H.264 video with AAC audio in a MP4 container. I also occasionally convert audio to mp3. This means I will be compiling the following:</p>
<ul>
<li><a href="http://ffmpeg.org/">ffmpeg</a></li>
<li><a href="http://www.videolan.org/developers/x264.html">x264</a></li>
<li><a href="http://www.audiocoding.com/">faac/faad</a></li>
<li><a href="http://lame.sourceforge.net/">LAME</a></li>
</ul>
<h3>Preparing to compile on Linux</h3>
<p><em>(If you already compile things on Linux, skip to the next section.)</em><br />
First make sure that you have all of the tools and headers required to compile on Linux. On Debian based systems (including Ubuntu) you can usually run the following as root to get everything you need. First update your system. It is important that you get the latest kernel and the correct sources for it.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;color: black;"><span style="color: #c20cb9; font-weight: bold;color: blue;">apt-get</span> update
<span style="color: #c20cb9; font-weight: bold;color: blue;">apt-get</span> dist-upgrade</pre></div></div>

<p>A reboot may be required here if your kernel updated.</p>
<p>Now get the compilers, tools and headers needed to compile software on Linux:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;color: black;"><span style="color: #c20cb9; font-weight: bold;color: blue;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;color: blue;">install</span> build-essential linux-headers-<span style="color: #000000; font-weight: bold;color: black;">`</span><span style="color: #c20cb9; font-weight: bold;color: blue;">uname</span> -r<span style="color: #000000; font-weight: bold;color: black;">`</span> git subversion yasm</pre></div></div>

<p>NB: your &#8220;git&#8221; package may be called something like &#8220;git-core&#8221;</p>
<h3>Compile ffmpeg (empty)</h3>
<p>Because some libraries require ffmpeg to be installed, we will first install a blank copy with no additional codecs specified.</p>
<p>When I update, I often find that I need to recompile a blank version of ffmpeg before I can compile x264.</p>
<p>Download the latest ffmpeg source with subversion, configure, compile:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;color: black;"><span style="color: #c20cb9; font-weight: bold;color: blue;">svn</span> checkout <span style="color: #c20cb9; font-weight: bold;color: blue;">svn</span>:<span style="color: #000000; font-weight: bold;color: black;">//</span>svn.ffmpeg.org<span style="color: #000000; font-weight: bold;color: black;">/</span>ffmpeg<span style="color: #000000; font-weight: bold;color: black;">/</span>trunk <span style="color: #c20cb9; font-weight: bold;color: blue;">ffmpeg</span>
<span style="color: #7a0874; font-weight: bold;color: blue;">cd</span> <span style="color: #c20cb9; font-weight: bold;color: blue;">ffmpeg</span>
.<span style="color: #000000; font-weight: bold;color: black;">/</span>configure
<span style="color: #c20cb9; font-weight: bold;color: blue;">make</span></pre></div></div>

<p>If this all worked with no errors (you can check with <code>echo $?</code>), run</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;color: black;"><span style="color: #c20cb9; font-weight: bold;color: blue;">make</span> <span style="color: #c20cb9; font-weight: bold;color: blue;">install</span></pre></div></div>

<p> as root. Use su or sudo if you need to. I use su.</p>
<h3>Compile faac and faad</h3>
<p>Download and extract faac and faad from <a href="http://www.audiocoding.com/">audiocoding.com</a>.</p>
<p>As above, run</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;color: black;">.<span style="color: #000000; font-weight: bold;color: black;">/</span>configure
<span style="color: #c20cb9; font-weight: bold;color: blue;">make</span>
<span style="color: #c20cb9; font-weight: bold;color: blue;">su</span> <span style="color: #660033;">-c</span> <span style="color: #ff0000;">'make install'</span></pre></div></div>

<p>on both libraries.</p>
<p>You can optionally do the same thing with <a href="http://lame.sourceforge.net/">LAME</a> if you want to be able to encode mp3 audio.</p>
<h3>Compile x264</h3>
<p>Download and compile the latest x264 source with git:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;color: black;">git clone git:<span style="color: #000000; font-weight: bold;color: black;">//</span>git.videolan.org<span style="color: #000000; font-weight: bold;color: black;">/</span>x264.git
<span style="color: #7a0874; font-weight: bold;color: blue;">cd</span> x264
.<span style="color: #000000; font-weight: bold;color: black;">/</span>configure
<span style="color: #c20cb9; font-weight: bold;color: blue;">make</span>
<span style="color: #c20cb9; font-weight: bold;color: blue;">su</span> <span style="color: #660033;">-c</span> <span style="color: #ff0000;">'make install'</span></pre></div></div>

<h3>Compile ffmpeg with the above codecs</h3>
<p>Now that we have all of the codecs (x264, aac, mp3) successfully installed as libraries on the system, we can reinstall ffmpeg to incorporate these libraries. First go back to the ffmpeg source directory and clean off the previous compile.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;color: black;"><span style="color: #7a0874; font-weight: bold;color: blue;">cd</span> <span style="color: #c20cb9; font-weight: bold;color: blue;">ffmpeg</span>
<span style="color: #c20cb9; font-weight: bold;color: blue;">make</span> clean</pre></div></div>

<p>Now configure to enable all of the installed libraries and recompile:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;color: black;">.<span style="color: #000000; font-weight: bold;color: black;">/</span>configure <span style="color: #660033;">--enable-gpl</span> <span style="color: #660033;">--enable-nonfree</span> <span style="color: #660033;">--enable-pthreads</span> <span style="color: #660033;">--enable-libx264</span> <span style="color: #660033;">--enable-libfaac</span> <span style="color: #660033;">--enable-libfaad</span> <span style="color: #660033;">--enable-libmp3lame</span>
<span style="color: #c20cb9; font-weight: bold;color: blue;">make</span></pre></div></div>

<p>(if it tells you that &#8211;enable-libfaad is not an option, just remove it. It&#8217;s probably either been rolled into faac or ffmpeg has it built in)</p>
<p>If it all worked, run make install as root.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;color: black;"><span style="color: #c20cb9; font-weight: bold;color: blue;">su</span> <span style="color: #660033;">-c</span> <span style="color: #ff0000;">'make install'</span></pre></div></div>

<h3>Testing</h3>
<p>As long as /usr/local/bin/ is on your $PATH environment variable, you should be able to just type <code>ffmpeg</code> to check that it is all installed. It should look something like this:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;color: black;">$ <span style="color: #c20cb9; font-weight: bold;color: blue;">ffmpeg</span>
FFmpeg version SVN-r23548, Copyright <span style="color: #7a0874; font-weight: bold;color: black;">&#40;</span>c<span style="color: #7a0874; font-weight: bold;color: black;">&#41;</span> <span style="color: #000000;color: maroon;">2000</span>-<span style="color: #000000;color: maroon;">2010</span> the FFmpeg developers
  built on Jun  <span style="color: #000000;color: maroon;">9</span> <span style="color: #000000;color: maroon;">2010</span> <span style="color: #000000;color: maroon;">13</span>:<span style="color: #000000;color: maroon;">35</span>:<span style="color: #000000;color: maroon;">17</span> with <span style="color: #c20cb9; font-weight: bold;color: blue;">gcc</span> 4.4.4
  configuration: <span style="color: #660033;">--enable-gpl</span> <span style="color: #660033;">--enable-nonfree</span> <span style="color: #660033;">--enable-pthreads</span> <span style="color: #660033;">--enable-libx264</span> <span style="color: #660033;">--enable-libfaac</span> <span style="color: #660033;">--enable-libfaad</span> <span style="color: #660033;">--enable-libmp3lame</span>
  libavutil     50.18. <span style="color: #000000;color: maroon;">0</span> <span style="color: #000000; font-weight: bold;color: black;">/</span> 50.18. <span style="color: #000000;color: maroon;">0</span>
  libavcodec    52.75. <span style="color: #000000;color: maroon;">1</span> <span style="color: #000000; font-weight: bold;color: black;">/</span> 52.75. <span style="color: #000000;color: maroon;">1</span>
  libavformat   52.68. <span style="color: #000000;color: maroon;">0</span> <span style="color: #000000; font-weight: bold;color: black;">/</span> 52.68. <span style="color: #000000;color: maroon;">0</span>
  libavdevice   52. 2. <span style="color: #000000;color: maroon;">0</span> <span style="color: #000000; font-weight: bold;color: black;">/</span> 52. 2. <span style="color: #000000;color: maroon;">0</span>
  libavfilter    1.20. <span style="color: #000000;color: maroon;">0</span> <span style="color: #000000; font-weight: bold;color: black;">/</span>  1.20. <span style="color: #000000;color: maroon;">0</span>
  libswscale     0.11. <span style="color: #000000;color: maroon;">0</span> <span style="color: #000000; font-weight: bold;color: black;">/</span>  0.11. <span style="color: #000000;color: maroon;">0</span>
Hyper fast Audio and Video encoder
usage: <span style="color: #c20cb9; font-weight: bold;color: blue;">ffmpeg</span> <span style="color: #7a0874; font-weight: bold;color: black;">&#91;</span>options<span style="color: #7a0874; font-weight: bold;color: black;">&#93;</span> <span style="color: #7a0874; font-weight: bold;color: black;">&#91;</span><span style="color: #7a0874; font-weight: bold;color: black;">&#91;</span>infile options<span style="color: #7a0874; font-weight: bold;color: black;">&#93;</span> <span style="color: #660033;">-i</span> infile<span style="color: #7a0874; font-weight: bold;color: black;">&#93;</span>... <span style="color: #7a0874; font-weight: bold;color: black;">&#123;</span><span style="color: #7a0874; font-weight: bold;color: black;">&#91;</span>outfile options<span style="color: #7a0874; font-weight: bold;color: black;">&#93;</span> outfile<span style="color: #7a0874; font-weight: bold;color: black;">&#125;</span>...
&nbsp;
Use <span style="color: #660033;">-h</span> to get full <span style="color: #7a0874; font-weight: bold;color: blue;">help</span> or, even better, run <span style="color: #ff0000;">'man ffmpeg'</span></pre></div></div>

<h3>Using ffmpeg</h3>
<p>I have written a small Python <a href="http://www.helyar.net/enc">video encoding script</a> to make encoding as easy as</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;color: black;">enc <span style="color: #660033;">-t</span> <span style="color: #7a0874; font-weight: bold;color: blue;">cd</span> file.vob</pre></div></div>

<p>If anyone has any suggestions to improve this, such as any advantages of using shared libraries, please feel free to post these suggestions in the comments.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.helyar.net/2010/how-to-compile-ffmpeg-from-source/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Remote recursive sha1sum with php</title>
		<link>http://www.helyar.net/2010/remote-recursive-sha1sum-with-php/</link>
		<comments>http://www.helyar.net/2010/remote-recursive-sha1sum-with-php/#comments</comments>
		<pubDate>Wed, 02 Jun 2010 13:29:11 +0000</pubDate>
		<dc:creator>George Helyar</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.helyar.net/?p=495</guid>
		<description><![CDATA[To calculate the SHA-1 sums, display them and make them available for download in a sums.gz file: &#60;?php echo&#40;`find ./some_directory/ -type f &#124; grep -v sums.gz &#124; xargs sha1sum &#124; gzip -c &#124; tee sums.gz &#124; zcat`&#41;; ?&#62; To check the sums: &#60;?php echo&#40;`zcat sums.gz &#124; sha1sum -c -`&#41;; ?&#62;]]></description>
			<content:encoded><![CDATA[<p>To calculate the SHA-1 sums, display them and make them available for download in a sums.gz file:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;color: black;"><span style="color: #000000; font-weight: bold;color: blue;">&lt;?php</span> <span style="color: #b1b100;color: blue;">echo</span><span style="color: #009900;color: black;">&#40;</span>`find <span style="color: #339933;color: black;">./</span>some_directory<span style="color: #339933;color: black;">/</span> <span style="color: #339933;color: black;">-</span>type f <span style="color: #339933;color: black;">|</span> grep <span style="color: #339933;color: black;">-</span>v sums<span style="color: #339933;color: black;">.</span>gz <span style="color: #339933;color: black;">|</span> xargs sha1sum <span style="color: #339933;color: black;">|</span> gzip <span style="color: #339933;color: black;">-</span>c <span style="color: #339933;color: black;">|</span> tee sums<span style="color: #339933;color: black;">.</span>gz <span style="color: #339933;color: black;">|</span> zcat`<span style="color: #009900;color: black;">&#41;</span><span style="color: #339933;color: black;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>To check the sums:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;color: black;"><span style="color: #000000; font-weight: bold;color: blue;">&lt;?php</span> <span style="color: #b1b100;color: blue;">echo</span><span style="color: #009900;color: black;">&#40;</span>`zcat sums<span style="color: #339933;color: black;">.</span>gz <span style="color: #339933;color: black;">|</span> sha1sum <span style="color: #339933;color: black;">-</span>c <span style="color: #339933;color: black;">-</span>`<span style="color: #009900;color: black;">&#41;</span><span style="color: #339933;color: black;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.helyar.net/2010/remote-recursive-sha1sum-with-php/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Get external IP address with Python</title>
		<link>http://www.helyar.net/2010/get-external-ip-address-with-python/</link>
		<comments>http://www.helyar.net/2010/get-external-ip-address-with-python/#comments</comments>
		<pubDate>Wed, 26 May 2010 18:04:43 +0000</pubDate>
		<dc:creator>George Helyar</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://www.helyar.net/?p=493</guid>
		<description><![CDATA[Here&#8217;s a quick snippet of Python code (tested in 3.0) to quickly look up your external IP address over HTTP and display it: import urllib.request print&#40;str&#40;urllib.request.urlopen&#40;&#34;http://www.whatismyip.com/automation/n09230945.asp&#34;&#41;.read&#40;&#41;, &#34;utf8&#34;&#41;&#41;]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a quick snippet of Python code (tested in 3.0) to quickly look up your external IP address over HTTP and display it:</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;color: black;"><span style="color: #ff7700;font-weight:bold;color: blue;">import</span> <span style="color: #dc143c;color: blue;">urllib</span>.<span style="color: black;color: black;">request</span>
<span style="color: #ff7700;font-weight:bold;color: blue;">print</span><span style="color: black;color: black;">&#40;</span><span style="color: #008000;color: blue;">str</span><span style="color: black;color: black;">&#40;</span><span style="color: #dc143c;color: blue;">urllib</span>.<span style="color: black;color: black;">request</span>.<span style="color: black;color: black;">urlopen</span><span style="color: black;color: black;">&#40;</span><span style="color: #483d8b;color: maroon;">&quot;http://www.whatismyip.com/automation/n09230945.asp&quot;</span><span style="color: black;color: black;">&#41;</span>.<span style="color: black;color: black;">read</span><span style="color: black;color: black;">&#40;</span><span style="color: black;color: black;">&#41;</span>, <span style="color: #483d8b;color: maroon;">&quot;utf8&quot;</span><span style="color: black;color: black;">&#41;</span><span style="color: black;color: black;">&#41;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.helyar.net/2010/get-external-ip-address-with-python/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Sign language scammers</title>
		<link>http://www.helyar.net/2010/sign-language-scammers/</link>
		<comments>http://www.helyar.net/2010/sign-language-scammers/#comments</comments>
		<pubDate>Fri, 21 May 2010 22:29:23 +0000</pubDate>
		<dc:creator>George Helyar</dc:creator>
				<category><![CDATA[Other]]></category>

		<guid isPermaLink="false">http://www.helyar.net/?p=489</guid>
		<description><![CDATA[Sometimes I think these people are just taking the piss to see who will notice.]]></description>
			<content:encoded><![CDATA[<p>Sometimes I think these people are just taking the piss to see who will notice.</p>
<p><a href="http://www.helyar.net/wp-content/uploads/2010/05/flap.jpg"><img src="http://www.helyar.net/wp-content/uploads/2010/05/flap-300x168.jpg" alt="" title="flap" width="300" height="168" class="aligncenter size-medium wp-image-490" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.helyar.net/2010/sign-language-scammers/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Courier notifications</title>
		<link>http://www.helyar.net/2010/courier-notifications/</link>
		<comments>http://www.helyar.net/2010/courier-notifications/#comments</comments>
		<pubDate>Fri, 26 Mar 2010 13:28:08 +0000</pubDate>
		<dc:creator>George Helyar</dc:creator>
				<category><![CDATA[Other]]></category>
		<category><![CDATA[courier]]></category>

		<guid isPermaLink="false">http://www.helyar.net/?p=485</guid>
		<description><![CDATA[Most couriers know where their drivers are at all times. They should update their tracking shortly before delivery, so that people are ready to collect at the door. Email or SMS notification 30 minutes before delivery would be very useful. Some couriers currently phone before they get there to make sure that you are in [...]]]></description>
			<content:encoded><![CDATA[<p>Most couriers know where their drivers are at all times. They should update their tracking shortly before delivery, so that people are ready to collect at the door. Email or SMS notification 30 minutes before delivery would be very useful. Some couriers currently phone before they get there to make sure that you are in before they even bother delivering, but that just doubles the chance for you to miss them because you have to be there for both the phone call and the delivery.</p>
<p>Websites that already offer SMS notifications and links to tracking websites could easily be notified by a courier&#8217;s tracking API and send out a SMS accordingly.</p>
<p>This would probably save a fortune in redelivery costs to couriers too.</p>
<p>Just a thought.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.helyar.net/2010/courier-notifications/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Xbox 360 &#8211; false economy</title>
		<link>http://www.helyar.net/2010/xbox-360-false-economy/</link>
		<comments>http://www.helyar.net/2010/xbox-360-false-economy/#comments</comments>
		<pubDate>Tue, 23 Mar 2010 18:05:11 +0000</pubDate>
		<dc:creator>George Helyar</dc:creator>
				<category><![CDATA[Other]]></category>

		<guid isPermaLink="false">http://www.helyar.net/?p=474</guid>
		<description><![CDATA[The main thing that caused me to buy an Xbox 360 rather than a PlayStation 3 was the price, as it probably is with a lot of people. However, now I am starting to regret that decision. To buy a 360 with HDMI, you need to get the most expensive version, the Elite, which is [...]]]></description>
			<content:encoded><![CDATA[<p>The main thing that caused me to buy an Xbox 360 rather than a PlayStation 3 was the price, as it probably is with a lot of people. However, now I am starting to regret that decision.</p>
<p>To buy a 360 with HDMI, you need to get the most expensive version, the Elite, which is <a href="http://www.game.co.uk/Consoles/Xbox-360/Xbox-360-Elite-Console/~r343541/">£200</a>. On top of that, it doesn&#8217;t play Blu-ray so if you want that (and you will, eventually) add another £130 for a <a href="http://www.play.com/Electronics/Electronics/4-/10360742/LG-BD370-Blu-ray-Player/Product.html?ptsl=1&#038;ob=Price&#038;fb=0&#038;&#038;_$ja=tsid:11518|cc:|prd:10360742|cat:Blu">LG BD370</a>, then you later find out how bad the media streaming is on the 360, something which you will probably also want eventually. Things like a complete lack of subtitles and surround sound audio causing the media to error completely rather than even play without sound or down-convert to stereo (on the same codec, AAC, which does work). This means you end up needing an additional piece streaming hardware. I chose the <a href="http://www.xtreamer.net/xtreamer/overview.aspx">xtreamer</a> for another €99 (£89).</p>
<p>Thats without even having any wireless options.</p>
<p>Total price comes out at about £420, compared to the 120GB PlayStation 3 Slim at £250. That&#8217;s almost double the price for the same, or fewer, features.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.helyar.net/2010/xbox-360-false-economy/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>wp-syntax to look like Visual Studio</title>
		<link>http://www.helyar.net/2010/wp-syntax-to-look-like-visual-studio/</link>
		<comments>http://www.helyar.net/2010/wp-syntax-to-look-like-visual-studio/#comments</comments>
		<pubDate>Tue, 23 Mar 2010 13:08:50 +0000</pubDate>
		<dc:creator>George Helyar</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.helyar.net/?p=471</guid>
		<description><![CDATA[wp-syntax is a nice plugin for WordPress using GeSHi to produce syntax highlighted blocks of code. The default colours aren&#8217;t very nice though, and there is no way to easily change them. wp-syntax-colorizer (horrible name) makes it easier to set the colours, but defaults to even worse colours. Most of us want readable colours that [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://wordpress.org/extend/plugins/wp-syntax/">wp-syntax</a> is a nice plugin for <a href="http://wordpress.org/">WordPress</a> using <a href="http://qbnz.com/highlighter/">GeSHi</a> to produce syntax highlighted blocks of code.</p>
<p>The default colours aren&#8217;t very nice though, and there is no way to easily change them. <a href="http://articles.akgfx.com/2008/04/wp-syntax-colorizer/">wp-syntax-colorizer</a> (horrible name) makes it easier to set the colours, but defaults to even worse colours.</p>
<p>Most of us want readable colours that we are used to from IDEs, and most of us will be using either Visual Studio or Eclipse. I mainly use the former. To get it to use the visual studio colours I edit wp-syntax-colorizer as follows:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;color: black;"><span style="color: #000000; font-weight: bold;color: blue;">function</span> my_custom_geshi_styles<span style="color: #009900;color: black;">&#40;</span><span style="color: #339933;color: black;">&amp;</span><span style="color: #000088;">$geshi</span><span style="color: #009900;color: black;">&#41;</span>
<span style="color: #009900;color: black;">&#123;</span>
  <span style="color: #000088;">$overall</span> <span style="color: #339933;color: black;">=</span> <span style="color: #0000ff;color: maroon;">&quot;black&quot;</span><span style="color: #339933;color: black;">;</span>
  <span style="color: #000088;">$keyword</span> <span style="color: #339933;color: black;">=</span> <span style="color: #0000ff;color: maroon;">&quot;blue&quot;</span><span style="color: #339933;color: black;">;</span>
  <span style="color: #000088;">$literal</span> <span style="color: #339933;color: black;">=</span> <span style="color: #0000ff;color: maroon;">&quot;maroon&quot;</span><span style="color: #339933;color: black;">;</span>
  <span style="color: #000088;">$comment</span> <span style="color: #339933;color: black;">=</span> <span style="color: #0000ff;color: maroon;">&quot;green&quot;</span><span style="color: #339933;color: black;">;</span>
&nbsp;
  <span style="color: #000088;">$geshi</span><span style="color: #339933;color: black;">-&gt;</span><span style="color: #004000;color: black;">set_overall_style</span><span style="color: #009900;color: black;">&#40;</span><span style="color: #0000ff;color: maroon;">&quot;color: <span style="color: #006699; font-weight: bold;">$overall</span>;&quot;</span><span style="color: #339933;color: black;">,</span> <span style="color: #009900; font-weight: bold;color: blue;">true</span><span style="color: #009900;color: black;">&#41;</span><span style="color: #339933;color: black;">;</span>
&nbsp;
  <span style="color: #000088;">$geshi</span><span style="color: #339933;color: black;">-&gt;</span><span style="color: #004000;color: black;">set_keyword_group_style</span><span style="color: #009900;color: black;">&#40;</span><span style="color: #cc66cc;color: maroon;">1</span><span style="color: #339933;color: black;">,</span> <span style="color: #0000ff;color: maroon;">&quot;color: <span style="color: #006699; font-weight: bold;">$keyword</span>;&quot;</span><span style="color: #339933;color: black;">,</span> <span style="color: #009900; font-weight: bold;color: blue;">true</span><span style="color: #009900;color: black;">&#41;</span><span style="color: #339933;color: black;">;</span>
  <span style="color: #000088;">$geshi</span><span style="color: #339933;color: black;">-&gt;</span><span style="color: #004000;color: black;">set_keyword_group_style</span><span style="color: #009900;color: black;">&#40;</span><span style="color: #cc66cc;color: maroon;">2</span><span style="color: #339933;color: black;">,</span> <span style="color: #0000ff;color: maroon;">&quot;color: <span style="color: #006699; font-weight: bold;">$keyword</span>;&quot;</span><span style="color: #339933;color: black;">,</span> <span style="color: #009900; font-weight: bold;color: blue;">true</span><span style="color: #009900;color: black;">&#41;</span><span style="color: #339933;color: black;">;</span>
  <span style="color: #000088;">$geshi</span><span style="color: #339933;color: black;">-&gt;</span><span style="color: #004000;color: black;">set_keyword_group_style</span><span style="color: #009900;color: black;">&#40;</span><span style="color: #cc66cc;color: maroon;">3</span><span style="color: #339933;color: black;">,</span> <span style="color: #0000ff;color: maroon;">&quot;color: <span style="color: #006699; font-weight: bold;">$keyword</span>;&quot;</span><span style="color: #339933;color: black;">,</span> <span style="color: #009900; font-weight: bold;color: blue;">true</span><span style="color: #009900;color: black;">&#41;</span><span style="color: #339933;color: black;">;</span>
  <span style="color: #000088;">$geshi</span><span style="color: #339933;color: black;">-&gt;</span><span style="color: #004000;color: black;">set_keyword_group_style</span><span style="color: #009900;color: black;">&#40;</span><span style="color: #cc66cc;color: maroon;">4</span><span style="color: #339933;color: black;">,</span> <span style="color: #0000ff;color: maroon;">&quot;color: <span style="color: #006699; font-weight: bold;">$keyword</span>;&quot;</span><span style="color: #339933;color: black;">,</span> <span style="color: #009900; font-weight: bold;color: blue;">true</span><span style="color: #009900;color: black;">&#41;</span><span style="color: #339933;color: black;">;</span>
&nbsp;
  <span style="color: #000088;">$geshi</span><span style="color: #339933;color: black;">-&gt;</span><span style="color: #004000;color: black;">set_symbols_style</span><span style="color: #009900;color: black;">&#40;</span><span style="color: #0000ff;color: maroon;">&quot;color: <span style="color: #006699; font-weight: bold;">$overall</span>;&quot;</span><span style="color: #339933;color: black;">,</span> <span style="color: #009900; font-weight: bold;color: blue;">true</span><span style="color: #009900;color: black;">&#41;</span><span style="color: #339933;color: black;">;</span>
  <span style="color: #000088;">$geshi</span><span style="color: #339933;color: black;">-&gt;</span><span style="color: #004000;color: black;">set_methods_style</span><span style="color: #009900;color: black;">&#40;</span><span style="color: #cc66cc;color: maroon;">1</span><span style="color: #339933;color: black;">,</span> <span style="color: #0000ff;color: maroon;">&quot;color: <span style="color: #006699; font-weight: bold;">$overall</span>;&quot;</span><span style="color: #339933;color: black;">,</span> <span style="color: #009900; font-weight: bold;color: blue;">true</span><span style="color: #009900;color: black;">&#41;</span><span style="color: #339933;color: black;">;</span>
  <span style="color: #000088;">$geshi</span><span style="color: #339933;color: black;">-&gt;</span><span style="color: #004000;color: black;">set_regexps_style</span><span style="color: #009900;color: black;">&#40;</span><span style="color: #cc66cc;color: maroon;">1</span><span style="color: #339933;color: black;">,</span> <span style="color: #0000ff;color: maroon;">&quot;color: <span style="color: #006699; font-weight: bold;">$overall</span>;&quot;</span><span style="color: #339933;color: black;">,</span> <span style="color: #009900; font-weight: bold;color: blue;">true</span><span style="color: #009900;color: black;">&#41;</span><span style="color: #339933;color: black;">;</span>
&nbsp;
  <span style="color: #000088;">$geshi</span><span style="color: #339933;color: black;">-&gt;</span><span style="color: #004000;color: black;">set_strings_style</span><span style="color: #009900;color: black;">&#40;</span><span style="color: #0000ff;color: maroon;">&quot;color: <span style="color: #006699; font-weight: bold;">$literal</span>;&quot;</span><span style="color: #339933;color: black;">,</span> <span style="color: #009900; font-weight: bold;color: blue;">true</span><span style="color: #009900;color: black;">&#41;</span><span style="color: #339933;color: black;">;</span>
  <span style="color: #000088;">$geshi</span><span style="color: #339933;color: black;">-&gt;</span><span style="color: #004000;color: black;">set_numbers_style</span><span style="color: #009900;color: black;">&#40;</span><span style="color: #0000ff;color: maroon;">&quot;color: <span style="color: #006699; font-weight: bold;">$literal</span>;&quot;</span><span style="color: #339933;color: black;">,</span> <span style="color: #009900; font-weight: bold;color: blue;">true</span><span style="color: #009900;color: black;">&#41;</span><span style="color: #339933;color: black;">;</span>
&nbsp;
  <span style="color: #000088;">$geshi</span><span style="color: #339933;color: black;">-&gt;</span><span style="color: #004000;color: black;">set_comments_style</span><span style="color: #009900;color: black;">&#40;</span><span style="color: #cc66cc;color: maroon;">1</span><span style="color: #339933;color: black;">,</span> <span style="color: #0000ff;color: maroon;">&quot;color: <span style="color: #006699; font-weight: bold;">$comment</span>;&quot;</span><span style="color: #339933;color: black;">,</span> <span style="color: #009900; font-weight: bold;color: blue;">true</span><span style="color: #009900;color: black;">&#41;</span><span style="color: #339933;color: black;">;</span>
  <span style="color: #000088;">$geshi</span><span style="color: #339933;color: black;">-&gt;</span><span style="color: #004000;color: black;">set_comments_style</span><span style="color: #009900;color: black;">&#40;</span><span style="color: #0000ff;">'MULTI'</span><span style="color: #339933;color: black;">,</span><span style="color: #0000ff;color: maroon;">&quot;color: <span style="color: #006699; font-weight: bold;">$comment</span>;&quot;</span><span style="color: #339933;color: black;">,</span> <span style="color: #009900; font-weight: bold;color: blue;">true</span><span style="color: #009900;color: black;">&#41;</span><span style="color: #339933;color: black;">;</span>
<span style="color: #009900;color: black;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.helyar.net/2010/wp-syntax-to-look-like-visual-studio/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Remove Size bbcode from phpbb</title>
		<link>http://www.helyar.net/2010/remove-size-bbcode-from-phpbb/</link>
		<comments>http://www.helyar.net/2010/remove-size-bbcode-from-phpbb/#comments</comments>
		<pubDate>Thu, 04 Mar 2010 17:16:13 +0000</pubDate>
		<dc:creator>George Helyar</dc:creator>
				<category><![CDATA[Code]]></category>

		<guid isPermaLink="false">http://www.helyar.net/?p=451</guid>
		<description><![CDATA[One of the most annoying things about phpBB is the ability for people to randomly use [size="200"]Huge[/size] BB code, with no easy way to remove it and every time you update between versions it comes back. To disable it: in /include/bbcode.php remove the whole case 5: ... break; section. To remove it from the posting [...]]]></description>
			<content:encoded><![CDATA[<p>One of the most annoying things about phpBB is the ability for people to randomly use [size="200"]Huge[/size] BB code, with no easy way to remove it and every time you update between versions it comes back.</p>
<p>To disable it:<br />
in /include/bbcode.php remove the whole</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;color: black;"><span style="color: #b1b100;color: blue;">case</span> <span style="color: #cc66cc;color: maroon;">5</span><span style="color: #339933;color: black;">:</span>
<span style="color: #339933;color: black;">...</span>
<span style="color: #b1b100;color: blue;">break</span><span style="color: #339933;color: black;">;</span></pre></div></div>

<p> section.</p>
<p>To remove it from the posting page:<br />
in /styles/prosilver/template/posting_buttons.html remove the whole</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;color: black;">&lt;select&gt;
...
&lt;/select&gt;</pre></div></div>

<p> section.</p>
<p>After that, delete your &#8220;cache&#8221; directory so that it uses the new copy.</p>
<p>Remember that you have to repeat this process after every update to phpBB3.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.helyar.net/2010/remove-size-bbcode-from-phpbb/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
