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
sábado, 14 de febrero de 2015
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
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
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
jueves, 29 de enero de 2015
connect to an Access Point from command line
I am setting up a laptop with Debian with no-gui just for lab purposes that's why I need to connect it to the AP I have, from command line you may accomplish this task through these ones:
1. sudo iwlist scan //you will AP available, event the hidden ones
2. sudo iwconfig essid "AP name" // in my case:
sudo iwconfig wlan0 essid "atenas"
3. sudo iwconfig wlan0 key s:
4. get a IP from the dhcp:
sudo dhclient wlan0
those steps worked for me, I read in several sites whether the AP has WPA2 passphare you should use the wpa_supplicant method, it may be true, but in my case it was not necessary, just check it in case some of the above steps do not work
Best
1. sudo iwlist scan //you will AP available, event the hidden ones
2. sudo iwconfig
sudo iwconfig wlan0 essid "atenas"
3. sudo iwconfig wlan0 key s:
4. get a IP from the dhcp:
sudo dhclient wlan0
those steps worked for me, I read in several sites whether the AP has WPA2 passphare you should use the wpa_supplicant method, it may be true, but in my case it was not necessary, just check it in case some of the above steps do not work
Best
monitoring your physical resources on Ubuntu
Since I am working with a really heavy DBMS and IDE for a project, I start to ask me about my physical resources, RAM and Processor specifically, once I got a message from that DBMS that I had only 200 MB of RAM available and that was because that monster load a lot of subprocess -It's a Windows based DBMS, there are a lot of options better, but you know, the client always is right.
So, to monitor the resources you may use:
1. from command line: egrep --color 'Mem|Cache|Swap' /proc/meminfo
2. Use a really cool tool: gnome-system-monitor, you get a great graphs about used/free resources, really useful
So, to monitor the resources you may use:
1. from command line: egrep --color 'Mem|Cache|Swap' /proc/meminfo
2. Use a really cool tool: gnome-system-monitor, you get a great graphs about used/free resources, really useful
jailing users with our FTP Server
I know FTP Server is still insecure for several reasons, I know there are better alternatives such as sftp, ssh or at least use ftp with SSL support, but we all know many users come from the dark side (win$$$... ) so maybe this post may be useful specially to them, in case you are running a FTP Server, it would be great restrict access just to the /home directory, in order to accomplish it these steps should be enough:
0. Create a directory for the "alienuser", it would be great in www directory in case you're at work and some consultant needs to upload something:
sudo mkdir /var/www/alienuserdir
1. change owner group to that directory:
sudo chown root.ftp /var/www/alienuserdir
2. addjust permission to the directory:
sudo chmod 770 -R /var/www/alienuserdir
3. it would be great to do a ls -l to alienuserdir so you may check your changes
4. Create user's account from terminal:
sudo adduser alienuser //I like to user perl script adduser, save us a lot of time unlike useradd
5. Change the alienuser's home directory:
sudo usermod --home /var/www/alienuserdir alienuser
6. Add alienuser to ftp group:
sudo usermod -G ftp alienuser
7. open the conf file of vsftpd:
sudo nano /etc/vsftpd.conf
8. uncomment/add/change the next lines:
anonymous_enable=NO
local_enable=YES
write_enable=YES
chroot_local_user=YES
local_root=/var/www/alienuserdir
9. save it and restart the service:
sudo service vsftpd restart
10. that's all, now you may try using your favorite ftp client such as filezilla entering the host name, user(alienuser) and the password, it would be great whether you try to upload/download something as well
All the best
jueves, 22 de enero de 2015
set environment variables in Ubuntu
This trick is useful, specially if you're using software outside of the repos, some of them need to set custom environment variables, in order to accomplish that you may follow these steps:
1. open a terminal
2. type: sudo nano /etc/profile.d/newvars.sh
3. adjust your vars like this: export MYVAR=/target/directory ; save it
4. give execute permissions like: sudo chmod 755 /etc/profile.d/newvars.sh
5. logout and login again
cool
so check it like this:
1. printev | grep MYVAR
you should see an output with the MYVAR's value
that's all
1. open a terminal
2. type: sudo nano /etc/profile.d/newvars.sh
3. adjust your vars like this: export MYVAR=/target/directory ; save it
4. give execute permissions like: sudo chmod 755 /etc/profile.d/newvars.sh
5. logout and login again
cool
so check it like this:
1. printev | grep MYVAR
you should see an output with the MYVAR's value
that's all
Suscribirse a:
Entradas (Atom)