Happy 1234567890!!

It has just passed the Unix time 1234567890! (or, if you prefer, 0x499602D2, which is not funny at all).

Friday, February 13, 2009 at exactly 23:31:30 (UTC, which I happen to be), is a nice Friday 13th (already spooky).

$ perl -e 'print scalar localtime(1234567890),"\n";'
Fri Feb 13 23:31:30 2009

I suppose you have a Unix at home, of course. Well, you probably do anyway…

Other fancy Unix dates to come:

$ perl -e 'print scalar localtime(2000000000),"\n";'
Wed May 18 04:33:20 2033
Next billionth second…

$ perl -e 'print scalar localtime(0x7FFFFFFF),"\n";'
Tue Jan 19 03:14:07 2038
As far as it can go, with 32bit signed integers…

And some other that passed already:

$ perl -e 'print scalar localtime(1000000000),"\n";'
Sun Sep 9 02:46:40 2001
The first billionth second:

And finally some before the Unix era:

$ perl -e 'print scalar localtime(0xDEADBEEF),"\n";'
Mon Apr 14 15:27:43 1952
Well, 0xD has the sign bit set, doesn’t it? It’s in the past too…

$ perl -e 'print scalar localtime(0x80000000),"\n";'
Fri Dec 13 20:45:52 1901
As far as it can go in the past…

But don’t worry, 64-bit systems can already (and do already) manage times up to 9223372036854775807 seconds back and forth 1st January, 1970. It’s plus and minus 292 million years. It’ll be good to tag even dinosaurs with Unix-time, as well as the Enterprise next-generation.

The only problem is that the two final catastrophes we can’t get rid of: sun becoming a red giant (thus engulfing all planets, or the Milky Way colliding with Andromeda, will happen in no less than 5 billion years from now, which means that we’ll need to change to 128-bit time-stamp eventually.

Happy unix-time 1234567890!!

Who’s afraid of the big bad code?

What would Bruce Schneier say about the magic list that the NSA is putting together with Microsoft and Symantec of the 25 biggest errors in code that normally lead to a security flaw.

Don’t get me wrong, putting out a list of bad practices is a fantastic job, that’s for sure. It makes programmers more aware of the dangers, and as the article says itself, newbies can learn from experience before getting into a new field.

But the way that (lay) people take it makes it so magical that the practical side of such list is greatly reduced.

Order and size of the list

I understand that the order must have some sense, but which? Is it ordered by number of attacks in the last 12 months? Or by the sum of all reported losses caused by them? Or by number of such errors found in common code (on those companies’ code, of course)? Or by any other subjective “importance” factor from a bunch of “Security Experts”?

Also, why 25? Why not 30? Who says that the 25th is so important to show up in the list and not the 26th?


We programmers know about most of them, know the problems they pose and normally how to fix them. We often want to fix them, but that normally requires some refactoring and now it’s time to implement those features that our client needs for the demo, right? We can think about that later… can we? Will we?

Than, NSA decides to make this a priority for the country and claim it as a national security problem. Big companies like fancy terms, and would strive to adopt any new standard that shows up in the market.

Then, comes down the VP of engineering and say:

“We need to make sure every programmer knows how to write code that is free of the top 25 errors.”

Done, he can put the GIF image from the NSA saying his company’s software is secure against all odds, according to the NSA and DHS.

Now, coders and technicians, tell me: Would any editor, IDE or compiler ever be able to spot those errors with 100% accuracy?

“Then we need to make sure every programming team has processes in place to find and fix these problems [in existing code] and has the tools needed to verify their code is as free of these errors,”

Of course not, but they will try, and Microsoft will put a beta on Visual C++ and other companies will tell their clients that their software is being tested with the new product and the clients will buy, after all, who are them to say anything about that matter?

Protect against who?

Now, after so much time and effort, 30+ companies and government departments working hard to come up with a (quite good) list of the most common errors that lead to security flaws for what?

“The real dedicated serial attacker will probably find a way in even if all these errors were removed. But a high school hacker with malicious intent – ankle-biters if you will – would be deterred from breaking in.”

WHAT?!?! All that to stop script-kids? For heavens’ sake, I thought they were serious on that… Well, maybe I expected too much from the NSA… again…

(Note: quotes from original article, ipsis litteris)

Search the Web and send a girl to school


“Most of us wish we could give more, now we can. Everyclick is a really simple way to raise money for free, just by doing something you already do” said Polly Gowers CEO, co- founder and winner of the WEBA Ethical Entrepreneur of the year 2007. “As we see it, every search that is not raising money for charity is a search wasted.”

 Everyclick.com works just like any other search engine, but allows the users to choose the charity they would like to benefit from their searching. The revenue generated for charities comes from companies that advertise on the site. There is no sign up fee or hidden charge to the user or the charity, it’s free giving.

 Charities of all sizes are benefiting from this new fundraising service; they range from Cancer Research to small village schools. If 10% of the UK online population used Everyclick.com for their searches, an additional £172,000 would be raised for charity every day.

How to raise more money for Camfed using Everyclick:

About Everyclick Charity Challenge

The Everyclick Charity Challenge enables us to raise more money and have the chance to win a poster campaign on 1500 Clear Channel Outdoor sites that will be viewed an estimated 192 million times.

The challenge runs from 15th October 2008 to 1 March 2009 during which time we will have a range of innovative ways to raise money online.

Silly game of the week: Grep Pipes

After writing my last post I couldn’t stop thinking about pipes and remembered a nice game called Pipe Dream (aka Pipe Mania) and than it came to me the geeky version of this game:

You have a starting point (some lines of text) and some ending points (stripped versions of the original text) and a few grep blocks with regular expressions. The objective is to place the grep blocks from start to finish before the data floods out.

grep pipes

After a few minutes with OODraw and Gimp I could come to this (horrible and ill drawn) interface for the game. Nothing really exciting, just to give you an idea on what should happen… 😉

I’ve also did a sample code on what the underlying library should look like available here.

The idea is to have more commands, such as awk, sed and perl to make it harder (because each one has its own regular expression syntax). A tee should also be required to split paths and other programs such as cat, diff and comm re-unite them.

Harder levels of the game should have bigger boards, tricky regular expressions and even more than one board with netcat or ssh bridges to send data across the network. Also, to increase the level of reality, some programs such as cat and grep should let the data flow faster than others like perl.

Another option is to let the user define the regular expression by hand or number of lines to crop. This would be like having some of the blocks as wild cards, in case there isn’t any suitable block available.

Anyway, the options are endless and I’m sure there will be lots of people that would love it (me included) but I’m a complete failure to design user interfaces. So this is an open invitation, if you’d like to see this game out and could give me a hand with the interface, just let me know… 😉

Just bear in mind the following fundamental pre-condition: the game must allow (better still, encourage) keyboard-only playing, even if high-end OpenGL graphics interface is used.

True wisdom from randomness

You can live a whole life and remain stupid but a stupid program using a pseudo-random number generator and a clever algorithm (Markov’s chain) can excel us quite easily:

  • Input: The GNU GPL license
  • Output:

    “GNU General Public License along with you add to sue for details.”

  • Input: man perl
  • Output:

    “PERL (higher numbers usually being affected by wraparound).”

  • Input: My own wiki
  • Output:

    “Bioinformatics is a physicist (definitions of enforcing standards but it puts wrong things can build complex information systems and nothing is totally unacceptable for every new piece of giving generic answers.”

Non-sense patent system acting as social reform

I was wondering about the patent system in US after reading this article. I am and always was against the non-sense of filling patents for thoughts and algorithms but this weird system can be in fact helpful, the weird results of the pressure against small companies in the US.

It is known that animals (men included?) can develop cannibalism when in restricted environments (such as a cage with more individuals than its capacity holds) or that cyclones develop when you have an extreme conditions in the atmosphere and the Coriolis effect force the air to spin at speeds much greater than we’d like. In a nutshell, the bigger the pressure, the bigger the results.

The capitalism system is all around property. When slaves were not humans, the property of humans were more valuable than their lives. The freedom we have today is the freedom of owning things IF you have money to buy them. If you can’t find a job to feed your children because you didn’t have money to pay for a good school (and therefore didn’t attend a good college) and you eventually steal food for your children, you get arrested and no one will look further to see why you have stolen in the first place.

The patent system was devised to protect the intellectual property (if that exists) and, conceptually is wrong from birth. Ideas don’t have owners and even the Greeks knew that. The core of augmenting ideas is to share and enhance and not to protect it. The only reason to protect ideas is to get money in the end, again, the capitalism is more about money and property than freedom and happiness (I’m being redundant here, I know).

Anyway, the US is the uttermost expression of the capitalism and supposedly of freedom and equality. A system that protects anyones ideas is, in principle wrong but, egalitarian. If that system can yield you money, so you can pay for your son’s studies and he can have a “better” life it means that it’s giving you “freedom” to choose your steps from now on.

But we all know how bureaucratic this systems is and individuals just can’t start filling patents, they won’t even know how to start even if they had good ideas. Worse, if their parents weren’t rich they couldn’t have gone to good school and college and have good ideas on their own and the US is not famous for treating well poor people not even trying to find ways to fight against poverty (they’re too busy getting oil from Middle-East).

So, for a long time, the patent system was used to protect the big companies’ interests for decades. They’d hire great minds and incorporate their ideas to the company (not personal anymore) and if someone can answer me how can a company have ideas I’d be very glad to know.

But as always, the bigger the pressure the worse the answer. Small companies are filling patents like crazy for the last decade or so and they’re making a huge profit out of them. It’s still not right, companies can’t have ideas to protect but that’s the very ugly answer to a very high pressure. It is, in the end, equalising the US society, spreading the money from the big companies to the small companies and probably making the capitalism a bit fairer.

Still, as capitalism, the only group benefited is the rich. Poverty levers are still maintained (increasing?) and they won’t be affected by this change. Pretty much like in the French revolution where the people were used as a mass to disband nobles and kill the king and when everything was settled the (then unusual) group of non-noble rich people took the government and the poor were only poor again (still are).

I don’t want to go into that now but terrorism (in fact all small things that were wrongly put in the same basket called “terrorism”) is also a reflection of that pressure. For me, terrorism is much more the pressure it’s made on people than actually their response to that pressure! I’m not trying to justify any attitude, it’s still horrible and must be stopped, but it’s not by increasing the pressure that they will be stopped!

Humans, like animals, behave like that for millions of years, but I do believe that humans, unlike animals, can educate their instincts.

Recursive patents

IBM once had great innovators working for them, many holding Nobel prizes etc but for a while they haven’t had a great idea… until NOW!

It’s a genius idea that will revolutionize the whole patent scheme: They’re filling a patent on Getting money out of patents.

Quoting The Register: If Big Blue gets its way, Microsoft’s promises to Novell and Xandros not to sue over alleged infringements of its Windows patent portfolio ought to mean Redmond pays a kickback to IBM.

If that doesn’t change the completely stupid and out-of-this-world patent system in US, I don’t know what will…

Geeks United! It’s time to recycle!

It’s time to recycle using your hand craft abilities!

Computer Chip Trivet

Don’t you know what to do with those old computer chips laying around? What do you think about a stylish trivet? Instructions are simple to follow: all you need are some computer chips , grout, adhesive, and a tile square.

Once you’re all finished, you’ll have a nicely geekified trivet for all your hot stuff.

You’ll really impress your geeky friends with this genuinely useful kitchen tool that you can make: a trivet built out of old computer chips.

Follow this link for full instructions.

Hard Drive Wind Chimes

The drive platters themselves are also quite remarkable: precisely made aluminium patters with a surface not unlike recording tape. The disks make a lovely clear note if you strike them, so it was only natural to make them into a set of wind chimes.

An interesting side effect is that the shiny shiny platters reflected little spots of light into the house. Naturally, if you have cats, they’ll love it too.

Follow this link for full instructions.

Hard Drive Picture Frames

So, you’ve disassembled hard drives, taken the magnets out, made wind chimes out of the platters, and so on. One thing that you might have left over is a set of printed circuit boards. Funny shaped printed circuit boards, with holes in them.

Here’s how to turn those leftover PCBs into fabulous geek-chic picture frames.

It’s done! Hang it on something ferromagnetic!

Here’s a completed picture frame, hanging on a wire bookshelf.

Follow this link for full instructions.