Color Meanings in Terminal

Blue color – Directory
Green color – Executable or recognized data file
Sky Blue Color – Linked file
yellow with black background – device
Pink colour – graphic image file
Red – Archive file

More information:

  • You can turn them off in $HOME/.bashrc file
  • You can see more detail by enter command follow: man dir_colors

Source: Color meaning in terminal

Posted in Ubuntu | Leave a comment

How to install WordPress on ubuntu 12.04

Step 1: Install apache2:

sudo apt-get install apache2

Step 2: Install mysql:

sudo apt-get install mysql-server-5.5

Step 3: Install php5

sudo apt-get install php5 libapache2-mod-php5

Step 4: Test installation:

  • Restart apache2
    sudo /etc/init.d/apache2 restart
  • Create /var/www/phpinfo.php
    sudo gedit /var/www/phpinfo.php
  • Add text follow to file:
     <?php phpinfo(); ?>
  • And Save and close.

Step 5: Install the MySQL Module for PHP

sudo apt-get install php5-mysql

Step 6: Create database workpress

Login mysql: mysql -u root –p
CREATE USER wordpress_user;
SET PASSWORD FOR wordpress_user = PASSWORD(“wordpress_pass”);
Grant all privileges to access the database: 
GRANT ALL PRIVILEGES ON wordpress.* TO  wordpress_user@localhost  IDENTIFIED BY ‘wordpress_pass’;
NOTE: To end command, you must be semicolon (;).

Step 7: Install wordpress.

  • Create /var/www/wordpressfolder:
    sudo mkdir /var/www/wordpress
  • Change mode for wordpress folder to read and write it:
    chmod -c 777 -R /var/www/wordpress/
  • Download wordpress . After download completed, Extraxt it to /var/www/wordpress.

Step 8: Configuration wordpress:

  • open wp-config-sample.php file and modify such as:
    /** The name of the database for WordPress */
    define('DB_NAME', 'wordpress');
    /** MySQL database username */
    define('DB_USER', 'wordpress_user');
    /** MySQL database password */
    define('DB_PASSWORD', 'wordpress_pass');
  • And then save it with name wp-config.php.

Step 9: Now, open web browser and browser to http://localhost/wordpress to see result.
If you see this error: Error Establishing a Database Connection. It means you have done something wrong.


Source: install-wordpress-locally-on-ubuntu-desktop

Posted in Ubuntu | Leave a comment

How to create ubuntu-custom


  • Ubuntu-custom is Ubuntu version which have more softwares that you installed.

How to create:

  1. Install Remastersys:
    • Add remastersys for source. Open /etc/apt/sources.list file and add this line to end file:
      deb precise main
      Note: This is Add Remastersys for Ubuntu 12.04 Precise. For others, see at end page remastersys.
    • Update source:
      sudo apt-get update
    • Install:
      sudo apt-get install remastersys
      Note: If you encounter error message, you can ignore them.
  2. Create Ubuntu-custom:
    • Open terminal and Enter the command follow:
      sudo remastersys backup
    • When completed, 1 custom.iso file will created in remastersys folder.
  3. Source: creating-custom-ubuntu-live-cd-with-remastersys
  4. Done.
Posted in Ubuntu | Leave a comment

Error: Could not get lock /var/lib/dpkg/lock


  • When you use apt-get to install 1 package and you encounter message:
    E: Could not get lock /var/lib/dpkg/lock - open (11 Resource temporarily unavailable)
    E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?


  • Solution 1:
    Open System Monitor –> process, find apt-get process and end it.
  • Solution 2:
      If apt-get doesn’t show up in the list of processes, here’s a work around to fix this:

    • Step 1: Open terminal, press Alt + Ctrl + T.
    • Step 2: Remove /var/lib/dpkg/lock file:
      rm /var/lib/dpkg/lock
      Recommend: you should change name instead of remove it. Reason: you can restore it if you encounter some error.
      You can use command follow to change name:
      mv /var/lib/dpkg/lock /var/lib/dpkg/lock_backup
    • Step 3: Recreate /var/lib/dpkg/lock file:
      sudo dpkg --configure -a
    • Step 4: Now, you can run apt-get to install your package.


Posted in Ubuntu | Leave a comment

Pin application to Dash Home and Launcher in Ubuntu

Example: Create launcher for eclipse.

Using Tool Alacarte:

  • Press Alt + F2 and Type alacarte and Enter:
  • Dialog Main menu show:
  • Choose New Item. Dialog Create Launcher show:
  • Choose application eclipse to create. And then press OK.
  • Now, Eclipse show in Main menu and Dash Home:

  • Drag and drop it to Launcher to pin it in Launcher.

Using file:

    • Create 1 file eclipse.desktop in ~/.local/share/applications/. Enter command follow in terminal:
      mkdir ~/.local/share/applications/eclipse.desktop
    • Open eclipse.desktop file to edit:
      gedit ~/.local/share/applications/eclipse.desktop
    • Add text in below to eclipse.desktop file:
      [Desktop Entry]
      Comment=Eclipse IDE
      Icon = <path-eclipse-icon>/icon.xpm
      Exec = <path-eclipse-executable>/eclipse
    • Save and Close file.
    • Drag and drop eclipse.desktop file to Dash Home and launcher.


Posted in Ubuntu | Leave a comment

Folder is Hidden in Window


  • Folder is Hidden although checked property “show file and folder hide” in window explorer.


  • “Hidden” Attribute of folder is checked.

Solution: unchecked “Hidden” attribute of folder.

  • How to access folder when it hidden:
    1. Type directory path to this folder on URL bar and Enter.
    2. Use “Search result” to find out folder and then double-click folder.
  • And then, right-click on folder and uncheck Hidden attribute
  • Now, folder is show again.


Posted in Window | Tagged | Leave a comment

How to fix error grub sescue


  • Path of root and prefix point to grub is wrong.


  • Start up computer and go to black screen with GRUB RESCUE prompt.


    Install dual boot (Window and ubuntu) on disk drive and then Resize partition on disk drive.

Solution: Set path of prefix and root to partition contain grub

  • Step 1: At prompt, to list all partition have on disk drive, use command follow:
    NOTE: if you know partition that contain grub, you can ignore this step.
  • Step 2: Set path for prefix and root, enter command follow:
    set prefix=(hdX,Y)/boot/grub
    set root=(hdX,Y)
    NOTE: hdX,Y is partition contain grub. X: is number your disk drive, Y: is number partition on disk drive.
    Tip: To show hdX,Y contain grub, use cammand: ls hdX,Y/, If The "hdX,Y" which contain boot ==> It contain grub.  
  • Step 3:If you want to show information that you just set, you can use command follow:
  • Step 4: Install loadable kernel module
    insmod /boot/grub/linux.mod
  • Step 5: Enter the linux line information
    linux /vmlinuz root=/dev/sdXY ro
  • Step 6: Boot loader initialized RAM disk
    initrd /initrd.img
  • Step 7: Finally, Enter command follow:


ls - (optional)
set prefix=(hdX,Y)/boot/grub
set root=(hdX,Y)
set - (optional)
insmod /boot/grub/linux.mod
linux /vmlinuz root=/dev/sdXY ro
initrd /initrd.img

SOURCE: restore grub at #5


Posted in Ubuntu | Leave a comment