How to create a Symbolic Virtual Host Link for Apache 2.2

apache318x260

In this post I’ll explain how to create a Symbolic Virtual Host Link for Apache 2.2. This technique provides more flexibility in the local Virtual Host management. You will also avoid to set up every time a new Virtual Host for each application preventing, so, some of the most common and annoying server errors.
Continue reading

Advertisements

Flash post: how to disable “Send & request money with Gmail”

GMoney

Well, I sent an e-mail from Gmail and a weird pop up appeared on the Message editing window.
Now you can send and receive money by GMail because Google Wallet is integrated with Gmail, so you can quickly and securely send money to friends and family directly within Gmail.

I honestly don’t like it..
I don’t like the idea to mix emails and money in this way for security issues. Different could be sending a confirm email after a payment but alike annoying to privacy issues. Ok, I’m not in love with the Online Banking neither but here we’ll talk about the new (new at the time I write this article) Google feature of Send & request money with Gmail. It’s not pre-configured with your credit card details but the new button called additional action is automatically activated on GMail. So, let’s see how to disable it.
Continue reading

WordPress: How to fix the “Site address” during publication

wordpress

How many times happens that, after developing a WordPress website on you local environment, after publishing the new shining website to live, something is broken!?!

What is that? Well, after building all the structure, articles etc on localhost (or anywhere else) nothing works?

Yes, this is due to a Site Address reference stored into the database. Actually, there are really many references to http://localhost/ and changing everything by hand is just a nightmare. Just think about all the internal links between posts / articles, images and so on.
Continue reading

Ubuntu hacking: back to the university time

Screen Shot 2015-02-09 at 14.27.46

Sometimes happens, for one reason or another, you lost the root password for your Ubuntu Server. What the hell? Yes, this is the situation. The reasons could be many and disparate like

  • you just don’t remember the infinitely complicate password you’ve set
  • you just don’t remember the infinitely easy password you’ve set
  • someone left the company and brought all the secrets with him (this is the case)
  • etc

However, we are not here discussing about what happened but about how to reconquer our server!
So, let’s start!
Continue reading

Manipulating CSS pseudo-elements using jQuery (e.g. :before and :after)

(original source from Stackoverflow, answer written by Blazemonger )

My situation:
I’ve a CSS file and I need to dynamically change the values of .is-selected:after and .is-selected:before from Javascript based on the user selection.

Here is my code

.is-selected {
    position: relative;
}
.is-selected:after, .topUp .is-selected:before {
    top: 85px;
    left: 0;
    border: solid transparent;
    content: " ";
    height: 0;
    width: 0;
    position: absolute;
    pointer-events: none;
}
.is-selected:after {
    border-color: rgba(136, 183, 213, 0);
    border-top-color: #9C2AA0;
    border-width: 31px;

    width: 1px;
    overflow: hidden;
}
.is-selected:before {
    border-color: rgba(194, 225, 245, 0);
    border-top-color: #ffffff;
    border-width: 38px;
    margin-left: -6px;
}

After few tries I’ve realised I can’t manipulate them because it’s not technically part of the DOM and therefore is inaccessible by any JavaScript.
However, I’ve found and here reported from an answer in Stackoverflow, written by Blazemonger, few alternatives to do it.
Continue reading

Flash post: Mac, PHP and “Warning: PHP Startup: Unable to load dynamic library”

I’m on Mac OS X Yosemite (Version 10.10.1) and I’m using PHP 5.5.14.
In a nutshell, every time I write

php -v

on the shell I’ve a list of errors like the following example shows

Warning: PHP Startup: Unable to load dynamic library '/usr/local/php5/lib/php/extensions/no-debug-non-zts-20121212/php_bz2.dll' - dlopen(/usr/local/php5/lib/php/extensions/no-debug-non-zts-20121212/php_bz2.dll, 9): image not found in Unknown on line 0

Warning: PHP Startup: Unable to load dynamic library '/usr/local/php5/lib/php/extensions/no-debug-non-zts-20121212/php_curl.dll' - dlopen(/usr/local/php5/lib/php/extensions/no-debug-non-zts-20121212/php_curl.dll, 9): image not found in Unknown on line 0

Warning: PHP Startup: Unable to load dynamic library '/usr/local/php5/lib/php/extensions/no-debug-non-zts-20121212/php_gd2.dll' - dlopen(/usr/local/php5/lib/php/extensions/no-debug-non-zts-20121212/php_gd2.dll, 9): image not found in Unknown on line 0

Warning: PHP Startup: Unable to load dynamic library '/usr/local/php5/lib/php/extensions/no-debug-non-zts-20121212/php_mbstring.dll' - dlopen(/usr/local/php5/lib/php/extensions/no-debug-non-zts-20121212/php_mbstring.dll, 9): image not found in Unknown on line 0

Warning: PHP Startup: Unable to load dynamic library '/usr/local/php5/lib/php/extensions/no-debug-non-zts-20121212/php_mysql.dll' - dlopen(/usr/local/php5/lib/php/extensions/no-debug-non-zts-20121212/php_mysql.dll, 9): image not found in Unknown on line 0

Warning: PHP Startup: Unable to load dynamic library '/usr/local/php5/lib/php/extensions/no-debug-non-zts-20121212/php_openssl.dll' - dlopen(/usr/local/php5/lib/php/extensions/no-debug-non-zts-20121212/php_openssl.dll, 9): image not found in Unknown on line 0

Warning: PHP Startup: Unable to load dynamic library '/usr/local/php5/lib/php/extensions/no-debug-non-zts-20121212/php_pdo_mysql.dll' - dlopen(/usr/local/php5/lib/php/extensions/no-debug-non-zts-20121212/php_pdo_mysql.dll, 9): image not found in Unknown on line 0

Warning: PHP Startup: Unable to load dynamic library '/usr/local/php5/lib/php/extensions/no-debug-non-zts-20121212/php_pdo_sqlite.dll' - dlopen(/usr/local/php5/lib/php/extensions/no-debug-non-zts-20121212/php_pdo_sqlite.dll, 9): image not found in Unknown on line 0
PHP 5.5.14 (cli) (built: Jun 28 2014 10:29:43)
Copyright (c) 1997-2014 The PHP Group

This is clearly a problem due to PHP no able to load some libraries previously activated on the php.ini file somewhere, over there.. Over there that I brought it here down to you.
Continue reading

The paradox of the Infinite Scrolling and the Footer

infinite

What we are going to talk about is not a technical error but a wrong approach, a contradictory implementation choice.

Let’s think about the general structure of our web system. We have the classic Header for our web system where we usually put main menu, table of contents, main links and other relevant objects for the users. We also have the Footer where we can repeat some main menu links and put some more information like About us, T&C, Copyright etc.

We have, obviously also the Content that, in case of the home page, it could be the list of all articles ever written. But wait a second, we can’t load billions of articles all at once, so, let’s split them in blocks. The pagination could be a valid solution but we want something better, nicer, more dynamic..

The infinite scroll could be a good alternative, so the user just scrolls down the page and a bunch of articles are automatically loaded and magically appearing with a fancy fade in effect or maybe a slide down.

Here we are, do you see the paradox?
Let’s look at that together.
Continue reading