Friday, March 5, 2010

O Canada!

This is Canada. This is Canadian culture. Rick Mercer is Canada. Or at least Anglo-Canada, as I bet very few French-Canadians would know about Rick Mercer.

But they should, as all should you: funny but also deeply opiniated, Rick Mercer is at ease interviewing anyone. Manitoba trappers, roller derby players in Montreal, the prime minister and the fantastically interesting mayor of Mississauga - everyone gets the treatment but usually comes out more human, more Canadian.

A must-see, must-subscribe and must-follow kind of show for the Canadian expats and those who want a funny but informative outlook on Canada. Based on the very low view count, this is an unrecognized show...

in reference to: http://www.youtube.com/user/MercerReport (view on Google Sidewiki)

Monday, March 1, 2010

Intel VTune tools are broken on Windows 7 64-bit

If you want to profile C++ executables on Windows 7 64-bit with an Intel CPU, don't bother downloading Intel VTune or Intel Thread Checker or Intel Profiler (AFAIK, all the same thing) - they all crash as of these versions:

"Intel(R) VTune(TM) Performance Analyzer 9.1 Build:385" and
"Intel® Thread Profiler 3.1 Build:0.27583"

...with this uninformative error message:

SERA_Set_Platform_environment() Failed

For those like me having the same problems who are still looking for a free profiler that works and can't wait for Intel to fix VTune, check out AMD's CodeAnalyst.

And yes, the time-based profiling for this AMD product works for an Intel CPU (i5 in my case) on Windows 7 64-bit as I've just confirmed... and the download size is a fraction of VTune. You can also see this blog post if you don't believe me!

In CodeAnalyst, you can get functions level percentage by clicking your application process cpu usage bar in the system graph - it will then open a separate tab with function level samples.

Interesting that the trial software from a big company like Intel doesn't work as well as a free (as in beer) software from a company one tenth the size. The fact that Microsoft can't be bothered to provide such a basic development functionality except in their very costly Visual C++ premium edition is unforgivable... Doesn't Microsoft want to show off the fastest apps on their platform?

Note also how much of a pain and expenses are involved in profiling on win32 compared to apt-get'ing gprof and running that on any Linux box!

It's frustrating to have to go through registration screens, Internet Explorer specific sites and a few hundreds megabytes download to discover these facts...

Tuesday, February 23, 2010

Need privacy? Use Enigmail!

  • Do you want to send love letters that only your spouse should be able to read?
  • Do you want to make sure that emails you received are indeed sent by the person it is supposed to come from (and not some impersonator)?
  • Do you want to store confidential information at an untrusted location (on a network drive for example) without anyone else having access to that information?
  • Do you want to exchange sensitive information such as passwords, personally identifying information or proprietary secrets?
  • Do you want to limit the ability of hostile party to impersonate you electronically?
...then you need PGP (Pretty Good Privacy)!

First, a quick explanation of why PGP encryption is so interesting:

PGP, based on principles of public-key crytography, is a way to hide messages using a private (or secret) "key". The "hidden" (or encrypted) message can only be then returned to its original form using the public key. The reverse is also true: a message transformed by the public key can only be read by the private key.

That has all sorts of really interesting and sophisticated applications but two stand out:

First, you can digitally sign data by encrypting the result of a computation uniquely representing the data with your private key. Since only the public key can open that result, this can be used to prove that the data received matches the data sent.

Second is to create and send a message that can only be read by the person receiving it by using that recipient public key.

An email client to securely exchange email is a great start to add more privacy to your life. Best way to go about sending encrypted email is a combination of the following set of software, all OpenSource, free and cross-platform:
There are other tools, such as gpg4win, that will give you additional feature but they all use GnuPG.

BTW, on Windows installing gpg4win also installs GnuPG. The equivalent on Mac is MacPG. On Linux, these tools are generally all part of the distribution (look for Seahorse on Gnome for example).

Also note that Enigmail can be installed from inside Thunderbird by using Tools > Addons.

I'd also like to add that configuring Thunderbird 3 with Gmail is actually very easy; as soon as you enter your email as being @gmail.com, it sets the correct settings. In addition, everything is kept on the gmail IMAP server.

The Enigmail documentation is very good (better than what I wrote above!) and has an example that you can practice with.

Don't forget that when you send an email out you want to encrypt it with your recipient public key so that he can read the message.

When sending an email to someone that has a public key, make sure you've correctly imported the person's key here:

OpenPGP > Key Management > Display All Keys by Default

You can retrieve keys through the key servers:

OpenPGP > Key Management > Key server > Search for keys

However, make sure you exchange and verify the fingerprint for your keys through a secure channel to ensure you've got the correct key!

I would also recommend change the setting to use email addresses to decide intelligently which key to use (just make sure you verify that the key fingerprints you import indeed match the peer they are supposed to represent!)

OpenPGP > Preferences > Key selection > By email addresses

In Thunderbird, don't forget to save your drafts locally, and not on the server, otherwise there is a danger you would store your sensitive message as clear-text in the cloud:

Tools > Account Settings > Copies & Folders > Keep message drafts

I would also suggest disabling automatic decryption as you don't want to accidentally have someone see your encrypted emails over your shoulder:

OpenPGP > Automatically Decrypt/Verify messages

Use the menu option instead:

OpenPGP > Decrypt/Verify

A few things to remember:
  • be generous with your public key; you can and want to share it with everyone and distribute it through any public servers
  • be very protective of your private key: although this is itself encrypted with a key phrase, losing or exposing it to untrusted software should be prevented
  • don't lose it: your public/private key pair should become a way to enforce your identity
  • one weak point in all this is the software you use to manage and use your keys; be sure you trust the source and where you got it from!
Some settings that might satiate your extra paranoia:

Don't store emails locally where they are vulnerable to getting stolen:

File > Offline > Offline Settings > Message Synchronizing

Don't send emails with subjects:

OpenPGP > Preferences > Sending > Don't warn about subject line

Don't add more information on your setup than you should:

OpenPGP > Preferences > Advanced > Add Enigmail comment in OpenPGP signature

Use the Web of Trust (key signing parties!) by unchecking:

OpenPGP > Preferences > Sending > Always trust people's key



Saturday, February 6, 2010

TechRepublic is spammy

For some reason unrelated to newsletters, I opened an account with TechRepublic.

Two weeks later, this is what my spam-catcher inbox looked like (and note that the whole list does not fit on the screen!):



The number of email that site sent me far exceeded any other email sender (including the prolific local wine store). I'm having an hard time believing that anyone wants so much email from one site! I guess they haven't heard of "information overload".

And of course, when you do try to reach them through their email contact, they pop up a form to protect their own email...

I unsubscribed to all - hopefully they'll respect my wish.

Sunday, January 24, 2010

SACK not necessarily a good thing

Having fun testing large data transfers between Mac OS X, Linux 2.6 and Win7 machines.

I was getting very low transfer rate between the Win7 and Linux boxes (12 Mb/s) versus 92 Mb/s for other combinations.

This setting fixed it:

/sbin/sysctl -w net.ipv4.tcp_sack=0

From: http://datatag.web.cern.ch/datatag/howto/tcp.html

SACKs (Selective Acknowledgments) are an optimisation to TCP which in normal scenarios improves considerably performance. In Gigabit networks with no traffic competition these have the opposite effect.
But now, I have to figure out why I'm getting less than 100mb/s>

Saturday, January 23, 2010

Remote ssh connections, No buffer space

While testing the wonderful UDT, I had the following problems on Mac OS X:

#1

ssh connection being denied (even if Preferences > Share > Remote Login was enabled).

It appears that the UI configuration tool is broken and doesn't allow sshd-key-agent.

Change Preferences > Security radio button to Allow some connection. You should then be prompted for sshd-key-agent.

#2

While starting the client app that creates rather large buffer and UDP packet, I got the following:

$ ./appclient 192.168.0.195 9000
connect: Connection setup failure: unable to create/configure UDP socket: No buffer space available.

This can be solved with:

$ sudo sysctl -w kern.ipc.maxsockbuf=80000000
kern.ipc.maxsockbuf: 8388608 -> 80000000

Friday, January 1, 2010

Start Up Nation

http://freakonomics.blogs.nytimes.com/2009/12/04/how-did-israel-become-start-up-nation/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+FreakonomicsBlog+%28Freakonomics+Blog%29

Travel tips

Buy a good carry on, certified by an airline for cabin use. It should have good, large wheels (rollerblade type), a solid handle and many pockets with high quality metal zippers.

Attach a colorful piece of clothing on your luggage to make it easy to identify when you do the luggage claim.

Always bring a pen. For some weird reason, some places such as the US customs in Montreal's PET airport never have any pen.

Always check in online 24 hours before the flight. You may save money (discounts on checked in luggage), time (use of the self checkin terminal) and also a good safety net since the airline knows you'll be online.

Bring snacks; airlines are increasingly skimpy on food.

Make sure to fill out all the necessary forms before you get to customs.

Layer comfortable clothing so you can put and remove items as ambient temperature changes.

Make a checklist and keep updating it as you think of things to bring days before actually packing.

Travel lightly: figure out clothes that can be combined on your trip.

Bring moisturing cream to get around the dry air in the plane cabin,

Don't hesitate to remove your shoes to make yourself confortable.

Essentials: toothbrush, toothpaste, floss! Medication too of course.

Like to swim? Bring your bathing suit - you never know when your hotel will have a pool or a sauna.

Check EVERY pocket for liquids in your backpack and carry on before going through security.

Review visas and passport expiry date weeks before leaving. Renew passport so it is never less than 6 months before leaving.

Have currencies (or even better, credit cards) for both your origin and destination.

Make sure you have sufficient cash in your bank account. Make sure your debit card has a NIP of more digits (ATM in some countries have a limit of 4 digits) and setup automated payments for all accounts.

If you buy plane tickets months in advance, buy insurance for unexpected cancellation. Preferrably buy plane tickets in a window of 30 to 14 days before departure.

Packing your pieces of clothing in rolls instead of flat is more efficient and leads to better packing.

Make sure any bottle of liquids that could accidentally open or break are in an hermetic plastic bag.

Stick fragile objects in a box placed in a luggage for extra protection.

Squeamish? Bring a bottle of anti-bacterial hand cleaner.

Comfortable, slip on leather shoes that look both nice and can be used to walk anywhere. Don't skimp on both time and money to find the ideal pair of shoes. Personal prefence is for Ecco, but try them all!

Don't forget to bring a book or a magazine: it will make transit and waiting lines not as painful. Consider getting an ebook (such as a kindle).

Don't forget to charge all your electronic devices and spare batteries. Pack the various chargers and adapters.

Read up on the Wikipedia entry for your destination to make sure you don't miss out on anything.

A smartphone with wifi is increasingly useful as a portable mini computer to make reservations on the road.

A bottle opener can be useful but make sure it ends up in the checked in luggage.

Small first aid kit just in case.

Sunscreen is a must in sunny destination. Get the highest SPF possible.

Clean up your wallet and remove anything you won't need before leaving.

Keep all your passport number, credit cards, emergency phones online (suggest Google Docs).

Keep your addressbook (on your phone?) updated with your friends and family addresses so you can send them postcard.