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