Saturday, December 14, 2013

How to Create a USB Installer for Windows 7 in Ubuntu 13.10 Using UNetbootin

It's fairly easy to turn any ISO (such as the Windows 7 Professional ISO from MSDN) into a bootable USB stick using UNetbootin for Linux. However, I just found out today that UNetbootin doesn't support Windows-required NTFS-formatted USB sticks. Therefore, it's impossible to create the bootable USB with the huge (3.8 GB or so) ISO. Luckily, there is a workaround. Follow these steps and you should be good to go.

  1. Format your USB stick as FAT32 in GParted. You might have to adjust partitions at this stage, mine was setup correctly.
  2. Open UNetbootin (install if not found on your system) and input the options up to where it shows the USB partition to install to. Mine was set to /dev/sdb1 - Don't actually try to create the installer USB from the ISO at this point, however. That won't work because it's set to FAT32, not NTFS.
  3. Leave UNetbootin open as is. Reopen GParted if you closed it (not necessary).
  4. Format the USB in GParted as NTFS this time. You *might* have to add the "boot" flag depending on how GParted behaves at this point. I didn't.
  5. Now, switch your view back to UNetbootin, which should still show the same options that you left open, and click OK.
  6. UNetbootin may complain that the USB drive isn't mounted. To mount it, just open the terminal and type: sudo mount /dev/sdb1 /mnt That should fix the problem such that you can proceed in UNetbootin.

When you do this, UNetbootin will think you are using a FAT32 partition but will let you use NTFS format for the USB stick.

Good luck!

Tuesday, July 9, 2013

Canonical to Develop Own xwindows Replacement

I read a while ago that Canonical plans to develop their own xwindows replacement for Ubuntu. Given the long and difficult struggle that the X team has faced over the years in bringing their project into the modern computing era, I'm not entirely against that effort.

However, I also know that members of the original X project have started their own modern version of a replacement (Wayland) that seems to fulfill all of the requirements Canonical is complaining about in X.

So, the question then becomes, 'Why is Canonical attempting to reinvent the wheel with no significant differentiating factors?' It stands to reason that they could leverage the work put forth in the Wayland project. It seems unlikely to me that Canonical would not have known about the Wayland project.

Given what Canonical did (or failed to do) with Unity, I'm skeptical that their new project (Mir) will be any more successful. I'd love to hear your thoughts on the matter.

Thursday, October 6, 2011

How to Install Older Kernel in Ubuntu

Here is the summary of the steps (replace with your desired kernel versions).
1. Download the working kernel files:


2. Next, install the three downloaded DEB files with dpkg:
sudo dpkg -i linux-*

3. Reboot your computer.
4. Put your current kernel on hold (otherwise it would be upgraded once again during your next "aptitude update && aptitude safe-upgrade" routine):
sudo aptitude hold linux-image-2.6.27-9-generic linux-headers-2.6.27-9-generic linux-headers-2.6.27-9

Monday, July 25, 2011

Running IE8 in Ubuntu

I discovered winetricks today. This handly little script and set of tools allows one to easily install IE8 in Ubuntu. Here are the details:

Basically, once you've downloaded the script, run sh winetricks and then install the Windows component from the default wine config. After that, if you'd like a shortcut, you'll need to create a link to the iexplore.exe file in the c:\program files\internet explorer folder of your wine instance.

Tuesday, April 19, 2011

XPath Matching in Unique XML Namespaces (xmlns)

I ran into a problem trying to get my Python script to locate an etree node in an XML document that had declared a namespace for all elements in the document. The trouble I was seeing is that the find and xpath functions weren't returning anything for any of the searches I was doing. Nothing seemed to make sense until I realized that I wasn't including the namespace in the search. The bugger with this is that you have to declare the ns on each and every element in the document! To simplify things a little, i went with code that looked a little like this:

The full code:

from lxml import etree as ET
fp = open("sitemap.xml","r")
element = ET.parse(fp)

namespace = "{"}"
e = element.findall('{0}url'.format(namespace))
for i in e:
print i.text

Editing XML/DTDs/XSLT/XPath in Linux

My favorite new tool for editing XML in Linux? Eclipse. That's right. The does-it-all-and-comes-with-batteries-too tool does a great job editing XML, XSLT, xpath, etc. All you need to do is add the plugin for Eclipse Web Tools (available in the standard list of plugins). Just enable the software site and install the latest version! Very simple and very powerful.

Thursday, April 14, 2011

Manipulating XML Using Python

I work with XML-related content on a day-to-day basis at work. I come from a .NET background and have written dozens of applications that leverage DOM when manipulating XML. Recently, I've started broadening my horizons to include more languages. I've written a few applications in Python now to do similar tasks as my .NET applications and there's one area that I always find lacking: XML manipulation with eTree. Perhaps I'm mistaken, but it appears from community pages that eTree is the defacto standard in Python for manipulating XML. Sure, it does *most* things correctly, but every once in a while, I can't help but stop and think, this was a whole lot easier with such and such method in .NET or, why does etree.xpath() work when etree.find() doesn't? Why are there two ways to do essentially the same thing in the same class library anyway?

One area that eTree really lacks cohesive support is mixed type XML (Some Text some more text even more text.). Dealing with tails and heads in this sort of situation is a nightmare but completely normal in the XML I work with.

Maybe I'm coming about this the wrong way. Maybe there's a better option out there I haven't considered yet? Maybe I'm just not used to seeing DOM in a Python-esque way. What do you think?