sábado, 14 de febrero de 2015

export tables' structure using phppgadmin

this trick is useful - and easy- whether you need to export only your tables' structure from your PostgreSQL database you may follow these steps:

1. logon using phppgadmin

2. in left pane click on your database's name and expand it using the + icon, just like in the next image:




3. then, go to "tables" option and you will see all your tables; now, from the central toolbar click on the option "Export"



4.so in the next screen you got, just select the option "structure only", whether you would read the commands only at the bottom option menu click on "show", otherwise click on "Download". Finally click on "Export"



5. You will obtain a file with sql extension, whether you click on it, you will see all needed commands in other to export you tables' schema. it would be cool whether we decide the file's name (by default is named dump), in fact this would be nice in phpmyadmin too but for now we need to name it manually

Best

martes, 10 de febrero de 2015

fixing /var/lib/dpkg/lock problem in 12.04 LTS

Well it seems there is a problem with some spanish header in the ubuntu 12.04 LTS official repo, anyway, after did an apt-get update you may get this error:

E: No se pudo bloquear /var/lib/dpkg/lock – open (11: Recurso no disponible temporalmente)
E: No se pudo bloquear el directorio de administración (/var/lib/dpkg/), ¿quizás haya algún otro proceso utilizándolo?


in order to fix this issue, go to your terminal and use these commands:

sudo fuser -vki  /var/lib/dpkg/lock
sudo rm -f /var/lib/dpkg/lock
sudo dpkg –configure -a
sudo apt-get autoremove

that's it, now you may use apt-get install.

PS: I hate to be sick, this sore throat is worst I need it now, hope to be better in a few days

viernes, 6 de febrero de 2015

adding 'verbose' mode to dd command when cloning a drive

This is a really cool trick, I often use dd command to backup my important data collected from SD Card or USB stick, but sometimes is annoying when you only see a black screen hoping to finish it successfully, in fact dd command does not have a verbose mode, but you may fix this following these steps:

1. sudo apt-get install pv dialog

2. (pv -n /dev/sdb | dd of=myiso.iso bs=128M conv=notrunc,noerror) 2>&1 | dialog --gauge "Cloning USB to ISO file, please wait..." 10 70 0

that's all, try it and you'll see a progress bar, really cool

Best