New horizons: flyover after 9 years, what a pressure!

Because Mendeley was invited to the New Horizons flyover in Washington D.C. I was reflecting a bit more on probes and sending things to the space from the software engineering point of view.

Be aware that I have no much knowledge about space probes, computers in the space, their development methods, etc.

One of the things that I thought is how I would feel if today I wrote code that would only really be used in real (production) 9 years later. Or design a hardware system that would be sent, out of my control (for sure the hardware, maybe not the software) out in the space for 9 years and then it really must work.

In Mendeley (and many other companies) there are different release methods. I would say divide them like:

  • Web/Platform code: a re-deployment should take minutes. Someone could fix a bug and release easily to all the users
  • Desktop (like a Windows, Mac, Linux application): a release can be done but the users must update their applications! The update process can be easy for the user, but we have to think that some users can’t update quickly (for example institutional computers), some users might not accept updates, etc.
  • Mobile apps: after fixing the problem they need to send the app to the store (PlayStore, etc.) and get the app approved again by a third party application. And then they still must handle that some usres might not update everything at once.

For the New Horizons probe: there is only one opportunity for the software to work when it’s flying close to Pluto. Only once, can’t fail! I’m sure that they tested many times, simulated, code reviewed, triple reviewed, unit tested, etc. but still nothing can go wrong at that time or the opportunity is over. In my case I tried our best to not have bugs but if something happens we know that we don’t need to send another probe and wait for 9 years (or even more!) to take the second chance.

Workshops and tutorials in a conference

Workshops
Months ago I went to the ACCU 2015. I already mentioned ACCU 2015 here in How to name things.

One of the sessions that got my attention was “Talking to the suits”. I planned to go. Then I realized that was a workshop and not a talk… and, deep inside me, I thought… “oh no!”. Sometimes I feel more comfortable with a talk, where I can sit and listen (a bit passive).

Anyway, I thought to go there… and is one of the most interesting sessions that I went! Being a workshop made me much more engaged. Next time, instead of avoiding workshops I’ll even prioritize workshops.

Following my own thoughts I went to some more workshops with great success… I was more engaged and used my time even better.

Tutorial
At the ACCU 2015 conference I only went to one tutorial and I didn’t really enjoy it (many other people didn’t like either). I’m not sure if it was the technologies used, the presenter or the session format (tutorial). I think that the last 2 caused the that I felt disengaged and that I could have just followed a Youtube tutorial and have the same knowledge… and the presenter way of talking was boring.

Thinking more about it: a tutorial could be replaced with videos quite easily. And a workshop can’t be replaced at all (needs interaction in a team or with the presenter). And a normal talk is a bit in-between.

Trip to Washington, D.C.: not too usual things

Recently I went to Washington, D.C. as part of the Mendeley team for the New Horizons flyover. If you are interested in the Mendeley activities there you might want to read New Horizons: from Research Papers to Pluto.

I extended the Mendeley trip with some extra days for a bit of tourism. I did some things that were not known by some of my colleagues and some are not mentioned in the guided book so I’m trying to summarize them here.

Washington monument
It’s possible to go to the top of Washington monument (the white monument). There are two options:

  • Get a free same day ticket: they open the box office at 8:30. I arrived there around 6am and I was the fifth on the queue. Each person could get 6 tickets and when getting the ticket the person can choose the time (if available).
  • I didn’t know that was possible to book in advance! See the National Service Park webpage. It cost $1.50 and then it’s not needed to get up so early.

Pentagon
It’s possible to visit the Pentagon inside. It’s needed to request it between 2 weeks and 6 weeks in advance. The tour shows the Pentagon building inside: corridors and a 2001 memorial. It’s free.

Crystal City Restaurant – Double Tree Hilton
The restaurant Crystal City: it’s about 15 min. walk from Pentagon City underground station and I think that there are shuttle buses. The restaurant is a revolving restaurant with views to the Pentagon building, Washington memorial, etc.

Baseball match
I went to a baseball match. Washington Nationals team played against L.A. Dogers (it was the best team from the East Coast Vs. best of from the West Coast). I bought my ticket just 1h30min before the match, paid $42 and I liked the experience. Even though they canceled the match because a bank of lights got broken… three times!

It seems that it’s usually easy to get tickets for the same day. Ah! and they have a very good WiFi connection everywhere, which was helpful to read the baseball rules as I didn’t know them and never watched any baseball match before that one.

Kennedy Centre: J Dilla
This is quite popular: the Kennedy Centre has a free performance everyday at 6pm. I went from the airport to the hotel and I thought to go there: free performance, cafeteria, views, etc.

I queued, got my ticket and then I realized that it wasn’t a normal performance (dance, music) but a panel of 10 experts of J Dilla: a DJ that passed away 9 years ago. I’m not into hip hop but I listened for a while… but usually the performances are different. See the webpage.

Air and space museum: Udvar Hazy Center
I enjoyed (3 times!) the Smithsonian air and space museum in Washington DC (I recommend to do the guided tour and then visit some of the exhibitions in more detail). But near the airport there is the Udvar Hazy Center: it’s an extension of the Air and Space museum near the Dulles airport. It can be reached by a regular bus and it takes about 10 minutes.

My plane departing time was 6pm so I went there in the morning. In that museum they have things that don’t fit in the Washington DC museum. It specially got my attention the Discovery (it has been in the space many times), a Concorde, some satellites and capsules. And many, many planes.

How to name things – thesaurus tip

I’m not particularly good at naming things (variables, methods, functions, classes, modules, etc.). Long time ago George (a colleague) and I were trying to think with “a better name” for a class but none of us had any good ideas. He suggested to use a thesaurus to check for synonyms, related words, etc. and start thinking which of the words would match it or not.

I thought that was a great idea! And actually it was mentioned very briefly at the talk “How to name things” from Peter Hilton (I saw it at ACCU 2015). If I were the presenter I would have explained the thesaurus method for naming things a bit more than he did.

One of the public results of the thesaurus method is my Github repository named potpourri (my first thought was “miscellaneous). Actually, the inspiration to have a github repository for small scripts and not named miscellaneous came when I saw mandrawer from Robert, another Mendeley colleague.

Wattpad story scraper

I wanted to read a story available on Wattpad.. Sadly Wattpad makes people read from phone devices (Android or iOS) instead of giving an epub file. And I really dislike reading from my mobile phone, I wanted to use my e-reader.

I searched on the Internet and I found quite a few videos on Youtube with complicated instructions to download a .jar and find the epub inside (it didn’t work for me, maybe they changed the website). Or to download the book into the mobile and then get the file (which is not easy anymore with Android 5.x, or at least I couldn’t do it easily. I think that I had to root my phone which I haven’t done it yet).

Finally I found the solution: a fantastic Python script! Called wattpad-ebook-scraper.

I know that people without handy Python (Window users) might have problems to use it… but for many other people it’s a very convenient way to create an epub file from Wattpad.

OpenVPN traffic measurement

After setting up the OpenVPN server I wanted to measure how much data the clients were using. I didn’t want to limit it but have an idea of how many MB they used.

I searched quite a lot on the Internet but I didn’t find a good solution. I’ll present my solution here.

In the /etc/openvpn/server.conf (or similar file for your server configuration) add the lines:

script-security 2
client-connect /etc/openvpn/scripts/client-connect.sh
client-disconnect /etc/openvpn/scripts/client-disconnect.sh

Then create the files client-connect.sh and specially client-disconnect.sh.

Using this will log the number of bytes used by a connection like:

Apr 14 23:18:31 localhost openvpn: Session $Client TX: 592794812 bytes RX: 42195316 bytes Duration: 11679 seconds HostIP: $IP

Then we might want an easy way to show the number of MB to make it easier to read. For example, using this script in Python:
Apr 14 23:18:31 $Client TX: 565.333187 MB RX: 40.240589 MB 194 min. $IP

So doing this finally I had the information that I wanted.

OpenVPN configuration for Android

For different reasons I wanted to setup an OpenVPN connection so my Android phone could connect to my Debian Wheezy VPS and from there to the Internet.

I followed this tutorial and was very good (I failed with another tutorial). And I generated the .ovpn that is needed for Android using the script that I wrote.

So the steps in a nutshell:
* Follow https://stavrovski.net/blog/how-to-install-and-set-up-openvpn-in-debian-7-wheezy
* Find the configuration for the server side and the configuration for the client side (Android or other clients like Windows or Linux)
* Generate the .ovpn
* Use OpenVPN Connect Android app
* Open the generated .ovpn file with the OpenVPN connect: connect!

Enjoy!

How to generate OpenVPN .ovpn configuration file

I followed this amazing tutorial and I had a working OpenVPN server.

One thing that I wanted to do is to create .ovpn files. So instead of having the configuration, certificate, private key, etc. in different files I wanted to have everything in the same file.

I found on the Internet how to do this manually, but I wanted to generate different .ovpn for different clients, so I wrote a small Python script.

Feel free to use it, it’s available in the potpourri github repository.

Internet in China: experience from a visitor

On my recent trip in China I used the Internet. I knew of the Chinese Firewall but I didn’t investigate much before going there. I just thought… I hope that I’ll have access to my small VPS server or to my home computer using ssh and from there I can just use SOCKS or something else if I need to. I didn’t have any VPN at that point.

I couldn’t access google.com (but one can access google.hk, the Hong Kong one). And I realized that I do access google.com more often that I thought… and I couldn’t access wikipedia.org (!!). Youtube.com is not accessible, facebook.com, twitter.com either. Or Dropbox: not possible either and I found about Dropbox after uploading the photos of the trip when I was back in London and I shared the links with the Chinese friends (and sadly, and for the first time, I paid one month to Dropbox to have more space… but it wasn’t useful).

I could access my VPS server without problems which was great! (and where I could share the photos after all).

I had my ssh + SOCKS server but from the two hotels where I was the Internet connection was so slow! Downloading files from Europe was about 30 KB/s (just downloading, no SOCKS server or anything like this).

Some days I was just using SOCKS to have “normal Internet”. But on other days I was trying to use “Internet as the Chinese use it!”.

There are many dependencies with Google services: I wanted to download an app for the phone and the app store didn’t work. Or, the thing that surprised me the most: I bought an Easyjet plane ticket without problems, but then I was buying a ticket from Vueling.com. Interestingly during the process of buying the browser stopped responding. I was having a look and the problem that their website use some Javascript from Google: which was not available!

I asked a few people. The ones that have international friends know how to use proxies and VPNs. The other ones, without international friends: they just live in the Chinese Internet.

According to Wikipedia it seems that they do this for control and also to help to Chinese alternatives (and I guess that they can control the Chinese alternatives better than international ones).

A few things that I observed in China

In China I tried to keep my eyes open as much as I could. I also have my camera handy all the time to try to take pictures of things that I see and that I don’t want to forget.

A few things that I observed and that I haven’t seen much in other places…

Chinese sit to take breaks in a squatting position
I saw many people using their phones or just resting in a squat position (almost sitting on the floor). I can’t stay in that position for long time, but it seems that the Chinese can.

I have the theory that they are used to that position a bit more than Westerners because they have quite a lot of toilets that are only a hole on the ground (without a toilet seat) so they are more experienced in making this position.

A Chinese woman said to me that she knew some Westerners that had to take breaks when using the toilet! Like a few minutes squatting, then standing up, then squat again!

On the underground: Chinese use mobiles
I saw many people using their phones on the underground… but I realized when I was back in London that Chinese don’t read newspapers on the underground! They don’t seem to have anything like “Metro” or “Evening Standard” (free newspapers). Also, some people read books but I’d say that there are fewer than in London.

They walk backwards (for exercise)
Every now and then, specially in parks, I saw people walking backwards. I asked why: they think that it’s good for the health, specially if it’s on a slope.

I tried it and I have to say… I liked it! I could feel that I used different muscles than walking forwards.