Why Cut a Hard Drive

I just started a video series where I cut things with an angle grinder. Here's the first episode where the victim is a 5-1/2 hard drive:

Let's Cut It

Some people want to know why one would cut a hard drive in half -- or anything else for that matter.

Erasing a hard drive

Cutting a hard drive is the surest way to make the data it contains unreadable.

When you change hard drives, you may be tempted to throw the old one in the bin; but if you do this you expose yourself to anyone picking your old hard drive from the bin and extracting all its contents (passwords, emails, etc.)

Simply "erasing" the contents, or even "formatting" the drive isn't enough either; those operations usually only rewrite the file system but not the data, which can be recovered with widely available "unerase" software.

There are utilities to permanently destroy data on your hard drive; they work, but take a long time and are clumsy -- and besides, who would use software where an angle grinder does the same thing?!?

Be in charge

But there are many other things to cut besides hard drives! Next on the list are phones, cameras, Nespresso coffee machines, etc.

Why would I want to cut all those things? Besides the fact that it's so fun, there's a philosophical point to it.

The iPhone comes with special screws that require a dedicated screw driver.

Most Apple products don't even have visible screws. They come in beautiful boxes as if they were jewels, and the message is that they're so perfect they should only be admired and caressed and nothing more. (Apple is not the only culprit of course, just the most prominent one).

The point of appliances should be to help us do things better / faster, not be part of a cult. They're here to serve us, not the other way around.

It's certainly more useful to take things apart than to destroy them; but there's a childish joy in cutting them open; it's a post-modern act of freedom.

Let's void this warranty.

Tue, 09 Apr 2013 • permalink

CSS2XML

On XSL list someone asked how to serialize a CSS to XML. There appears to be no ready-made solution, so I gave it a shot.

There are a couple of projects that try to parse CSS from scratch -- for instance, a node.js library that parses CSS and outputs JSON; an XSL project that parses CSS in XSLT and reinjects the results in a custom-built XSL stylesheet for further processing...

The problem with these initiatives is that they need to be actively maintained to stay current; most aren't.

CSS parsing is difficult; rather than trying to come up with your own parser, it's much much better to use an existing specialized library. CSSutils is such a library, available for Python 2.x (>=2.5) and 3.x; it's pretty complete (it even parses comments!) and active.

10 lines of Python

Using this library, it's pretty easy to produce an XML version of a given CSS; here's the Python code:

import cssutils, gnosis.xml.pickle

css = {}
sheet = cssutils.parseFile("yourcssfile.css")

for rule in sheet:
  if rule.type == rule.STYLE_RULE:
    css[rule.selectorText] = {}
    for property in rule.style:
      css[rule.selectorText][property.name] = property.value

print gnosis.xml.pickle.dumps(css)

(We create an object for each rule and property, and then serialize this object to XML. Or, to serialize to JSON instead, import json and change the last line to 'print json.dumps(css)').

Here, the CSS is taken from a local file; but cssutils is able to parse either a string, or even fetch a "live" CSS (cssutils.parseUrl deals with urllib2 directly).

Many things could be improved from this simple example, but that should get one started.

And if anyone is interested in using [a more elaborate version of] this as a service, please get in touch!

Mon, 01 Apr 2013 • permalink

Benjamin Franklin and me

My first job was one of "consultant". In those times, consulting meant reformulating a problem the client knew he had, and listing fairly obvious solutions to throw at it (with more consulting hours).

The client would then either

  • entirely ignore our advice and pretend the problem never existed
  • pick up the cheapest solution and cut the recommended budget by half
  • come up with a grand, very expensive plan to address not just this specific problem, but any one of its kind, for now and the rest of eternity

Consulting firms are said to hope and push for solution #3, but that's only partially true. As human beings, we like to help, solve problems and build things that last.

Yet it's true that if we can't implement a good solution, we'd rather bill a lot of hours for a bad solution than not participate in it at all. (Consultants are very good at claiming success as theirs while blaming others for disasters.)

After a few years of this, I chose a different line of work and went on to build custom systems and solutions (i.e., without the consulting part whenever possible): I had come to the conclusion that smart companies are able to guide themselves, while not so smart ones don't benefit from external suggestions very much, or listen to the wrong ones.

I was pleased with this diagnostic... and then I came upon this phrase: "Wise men don't need advice. Fools won't take it."

It's usually attributed to Benjamin Franklin, although it may have come from an earlier English proverb. I find it quite true; I kind of wish it hadn't taken me so long to rediscover it.

Mon, 25 Mar 2013 • permalink