Skip to content Skip to footer

Author page: Valerio Galano

Modificare username WordPress utilizzando phpMyAdmin

Come sicuramente saprete, Wordpress non permette agli utenti di cambiare la propria username dal pannello di amministrazione. Tuttavia, avendo accesso al database, è possibile agirare facilmente tale limitazione. In questo piccolo tutorial, vedremo tutti i passaggi necessari per cambiare un nome utente di Wordpress modificando direttamente i record del database. Ovviamente, queste operazioni possono essere eseguite con qualsiasi client MySQL, ma le seguenti schermate si riferiscono a phpMyAdmin.

Delete history of on your own SparkleShare server

SparkleShare is a little Open Source software that allows users to share documents and files with version control and client side encryption system. To put it simply, it acts like Dropbox or Ubuntu One, but it works on top of a Git repository. This means that, if you want, you can simply setup you own a SparkleShare server and share office documents with your colleagues having all infrastructure under your control using Git. This is exactly my office's approach and it works very well. There's only an issue about this: sometimes you need to share big files for a limited period of time. Actually, SparkleShare (v 1.1) has no feature to clear history and this means that Git repositories contain all data needed to access to revisions. In simple words: each repository has disk size equal to the sum of each version of each file (also deleted). In this case it could be useful to clear repository history in order to free a lot of disk space both on server and client.

Change WordPress username using phpMyAdmin

As you surely know, Wordpress doesn't allow users to change their username from administration panel. But, if you have access to Wordpress database, you can simply workaround this limitation. In this little tutorial, we will show all steps needed to change a Wordpress username directly editing database records. Of course, this operations can be done with every MySQL client, but following snapshots specifically refers to phpMyAdmin. First of all, we need to access to phpMyAdmin. In my case, I started from a cPanel administration dashboard and I simply need to click on phpMySql panel link. change-wordpress-username-step1

Setup Oracle JDK 7 + Netbeans 7.0.1 on Ubuntu 12.04 LTS

In this post we will see how to setup a basic environment to develop Java applications on a Ubuntu Precise Pangolin. Normally this setup should be a very simple operation, anyway I had some trouble during process, so I decided to write down and describe all steps I followed to sort out. First of all, I installed Oracle Java Development Kit using specific webupd8team repository. Please note that this step is mandatory because using ubuntu openjdk package, Netbeans won't be able to work correctly: in fact new project window will lock down on "please wait..." message.

Update Twitter Bootstrap to release 3 in Zend Framework 2

Recently I started a new project based on Zend Framework 2, using Twitter Bootstrap as CSS framework. Some days ago, new Bootstrap v3 was released and introduced a lot of changes and improvements. Because of ZF2 Skeleton Application comes out-of-box with Twitter Bootstap 2, I decided to setup the new project skeleton and update CSS framework to latest available release. In this post, I'll describe the process to update Bootstrap to v3 into a ZF2 project. Please note: I set up the project with Zend Framework 2.2.2 and updated to Twitter Bootstrap 3.0.0-rc1 because, actually, are latest available versions. If time is passed, you should check official documentations to ensure that this procedure is still valid. I'll describe update process assuming that we have a working Skeleton Application deployed following Zend Framework Getting starded guide. First of all, we have to update libraries in public/ folder by accomplish following steps:
  1. Download Twitter Bootstrap library package and unzip it.
  2. Move content of dist/ folder into <project>/public/ folder.
  3. Download Glyphicons package and unzip it.
  4. Copy fonts/ folder into <project>/public/ folder.
  5. Copy css/bootstrap-glyphicons.css into <project>/public/css/ folder.

Fix Hibernation after swap partition resize

Hibernation can be an important feature for many users: it allows people to turn on the PC and get it in the exact state session of when it was turned off (open files, running applications, configurations edited, terminals, etc.). This feature is based on usage of swap partition. In poor words: when user hibernate PC, all content of RAM memory is stored in this partition and is fetched at next startup time. For this reason, the swap partition must be bigger (or at least equal) than RAM size and, in case of RAM update, must be enlarged.

The problem

The problem is that, after a resize operation, swap partition's UUID is modified and initramfs is unable to recognize swap partition. This means that when you try to hibernate your PC, it don't wake up correctly and boots as you turned it off normally.

The solution

The solution is very simple: after swap partition resize operation, let's inform initramfs about new UUID. Let's see how.

Riattivare ibernazione dopo il ridimensionamento della partizione swap

L'ibernazione può essere un funzionalità importante per molti utenti: essa permette di spegnere il PC ed ottenere, alla riaccensione, la sessione nello stesso identico stato di quando è stata arrestata (file aperti, applicazioni caricate, configurazioni modificate, terminali, ecc.). Questa funzionalità si basa sull'utilizzo della partizione di swap. In parole povere: quando l'utente iberna il PC, tutto il contenuto della memoria RAM viene conservato in questa partizione e viene recuperato all'avvio successivo. Per questa ragione, la partizione di swap deve essere più grande (o almeno pari) della dimensione della RAM e, in caso di un aggiornamento di RAM, va ridimensionata.


Il problema è che, dopo un operazione di ridimensionamento, l'UUID della partizione di swap viene modificato e initramfs non riesce più a riconoscere la partizione swap. Ciò significa che quanto proverete ad ibernare il PC, esso non si riattiverà nel modo corretto e si avvierà come se fosse stato spento normalmente.


La soluzione è molto semplice: dopo il ridimensionamento della partizione di swap, informiamo initramfs riguardo il nuovo UUID. Vediamo come.

Ridimensionare un gran numero di immagini con Linux

Il problema

Ridimensionare un immagine è un'operazione semplice: esistono molti software in grado di farlo. I più conosciuti sono Gimp e Photoshop. Ma qual'è la giusta procedura per ridimensionare un gran numero di immagini? Immaginate di dover preparare le anteprime per una galleria o di dover ridimensionare tutte le immagini da inserire in una presentazione o, ancora, di dover ridurre delle foto da mandare via email, e così via. Aprire le immagini con Gimp o Photoshop e ridimensionarle una ad una sarebbe una follia. Come si può eseguire questa operazione in modo semplice e senza stress?

La soluzione

Utilizzare la riga di comando di Linux. Ridimensionare più immagini con Linux è molto semplice se si utilizza la suite ImageMagick.

Resize multiple images using Linux

Resize an image is a simple operation: there are many software able to do that. The most obvious are Gimp or Photoshop. But what's the right procedure to resize lots of images? Imagine you have to prepare thumbnails for a gallery or resize all images to insert into a presentation or, again, reduce photos to send them by email, etc. Open each image with Gimp or Photoshop and resize them one by one is foolish. How can we perform this operation in a simple way and without stress?

The solution

Use Linux command line. Resize multiple images with Linux is very simple by using ImageMagick suite. First of all, let's install ImageMagick that includes lots of tools to manipulate images. To do that, execute following command in terminal window:

PHP jobs with Gearman and Supervisor

The problem

Often in a PHP project there could be operations that need to be executed asynchronously. Some example are: processing mail queues, indexing data, computation that requires long elaboration time. A common behavior is handle those operations by using cron to execute processes in background. However, using cron requires expedients to avoid cross executions and forces us to implement some specific procedures and mechanism to store data needed to elaborate.

Solution: Gearman + Supervisor

The solution that involves Gearman and Supervisor, instead, don't require any kind of data storage mechanism and supply a very simple way to develop processes in PHP.