Pages

Saturday, 26 January 2013

Keep your data safe while traveling


Photo 27-01-2013 11 02 21
Before leaving London for a 6 month break I sold my desktop and replaced it with a MacBookPro. The MBP has become my main computer and because I'm traveling, I had to review the whole backup routine… The likelihood of having it stolen or lost on the beach is quite high (compared to having my flat broken into for instance).

After trying a few things I came up with this: I sorted out my data into two groups, sensitive data and mobile data.

Sensitive data
Stuff you really don’t want someone to steal from you.
That includes budget spreadsheets, bank statements, receipts, health documents…
  • Store on local drive
  • Encrypt with TrueCrypt (Windows) or Filevault (MacOs). You can forget the Filevault password, the only purpose of encrypting the data on the local drive is to prevent it from being accessed by someone who steals the laptop. 
  • Back-up manually to external HD with hardware encryption (such as My Passport which comes with a built-in backup software WDSmartware).
    This external HD should always stay in the room, or in the hotel safe. If the main laptop gets stolen or crashes, this is the first line of defense. Of course the HD itself could be stolen that’s why data should be encrypted with a password that you remember.
  • Backup off-site automatically with a service that allows local encryption (such as Mozy)
    Local encryption technology exists so there is no point taking the risk of trusting the cloud storage provider to encrypt the really sensitive data for you. Just don’t forget the password.
Mobile data
Stuff you need with you all the time, files used often and on-the-go that are less sensitive: photos, travel itineraries, hotel bookings, flight tickets, travel insurance certificate, passport scans, ebooks.
  • Must be quickly synchronised across devices (iPhone, iPad, PC, MacBook, web). Dropbox is good for that. iCloud not so much...
  • Encrypt the offline cache with OS encryption. Encrypt the Dropbox folder with TrueCrypt/FileVault so that the files stored offline cannot be accessed if the laptop gets stolen.
Notes:

Why use TrueCrypt for sensitive data under Windows and not EFS?
The backup systems I tried (WDSmartware and Windows8 File History) don't know how to save EFS-encrypted files. Mozy knows how to save EFS-encrypted files. But when it restores them, they're still encrypted with EFS. So if you lose your laptop and don't have the EFS keyfiles, you lose your data. I find EFS a bit cumbersome because if you're serious about testing it, you have to do a restore to a totally different system to make sure that you're able to decrypt the EFS files, save the keyfiles to USB drives, blah blah blah. I know I’ll just get it wrong so I prefer using TrueCrypt.

Don't use Mozy to save data stored on the external HD
Mozy is really bad at saving data located on a removable drive (such as an external HD). Mozy starts automatically. If the drive is not connected at the time when Mozy starts, Mozy thinks the files were deleted from the machine and it marks them as deleted from the server, which is a bit rough.

Tuesday, 22 January 2013

HTML5/CSS3/Javascript Resources

 

It is sunny in Langkawi because we’re in the middle of the dry season on that side of Malaysia, unlike Singapore where it’s raining all day at the moment.
This is the perfect setting to gather some resources about HTML5 and in particular to prepare for Microsoft exam 70-480.
  • Exam registration
  • upcoming Microsoft exam book.
  • From Safari Online Books:
    • Head-first HTML5 programming dives directly into the things a client apps dev is actually interested in: how to do asynchronous programming with Javascript to avoid page reloads, how to change the DOM programmatically, how to call Web services, how to execute tasks in parallel, how to use local storage, how to use geolocation and Google maps.
    • Beginning iPhone and iPad web apps
  • Test Papers (exam Q&As)
  • Some study guides:
  • HTML5 Jumpstart (Microsoft Virtual Academy)
    • The videos spend a lot of time on CSS3 (as opposed to Head-First that goes into Javascript immediately).
    • The focus is to build apps for Windows 8 rather than web apps therefore some of the CSS properties and Javascript code is Microsoft-specific.
    • There is a good demo of WinJS’s Promises, which makes asynchronous programming under Javascript look more industrial.
  • HTML5 Spec

Friday, 16 November 2012

How not to go mad with Parallels for Mac

Parallels uses your bootcamp partition to create a Windows virtual machine. It aims at blending windows programs within MacOsX so that eventually you don’t realise you are using a virtual machine. It goes as far as mapping MacOs shortcuts to Windows shortcuts. You can configure very precisely how much integration you want: it’s very impressive and it can get very very confusing as well… It looks like my brain works better with 2 distinct OSs rather than a merged one.

Anyway, here are a few points that bugged for a while before I find the solution:

  • How do you log out from Windows 8 or switch user without restarting???

Type <fn><ctrl><alt><Del>

  • How do you display the Windows 8 toolbox?

Screen Shot 2012-11-21 at 01.00.01

If <cmd>X does not work, go to Parallels Desktop > Preferences > Shortcuts >Virtual Machines > Profile. Set it from Windows to Generic.

  • How to use the F1, F2 keys directly under Windows without having to press Fn?

Apple > System Preferences > Keyboard > Tick Use all F1, F2, etc. keys as standard function keys.

image

  • How to select text (<ctrl> <shift> <right> in Windows).

<cmd> <ctrl> <shift> <right>.

Friday, 19 October 2012

Jabs for South-East Asia

jab According to Fit For Travel this is the list of vaccines/medications I should get on top of tetanus/typhoid/hepatitis A/diphtheria to travel to South East Asia:
Fit For Travel recommends going to my GP but that's going to take years. There is a place called the Travel Clinic where you can make appointments even at the weekend.

Classic vaccines are free but exotic ones are about £50 a shot (see prices) and for each vaccine you need between 2 and 3 shots. This is the list of vaccines paid for by the NHS.
To get an appointment with my GP, all I need to do is go there in person and ask for a travel vaccination appointment (can’t be that specific on the phone).
More resources: NaTHNac

Wednesday, 17 October 2012

Learning plan for a 6-month break

If you were taking a 6-month break off work, what would you start learning?

This is what I put on my plate:

  • CSS\Javascript\HTML5

I haven’t touched CSS and HTML in a while. It’s about time to have a refresh. Microsoft now has certifications for those.

  • One CMS (Wordpress or Drupal)

…because my blog looks quite boring in Blogger.

  • One no-SQL technology

…because I worked with Relational Data Models for too long…

…sometimes it’s good to learn about Microsoft technologies independently of a project. The material for certifications –without making you proficient- gives you a healthy overview of everything that’s available. So when you’re back on projects, you know what tools to consider.

  • C++ 11

…to lose old habits and re-learn new ones.

  • Risk calculation in finance

Some financial calculations basics: statistics, value at risk, options valuation, portfolio valuation… I will prepare the FRM exam to write it in May.

And those will be mostly for fun….

  • iPad + iPhone development
  • High Frequency Trading

 

That could be too many things to learn for 6 months, it’s likely I am biting more than I can chew. I will see in 1 month how much I’ve done and I might review the list.

Monday, 1 October 2012

The most exciting novels I've read in years


Very very gripping books, don’t read on if you’d rather avoid spoilers…

WIFI WPA hacks, phone tracking, drones, armies of self-driving cars, hypersonic weapons, plasma weapons, distributed software able to kill people remotely, GPS-enabled glasses with augmented reality overlay controlled by motion-detection gloves… Stealth processes running on unreachable servers in China scanning RSS feeds for a text pattern and sending instructions when a match is found, therefore reacting to events in real-time... People and machines controlled using basic AI available in computer games, a bit like a giant SimCity or a lethal MMORPG where the player is a program and characters are actual people… Encrypted APIs allowing whoever decrypts it to wipe out a company’s entire data backup just by passing the company name as a function argument… entire companies fall under the control of an unstoppable distributed computer program whose mad creator died before triggering it. It recruits people through coercion at first until it grows powerful enough to be the best employer in a country ravaged by 25% unemployment. It’s a computer program that kills spammers, hedge fund managers and anything that gets in its way and simultaneously builds self-sufficient communities based on renewable energy and sustainable farming…

What makes this book powerful is that everything is based on technology available now. There is little that the author made up, it all exists. You end up thinking: that could happen if someone smart with unlimited funds decided to put his mind to it (Eric Schmidt maybe?). Of course a lot of the tech in the book works a little too well. Suarez’ technique consists in taking a bunch of technologies currently in the R&D stage and imagine what would happen if they actually were fully developed. This is the kind of sci-fi I like: grounded, realistic, credible and very very close to us. 

You could make such a good film out of this plot… There is enough material to build a very cool tech action-thriller trilogy.

Sunday, 23 September 2012

My Huawey E585 does not work with T-Mobile any more

I can't use mobile internet any more with T-Mobile using my E585 Huawey mifi device. For the past few weeks it fails to connect. It displays the operator (T-Mobile), says "connecting" then "disconnected" and that's it. I talked to phone support, restored the factory defaults, no success.

I brought my SIM to a T-Mobile shop to try out the data feature with another device: the data download was still ok. So my SIM and my account are fine.

EverytingEverywhere will be soon available in the UK. A T-Mobile assistant told me this would involve getting a new SIM, a new contract and new hardware. If they still use Huawey devices, I guess they will go for the E589, the one that supports LTE...

Until then I'll get myself an unlocked E586es (the model T-Mobile actually uses). It supports HSPA+ so I should get faster speeds than with the E585.

Tuesday, 11 September 2012

Using Reactive Extensions with Bloomberg

 

2012-09-17 15.44.26Lately I had a chance to use the Bloomberg API to build a price capture service. In the context of finance the Bloomberg API -when run on a PC where the Bloomberg terminal is installed- allows you to read prices and rates for financial instruments. The “Bloomberg terminal” is an expensive piece of software that looks like nothing you’ve seen before unless you are old enough to have used the French Minitel. It comes with a funny-looking keyboard and a Mission Impossible-style fingerprint authentication system.

The API is straightforward and fully asynchronous. When opening a session you specify a single delegate that processes all notifications received from Bloomberg.

Bloomberg provides several services, some for real-time market data, others for reference static information, another for historical data… When you start a session, Bloomberg sends you a  SESSION_STATUS message confirming the session is up. If you open a service you get SERVICE_STATUS messages . If you start subscribing to an instrument’s updates Bloomberg sends SUBSCRIPTION_DATA messages with the price updates as well as SUBSCRIPTION_STATUS messages containing subscription errors if something went wrong.

When writing such a client you find yourself waiting for a message before taking action. For instance you wait for a service to open before subscribing with instruments, you wait for subscription updates to arrive in order to save them to memory…

If you take action following the reception of a message, you run this action in the same call stack as the delegate you passed to the API. Is that a problem? Yes it can be: if your action takes too long, you slow down the Bloomberg thread consuming the messages and the system starts sending you ‘Slow Consumer’ warning admin messages.

So in the end you have to do things such as:

  • redirect execution from a worker thread to the main thread (to avoid blocking the consumer thread)
  • fire off a timer at regular intervals to display stats,
  • schedule tasks at a set time (to schedule snapshots for instance)
  • wait for several tasks to complete before starting a new one

Of course you could do all this using threads/handles/message loops, or the BackgroundWorker pattern which I used a lot when building windows UIs but it’s just not practical. So I started looking up MSDN to get familiar with the latest tools that make async programming easier (in .NET 4.0) with BeginInvoke / EndInvoke, thread pooling, the TPL

@smwhit told me “Stop being such a C++ tard and take a look at Reactive Extensions”

Indeed RX is spot-on for this. One of the very very nice things with Reactive Extensions is that you can parameterize the scheduler. For each delegate you register you simply set a parameter to decide whether you want the code to run on a new thread, a thread pool, a dispatcher, an event pool or on the current thread the next time it’s available. You can even replace the scheduler with a TestScheduler, which makes unit-testing concurrent code possible.

Resources:

Thursday, 16 August 2012

More about Windows Services…

Following up from a previous blog post:

To violently remove a service from the Services window when uninstall fails, type at the command prompt:

sc delete "My Service"