Searching for the perfect speed

Since I got the crazy idea to radically change this website engine, from Windows+mojoPortal to Linux+PHP, I noticed that I need a LOT of more CPU time to generate each page:

cpu-year

It uses a lot of processor time, but requests are much more faster… if the page has been “cached”:

http_loadtime-year

In my experiments I saw that the forum that I was using (bbpress) slows down the site a lot: it loads a lot of useless javascript in all pages, and doesn’t allow “caching” the pages. So I temporarily disabled the forum, searching for a temporary solution. I’m thinking to use Discourse

What does “root” means?

In computer terms, with root we can mean:

  • Root as user
  • Root as in file path

If we mean root as an user, we mean the main user, the one with the “master” control of the machine. For example, if you have root on Android, it means you can do whatever you want it it.

If you mean root as a file path, it’s the base, just place the file outside any folder. If you’re using the D: drive, by saying “place the file in root”, it means just place it on D:

How to control a lamp via Arduino

In the last posts I wrote that I bought a lot of Arduino stuff, to try to build something interesting, but I didn’t show anything.

This is the first example, the easiest: how to control a lamp.

Ingredients:

The circuit and the code it’s super easy and it’s on GitHub.

Code explanation:

  1. in setup() we declare that pin 7 is an output
  2. in loop() we turn on pin 7
  3. We wait 10000 milliseconds (10 seconds) before running next instruction
  4. We turn off pin 7
  5. We wait another 100000 milliseconds
  6. We start again from point 2

The result is that we have turn on and off the lamp every 10 seconds.

Obviously, this is an useless circuit, but we can expand it, for example by controlling the lamp via Bluetooth or via WiFi.

How to change the email in WordPress

I don’t see a logical reason behind it, but WordPress is designed for sending emails from the address [email protected]

Did you spent hours to search where in the settings it’s possible to change this address? Wasted time, there the address is hardcoded, you can’t easily change it!

There are 2 ways to change it:

  1. Install a plugin like this: https://wordpress.org/plugins/wp-change-default-email/
  2. Write a few lines inside the functions.php in the theme (better if it’s a child theme)

Since I try to avoid to install WordPress plugins, I chose option 2.

In functions.php, add this:

// change the email
function wpb_sender_email( $original_email_address ) {
    return '[email protected]';
}

// change the name
function wpb_sender_name( $original_email_from ) {
    return 'Your Name';
}

// Hook those functions to WP 
add_filter( 'wp_mail_from', 'wpb_sender_email' );
add_filter( 'wp_mail_from_name', 'wpb_sender_name' );

I let a Japanese play Majiang

On the Japanese gaming consoles there are hundres of games about Majiang (or Mahjong, 麻雀, 麻将, マージャン, according where it’s played). The game it’s totally different to the “Mahjong” we know in the west, that “puzzle/find couples”, but it’s some kind of poker, I never understood the rules.

I always wanted to play this game, but I was unable to learn the rules, so I asked to a Japanese friend to play to Mahjong Fight Club DS – Wi Fi Taiou for Nintendo DS ed I recorded the gameplay:

Unfortunately, I didn’t record mic input, it would have been much more interesting…

Is it worth to pay for the JR Pass?

A 7 days Japan Rail Pass costs 29110 yen (about 240 euro, depending on the exchange rate). It may seem expensive: is it worthwhile?

It all depends on our travel plans: if we’ll just visit the outskirts of Tokyo, it is a waste of money, even going to Yokohama, Kamakura, Saitama, we’ll never would spend this amount.

But, if we plan to visit also Osaka, we can see on Hyperdia that the pass is cheaper than a return ticket!

Obviously, there are cheaper ways to go to Osaka, for example, a night bus costs about 8000 yen, and even a plane ticket Haneda => Itami costs much less. Or you can try to take the train without reservation saving fifty euro each way.

But the Shinkansen is much more comfortable for many ways: in 3 hours you arrive, without bother to check-in, book months in advance, depart at odd hours, transfer to airports, overweight luggages, etc …

With the JR Pass you can take all trains except the Nozomi (the fastest Shinkansen), berths, and private companies trains (eg: the Seibu-Shinjuku line, Seibu-Ikebukuro, Keio, subway, etc.), so you can save even with a simple, one week trip like this:

  • Narita Express from Narita Airport to Tokyo (2630 yen)
  • Transfers on the Yamanote line to visit Shinjuku, Shibuya (200 yen for each trip)
  • Hikari for Osaka (14140 yen)
  • Train for Kyoto (560 yen)
  • Return to Tokyo (560+14140)
  • Narita Express for the airport (2630 yen)

Total: 35000 yen => a 55 euro savings!

It all depends by what do you want to see during the trip.

Google Play Store is always waiting for Wi-Fi

For several days, at least on my phone, Google Play store can’t download any app, is always waiting for Wi-Fi.

But I’m connected to Wi-Fi!!!

I saw that you can fix it by going to Settings> Apps> Google Play store and then “uninstall updates”

After a while, unfortunately, Google Play store will automatically update to the broken version, stopping again to function. I hope they can fix this problem as soon as possible 😢

No Super Mario Run on rooted phones

Finally, after waiting for months, Super Mario Run is available on Android too! (A totally inexplicable delay – being programmed with Unity, compiling a version for Android it is a matter of a few hours!!!)

I go now to install it! Play Store can’t find it. Strange. I search it from my computer, and I got his:

What does it mean that the app is not compatible with any of my devices???

I have an horrible feeling… maybe they got the same brilliant idea of Pokémon GO and then block the app on rooted phones? The game doesn’t really have online multiplayer, just racing against “ghosts”, and everyone could potentionally cheat via a MITM attack or a cracked APK.

Ok, maybe it’s just a simple check before the installation, just download the APK from some other shady store and it will work, right?

No, as soon it can see that your phone is tampered, it exits immediately!

WTF!!! 💩💩💩💩💩💩💩

Solutione:

Star Wars: Revelations

Cleaning my hard drive I found a 10 year old file: Revelations.divx

I had no idea not what it was, so I opened it. What will it be? A pirate copy of Matrix Revelations? I don’t think so. Also because it was The Matrix Revolutions 😂

Meanwhile the media player loads: “A long time ago, in a galaxy far far away…”
What??? Star Wars???

I keep looking, but I’ve never seen this stuff!!! It’s very well made, so I say to myself “maybe it’s a pilot for a TV series that I’ve never heard of.”

Then I open Wikipedia and see: http://en.wikipedia.org/wiki/Star_Wars:_Revelations

It is a 10 year old fan film!

At the time, there was not even YouTube + Adsense or Kickstarter to monetize it, and yet they did a high-quality film, with no economic return (except in reputation for the director)

The original site no longer exists, but you can always see it on YouTube