↓ Skip to main content

System Administration

Get Windows Service name from executable in PowerShell.

I was recently putting some PowerShell scripts together for deployment and maintenance of software to our machine instances. One of the requirements was to be able to discover the service name from a Windows Service executable that uses ServiceInstaller. I needed to be able to extract this value in a generic way in order to query the service and stop it if running. Here is what I was able to put together.

Automate IIS enable on Windows 7.

·3 mins
Background # There are plenty of sites that will tell you how to enable IIS through the Control Panel. Although, if you are tasked with enabling IIS automatically (eg. for an installer), it can be a nightmare. This is only really needed though in special cases where the installer has more control over the hardware specifications. Determining an upgrade or uninstall scenario with IIS can be very tough since you are not installing your own software but rather enabling a feature of Windows. With that in mind, we can propose a solution for automated enabling of IIS.

Delete long file path names.

·1 min
I made the stupid mistake of importing an Eclipse project into my workspace when the import location was from the workspace itself. I went to delete the recursive folder when I encountered an error that the file path name was too long to delete. The best manual solution that I found was to go as deep as possible in the recursive folder and then map it to a virtual drive. [ ]{.Apple-style-span style=“font-family: ‘Courier New’, Courier, monospace;”} [subst x: c:\recursiveFolder\]{.Apple-style-span style=“font-family: ‘Courier New’, Courier, monospace;”}[recursiveFolder\]{.Apple-style-span style=“font-family: ‘Courier New’, Courier, monospace;”}[recursiveFolder\...]{.Apple-style-span style=“font-family: ‘Courier New’, Courier, monospace;”} [ ]{.Apple-style-span style=“font-family: inherit;”} [This can be quite an arduous process; I found myself creating up to 9 virtual drives. It eventually worked though and I was able to delete the recursive folder.]{.Apple-style-span style=“font-family: inherit;”} [ ]{.Apple-style-span style=“font-family: inherit;”} [I also found a site with a Perl script that deletes long file paths but haven't tested it myself.]{.Apple-style-span style=“font-family: inherit;”}

Using Ubuntu 10.04 with SVN+HTTP.

·1 min
I setup a server recently using Ubuntu 10.04. LAMP was easy to configure, as was Subversion. Although making Subversion and Apache2 play nice together with DAV SVN was a nightmare. I followed the guide provided but the website location just kept reprompting for my login. After hours of running in circles, I was able to find the solution. The Require valid-user directive in /etc/apache2/mods-available/dav_svn.conf required the Limit directive to be around it. \