Force Composer to require/fake a specific PHP version

If you are developing with the newest PHP and are running production with a very outdated version you will find useful the fake platform feature of Composer (the perfect solution would consist to use the same platform on your development, staging and production servers).

platform

Lets you fake platform packages (PHP and extensions) so that you can emulate a production env or define your target platform in the config.

Using the following snippet in composer.json, a php version can be simulated:


"config": {
    "platform": {
        "php": "5.5.1"
    }
}

Remember to update often and maintain awareness of the latest versions and their changes!

Chirimen, a Firefox OS Single-Board Computer by Mozilla

A community called “MozOpenHard Prject” of Mozilla Factory is developing a Firefox OS based developer board and WebAPIs for hardware (I2C and GPIO) control: Chirimen.

Chirimen

Currently you cannot purchase this board, it is still under development and the price is targeting less than USD50.

The hardware specs are:

  • SoC RK3066 (Dual-core ARM Cortex-A9 processor, ARMv7 architecture, clocked up to 1.6 GHz)
  • DDR3 1GB RAM
  • NAND Flash 1GB
  • 1 MicroSD slot
  • Video micro HDMI female
  • Dimension 80 mm x 48 mm
  • USB microUSB x 1 (OTG) , USB x 1 , microUSB x 1 (UART debug)
  • WiFI (not on board. Use RTL8188CUS compatible USB WiFi adaptor)
  • GPIO >1 (configurable)
  • I2C 2
  • UART 2
  • SPI 2
  • Audio analog stereo IN x 1 / OUT x 1
  • PWM 1
  • Analog IN x 1

Mozilla will share openly the firmware code, board design, manufacturing process, API spec, and all necessary sources.

Stay tuned!

Quanto fa 6:2(1+2)?

L’altro giorno, mentre ero sul divano a riposarmi, una mia amica mi ha girato questa semplice domanda: quanto fa 6:2(1+2)?
Cerchiamo di risolverlo nella maniera più “scientifica” possibile visto che esistono opinioni discordanti riguardo il risultato.

La prima cosa che insegnano a matematica è l’ordine delle operazioni, tale logica può essere riassunta così (PEMDAS):

Ossia:

  1. Parentesi
  2. Potenze
  3. Moltiplicazioni e divisioni (da sinistra a destra)
  4. Addizioni e sottrazioni (da sinistra a destra)

Cerchiamo di applicare tali regole alla risoluzione dell’espressione in oggetto:

  1. Eseguiamo le operazioni raggruppate tra parentesi: 6:2(3)
  2. Eseguiamo le moltiplicazioni/divisioni: 3(3) che diventa poi 9

Il risultato è pertanto 9, sia Google che Wolfram ci danno ragione.
Da notare come esiste anche un operatore nascosto, la moltiplicazione, quindi in realtà l’espressione originaria dovrebbe essere scritta 6:2x(1+2).

Perchè c’è gente che si ostina a dire che il risultato di tale espressione è 1?
Semplicemente per il fatto che sono portati a pensare l’espressione come una frazione, ossia 6:[2(1+2)].
Come potete vedere questa assunzione di fatto porta ad allontanarsi dall’espressione originale in quanto si aggiungono delle parentesi che cambiano l’ordine delle operazioni.

Problem solved!

Microsoft is downloading Windows 10 to users machines without their consent

Microsoft has confirmed that Windows 10 is being downloaded to computers whether or not users have opted in, so if you have Windows 7 or Windows 8 you should be worried.

The rationale behind this choice is:

For individuals who have chosen to receive automatic updates through Windows Update, we help upgradable devices get ready for Windows 10 by downloading the files they’ll need if they decide to upgrade.
When the upgrade is ready, the customer will be prompted to install Windows 10 on the device.

How to avoid this shitty behaviour?

We need to disable/hide these updates in Windows Update (Windows 7/Windows 8):

[7]   KB 2952664
[8]   KB 2976978
[7/8] KB 2977759
[7]   KB 2990214
[7]   KB 3021917
[8]   KB 3022345
[7/8] KB 3035583
[8]   KB 3044374
[7/8] KB 3068708
[7/8] KB 3075249
[7/8] KB 3080149

If you are a tech savvy guy you can run this .bat:

wusa /uninstall /kb:2952664 /norestart /quiet
wusa /uninstall /kb:2976978 /norestart /quiet
wusa /uninstall /kb:2977759 /norestart /quiet
wusa /uninstall /kb:2990214 /norestart /quiet
wusa /uninstall /kb:3021917 /norestart /quiet
wusa /uninstall /kb:3022345 /norestart /quiet
wusa /uninstall /kb:3035583 /norestart /quiet
wusa /uninstall /kb:3044374 /norestart /quiet
wusa /uninstall /kb:3068708 /norestart /quiet
wusa /uninstall /kb:3075249 /norestart /quiet
wusa /uninstall /kb:3080149 /norestart /quiet
pause

Another solution is: Install Linux!

How to opt-out your Wi-Fi from Microsoft Wi-Fi Sense and Google Location Server

As you know Windows 10 is out with all the related privacy issues (you should be aware of): what makes Wi-Fi Sense controversial is that it encourages you to crowdsource private Wi-Fi network passwords with your Outlook, Skype and Facebook contacts.
Google Street View cars were found to be collecting data from unsecured Wi-Fi networks in 30 countries worldwide; Google feeds this data into its location database, the Google Location Server, and now collects from Android phones and tablets.
To opt-out your wifi from Microsoft Wi-Fi Sense and Google Location Server you need to change the SSID in this way:

  • Opt-out from Microsoft Wi-Fi Sense including _optout somewhere in the Wi‑Fi network name (SSID);
  • Opt-out from Google Location Server changing the network name (SSID) so that it ends with _nomap.

So if you’re sensitive about privacy concerns you should have a SSID like this: myoriginalssid_optout_nomap.