configuration

Install AMD Radeon HD 6470M and solve overheat on Ubuntu 11.10 Oneiric

31 Oct , 2011  

UPDATE: Try upgrade your BIOS. Several people have said they reduce heat by upgrading the BIOS.
http://h20000.www2.hp.com/bizsupport/TechSupport/SoftwareIndex.jsp?lang=en&cc=th&prodNameId=5086746&prodTypeId=321957&prodSeriesId=5086745&swLang=13&taskId=135&swEnvOID=4061#93211

Please note that installing the latest AMD ATI Radeon FGLRX still not solve the overheat issue. I recommend you to switch off the radeon VGA and use Intel VGA card. It will decrease overheat from 90 C fall into 57 C.

I have HP 431 which support with 2 VGA driver, Intel and AMD Ati Radeon HD 6470M. I start install fresh Ubuntu Oneiric by default & use open-source ATI Radeon proprietary driver. Suddenly, my laptop got overheat about 80 C when i start my activity like writing code, run VM and many else. I thought it was kernel bug. After searching through Google and find there no right solution there.

So i start diving into my Ubuntu Oneiric and find that dual-VGA is the main problem here. To check your VGA availability, do “lspci -nn | grep VGA” :

1
2
00:02.0 VGA compatible controller [0300]: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller [8086:0116] (rev 09)
01:00.0 VGA compatible controller [0300]: ATI Technologies Inc NI Seymour [AMD Radeon HD 6470M] [1002:6760]

More…

,

Uncategorized

Install Ubuntu Server on Virtualbox, Guest Addition & Solve network problem

25 Oct , 2011  

Installing Ubuntu Desktop 11.04 or 11.10 on Virtualbox is easy. All you need is just configure NAT & Host-only adapter to make VM can connect to internet and Host.
Also, there is easy installation for Virtualbox Guest Addition, which can done with right-click.

But it’s different with Ubuntu Server on Virtualbox. It’s doesn’t have GUI. So, we need to install Virtualbox Guest Addition manually. Other problem is about network adapters problem. I have tried with Ubuntu 11.04 Natty and 11.10 Oneiric. All results are same! Virtualbox only detecting one network cards only.

So, let start with VboxGuestAddition. Click on Devices menu and select Install Guest Additions. Then go to terminal and do this :

1
2
3
4
5
6
sudo apt-get install linux-headers-$(uname -r) build-essential
sudo mkdir /tmp/cdrom
sudo mount /dev/cdrom /tmp/cdrom
sudo su
cd /tmp/cdrom
./VBoxLinuxAdditions.run

Now Virtualbox Guest Addition success installed.

Then we need to solve network card problem. We need to delete network rules to reset network interfaces.

1
sudo rm -rf /etc/udev/rules.d/70-persistent-net.rules

More…

,

system

Solving WordPress not loaded properly in NGINX

24 Oct , 2011  

I have built a few wordpress sites on HAProxy and NGINX. Somehow, my clients tell me that wp-admin doesn’t loaded properly. When start new post or editing, text menu doesn’t load properly. Also, when show button clicked on image manager, it will get nothing.

So, i try to check and got this by firebug :

1
Jquery is not defined

So, i open nginx conf, this is the past version :

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
....
    index  index.php index.html index.htm;

    # catch all
    error_page 404 /index.php;
    location = /favicon.ico {  
        log_not_found off;
        access_log off;
    }
 
    location = /robots.txt {
        allow all;
        log_not_found off;  
        access_log off;
    }
   
    location / {
        # This is cool because no php is touched for static content
....

Then i change into this one :

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
...
    index  index.php;
   
    location / {
        # This is cool because no php is touched for static content
        try_files $uri $uri/ /index.php;
    }

    # catch all
    error_page 404 /index.php;
    location = /favicon.ico {  
        log_not_found off;
        access_log off;
    }
 
    location = /robots.txt {
        allow all;
        log_not_found off;  
        access_log off;
    }
...

And all issue are solved!
It’s pretty weird, but changes NGINX conf solve this problem.

,

configuration

Install and configure Vagrant on Ubuntu Oneiric 11.10

23 Oct , 2011  

Installing Vagrant on Ubuntu 11.04 using base tutorial on vagrantup.com will give success result. But not with Ubuntu Oneiric. This is because gem path changes and “Invalid gemspec invalid date format in specification”.

Here are right steps to install & run Vagrant on Ubuntu 11.10 :

1. Install & Configuring Virtualbox
Go to https://www.virtualbox.org/wiki/Linux_Downloads and install as your Ubuntu Oneiric version (32 or 64 bit).

1
2
A. Install by "sudo dpkg -i virtualbox-package.deb".
B. Add your users into vbox group

2. Install ruby and gems

1
sudo apt-get install rubygems ruby1.8

3. Install Vagrant

1
sudo gem install vagrant

After installing, when you type “vagrant”, you will get error like this :
More…

,

configuration

Configuring CakePHP works in sub-folder Localhost NGINX

21 Oct , 2011  

Building CakePHP in sub-folder of localhost is a common way. If you use NGINX as web server for development, we need to setup several thing to make CakePHP works in sub-folder. For example, i have one CakePHP applications

1
2
3
4
5
6
7
localhost
 |_ mycakephp
       |_ app
       |_ cake
       |_ vendors
       |_ plugins
       |_ ...

So, i need to open my CakePHP apps from http://localhost/mycakephp. To make it’s works :

1. Edit /etc/nginx/sites-available/default

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
server {
    listen   80; ## listen for ipv4; this line is default and implied
    #listen   [::]:80 default ipv6only=on; ## listen for ipv6

    root /var/www;
    access_log  /var/log/nginx/access.log;
    error_log  /var/log/nginx/error.log;
   
    index index.php index.html index.htm;

    # Make site accessible from http://localhost/
    server_name localhost;
    # server_name_in_redirect off;
   
    location / {
        autoindex on;
        # This is cool because no php is touched for static content
        try_files $uri $uri/ /index.php;
    }
   
    # rewrite rules for cakephp
    location /mycakephp {
        if (!-e $request_filename) {
            rewrite ^/mycakephp(.+)$ /mycakephp/app/webroot/$1 last;
            break;
        }
    }
   
    location /mycakephp/app/webroot {
        if (!-e $request_filename) {
            rewrite ^/mycakephp/app/webroot/(.+)$ /mycakephp/app/webroot/index.php?url=$1 last;
            break;
        }
    }

    ......

2. Restart NGINX services

3. Open your cakephp Applications.

4. Done :D

,

wordpress

Configuring WordPress on Localhost NGINX sub-folder

21 Oct , 2011  

Using WordPress on localhost with sub-folder in Apache is very easy. But using NGINX, it will little bit differents. Usually, we use custom domain like http://wordpress, register domain into “/etc/hosts” and define into NGINX sites-available.

But, this is not effective way. We like to access our wordpress like Apache. Access WordPress from localhost like http://localhost/wordpress will ease our development. Here are steps to do :

1. Configure /etc/nginx/sites-available/default

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
server {
    listen   80; ## listen for ipv4; this line is default and implied
    #listen   [::]:80 default ipv6only=on; ## listen for ipv6

    root /var/www;
    index index.php index.html index.htm;

    # Make site accessible from http://localhost/
    server_name localhost;
    # server_name_in_redirect off;
       
    location / {
         autoindex on;
         # This is cool because no php is touched for static content
         try_files $uri $uri/ /index.php;
    }

    location ~ .php$ {                                      
       fastcgi_pass unix:/var/run/php5-fpm.sock;
       fastcgi_index index.php;
       fastcgi_param  SCRIPT_FILENAME $document_root$fastcgi_script_name;
       include fastcgi_params;
    }
}

More…

,

wordpress

Upgrade WordPress using command-line in 10 seconds

21 Oct , 2011  

WordPress always release their engine most in every 2 month or less. Using command-line will make upgrading wordpress done in 10 seconds.

I assume you have latest version of wordpress in folder called “wordpress”. And i have “wordpress-old” as my old wordpress. Make latest and old on same level folder and do this :

1. Deleting Old WordPress files

1
2
rm -rf wordpress-old/wp-includes
rm -rf wordpress-old/wp-admin/

2. Copy New WordPress into Old files

1
2
3
cp -dR wordpress/wp-includes wordpress-old/
cp -dR wordpress/wp-admin wordpress-old/
cp -dR wordpress/wp-content wordpress-old/

3. Check wp-config and compare if there new feature to be added.

4. Login into admin and do “Update Database”

Done! :D

,