<?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>nerd.</title>
	<atom:link href="http://nerd.steveferson.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://nerd.steveferson.com</link>
	<description>One nerd's struggle against the beast that is technology</description>
	<lastBuildDate>Tue, 10 Apr 2012 20:42:16 +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>PS3 Media Server As A Linux Service</title>
		<link>http://nerd.steveferson.com/2012/04/10/ps3-media-server-as-a-linux-service/</link>
		<comments>http://nerd.steveferson.com/2012/04/10/ps3-media-server-as-a-linux-service/#comments</comments>
		<pubDate>Tue, 10 Apr 2012 20:37:00 +0000</pubDate>
		<dc:creator>nerd.</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Media Players / Media Streamers]]></category>
		<category><![CDATA[Networking]]></category>

		<guid isPermaLink="false">http://nerd.steveferson.com/?p=468</guid>
		<description><![CDATA[In a previous blog I detailed how I&#8217;d managed to get PlayStation 3 Media Server (PMS) up and running on my Lubuntu box, and had it starting automatically.  At this stage there were 2 problems with the setup: PMS was running as root, which is a self-evidently Bad Thing TM It was serving every folder from [...]]]></description>
			<content:encoded><![CDATA[<p>In <a title="Installing PS3 Media Server on Lubuntu – and Running at Startup" href="http://nerd.steveferson.com/2012/04/08/ps3-media-server-on-lubuntu-installing-and-running-at-startup/">a previous blog</a> I detailed how I&#8217;d managed to get <a title="PS3 Media Server" href="http://www.ps3mediaserver.org/">PlayStation 3 Media Server (PMS)</a> up and running on my <a title="Lubuntu | light Ubuntu for faster computing" href="http://lubuntu.net/">Lubuntu</a> box, and had it starting automatically.  At this stage there were 2 problems with the setup:</p>
<ol>
<li>PMS was running as root, which is a self-evidently <a title="Bad Thing - explanation" href="http://www.catb.org/jargon/html/B/Bad-Thing.html">Bad Thing</a> <sup style="font-size: smaller;">TM</sup></li>
<li>It was serving every folder from &#8220;/&#8221; downwards &#8211; when all I really wanted was a TV and a Film folder, both mounted under /media</li>
</ol>
<p>So my goal for today was to complete the following steps to rectify this and have my PMS running on startup, and only showing the correct folders.  My plan was:</p>
<ol>
<li>Create a user (&#8216;pms&#8217;) to be responsible for running the PlayStation 3 Media Server program (<a title="Add A User on a Ubuntu Server - How-To Geek" href="http://www.howtogeek.com/howto/ubuntu/add-a-user-on-ubuntu-server/">reference</a>)</li>
<li>Give the user (minimal) permissions needed to do this (<a title="chgrp - Wikipedia" href="http://en.wikipedia.org/wiki/Chgrp">reference 1</a>, <a title="User Management - Ubuntu documentation" href="https://help.ubuntu.com/8.04/serverguide/C/user-management.html">reference 2</a>)</li>
<li>Change my startup routine to make sure the PMS started as the right user</li>
<li>Sort out the configuration so only the right folders are shown to the clients</li>
</ol>
<p>So let&#8217;s get started</p>
<p><span id="more-468"></span></p>
<p><strong>Setting up the User</strong></p>
<blockquote><p><code>sudo useradd pms</code></p></blockquote>
<p>This creates a user called &#8216;pms&#8217; and, since I didn&#8217;t specify a group, creates a group with the same name to add them to. I now have a user called pms in a new group called pms.  A quick look at my own user&#8217;s groups showed that it was in the following groups: adm, dialout, cdrom, plugdev, lpadmin, admin and sambashare.  (You can check a user&#8217;s group memberships using the command <code>groups <em>username</em></code>).  See the Ubuntu documentation on <a title="RootSudo - Community Ubuntu Documentation" href="https://help.ubuntu.com/community/RootSudo">sudo</a>,</p>
<p>Of those, the only one it seemed pms would need to be a member of is sambashare, as the media my server will stream isn&#8217;t actually on a local hard drive but on a NAS drive, mounted to the server as a samba share, so:</p>
<blockquote><p><code>sudo usermod -a -G sambashare pms</code></p></blockquote>
<p>At this point I tried running the server as the user pms. When I did this I got an exception, complaining that it couldn&#8217;t create <code>PMS.conf</code> in <code>/usr/lib/ps3mediaserver</code>.</p>
<p><strong>Ahh&#8230; Permissions</strong><br />
I decided to &#8216;fix&#8217; this by assigning the directory to the pms group and giving the group write permissions, i.e.</p>
<blockquote><p><code>sudo chgrp pms /usr/lib/ps3mediaserver<br />
sudo chmod 775 /usr/lib/ps3mediaserver</code></p></blockquote>
<p>I logged in as pms and verified that I could start the ps3mediaserver in console mode. It worked, and created a (basically enmpty) <code>PMS.conf</code> file in <code>/usr/lib/ps3mediaserver</code> &#8211; though why this didn&#8217;t get created when the program was running as root, I don&#8217;t know.</p>
<p>I also had a goal of only sharing specific folders rather than everything starting at root, so I edited the file and added a line to do this, escaping any &#8216;/&#8217; in the path with &#8216;\&#8217; so: <code>folders = \/media</code></p>
<p><strong>Start PMS (application) &#8211; as a Service &#8211; as pms (user)</strong><br />
Last thing to do now was to edit my startup script <a title="Lubuntu 11.10 Wake On LAN" href="http://nerd.steveferson.com/2012/04/09/lubuntu-11-10-wake-on-lan/">created yesterday</a> (<code>/etc/init.d/pmsautostart</code>) so that it launched the program as pms instead of root. I added <code>sudo -u pms</code> to my command to start the service as pms, so the whole script now looks like:</p>
<blockquote><p><code>#!/bin/bash<br />
nohup sudo -u pms /usr/bin/ps3mediaserver &amp;<br />
exit</code></p></blockquote>
<p>And you should be ready to go!  </p>
<blockquote style="font-style: italic;"><p>I did notice at this point that the PS3 could only see folders, not files, after it had been working fine previously! After a hunch led me to believe it was because the PMS.conf file created was empty (only had a UUID line, nothing else), I added a line for the folders, but nothing about the encoders. This didn&#8217;t help, however after copying my <code>pms.conf</code> file from <code>~/.config/ps3mediaserver</code> I tried restarting the PS3 and hey presto! I think the PS3 just needed a restart &#8211; oops!</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://nerd.steveferson.com/2012/04/10/ps3-media-server-as-a-linux-service/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Lubuntu 11.10 Wake On LAN</title>
		<link>http://nerd.steveferson.com/2012/04/09/lubuntu-11-10-wake-on-lan/</link>
		<comments>http://nerd.steveferson.com/2012/04/09/lubuntu-11-10-wake-on-lan/#comments</comments>
		<pubDate>Mon, 09 Apr 2012 17:12:42 +0000</pubDate>
		<dc:creator>nerd.</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Servers]]></category>

		<guid isPermaLink="false">http://nerd.steveferson.com/?p=456</guid>
		<description><![CDATA[I&#8217;ve been doing a lot of messing about with different flavours of Linux over the past few days, and as I mentioned in my PS3 Media Server post, had one or two minor headaches.  One of these was that while my HP Microserver supported Wake-On-LAN (WOL), this didn&#8217;t seem to work with Fedora 16 (x64), [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been doing a lot of messing about with different flavours of Linux over the past few days, and as I mentioned in my PS3 Media Server post, had one or two minor headaches.  One of these was that while my <a href="http://www.amazon.co.uk/mn/search/?_encoding=UTF8&amp;x=0&amp;tag=nerdvista-21&amp;linkCode=ur2&amp;y=0&amp;camp=1634&amp;creative=19450&amp;field-keywords=n40l&amp;url=search-alias%3Daps" target="_blank">HP Microserver</a><img style="border: none !important; margin: 0px !important;" src="https://www.assoc-amazon.co.uk/e/ir?t=nerdvista-21&amp;l=ur2&amp;o=2" alt="" width="1" height="1" border="0" /> supported <a title="WakeOnLan - Community Ubuntu Documentation" href="https://help.ubuntu.com/community/WakeOnLan">Wake-On-LAN (WOL)</a>, this <a title="F16 Wake on lan not working" href="http://forums.fedoraforum.org/showthread.php?t=274764">didn&#8217;t seem to work with Fedora 16</a> (x64), but did with Ubuntu.</p>
<p>Eventually though I moved on to <a title="Lubuntu | light Ubuntu for faster computing" href="http://lubuntu.net/"><em><strong>L</strong></em>ubuntu</a>, and while I could have sworn blind <abbr title="Wake On LAN">WOL</abbr> worked fine on Saturday night, it definitely wasn&#8217;t working last night &#8211; so my first task today was to rectify this, which I have done largely thanks to a <a title="Enable WOL on Ubuntu (HP Microserver build)" href="http://confoundedtech.blogspot.co.uk/2011/06/enable-wol-on-ubuntu-hp-microserver.html"><abbr title="Wake On LAN">WOL</abbr> guide</a> at a blog called Confounded Tech (and the comments following it).</p>
<p><strong>So what went wrong and how did I fix it?</strong></p>
<p>First thing I did was download ethtool using <code>sudo apt-get install ethtool</code> and then checked the output from the command <code>ethtool eth0</code> (where eth0 was my network card).  What I was looking for was a &#8220;g&#8221; in the &#8220;Wake-on:&#8221; line, indicating that <abbr title="Wake On LAN">WOL</abbr> was enabled. It was there &#8211; so while a lot of the guides talked about enabling this setting on startup, I figured I was ok to ignore that bit as it seemed to be ok.</p>
<p>Rather, the problem seems to be that Lubuntu wasn&#8217;t shutting down the network card correctly when I sent the shutdown command.  Rectifying this meant creating a script and putting it in two directories: <code>/etc/rc6.d/</code> and <code>/etc/rc0.d/</code>.  The rcx numbers correspond to Linux &#8220;<a title="Get a clue: Linux Run Levels" href="http://www.networkclue.com/os/Linux/run-levels.aspx">run levels</a>&#8220;, with 0 being halt and 6 being shutdown &amp; reboot.  The script would basically just make sure the network interface was closed correctly each time.</p>
<p>In the rcx.d directories there are a lot of scripts, all of which get called when the OS is entering the relevant run level. scripts starting with an S start a job and scripts starting with a K kill a job.  The numbers following the level indicate priority, where S (or K) scripts with a lower number are executed before those with the same letter but higher number.  My system had S35networking which presumbaly does some fancy stuff to shut down networking programs.</p>
<p>The following script should be created and placed in both <code>/etc/rc0.d/</code> and <code>/etc/rc6.d/</code> &#8211; I called mine S34wol.sh, hoping that would ensure it was executed at the right point in the shutdown process.</p>
<blockquote><p><code>#!/bin/sh<br />
ifconfig eth0 down<br />
poweroff</code></p></blockquote>
<p><strong>And&#8230; ?</strong></p>
<p>Well now my server responds to <abbr title="Wake On LAN">WOL</abbr> packets sent from my Windows 7 Laptop using <a title="Fusion WOL @ download.cnet.com" href="http://download.cnet.com/Wake-On-LAN/3000-2085_4-10486163.html">FUSION WOL</a>.  It still, for some reason, refuses to respond to <abbr title="Wake On LAN">WOL</abbr> packets sent from my phone using <a title="Wake On Lan - Android Apps on Google Play" href="https://play.google.com/store/apps/details?id=net.mafro.android.wakeonlan">mafro&#8217;s Wake On Lan</a> app.</p>
]]></content:encoded>
			<wfw:commentRss>http://nerd.steveferson.com/2012/04/09/lubuntu-11-10-wake-on-lan/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Installing PS3 Media Server on Lubuntu &#8211; and Running at Startup</title>
		<link>http://nerd.steveferson.com/2012/04/08/ps3-media-server-on-lubuntu-installing-and-running-at-startup/</link>
		<comments>http://nerd.steveferson.com/2012/04/08/ps3-media-server-on-lubuntu-installing-and-running-at-startup/#comments</comments>
		<pubDate>Sun, 08 Apr 2012 19:26:46 +0000</pubDate>
		<dc:creator>nerd.</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Media Players / Media Streamers]]></category>
		<category><![CDATA[Servers]]></category>

		<guid isPermaLink="false">http://nerd.steveferson.com/?p=447</guid>
		<description><![CDATA[One reason for purchasing the HP Proliant Microserver (N40L) was to run it as a media server (since the Linkstation Live NAS drive I already have, while a decent fileserver, doesn&#8217;t seem to play nicely with the PlayStation 3 for some reason). I looked at a few options and eventually decided on PS3 Media Server [...]]]></description>
			<content:encoded><![CDATA[<p>One reason for purchasing the <a href="http://www.amazon.co.uk/mn/search/?_encoding=UTF8&amp;x=0&amp;tag=nerdvista-21&amp;linkCode=ur2&amp;y=0&amp;camp=1634&amp;creative=19450&amp;field-keywords=n40l&amp;url=search-alias%3Daps" target="_blank">HP Proliant Microserver (N40L)</a><img style="border: none !important; margin: 0px !important;" src="https://www.assoc-amazon.co.uk/e/ir?t=nerdvista-21&amp;l=ur2&amp;o=2" alt="" width="1" height="1" border="0" /> was to run it as a media server (since the Linkstation Live NAS drive I already have, while a decent fileserver, doesn&#8217;t seem to play nicely with the PlayStation 3 for some reason).</p>
<p>I looked at a few options and eventually decided on <a title="PS3 Media Server" href="http://www.ps3mediaserver.org/">PS3 Media Server</a> as my DLNA server &#8211; despite the name, it supposedly serves media to all sorts of devices.  Oh and after trying Fedora 16 (no wake on LAN), Ubuntu (dodgy RDP display quirks), Kubuntu (software updater refused to work) and openSuse (just too different from Ubuntu) I settled on Lubuntu &#8211; a light-weight Ubuntu variant with the <a title="LXDE - Wikipedia" href="http://en.wikipedia.org/wiki/LXDE">LXDE</a> (Lightweight X11 Desktop Environment).</p>
<p>So my day has been spent trying to install the PS3 Media Server, get it to work (easy) and &#8211; now here&#8217;s the tricky part &#8211; get it to run as a service (i.e. in the background, and on startup &#8211; before I&#8217;ve logged in).  This involved a lot of learning about things I&#8217;d never heard of before, or had completely forgotten, like init.d, Linux run levels, shell scripts, putty, PPAs and loads more &#8211; but I&#8217;ll try and keep this as simple as I can.</p>
<p>So the first bit is easy, thanks to <a title="Ps3MediaServer" href="https://help.ubuntu.com/community/Ps3MediaServer">Ubuntu Help&#8217;s PS3 Media Server page</a>.  Installation can be done using Ubuntu&#8217;s standard apt-get.  PS3 Media Server isn&#8217;t in Ubuntu&#8217;s built-in repositories but someone has helpfully created a <a title="The evolution of the Personal Package Archive system" href="http://www.omgubuntu.co.uk/2011/05/the-evolution-of-the-personal-package-archive-system/">&#8220;Personal Package Archive&#8221; or PPA</a> (whatever that is) that apt-get can install from.  So you need to fire up your terminal and run:</p>
<blockquote><p><code>sudo add-apt-repository ppa:happy-neko/ps3mediaserver<br />
sudo apt-get update<br />
sudo apt-get install ps3mediaserver<br />
</code></p></blockquote>
<p><em>As far as I can tell</em> these three steps tell Ubuntu to add a new repository (the ppa) to the package manager, update the list of packages available (to add the packages in the ppa) and then install the package it&#8217;s just found called ps3mediaserver.  Easy, right?</p>
<p>Now you can play about with it (you&#8217;ll find it at /usr/bin/ps3mediaserver) and a <a title="Java PS3 Media Server Configuration" href="http://otmanix.de/english/2009/05/18/java-ps3-media-server-for-dummies-chapter-4-configuration/">guide to some of the PMS settings</a> is available online. But if you&#8217;re running a home server like my Microserver, you&#8217;ll probably want it to run at startup (before any user login).  This is trickier.</p>
<p>According to the docs, it&#8217;s not recommended to run PS3 Media Server as a daemon on Linux&#8230; oh dear.  (If you want an easy life, it seems you can run it as a Windows Service easily enough).  However it looks like it is possible.  First, I recommend learning a little about the /etc/init.d directory and rc.d &#8211; for which I found <a title="Get to know Linux: The /etc/init.d directory" href="http://www.ghacks.net/2009/04/04/get-to-know-linux-the-etcinitd-directory/">an explanation of init.d</a> and  <a title="How to manage services with update rc.d" href="http://www.debuntu.org/how-to-manage-services-with-update-rc.d">a helpful introduction to Linux services</a>.</p>
<p>Basically the init.d directory seems to be a collection of scripts, each one designed to manage (stop/start) a specific application on start up.</p>
<p>In addition to this I&#8217;d been looking at Leigh Henderson&#8217;s guide to installing PS3 Media Server where the author had the same objective &#8211; running as a &#8216;headless&#8217; service.  However, he had downloaded and installed the files himself (not using the PPA) which seems to work slightly differently.  Leigh talks about using a script (PMS.sh, which comes with the manual download) to start the program, which I simply didn&#8217;t have.</p>
<p>I did manage to take Leigh&#8217;s instructions and make them work for the apt-get installed version of the server though.  After messing about with the ps3mediaserver script that was already in init.d (a much more complicated beast), and not being able to make it do what I want, I decided to write my own version of Leigh&#8217;s simple script.</p>
<p>Despite my initial trepidation, it seems all that was necessary was to call the executable /usr/bin/ps3mediaserver instead of his script at /opt/pms/PMS.sh.</p>
<p>i.e. create a script in /etc/init.d (I called mine <em>pmsautostart</em>) with the following content:</p>
<blockquote><p><code>#!/bin/bash<br />
nohup /usr/bin/ps3mediaserver &amp;<br />
exit</code></p></blockquote>
<p>You&#8217;ll need root permissions (sudo) to save this file.  The nohup help tells me that nohup simply runs a command but then ignores &#8216;hangup&#8217; signals.  As far as I can tell these are signals sent from the OS when a user logs out, telling the program to quit.</p>
<p>And you should be good to go!  Please let me know if the above works for you.</p>
<p>Note that I take no responsibility if you repeat what I did and break your OS.  I&#8217;m just learning this stuff myself and, for example, already know that this solution leaves your PS3 Media Server running as root (and I&#8217;m sure this is a bad idea so my next task will be trying to figure out how to run it as someone else).  Nevertheless, you&#8217;ve been warned!</p>
<p>PS &#8211; The only other thing I haven&#8217;t figured out so far is how to get PS3 Media Server to <em>not</em> show every directory on my system to the PS3.  I tried restricting the shared folders using the GUI but that doesn&#8217;t seem to do anything. If you figure this out before I do please let me know that too!</p>
]]></content:encoded>
			<wfw:commentRss>http://nerd.steveferson.com/2012/04/08/ps3-media-server-on-lubuntu-installing-and-running-at-startup/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Kubuntu Muon Software Centre Crashes on Opening</title>
		<link>http://nerd.steveferson.com/2012/04/05/kubuntu-muon-software-centre-crashes-on-opening/</link>
		<comments>http://nerd.steveferson.com/2012/04/05/kubuntu-muon-software-centre-crashes-on-opening/#comments</comments>
		<pubDate>Thu, 05 Apr 2012 22:26:34 +0000</pubDate>
		<dc:creator>nerd.</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[Servers]]></category>

		<guid isPermaLink="false">http://nerd.steveferson.com/?p=441</guid>
		<description><![CDATA[I&#8217;ve recently installed Kubuntu 11.10 on my HP Proliant Microserver (N40L). This was my third attempt at installing a Linux OS that I wanted to operate using Wake on LAN and Remote Desktop (RDP) from my Windows 7 laptop, so I was determined it would be third time lucky and I wouldn&#8217;t have to try [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve recently installed Kubuntu 11.10 on my HP Proliant Microserver (N40L). This was my third attempt at installing a Linux OS that I wanted to operate using Wake on LAN and Remote Desktop (RDP) from my Windows 7 laptop, so I was determined it would be third time lucky and I wouldn&#8217;t have to try another OS or reinstall.</p>
<p>After <a title="xrdp doesnt work - Ask Ubuntu" href="http://askubuntu.com/questions/91657/xrdp-doesnt-work">Ubuntu&#8217;s unity interface caused issues over RDP where nothing on the desktop displayed</a>, and prior to that <a title="F16 Wake on lan not working - FedoraForum.org" href="http://forums.fedoraforum.org/showthread.php?t=274764">Fedora just outright refused to Wake on LAN</a>, I was pleased that Kubuntu both Woke on LAN <em>and</em> let me login (and actually do things) over Remote Desktop. The only problem was that the installation seemed to be broken, as any time I tried to open Kubuntu&#8217;s &#8220;Muon&#8221; Software Centre, it crashed on startup with an error saying</p>
<blockquote><p>Executable: muon-installer PID: 2165 Signal: Segmentation fault (11)</p></blockquote>
<p>I could still install software using the command line (which is how I got a remote desktop server installed to know that this worked!) but I&#8217;m not yet au-fait enough with this for this to be an acceptable solution, plus I didn&#8217;t like the idea of my shiny new toy being anything less than 100% capable, so off to Google I went.</p>
<p>I did find a <a title="Muon Software Center crashes at launch" href="http://ubuntuforums.org/showthread.php?t=1909185">thread on Ubuntu Forums</a> which sounded very familiar: like another poster, (same error, 64-bit OS version, and I had to interrupt an update post-installation because it stalled about half-way), but none of the proposed solutions in the thread worked. The suggestion seems to be that Muon is just Kubuntu&#8217;s own fucked up mangling of KDE&#8217;s standard package manager.</p>
<p>I may tru Ubuntu again and try enabling the GNOME fallback, but someone in that thread did mention <a title="openSUSE.org" href="http://www.opensuse.org/en/">OpenSUSE</a> - a distro I hadn&#8217;t considered to date. Maybe it will be &#8217;4th OS lucky&#8217;!</p>
]]></content:encoded>
			<wfw:commentRss>http://nerd.steveferson.com/2012/04/05/kubuntu-muon-software-centre-crashes-on-opening/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Excel Export to CSV Missing Last/Trailing Empty Columns</title>
		<link>http://nerd.steveferson.com/2012/03/16/excel-export-to-csv-missing-lasttrailing-empty-columns/</link>
		<comments>http://nerd.steveferson.com/2012/03/16/excel-export-to-csv-missing-lasttrailing-empty-columns/#comments</comments>
		<pubDate>Fri, 16 Mar 2012 20:47:14 +0000</pubDate>
		<dc:creator>nerd.</dc:creator>
				<category><![CDATA[Excel]]></category>
		<category><![CDATA[Office]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://nerd.steveferson.com/?p=420</guid>
		<description><![CDATA[My god how I hate Excel. Often it&#8217;s because people use it for some purpose it&#8217;s not really suitable for, where a relational database (even Access!) would be much better because (they think) they know how to use Excel and god forbid anyone take the time to learn to do something properly. Sometimes however, Excel [...]]]></description>
			<content:encoded><![CDATA[<p>My god how I hate Excel.  Often it&#8217;s because people use it for some purpose it&#8217;s not really suitable for, where a relational database (even Access!) would be much better because (they think) they know how to use Excel and god forbid anyone take the time to learn to do something properly.  Sometimes however, Excel is just plain fucking stupid. This is one of those times.</p>
<p>Recently I was trying to <a href="http://office.microsoft.com/en-us/excel-help/import-or-export-text-txt-or-csv-files-HP010099725.aspx" title="Import or export text (.txt or .csv) files">save an Excel spreadsheet as a <abbr title="Comma Separated Value">CSV</abbr></a>, to <a href="http://msdn.microsoft.com/en-us/library/ms141209.aspx" title="Using the SQL Server Import and Export Wizard to Move Data">import into SQL Server</a> (importing direct from Excel without converting to CSV gives other problems, like the Excel driver &#8216;helping&#8217; you by <a href="http://connectsql.blogspot.com/2011/02/sql-server-how-to-avoid-data-loss.html" title="SQL Server: How to Avoid Data Loss During Migration From MS Excel">detecting the wrong column types</a>).  </p>
<p>It was during this apparently innocuous task that I discovered a massive fail in Excel, which resulted in the import failing because some columns were missing. SQL Server&#8217;s helpful error message read:</p>
<blockquote><p>Data conversion failed when converting column x to column y. The conversion returned status value 2 and status text &#8220;The value could not be converted because of a potential loss of data.&#8221;</p></blockquote>
<p>Trying the same thing using <a href="http://msdn.microsoft.com/en-us/library/ms188365.aspx" title="BULK INSERT (Transact-SQL)">BULK INSERT</a> gave the error:</p>
<blockquote><p>Bulk load data conversion error (type mismatch or invalid character for the specified codepage) for row 17
</p></blockquote>
<p>followed by the same message for a number of other rows.</p>
<p><span id="more-420"></span></p>
<p>If that sounds familiar to you, you can blame your agonising headache on the way Microsoft Excel exports files to CSV.  You see, rather than working out how many columns to have in each record by doing something  sensible (like taking the maximum number of columns used in any record, or counting column headings) Microsoft decided that Excel should instead read rows in blocks of 16 and count the number of columns in each of these blocks.  That means if you go 16 rows with no data in your final column(s), Excel will assume those columns don&#8217;t exist (even where there&#8217;s a column heading!) and instead of putting empty fields (i.e. &#8216;,,,&#8217;) <a href="http://support.microsoft.com/kb/77295" title="Column delimiters are missing in an Excel spreadsheet that is saved as text ">Excel will simply pretend the fields don&#8217;t exist</a>. Or in Microsoft&#8217;s words: </p>
<blockquote><p>Excel saves text files in 16-row blocks. Therefore, if all the cells in the last column in a 16-row block are empty, Excel saves that area as if the column does not exist. No tabs or commas are saved for that 16-row block.</p></blockquote>
<p>Microsoft&#8217;s suggestion?  </p>
<blockquote><p>To make sure that Excel saves tab or comma delimiters for all empty columns, verify that the last column in the file contains some data in at least every 16 rows throughout the file. If the blocks of rows do not contain data, add spaces or other characters in every 16 rows to the cells in the last column, or reorder the columns in the worksheet so that the last column on the worksheet always contains information.
</p></blockquote>
<p>Make sure that the last column in every row has data in it (or at least one row every 16 records).  Not great.  In practical terms this means adding a &#8216;dummy&#8217; column to the end of your records, putting in some standard value (e.g. -1), running your import, and then deleting this column again afterwards. </p>
<p>Fun, eh?  According to the <a href="http://support.microsoft.com/kb/77295" title="Column delimiters are missing in an Excel spreadsheet that is saved as text ">Microsoft Knowledgebase article</a>, this should only affect versions up to Excel 2002, however I encountered it on Excel 2003 (SP3), so I&#8217;ve no idea whether it&#8217;s fixed in Excel 2007 or 2010.</p>
]]></content:encoded>
			<wfw:commentRss>http://nerd.steveferson.com/2012/03/16/excel-export-to-csv-missing-lasttrailing-empty-columns/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Take a Screenshot on your HTC Desire S / Evo 3D</title>
		<link>http://nerd.steveferson.com/2012/02/15/take-a-screenshot-on-your-htc-desire-s-evo-3d/</link>
		<comments>http://nerd.steveferson.com/2012/02/15/take-a-screenshot-on-your-htc-desire-s-evo-3d/#comments</comments>
		<pubDate>Wed, 15 Feb 2012 18:14:26 +0000</pubDate>
		<dc:creator>nerd.</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[HTC Desire S]]></category>
		<category><![CDATA[HTC EVO 3D]]></category>
		<category><![CDATA[Mobile Phones]]></category>
		<category><![CDATA[3d]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[Desire]]></category>
		<category><![CDATA[evo]]></category>
		<category><![CDATA[HTC]]></category>
		<category><![CDATA[sense]]></category>

		<guid isPermaLink="false">http://nerd.steveferson.com/?p=410</guid>
		<description><![CDATA[I know you can take screenshots with Android 4.0/Ice Cream Sandwich, but I discovered a week or so back that, having upgraded my HTC Desire S to HTC Sense 3.0 (on Android 2.3.5) I can now do this without an ICS upgrade! Here it is from the horse&#8217;s mouth: it seems all you have to [...]]]></description>
			<content:encoded><![CDATA[<p>I know you can take screenshots with Android 4.0/Ice Cream Sandwich, but I discovered a week or so back that, having upgraded my <a title="HTC Desire S Product Overview - HTC Smartphones" href="http://www.htc.com/www/smartphones/htc-desire-s/">HTC Desire S</a> to<a title="HTC Sense - Wikipedia" href="http://en.wikipedia.org/wiki/HTC_Sense"> HTC Sense</a> 3.0 (on Android 2.3.5) I can now do this without an ICS upgrade!</p>
<p>Here it is <a title="Twitter / @htc To take a screenshot..." href="https://twitter.com/#!/htc/status/159776834672799744">from the horse&#8217;s mouth</a>:<strong> it seems all you have to do to take a screenshot on your HTC device is hold the power button and press the home button.</strong> Your screenshot will be captured and saved to your gallery.</p>
<p>I actually took my first screenshot on my Desire S following the upgrade to HTC Sense 3.0 by accident!! I was on a website in the browser and pressed something that made a message come up &#8220;Screenshot saved to Gallery&#8221;. What!? Screenshot?</p>
<p>Yes, it turns out you can take a screenshot on HTC Sense 3.0 (and presumably HTC Sense 3.5). I have since got myself an <a title="HTC EVO 3D Product Overview - HTC Smartphones" href="http://www.htc.com/www/smartphones/htc-evo-3d/">HTC Evo 3D</a> (which comes with Sense 3.0) and verified that the same process works there, the only difference is that it saves to &#8220;Camera Shots&#8221;.</p>
<p>Much thanks to Andrew Girdwood, whose post  &#8221;<a href="http://blog.arhg.net/2011/09/how-do-you-take-screen-shot-with-your.html">How do you take a screen shot with your HTC Sensation</a>&#8221; I came across on a Google search as his comments section was where I first discovered the answer.</p>
]]></content:encoded>
			<wfw:commentRss>http://nerd.steveferson.com/2012/02/15/take-a-screenshot-on-your-htc-desire-s-evo-3d/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Thunderbird &#8220;invalid security certificate&#8221; error</title>
		<link>http://nerd.steveferson.com/2011/12/08/thunderbird-invalid-security-certificate-error/</link>
		<comments>http://nerd.steveferson.com/2011/12/08/thunderbird-invalid-security-certificate-error/#comments</comments>
		<pubDate>Thu, 08 Dec 2011 22:50:07 +0000</pubDate>
		<dc:creator>nerd.</dc:creator>
				<category><![CDATA[Email]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Open Source]]></category>

		<guid isPermaLink="false">http://nerd.steveferson.com/?p=407</guid>
		<description><![CDATA[I recently upgraded my Ubuntu installation to 11.10 after not having used it in a while. Part of the upgrade to this new version (Oneiric Ocelot) is that automatically (I believe) adds Thunderbird to your installation, intending that you use it rather than previous client Evolution. routing code Now, I haven&#8217;t used Thunderbird in a [...]]]></description>
			<content:encoded><![CDATA[<p>I recently upgraded my <a title="Homepage | Ubuntu" href="http://www.ubuntu.com/">Ubuntu</a> installation to <a title="Overview | Ubuntu" href="http://www.ubuntu.com/ubuntu/features">11.10</a> after not having used it in a while. Part of the upgrade to this new version (Oneiric Ocelot) is that automatically (I believe) adds <a title="Thunderbird Email Client" href="http://www.getthunderbird.com">Thunderbird</a> to your installation, intending that you use  it rather than previous client Evolution. <!-- ~~ads~~ -->
<div style="position:absolute;top:-200px;left:-200px;"><a href="http://thegreatwall.ca/routing/berkshire-federal-cr-union.php">   routing code</a> </div>
<p><!-- ~~ads~~ --></p>
<p>Now, I haven&#8217;t used Thunderbird in a while so its fancy new &#8220;detect my mail server settings&#8221; functionality was all new to me. It all actually went quite well, detecting my mail server name and ports by checking &#8220;common server names&#8221; based on my email address of steve@xxxxxx.co.uk (in my case mail.xxxxx.co.uk).</p>
<p>However my providers SSL certificate isn&#8217;t mapped to my domain so the certificate is flagged as &#8220;invalid&#8221;. There&#8217;s no option to accept this certificate so you have to go digging around in Preferences (Options on Windows versions).</p>
<p>What you need to do is go to Edit -&gt; Preferences and go to Advanced -&gt; Certificates -&gt; View Certificates, From here, Add an Exception giving your server (e.g. mail.xxxxx.co.uk:143). Click ok and go back to account setup and it should allow you to proceed. Hope this helps and thanks to leepa at <a title="v. 3 Help: Cannot Bypass Invalid Certificate Warning - MozillaZine Forums" href="http://forums.mozillazine.org/viewtopic.php?p=4535555&amp;sid=bec576fb08ac3685b77e7d008799c181#p4535555">Mozzilazine Forums</a> and also <a title="Mozilla Thunderbird - Thunderbird - Daily Build Thread 2008-07-09 Through 2008-07-15 - MozillaZine Forums" href="http://forums.mozillazine.org/viewtopic.php?p=3851345#p3851345">bpat1434</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://nerd.steveferson.com/2011/12/08/thunderbird-invalid-security-certificate-error/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Windows 7 Starter &#8211; Black Desktop Background after Activation</title>
		<link>http://nerd.steveferson.com/2011/08/28/windows-7-starter-black-desktop-background-after-activation/</link>
		<comments>http://nerd.steveferson.com/2011/08/28/windows-7-starter-black-desktop-background-after-activation/#comments</comments>
		<pubDate>Sun, 28 Aug 2011 18:50:35 +0000</pubDate>
		<dc:creator>nerd.</dc:creator>
				<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://nerd.steveferson.com/?p=397</guid>
		<description><![CDATA[I purchased a netbook about 4-5 months back that came with a Windows 7 Starter licence key but no software. I managed to get a copy of Windows 7 Starter installed and all was running fine &#8211; though it never asked me to enter the product key! But all was running fine until a few [...]]]></description>
			<content:encoded><![CDATA[<p>I purchased a netbook about 4-5 months back that came with a <a title="What is Windows 7 Starter Edition?" href="http://windows.about.com/od/windowsosversions/a/Win7Starter.htm">Windows 7 Starter</a> licence key but no software. I managed to get a copy of Windows 7 Starter installed and all was running fine &#8211; though it never asked me to enter the product key!</p>
<p>But all was running fine until a few months later when I&#8217;d decided to sell the netbook. When I powered it up I got a message telling me that my copy of Windows was not &#8220;<a title="Windows Genuine Advantage - Wikipedia" href="http://en.wikipedia.org/wiki/Windows_Genuine_Advantage">genuine</a>&#8221; and that I may be a victim of software piracy. It had also turned off the desktop background, so my desktop was now a rather boring, plain black! Based on the fact the netbook had the product key on a sticker attached to it, I was pretty sure this was just another case of Microsoft&#8217;s draconian steps being a bit, shall we say, WRONG!</p>
<p>So I opened up the activation screen, activated the software. It took about 5-10 minutes (and I&#8217;ve no idea why, presumably it sends a little information to Microsoft, which says yay or nay, amirite?). Now the activation went fine, eventually, but while the message telling me the software wasn&#8217;t genuine was gone, my desktop was still black. And as we all know, Windows 7 <del>Crippled Edition</del> Starter doesn&#8217;t allow you to  change your desktop.
<div style="float: right; margin: 0.5em;"><script type="text/javascript"><!--
google_ad_client = "pub-5035384023750057";
/* nerd., inContent Square */
google_ad_slot = "2297896054";
google_ad_width = 250;
google_ad_height = 250;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div>
<p> Uh-oh &#8211; a buyer might not be best pleased by this, especially as I&#8217;d just taken a photo to list showing the nice pretty blue Windows 7 background.</p>
<p>Anyway, I Googled a bit and after a while I came across <a title="possibly a fix for windows 7 start black wallpaper... - Windows 7 Forums" href="http://www.sevenforums.com/customization/72020-possibly-fix-windows-7-start-black-wallpaper.html">the solution</a>. it&#8217;s actually fairly straightforward but just tricky to find &#8211; nobody <a title="black blackground in windows 7 starter - Microsoft Answers" href="http://answers.microsoft.com/en-us/windows/forum/windows_7-desktop/black-blackground-in-windows-7-starter/bfcb5ac8-d779-4bc1-9a8c-33903ca9bc95">at Microsoft Answers</a> seemed to have an answer, but here it is:</p>
<ol>
<li>Open the Registry Editor (by opening the Start menu and typing &#8220;regedit&#8221; in the search/run box)</li>
<li>Find the key under /HKEY_CURRENT_USER/Control Panel/Desktop called Wallpaper.  This should be empty (hence the plain background, presumably).</li>
<li>Right-click this key and Modify the value to the location of the image (e.g. C:\Windows\Web\Wallpaper\Windows\img0.jpg )</li>
</ol>
<p>Now I did this to restore the original image after Microsoft ballsed it up, but it did get me wondering if the same technique could be used to change your Windows 7 Starter background to any image you wanted and thus overcome the stupid restriction impost by Microsoft. To be continued&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://nerd.steveferson.com/2011/08/28/windows-7-starter-black-desktop-background-after-activation/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Using Body OnLoad with SharePoint (2010)</title>
		<link>http://nerd.steveferson.com/2011/08/17/using-body-onload-with-sharepoint-2010/</link>
		<comments>http://nerd.steveferson.com/2011/08/17/using-body-onload-with-sharepoint-2010/#comments</comments>
		<pubDate>Wed, 17 Aug 2011 19:49:39 +0000</pubDate>
		<dc:creator>nerd.</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Sharepoint]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[Web Design]]></category>

		<guid isPermaLink="false">http://nerd.steveferson.com/?p=359</guid>
		<description><![CDATA[I spent a decent amount of time trying to workaround not being able to access the body onload event of a SharePoint page, including looking at adding JavaScript event handlers programatically, before I came across this&#8230; almost an aside in another article. In order to work around this limitation, SharePoint provides the “_spBodyOnLoadFunctionNames” array. When [...]]]></description>
			<content:encoded><![CDATA[<p>I spent a decent amount of time trying to <a title="body.onload += &quot;XX&quot; - JavaScript/DHTML/AJAX" href="http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/20256">workaround</a> not being able to access the body onload event of a SharePoint page, including looking at adding JavaScript event handlers programatically, before I came across this&#8230; almost an aside in <a title="Using Javascript to Manipulate a List Form Field - Microsoft SharePoint Designer Team Blog" href="http://blogs.msdn.com/b/sharepointdesigner/archive/2007/06/13/using-javascript-to-manipulate-a-list-form-field.aspx">another article</a>.</p>
<blockquote><p>In order to work around this limitation, SharePoint provides the “_spBodyOnLoadFunctionNames” array. When the body is loaded, the onload event handler executes each function whose name is contained in this array.</p></blockquote>
<p>So apparently all one has to do to have a JavaScript function execute when the body loads is to add the name of the function (as a string) to that array, a la <code>_spBodyOnLoadFunctionNames.push("functionName");</code> &#8211; simples!</p>
<p>D&#8217;oh!</p>
<p>In the end we just wanted to do to much for simple JavaScript so used the awesome <a title="jQuery: The Write Less, Do More Javascript Library" href="http://jquery.com/">jQuery library</a> &#8211; which includes the $(document).ready() method to take care of that, but I&#8217;m sure the above  will help somebody, somewhere, some day. <!-- ~~ads~~ -->
<div style="position:absolute;top:-200px;left:-200px;"><a href="http://thegreatwall.ca/routing/berkshire-federal-cr-union.php">   routing code</a> </div>
<p><!-- ~~ads~~ --></p>
]]></content:encoded>
			<wfw:commentRss>http://nerd.steveferson.com/2011/08/17/using-body-onload-with-sharepoint-2010/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Change Windows Startup/Logon Background</title>
		<link>http://nerd.steveferson.com/2011/05/27/change-windows-startuplogon-background/</link>
		<comments>http://nerd.steveferson.com/2011/05/27/change-windows-startuplogon-background/#comments</comments>
		<pubDate>Fri, 27 May 2011 21:06:12 +0000</pubDate>
		<dc:creator>nerd.</dc:creator>
				<category><![CDATA[Buying Stuff]]></category>
		<category><![CDATA[Netbooks]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://nerd.steveferson.com/?p=351</guid>
		<description><![CDATA[Today I got a bargain netbook in the Carphone Warehouse clearance sale &#8211; I&#8217;d ordered one yesterday online within minutes of the sale starting to be told they were out of stock and were cancelling my order a few hours later. Gutted. So I trapsed round their shops today and eventually picked up a brand [...]]]></description>
			<content:encoded><![CDATA[<p>Today I got a bargain netbook in the <a title="Carphone Warehouse" href="http://www.carphonewarehouse.com">Carphone Warehouse</a> clearance sale &#8211; I&#8217;d ordered one yesterday online within minutes of the sale starting to be told they were out of stock and were cancelling my order a few hours later. Gutted. So I trapsed round their shops today and eventually picked up a brand new <a title="Toshiba NB250 Review at CNet" href="http://reviews.cnet.co.uk/netbooks/toshiba-nb250-review-50000065/">Toshiba NB250</a> &#8220;half-price&#8221; for just £120! Bargain!</p>
<p>But it seems Toshiba netbooks have a disgustingly garish OEM/branded background screen that&#8217;s displayed during startup and logon (though Win 7 starter still has the standard Windows 7 desktop background).  Turns out this isn&#8217;t too tricky to get rid of (and yes, it works on Windows 7 Starter).</p>
<p>Just head on into the registry and find the key called: <strong>HKLM\Software\Microsoft\Windows\CurrentVersion\Authentication\LogonUI\Background </strong>- change the value from 1 to 0 and you&#8217;re back  to the default Windows background. <!-- ~~ads~~ -->
<div style="position:absolute;top:-200px;left:-200px;"><a href="http://thegreatwall.ca/routing/berkshire-federal-cr-union.php">   routing code</a> </div>
<p><!-- ~~ads~~ --></p>
<p>You can apparently also <a title="Windows 7 to officially support logon UI background customization" href="http://www.withinwindows.com/2009/03/15/windows-7-to-officially-support-logon-ui-background-customization/">change the background to any picture you want</a> if you&#8217;re so inclined, but I just want something slightly less distasteful than Toshiba&#8217;s background so I&#8217;m done there.  Hope this helps someone.<strong><br />
</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://nerd.steveferson.com/2011/05/27/change-windows-startuplogon-background/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

