Flash post: few Vagrant errors and few Vagrant fixes

687474703a2f2f6572696b6168656964692e636f6d2f7468656d652f6661746361747a2f696d616765732f76616772616e742f6c6f676f5f76616772616e742e706e67

Hi there, in these days I’m working with Vagrant and VirtualBox . There are few recurrent errors I’d like to write down to keep in mind error-solution and probably save time the next time I face them.
Continue reading

Useful tricks: live monitoring with “watch” command on Mac OS

img_Terminal

Today I’d like to share an useful command that unfortunately is not native on Mac OSX (I’m using v10.9.5).
This command is watch (http://en.wikipedia.org/wiki/Watch_(Unix)).

I was used to use it on Linux to monitor live changes to logs or even to monitor git repositories but you can execute it for many other purposes.
Now, moving to Mac, the story changed and I had to find my solution. What’s better than creating your custom command with your own code?

The way it’s done is like a primitive version of the well consolidated and full of options watch in Linux but for sure it’s really better than nothing. So far I just needed the basic version but if you want you can add all the options you wish.
Continue reading

Flash post: “Site identity not verifiable”:

This is meant to be a flash post and a relief for someone that, like me, has to test the website on different mobile phones.
I’ll omit the software version because not pertinent to the problem or the solution.

I had to test a website on different mobile devices and Blackberry z10 kept returning a Certificate Exception like “my certificate has expired” and the following error

Site identity not verifiable

Not verified? What?
I’ve tested the website on VM, with User Agent switchers and on different Z10!!

So, recalling an oversimplification of the Occam’s Razor,

The simplest answer is most often correct

and digging a bit into the web, the solution I found was quite simple and based on the Date/Time used to validate the Certificate Expiration Date.

These are the steps to fix the problem (if we can use “fix” and “problem”):

1. Open the phone Settings
2. Select Date and Time option
3. Set Set Date and Time Automatically to Off
4. Set manually the Date and Time
5. Done

The validation of the certificate was incorrectly done on the phone Date/Time but, more important, the Automatic Date/Time setting didn’t work properly on my device.
Following these steps the website will not return the error any more.
An easy solution to an easy problem but often the last thing you think about.

RESTful client-server with MVC Design Pattern

Few months ago I’ve created a Service Oriented Architecture from scratch using the MVC paradigm.
The API is based on three parameters to demonstrate you can create your own with as many parameters you prefer*.

http://restful_client-server/category/keyword/pub_year

where

  1. {category}
    The value ‘book’ is the only available for this parameter

  2. {keyword}
    Any string, any keyword for the book search

  3. {pub_year}
    The published year in the following format 0000

For example, with the following request you’ll get all the books with “RESTful” in the title and with publish year “2014”

http://restful_client-server/book/RESTful/2014

Continue reading

Moving MySQL database folder to a different location on the same server

MySQL logo

Authors: Dariusz Falkiewicz, Mauro Donadio

Few days ago from the post date, Dariusz Falkiewicz and I had to move a MySQL database folder to a different location on the same server.
We worked on Ubuntu Server v12.10 and had to move MySQL v5.1.41.

The first and main idea was to “mv” the folder to a different location and create a symbolic link to replace the original folder.
It sounds good, it could work! Later we realised that moving MySQL default folder is not so easy as it appears.

Continue reading

MongoDB string comparison

highres_14391580

In this article we’ll go through the MongoDB string comparison to understand how it internally sorts and compares strings.
We’ll also have a practical example to be executed by MongoDB Shell to better understand the different behaviour in front of a small concrete collection.

Continue reading

Xdebug problem: Xdebug doesn’t format output as expected

xdebug-logo

Xdebug is a PHP extension which provides debugging and profiling capabilities.
( Wikipedia http://en.wikipedia.org/wiki/Xdebug )

The test architecture I’m using has the following features

  • Ubuntu Server 12.04
  • Apache/2.2.22
  • PHP 5.3.10
  • Zend Engine v2.3.0
  • Xdebug v2.2.5

Continue reading