jueves, 31 de diciembre de 2015

list of commands after a fresh install of Debian Jessie

Although there are a lot of this kind of post, here it is my list of commands I used after a fresh install of Debian, at the right of some commands I wrote a short explanation:

1. enable non free repos: add 'contrib non-free' at the end of your repos, then apt-get update and apt-get dist-upgrade

2. apt-get install wireless-tools

3. apt-get install firmware-realtek  //in case you've realtek NIC's

4. apt-get install firmware-linux-nonfree libgl1-mesa-dri xserver-xorg-video-ati // for ATI video cards

5. apt-get install unzip cmus shotwell vlc recordmydesktop gthumb baobab rar unrar //some utils

6. sudo apt-get install netselect-apt //looks for best repo for you (this is related with your ISP backbone, long talk about it)

 7. apt-get install build-essential module-assistant
     apt-get -f install

8. apt-get install flashplugin-nonfree  //flash player for iceweasel

sábado, 26 de diciembre de 2015

install realtek modules on debian jessie

My two NICs are Realtek, after a fresh installation of Debian you need to follow these steps to enable them:

1. edit your sources.list and add the non-free repositories (contrib non-free)

2. apt-get update

3. apt-get install firmware-realtek

After that, restart your system, you should use your NIC now.

cheers

lunes, 14 de diciembre de 2015

backup your Postgres Database Server

Very easy trick, but useful at the same time, whether you need to backup your PostgreSQL database server just follow these steps:

1. su postgres

2. psql -l

3. pg_dumpall > allmypgdata.sql

Now, in case you have any doubts, to check the databases had been backed up just use this:

 grep "^[\]connect" allmypgdata.sql

You have to see all databases' names

That's all

sábado, 12 de diciembre de 2015

avoiding "can't load menu.c32" error on booting from a pendrive

I needed to install Lubuntu on an old HP mini 110 laptop, normally I have a pendrive with  multiple Linux distro, I use multisystem to accomplish this; so, I tried to boot from my pendrive but I always got the error "can't load menu.c32 from..." I copied it on several location on the pendrive but it did not work, at last I got the error "can't load image file", so I decided to drop multisystem and try to install lubuntu on it using unetbootin.

Then I tried to boot from it and I always got the same error, so, to solve this I followed these steps:

1. from a terminal on another computer with Linux, go to /usr/lib/syslinux/modules/bios

2. copy the file vesamenu.c32 to the pendrive, just copy it outside any directory, it would be enough.

3. then try to boot from it and you'll see the Grub Menu to try Lubuntu or any other linux distro you need to install.

This little trick is useful when the videocard of the computer is not so fancy, to load you just need to load the VESA module and everything will work.


viernes, 11 de diciembre de 2015

bringing to life a deadly XFS partition

This kind of post makes me feel really happy because it could helps anyone when the things looks pretty bad and for the joy to solve an issue I needed to fix.

Long long long time ago I had a problem with one HDD, it had two partitions, one of them was an ext4 and the other one was an XFS, I was copying more than 400 GB of data but an energy outage happened and the partitions became corrupted;`  as a result, I could not read the entire HDD, I had important data in there so I have to recover them.

I think the most important step to accomplish this task is to be calm as much as you may; by that time, I had a lot of stuff in progress, my job, an outsource IT project, and teaching at university, I had to wait around 8 months to start working on this, so, avoiding that comment, these steps were really helpful for me:

1. plug your HDD using an enclosure
2. You may a distro called System Rescue CD, it has a programm called testdisk, so boot your computer using that distro
3. an important step was to make sure if the filesystem is recognize by the OS, SystemRescueCD has a programm called "Display Filesystems", I used it and I could see the filesystem on my broken HDD, one ext4 and the other the XFS one.
4. next step I tried to mount the partitions but I got and input/output error then I decided to use testdisk.
5. Using testdisk I found I had a problem with the geometry of the HDD, you have to choose to do a "quick search" test in order to fix this, then you need to write the changes made to the disk
6. I decided to do a Deep Search to the disk, this was not necessary because at this time I could mount the partition but one of them could not be written, but using this option you could list the files that are in the partition and save it to a safe location.
7. As I wrote, at this point the partitions could be mounted but the XFS one couldn't be written, I still got an input/output error, the ext4 did not present any problem at all.
8. There is an utility called xfs_repair, you may install it using "apt-get install xfsprogs", after that I use this line:
xfs_repair -L /dev/location_of_the_partition

and that's it, xfs_repair found some zombie inodes, it moved them to lost+found and the process was successful.

Then I tried to mount it and everything works perfect, I could backup my data.

Hope it may help you in case on emergency.

miércoles, 21 de octubre de 2015

Adding user account to several groups

Fast Ball, whether you need to add your user account to several group use this command:

usermod -a -G

Example:

usermod -a -G ftp bobdylan

Cheers

sábado, 4 de julio de 2015

backup and restore PostgreSQL database

I am sure there are a lot of ways how to do this but I would like to show you this effective way

1. whether you want to backup a database the sintaxis is:

pg_dump -h -U -f

Example:
pg_dump -h localhost -U bob accounting -f accounting07042015.sql

2. whether you want to restore a database you may use this sintaxis:
 psql -H -U -d -f

Example:
psql -h localhost -U bob -d accounting -f accounting07042015.sql

pay attention whether you get some warning or error messages.

Cheers

lunes, 22 de junio de 2015

Java StackTrace Console output on Eclipse Luna

Eclipse it's a great product, currently I am using Luna version and it's really cool, I've integrated J2EE, Python with PyDev and C++, but I think for those capabilities some options does not work as automatically as I wish, one of them is the console, so in order to get output using Java, you may follow these steps:

1. Go to Window>Show View>Console
2. on that view, click on the button "Open Console" and Select "Java Stack Trace Console"
3. Stop your App Server, in my Case is Glassfish 4.x
4. Restart Eclipse
5. Start your App Server
6. Run your application

at this point you have to get output from your App Server on the Console View, in fact, on the Console View you'll see something like: GlassFish 4 at localhost [domain_name], this means your App Server and the Eclipse Console are sync.

Best

domingo, 31 de mayo de 2015

enable connection to postgresql server on Eclipse Luna

On Eclipse Luna to add a connection to postgresql Server follow these steps:

1. go to "Data Source Explorer" tab, on "Database Connections" Double click and choose "New"
2. From the "Connection Profile Types" choose "PostgreSQL" and click on Next
3. On the new Window, on Drivers option click on the button called "New Driver Definition", on "Name/Type" click on "PostgreSQL JDBC Driver", next move to JAR List Tab, then click on "Add JAR/Zip" button
4. Now you have to download the PostgreSQL JDBC Driver available, go to https://jdbc.postgresql.org/download.html and download the appropriate driver for you, this depend on what jdk version you are using. Once you have downloaded it, go to the directory where it is, choose it and click on OK
5. Then just click on "OK"
6. Now, you back on the Window from step 3, in fact it is call "New JDBC Connection Profile", here you need to specify the connection details like Database Name, User Name and Password, you are free to choose the option "Save Password". Once you are done click on "Next", read the Summary page, check if everything is OK and click on "Finish".

Now, if everything is OK on the Data Source Explorer Tab you may click on your database name and see the tables, index and everything.

that's it

viernes, 29 de mayo de 2015

install glassfish support on Eclipse Luna

This is an important info, specially if you are going to develop application with database support. So, to enable glassfish support on Eclipse Luna just follow these steps:

1. From Luna's main menu bar, go to help>Install New Software
2. Click on Add Button
3. on Name type a specific name in my case I chose Glassfish Tools for Eclipse, on the Lotaction type: http://download.oracle.com/otn_software/oepe/12.1.3.5/luna repository, and click on OK
4.  now with a few seconds to download the definitions from the repo. Once it have done, click on "Glassfish Tools", you may browse the entire list in case you are interested on any of them.
5. Then click on Next Button, accept the license agreement and wait until it finishes

doing this process, another repo will be configure on Eclipse ( http://download.oracle.com/otn_software/oepe/12.1.3.5/luna/repository/dependencies), don't be aware about it.

One thing more, I tried to do this behind a proxy and it was impossible - at least for me- I talked with the sys admin and told me it was not any rule against the eclipse repo, by the end of that day I tried at home and the process was really quick, take it in count.

and that's all, now you can create an instance of Glassfish for call it from Eclipse Luna.

Bye

lunes, 18 de mayo de 2015

install additional software on Eclipse Luna over Ubuntu 14.10


For any reason, the process to install additional software on eclipse is tricky. Some days ago I've install pydev+python support on it without any problems. Now I need to add another packages but the access to repos is extremely slow, so in order to fix this on Ubuntu, from command line just pass some args like this:

./eclipse -vmargs -Djava.net.preferIPv4Stack=true

after this you may do an update, install additional software or access to the Eclipse Software Center.

I read a lot at google about this problem, it looks this bug was fixed but several people still got it, anyway, at least for me it works using that parameter.

Cheers

domingo, 17 de mayo de 2015

start, stop and reload glassfish 4.x on Ubuntu

this is a short post, if you've already downloaded and installed glassfish 4.x (most of the time at /opt directory), you may use these commands to work with it:

1. to start: sudo ./asadmin start-domain

2. to enable admin's page (at 4848 port): sudo ./asadmin enable-secure-admin

3. to restart: sudo ./asadmin restart-domain

4. to stop: sudo ./asadmin stop-domain

that's all

cheers

jueves, 7 de mayo de 2015

install and configure Oracle 11g Express Edition on Ubuntu

There are several guides online how to achieve the installation of Oracle XE on Ubuntu, in my case I need it for academic purposes, I am pretty sure the installation of the full Oracle Suite has to be more friendly.

Cool, I read several of those guides, maybe some of them are out of date, in other cases the steps were enough, but in my case I had to mix a lot of them in other to accomplish the process, I am using Ubuntu 14.10 so maybe this would required to custom the installation. Before begin I need to say Oracle XE just accept up to 11GB of data storage, it may use up to 1 GB of RAM -although I you have more it won't be used- and the resources used will not exceed one CPU. As you may read, Oracle XE works great if you are a beginner in this DBMS.

1. the first step is to download the package -by the way for Linux there is a RPM package-, just go to this URL:
www.oracle.com/technetwork/products/express-edition/downloads/index.html  
create your account and then the download process will start.

2. From your $HOME directory create a directory called "oracle", copy the ZIP file and unzip it using:
  unzip oracle-xe*.zip

3. Open a terminal and install some needed packages:
  sudo apt-get install alien libaio1 unixodbc vim

4. next you have to convert the rpm package to deb, using:
   sudo alien --to-deb --scripts oracle*.rpm

5. then we need to configure awk and chkconfig:
    sudo ln -s /usr/bin/awk /bin/awk
    sudo mkdir /var/lock/subsys

6. Oracle requires to have a separate shm mount moint, in order to get this type:
   sudo rm -rf /dev/shm
   sudo mkdir /dev/shm
   sudo mount -t tmpfs shmfs -o size=2048m /dev/shm

   Notice you are typing size=2048m, this is related to the amount of physical RAM your system has, take some notes about it:
   -whether you are using a 32bit based system you must type just 2048m even whether you have more of it.
   -whether you are using a 64bit based system you are free to type the amount of RAM installed. in my case I have 4 GB but I just type 3GB of it
   -if you have a swap partition less than 2 GB you need to create expand it or create a swap file. I will avoid this step because most of the systems have more than 2 GB of RAM, enough HDD space so it would be a good a idea to expand you swap partition instead to do extra -and even more confused- steps

 Now, the idea is to everytime you start your system, you may have an available working environment for Oracle, so you need to write these steps in one file as I show next:

   sudo nano /etc/rc2.d/S01shm_load
    #!/bin/sh
    case "$1" in
    start) mkdir /var/lock/subsys 2>/dev/null
           touch /var/lock/subsys/listener
           rm /dev/shm 2>/dev/null
           mkdir /dev/shm 2>/dev/null
           mount -t tmpfs shmfs -o size=2048m /dev/shm ;;
    *) echo error
       exit 1 ;;
   esac

    Finally save the file and give exec permissions:
     sudo chmod 755 /etc/rc2.d/S01shm_load

7. Now, we need to create a chkconfig script (please type each line without any quote for read purpose at the blog I had to use them), login as root:
    sudo -i
 
  Then copy these lines:
 

 
Since blogger does not have a way how to embed code snippet I had to use an external service. 
 
Type the lines exactly as they are in. 


8. logout from root:
exit

9. give exec permissions:
   sudo chmod 755 /sbin/chkconfig

10. go to the "oracle" directory you created from step 2:
    cd ~/oracle/Disk1

11. install the deb package generated:
     sudo dpkg -i oracle*deb

Wait some minutes.

At this stage, oracle-xe is installed and ready to be configured, the next steps are really important so be prepare:

12. Edit your .bashrc en add the next lines at the end:
     export ORACLE_HOME=/u01/app/oracle/product/11.2.0/xe
     export ORACLE_SID=XE
     export NLS_LANG=`$ORACLE_HOME/bin/nls_lang.sh`
     export ORACLE_BASE=/u01/app/oracle
     export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH
     export PATH=$ORACLE_HOME/bin:$PATH
     save it and close it
13. configure oracle using this command:
     sudo /etc/init.d/oracle-xe configure
    

     You'll be asked about:
     -available port for Oracle XE(it suggested 8080 I chose another one)
     -available port for Oracle Listener (I kept the default: 1521)
     -A password for SYS and SYSTEM user accounts

    Then You have to wait some minutes in order to confirm all stages, If evey of them were OK you should see something like this:
    Starting Oracle Net Listener...Done
    Configuring database ... Done
    Starting Oracle Database 11g Express Edition instance... Done
    Installation completed successfully

14. So at this point, all howtos online say eveything is ready, in my case I got an error at the "configure database" stage, this is where this guide might give you something new:

After this, you have to check 4 log files at:
/u01/app/oracle/product/11.2.0/xe/config/log

At least in my case I found something useful in cloneDBCreation.log, the other ones looked ok. So I found this error:
ORA-01109 database not open

besides this message, everything looks ok, the database was mounted and unmounted, for some reasons it could not be reopened. It seems the configure process almost finished, so I decided to try to connect to DB Engine using sqlplus.

15. Cool, before this, your current user needs to be part of the dba group:
    usermod -a -G dba 
16. login using sqlplus:
     sqlplus / as sysdba

17. now you have to be logged, then type these commands:
    shut immediate
    startup

18. Verify if some instante is ready to accept connections:
   select status from v$instance;

And that's all, for the moment, I know I missed the part to load oracle as a service, for now you may use it loading it manually, it's not perfect but it is a start. In fact, the log files do not give the necessary information in order to solve properly this issue. Several years ago I tried to install Oracle (I guess it was 8i) on CentOS and the process was less complex. It would be great the guys from Oracle may create a deb package.

Suggestions are welcome.

Be good

sábado, 2 de mayo de 2015

install and configure Kivy and Eclipse Luna

Today I would like to post about Kivy, which is a great Framewok based on python to develop apps with rich UI. I think this is a cool library, I am not using it for business purposes, I am teaching python this semester so it's really cool to focus on it.

So, first to install kivy on Ubuntu, open a terminal and type these commands:

1. sudo add-apt-repository ppa:kivy-team/kivy
2. sudo apt-get update
3. sudo apt-get install python-kivy kivy-examples

after this, you may check the examples at /usr/share/kivy-examples

Next step is to install eclipse luna which is the latest version of this project, just go to:
https://www.eclipse.org/downloads/ and choose the version you like more, in my case I chose "for Java EE DEvelopers" one, wait until it's downloaded

once it finished, just unpack the tar.gz file, and execute the file called "eclipse" and that's it, now you have Eclipse Luna installed.

last steps are:
from eclipse main menu, go to "help" menu and choose "install new software", in the new window, in the"work with..." section type:
http://pydev.org/updates

Pydev is another important IDE for Python, the integration with eclipse is really great.

click on next, accept the terms and wait some minutes until it finished the process

and if you don't get any weird message you have done this job

cheers


domingo, 12 de abril de 2015

installing pygame on ubuntu 14.10

this one was really tricky, in theory you just need this one:

apt-get install python-pygame

but it's not so easy, there are several unmet dependencies, so to accomplish it you may follow those steps:

1. install some dependencies:

sudo apt-get install mercurial python-dev libav-tools libsdl-image1.2-dev libsdl-mixer1.2-dev libsdl-ttf2.0-dev libsmpeg-dev libsdl1.2-dev libportmidi-dev libswscale-dev libavformat-dev libavcodec-dev

2. you will have this unmet dependence:
sudo apt-get install python-numpy

that is because gcc version is upper than need it, here is the real trick

3. sudo aptitude install liblapack-dev liblapack3 libgfortran3

then you'll get a suggestion to not install any of them, press N and you'll get another one but this time to downgrade several packages, press Y and you'll have to wait some minutes. I know gcc is one of the core packages but after finish the download process I restart Ubuntu (just in case) and everythings works.

4. sudo aptitude install python-numpy python-pygame

5. that's all

Best

viernes, 27 de marzo de 2015

Creating a database connection to SAP ASE 16 from NetBeans

I would like to start saying this was a pain in the neck for sure, if I think this, the hardest part was the lack support from the SAP guys, specifically the official docs, independent blogs or user's list. So one client has a deployment  using SAP ASE, formerly called Sybase, it's a must to keep that DBMS -first weird decision- That's why I have to download latest ASE available to try connect it from NetBeans because the new project will use JSF -cool, but over ASE? even weird decision. So after many failed test here are the steps to connect to over Linux:

1. download ASE from SAP's website, the installation process is windows style: graphical, lack of details, slow, heavier, etc. Just try to take notes about the port connections. The server is started using a weird script, anyway, I installed it on /opt.

2. after start from command line, start glassfish and load Netbeans

3. from your project go to the services tab and create a new driver, then look for the jconn4.jar file, this is supplied from the ASE installation, you may download it from the official site as well.

4. find the main class using the button FIND, the class is the jdbc4 one.

5. then go to Database Option and choose "New Connection" option, load the driver you have created, click on next button.

6. in the next window type the USer Name and PAssword, you may use the 'sa' user in case you are not created another one, for this test is ok.

7. the most important part is this, the JBC Url, the sintaxis is this: jdbc:sybase:Tds::
now, from here I spend like 5 days figuring out why I could not connect to it, I was sure about the server's name and the port but I always got this error: UnknownHostException.  Here I discovered the lack of this DBMS, the official docs are usefulness, there is no end user support at blogs, social networks nor IRC, it was really cruel at this point.

8. so I decided to face this from another point of view, I used netstat to check if the port was available:
  netstat -atun

9. if you want to be more specific you may use:
 netstat -tulnp | grep 5000

So I found the port is listening but I figured out about the hostname (127.0.1.1) so I decided to include it in the JDBC url instead of server's name, so the url was: jdbc:sybase:Tds:127.0.1.1:5000

10. just press "Test Connection" button and... it works

and that's it, I can start to code my JSF CRUD's , in case you decide to work with ASE - for some weird decision- this will be really useful for you

Best!





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

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

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


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

jueves, 15 de enero de 2015

disable media scanner service in ubuntu

Since I upgraded to Ubuntu 14.10 everytime I plug an USB device I got a message "device is busy" specially whether the devices has a lot of media files and must of the times this is annoying. So, in order to disable this just do these steps:

1. open a terminal
2. from your /home directory just type: echo manual >> ~/.config/upstart/mediascanner-2.0.override
3. login again in order to update your profile

Whether you have several user accounts you should use this line instead:
sudo sh -c "echo manual >> /usr/share/upstart/sessions/mediascanner-2.0.conf"

that's it, try this time to plug/unplug your usb device and you'll see the difference.

Another approach would be to purge mediascanner but I read ubuntu-sdk uses mediascanner in several operations, in case you're developing for ubuntu touch for example, purge it would not be a good idea.

All the best

martes, 13 de enero de 2015

export a VirtualBox appliance from command line

This trick might be useful, I did an Ubuntu update and it did not works for my system, so I'm rescuing many things, one of them are Virtual Machines from VirtualBox, so from command line the steps are:

1. vboxmanage list vms
  You will get the list of all your Vm's

2.  vboxmanage export -o .ova
Export the appliance to a single file, I tried this directly to an removable USB Hard Drive and it worked

3. Go to the target system and use this command:
    vboxmanage import .ova  or use the VirtualBox's graphical interface to import it

and that's it, the import process may delay, it depends of the size of the appliance.

Cheers

viernes, 9 de enero de 2015

random password commands in Linux

This is an alternative to generate random password, in general you may use this whether:

1. you use the same password for all your accounts (that's not a good idea)
2. you are a programmer and in you need a random password generator for sign-up process

in those cases, you may use this commands:

1. makepasswd, it uses /dev/urandom to generate them, here the first steps to use it:

  -sudo apt-get install makepasswd
  -makepasswd --chars 16  -> generate password with a length of 16 characters, you may change it.
   -makepasswrd --chars 16 --count 5 -> it will generate a list of five different passwords


2. pwgen: generate readable passwords ( use your imagination, many of them seems unreadable for me)

  -sudo apt-get install pwgen
  -pwgen 16 2  -> it will generate 2 passwords with 16 chars of length.

That's all, whether you're interest to explore more parameters for these commands, please use man

Cheers