#5yearsago

5 years ago today I am in the Yamanote line going to an interview for what is to become my current job. The shaking hits as we are pulling in to the platform at Shinjuku station. I brace myself as the car sways to what feels like 30º angles and people standing don’t know if they should jump out or jump in.

As things calm down, the station master announces on the PA system that all trains are stopped probably for the rest of the day and asks everyone to exit the station calmly. I glance up at towers in Shinjuku west side, they are still swaying back and forth 10 minutes after the quake.

I leave the station but all I can think about is how to make it to my interview. I try calling the HR guy and my agent maybe 20 times but nothing is going through. I send a couple emails to my family and friends abroad saying I’m fine so that they don’t worry as they wake up and see a big earthquake on the news.

I try desperately to catch a taxi that could bring me closer to Tamachi where my interview is. Finally I manage to get through to the HR guy who tells me everyone left the building and the interview is cancelled.

That’s the moment when I look up at the giant video screen on the front of the Flags building at Shinjuku south entrance. It shows the live view from a helicopter as the wave unfurls over Tohoku. I realize how bad the situation is and how silly I was focusing on my stupid job interview…

I stay maybe 30 minutes in shock, watching the live images of the disaster with hundreds of business people and shoppers. Then I realize there is nothing to do but walk home. I curse myself for buying new business shoes for this interview as I walk 5km back to Ikebukuro.

Server move

This blog, as well as all my other personal websites, used to be hosted on servers provided by MacBidouille (which I’m co-founder of). However, sharing a server with other people and services was starting to feel a bit restrictive (I couldn’t easily move from Apache to nginx or support IPv6) so about a year ago I decided to move to my own little VPS box.

I started out with Gandi Cloud VPS and it was fine, but last week I decided to trash that and shop for something better. I chose Linode and I must say I’m very happy.

  • Gandi VPS – 1 share – 16€/month (1556¥) for 256MB of memory. Server was hosted in France which was very slow for me.
  • Linode 512 – $19.95/month (1568¥) for 512MB of memory. Server can be hosted in Tokyo datacenter which is super fast and responsive for me.

So for the same price in Yen (thank you super low exchange rates), I get a server with twice the RAM and hosted right next door. Also Linode has a much nicer admin interface (Gandi is pretty messy and slow):

linode dashboard

Added advantage of hosting my own server: since I changed job last year, I don’t get to play with linux at work anymore (or any technical stuff actually), so this way I compensate a little bit for my technology withdrawal….

Update: oops! I just realized that Gandi has recently increased the minimum specs of their hosting service, so I could have had a 512MB memory box for the same price since June, making it pretty much equivalent to Linode… Well anyways, the added performance of having the server in a datacenter in Tokyo is invaluable.

New Feature: Deep Linking

Yesterday I did a bit of coding and added a new feature to Sunsetter: deep linking. When you make a query to find a sunrise or sunset forecast, the address bar will update with a link you can copy and share or send to friends to show the same page you were on.

For example, here’s a link to the alignment between the Tokyo Skytree and Fujisan:

http://www.sunset.io/#pov=35.71,139.810744&poi=35.363976,138.732217

fujisan-from-skytree

Early November or February should make for some nice pictures!

Feel free to share some nice alignments with your friends.

Predicting Manhattanhenge

There has been a lot of talk lately about the Manhattanhenge, the 2 days in the year when the sun sets in the alignment of New York streets (thank you city grid design).

Manhattanhenge By @NYCphotos-flickr

It’s awesome to see so many pictures like this popping up on flickr and instagram because this way I also get to confirm my little app Sunsetter is actually giving correct results:

Manhattanhenge prediction on Sunsetter

Note: the app is configured to predict when the sun’s lower limb touches the horizon, not the civil sunset when the sun completely disappears behind the horizon, as this makes for a better picture.

Tokyo is not an easy city to take such pictures but so many cities in the US have the potential. For example, I’m hoping to see many pics from San Francisco on September 24th.

SF-henge

Pet Project: Sunsetter

At home I have a nice view of the Fujisan to the south-west. I often take pictures of it in winter when the skies are so clear.

Many times I’ve told myself it would be nice to take a picture with the sun setting right behind the mountain. I’ve searched the internet for an app that would tell me when this happens but all I could find were apps that tell you where the sun sets on a particular day, not the other way around. So I decided to build it…

Sunsetter is a simple python web app running on Heroku. It’s based on the brilliant pysolar library for the hardcore astronomical calculations and binds it all to Google Maps with a dash of Ajax and JavaScript.

The app still needs polish but the data it gives out should be pretty accurate and reliable at normal altitudes (standing on top of a very tall mountain overlooking a wide plain will change the distance of the horizon and screw with the calculations a bit).

If this app was useful to you or you have suggestions, I’d love to hear from you in the comments.

Update (2012-06-03): I’ve open sourced the code on Github.

Foreman and Procfile tips&tricks

Lately I’ve been playing around with the Heroku stack and I’d like to share little tricks that might be common knowledge but which I’ve not seen mentioned on the Heroku standard documentation.

So the doc tells you you must set your Procfile as such (for a Python app):

web: gunicorn app:app -b 0.0.0.0:$PORT -w 3

You can then run the webserver on your machine for development with the command:

foreman start

But if your app also uses memcached, redis, postgres or others, then you must open as many additional tabs in your terminal to run each service (I don’t want to have the daemons running all the time on my all-purpose macbook air).

What you can do to make your life easier is to create a new file Procfile.dev which you should add to .gitignore (so that it is not uploaded to Heroku and does not affect your production environment) and add all those services in there:

web: python app.py
memcached: memcached -v
coffee: coffee --watch --output static/js/ --compile lib/

And run it with:

foreman start -f Procfile.dev

This will launch my app with standard Python (easier for quick debugging than gunicorn), my memcached instance and even compile my CoffeeScript on the fly so I can edit freely while testing my changes.

Looking in your terminal you’ll even see each service logs all pretty and color coded.

SoftBank plans for new iPad

SoftBank has just published their new deals for iPhone owners wanting to buy one of the newer iPads.

The mechanics of the plan are the same as for the iPad 2 campaign last year, you get a full rebate on the 16GB model’s price, but that applies only on the data plan charge. So if you use less than the 100MB free allotment of 3G/4G data, you will still have to pay at least the iPad’s price (split over 24 months).

Now the big differences with the iPad 2 campaign we had last year:

  • The iPad 2 3G model used to be offered by SoftBank for the same price of the WiFi only model at Apple. This is not the case anymore. You will pay a ¥10,960 to ¥10,800 premium for the 4G model over the simple WiFi model.
  • The access to SoftBank WiFi hotspots which was included for free before is now charged at ¥490 a month.

This makes this campaign plan much much less interesting than its predecessor.

3G or 4G speeds?

Additionally, the page adds an enigmatic note next to all mentions of 4G

日本国内ではSoftBank 3Gエリアのみで、ご利用いただけます。

Inside Japan, can only be used in SoftBank’s 3G area.

I suspect this is a shrouded way of saying that the iPad sold currently will only work with SoftBank’s 3G network, corroborating other sources around the web that it is incompatible with 4G LTE network bands used outside the US.