Create a unique database ID in Microsoft SQL Server

I work with Microsoft SQL Server everyday and have been developing scripts to monitor such things as database growth and the amount of free HD space on each of the systems.

The script I have that records HD space stores the DBID of each database next to each recording so I can track growth over time. “Sounds fine so far” you say. So did I…

When developing some code to report on the data collected I noticed that there were several databases where the sizes had changed after a period of having zero size.

Further investigation showed that MSSQL had reused IDs that belonged to databases I’d previously deleted. Doh! I needed a better way of differentiating between the databases I was monitoring. Continue reading

Sharing your Minecraft data folder on a dual boot system

I finally made the move to Windows 7 recently but have left my old HD connected so I can boot into it my old XP set up. Sometimes I like to play games that don’t work well with Windows 7. I can also get more from my gaming with XP as the OS has a smaller footprint leaving the RAM free for the games.

The problem is that Minecraft expects it’s data to be in your Application Data folder which is specific to your profile. I had Minecraft installed on both systems and therefore had two different data folders. I could just copy over the data folder to the New HD to continue playing n the worlds I had already created but I’d then have to copy it back if I played when playing in XP.

Initially I tried creating a standard shortcut to the minecraft folder on my XP disk but Minecraft didn’t recognise it and created its own. If only I could make a proper symbolic link to the data folder like in Linux….. Wait a minute…. I can! 🙂 Continue reading

LibreOffice 3.5.2 install error on Windows 7 / Vista

Error 1935: An error occurred during the installation of assembly ‘policy.9.0.Microsoft.VC90.CRT,publicKeyToken=”1fc8b3b9a1e18e3b”,
version=”9.0.30729.6161″,processorArchitecture=”x86″,
type=”win32-policy”. Please ref…

What does it mean? I don’t know but I kept getting it when trying to install the latest LibreOffice on a freshly installed Windows 7 Pro.

Firstly make sure your download is good and hasn’t been corrupted on its journey down the intertubes.

If your download is fine then you’ll need to try this fix. The problem is linked to the Microsoft Visual C++ runtime components. Microsoft have decided not to fix but I did find a work-around: Continue reading

Reading Raw Disk Images with 7zip

Despite using Linux most of the time 7zip has been a staple utility on any Windows system I work with as it is very versatile and much more than a simple archive creation and extraction tool.

It’s very good at doing what you’d expect; Handling all of the day-to-day formats you tend to come across (such as Zip and RAR) as well as plenty of less well-known or older formats (lha!).

The interface is clean and the OS integration isn’t very intrusive (and you can remove it anyway if you’re not a fan of items cluttering your context menu).

I’ve always been impressed how I can extract files that don’t even look like archives and use 7zip as an extra security tool. I’ve successfully avoided many trojans by extracting an executable file to find the real setup file inside. The wrapper executable was just a delivery vehicle for something malicious.

I’ve also loved the way you can treat an ISO image as an archive and open it up to get at specific files. I store a lot of ISO images on my fileserver so now get the best of both worlds: the original ISO images for faithful reproduction along with the ability to access files as almost as easily as a standard folder.

Finally, the most recent thing I discovered and the reason for this post of praise is the ability to open up and access files in a raw hard disk drive image!

I’d made a backup image of a failing 160GB HD using ddrescue and saved it to my server. I then needed to get access to some files on the image and mounted it using the loop device on Linux. The image has multiple partitions so I found the partition I needed, calculated the offset and mounted it. I then got sidetracked and didn’t get round to getting the files and shutdown the PC.

The next morning as I raced to get out of the door on time for a change I remembered I needed some files and logged onto my Windows computer (which was already on). The backup folder was already open and the disk image showed the ImgBurn logo as the .img extension is associated with that.

Imgburn couldn’t open the file but seeing the 7zip entries in my context menu led me to try the ‘Open archive’ option.

Amazingly it could see all the partitions of the RAW image dump and. It took a minute to do as it read the partition info but I could even double-click on the NTFS partitions to see the individual files and folders contained within.

Brilliant!

7zip In Action
7zip In Action