ubuntu 12.04 with NVIDIA 8400 graphics card

When I finished setup everything I need on windows, and peek back to ubuntu.

Everything works. Damn it !!!

The story begins that I would like to buy a second monitor for my laptop.

I try to figure out how to make it work on ubuntu with my NVIDIA graphic card with a lot of methods I could find on the Internet.

I try to install nvidia-current, nvidia-current-updates, nvidia-current-dev, nvidia-173, nvidia-319, etc., but nothing works in my case.

Moreover, some package gives my ubuntu a black screen of death.

I also try to download an official package from NVIDIA website, but I could not finish installation. That installation told me that I have to disable the nouveau driver that is in my machine. I try put it into a blacklist, but it does not works, so I set it back.

After give up with ubuntu and try to install every software I needed on windows, and I peek back to ubuntu to get some files. Everything works in a couple of minutes !! I do not know what is the real cause of the problem, so everything I note here is just for myself for using in the future ( I hope ). However, if it works for your system I will be appreciate.

First thing I do today is uninstall all the nvidia package

$ sudo apt-get purge nvidia-*

Modify the xorg file a little bit. Note that here I commented out the resolution of the xorg file (# Virtual 1024 768).

I post my whole xorg file here. For the one who is not familiar with ubuntu, use it with care. It is very dangerous to change xorg file without any knowledge.

Section "Monitor"
 Identifier "Monitor0"
 VendorName "Unknown"
 ModelName "Unknown"
 HorizSync 28.0 - 33.0
 VertRefresh 43.0 - 72.0
 Option "DPMS"

Section "Screen"
 Identifier "Screen0"
 Device "Device0"
 Monitor "Monitor0"
 DefaultDepth 24
 SubSection "Display"
 #Virtual 1024 768
 Depth 24

Section "ServerLayout"
 Identifier "Layout0"
 Screen 0 "Screen0" 0 0
 # commented out by update-manager, HAL is now used and auto-detects devices
 # Keyboard settings are now read from /etc/default/console-setup
 # InputDevice "Keyboard0" "CoreKeyboard"
 # commented out by update-manager, HAL is now used and auto-detects devices
 # Keyboard settings are now read from /etc/default/console-setup
 # InputDevice "Mouse0" "CorePointer"

Section "Device"
 Identifier "Device0"
 Driver "nvidia"
 VendorName "NVIDIA Corporation"
 Option "NoLogo" "True"

Stop the lightdm service

$ sudo service lightdm stop

and Restart the gdm service

$ sudo service gdm restart

At first my login screen and unity side panel are on the output display tv, but when I disabled my tv ( using System Settings > Displays  ), they can recognized my laptop as main screen.

NOTE that I can use resolution 1280×800 on my laptop, and 1920×1080 on my extended screen, using the ubuntu that is stored in the external drive connected with machine using USB-2.0 without any lag. ( At first, I though USB-2.0 is not fast enough, so my laptop is lag when connected to the high-resolution screen, but it is not. )

That’s it. I just note it here perhaps this will be useful for my future.


[ apache2 ] how to install mod_rewrite in ubuntu


/etc/apache2$ sudo a2enmod rewrite

will be in 


2. change ‘AllowOverride None’ to ‘AllowOverride All’

in /etc/apache2/sites-available/default

For example, 

<VirtualHost *:80>
  ServerAdmin webmaster@localhost

  DocumentRoot /var/www
  <Directory />
    Options FollowSymLinks
    AllowOverride None
  <Directory /var/www/>
    Options Indexes FollowSymLinks MultiViews
    AllowOverride All
    Order allow,deny
    allow from all

วิธีเลือก โปรแกรมใช้งานของ ubuntu กรณีมีหลายเวอร์ชั่นในเครื่องเดียวกัน : list all java version

กรณีเรามี software หลายตัว ลงไว้เครื่องเดียวกัน

เช่น ubuntu มี openjdk อยู่ แต่เราต้องการใช้ java ของ sun

ก่อนอื่นให้ลง java ของ sun ก่อน [ ลงจาก apt-get install หรือ โหลด debian file : sun-java6-jdk, sun-java6-bin, and sun-java6-jre มาลงเองก็ได้ ]


$ sudo update-alternatives --config java
There are 4 alternatives which provide `java'.

Selection    Alternative
1    /usr/bin/gij-4.2
2    /usr/lib/jvm/java-6-sun/jre/bin/java
3    /usr/lib/jvm/java-gcj/jre/bin/java
*+        4    /usr/lib/jvm/java-6-openjdk/jre/bin/java

Press enter to keep the default[*], or type selection number: 2

มันจะถามว่าให้รัน อันไหนเป็น default ก็ตอบ jdk ไป

วิธีดู version

 $ update-alternatives --display java


link currently points to /usr/lib/jvm/java-6-sun/jre/bin/java

อ้า จาวา 1.6 นั่นเอง