Tuesday, November 22, 2011

Find all Hard Links to a File

While writing a wrapper to submit files for batch processing I found a need to find all the hard links to a file. Like so many things in Linux, the solution turns out to be simple -- once I found it.

Use the find command

$ find <dir to start search in> -xdev -samefile <path to file>

For example, to find all the hard link to the file /home/buser/chosen.one.txt on the home partition, use:

$ find /home -xdev -samefile /home/buser/chosen.one.txt

The switch -xdev means to only search on the original volume. It can be omitted but, because a hard link cannot cross volume boundaries, the switch will save time by not searching where a linked file cannot be anyways.

Friday, November 18, 2011

Water Is Not Wet

At least not in Europe.

According to The Telegraph, water does not prevent dehydration and drink manufacturers cannot legally claim it does.

EU officials concluded that, following a three-year investigation, there was no evidence to prove the previously undisputed fact.

Producers of bottled water are now forbidden by law from making the claim and will face a two-year jail sentence if they defy the edict, which comes into force in the UK next month.

Just when I think that the nanny states have collectively plumbed the depths of human stupidity (or maybe human evil), one will bounce back and astound me once again. Maybe it is time to just toss the whole idea of the state on the dust heap of human history. I can only hope my descendants will look back on this time and see the obsession with the state as protector as just a silly an idea. Like a flat Earth or a geocentric universe.

Oh yeah. Drink Brawndo. Its got electrolytes!

Wednesday, November 16, 2011

Downed Spitfire's Guns meet an Ignominious End

BBC News Magazine reports on a salvaged Spitfire that crashed into a peat bog in the early years of World War 2. The anaerobic environment left it is a remarkable state of preservation. Amazingly, with some work, six of the plane's guns were in good enough condition that specialists in the Irish Army were able to assemble a working model. In the test, the gun spit a belt of ammunition (the article doesn't specify how many rounds were fired but the Spitfire had 300 rounds per gun) without a hitch.

The WWII guns firing after 70 years buried in peat

The article concludes with this observation:

The machine guns will now be made safe and join the rest of the aircraft on permanent display in Londonderry, where Wolfe was based, a city on the edge of Europe that played a pivotal role in the war.

When I got the to part about rendering the guns "safe" I asked myself, what the hell happened to the English? Seventy years ago brave men and women kicked Nazi butt at the Battle of Britian and turned the tide of WW2 in Europe. Today, their grandchildren live in dread of pointed kitchen knives.

I swear, if the modern British were to locate Arthur's tomb and unearth Excalibur, they would grind the edges flat in name of "safety".

H/T to Grant Cunningham among other.