Saturday, April 30, 2011

HOWTO : Ubuntu 11.04 on Gigabyte TouchNote T1028X/M1028

Gigabyte TouchNote T1028X/M1028 equipped with Intel Atom N280 and eGalax touch screen. It runs Ubuntu 11.04 flawlessly except touchpad. This tutorial is telling you how to overcome this problem.

"lsusb" shows the following :

Bus 005 Device 002: ID 0eef:0001 D-WAV Scientific Co., Ltd eGalax TouchScreen

Step 1 :

Boot up the system and press "Ctrl+Alt+t" to open a terminal.

sudo nano /etc/default/grub

Append "i8042.noloop=1" to "GRUB_CMDLINE_LINUX_DEFAULT".

It will look like this :

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash i8042.noloop=1"

Save and exit.

sudo update-grub

Step 2 :

sudo nano /etc/modprobe.d/blacklist.conf

Append the following to the file.

blacklist usbtouchscreen

Step 3 :

Reboot your system.

That's all! See you.

Wednesday, April 27, 2011

HOWTO : Wipe hard drive safety and completely

Darik's Boot and Nuke (DBAN) is a self-contained boot disk that securely wipes the hard disks of most computers. DBAN will automatically and completely delete the contents of any hard disk that it can detect, which makes it an appropriate utility for bulk or emergency data destruction.

There are some wipe methods, they are Quick Erase, RCMP TSSIT OPS-II, DoD Short, DoD 520.22-M, Gutmann Wipe and PRNG Stream. Where DoD is The American Department of Defense. The default is The American Department of Defense 5220.22-M short wipe (DoD Short).

It is a very easy to use utility. A 300GB hard drive will take about 2 or 3 hours to wipe with the DoD Short method. The hard drive after the wipe is like a brand new one.

You can download it at here. Then, burn it in a CD-ROM or create a bootable USB stick with UNetBootin.

That's all! See you.

Sunday, April 24, 2011

HOWTO : nVidia CUDA 4.0 RC on Ubuntu 10.10 Server

If you have nVidia display card that have several CUDAs on it, you will interested in this tutorial. This time, I would like to show you how to install CUDA 4.0 RC on Ubuntu 10.10 Server.

You will experience a faster server after the installation of CUDA 4.0.

This HOWTO does not require to install X.

Step 1 :

Add the CUDA 4.0 PPA.
sudo add-apt-repository ppa:aaron-haviland/cuda-4.0

Step 2 :

sudo apt-get update
sudo apt-get upgrade


64-bit :
sudo apt-get install nvidia-cuda-gdb nvidia-cuda-toolkit nvidia-compute-profiler libnpp4 nvidia-cuda-doc nvidia-current-modaliases libcudart4 libcublas4 libcufft4 libcusparse4 libcurand4 nvidia-current nvidia-opencl-dev nvidia-current-dev nvidia-cuda-dev nvidia-kernel-common opencl-headers

32-bit :
sudo apt-get install nvidia-cuda-gdb nvidia-cuda-toolkit nvidia-compute-profiler lib32npp4 nvidia-cuda-doc nvidia-current-modaliases lib32cudart4 lib32cublas4 lib32cufft4 lib32cusparse4 lib32curand4 nvidia-current nvidia-opencl-dev nvidia-current-dev nvidia-cuda-dev nvidia-kernel-common opencl-headers

Step 3 :

sudo nano /etc/init.d/nvidia_cuda

Append the following lines.

============= Copy from here ================
#!/bin/bash

PATH=/sbin:/bin:/usr/bin:$PATH

/sbin/modprobe nvidia

if [ "$?" -eq 0 ]; then

   # Count the number of NVIDIA controllers found.
   N3D=`/usr/bin/lspci | grep -i NVIDIA | grep "3D controller" | wc -l`
   NVGA=`/usr/bin/lspci | grep -i NVIDIA | grep "VGA compatible controller" | wc -l`

   N=`expr $N3D + $NVGA - 1`
   for i in `seq 0 $N`; do
      /bin/mknod -m 666 /dev/nvidia$i c 195 $i;
   done

   /bin/mknod -m 666 /dev/nvidiactl c 195 255

else
   exit 1
fi


=========== Copy to here =================

Step 4 :

sudo chmod +x /etc/init.d/nvidia_cuda
sudo update-rc.d nvidia_cuda defaults

Step 5 :

Reboot your system.

Remarks

I do not have nVidia display cards server in hand at the moment, I am not sure the captioned startup script working properly or not.

That's all! See you.

Saturday, April 23, 2011

HOWTO : nVidia CUDA 4.0 RC on Ubuntu 10.10 Desktop

If you have nVidia display card that have several CUDAs on it, you will interested in this tutorial. This time, I would like to show you how to install CUDA 4.0 RC on Ubuntu 10.10 Desktop.

You will experience a faster desktop after the installation of CUDA 4.0. Meanwhile, if you installed SMPlayer, you can playback 1080p videos with the help of vdpau.

Step 1 :

Add the CUDA 4.0 PPA.
sudo add-apt-repository ppa:aaron-haviland/cuda-4.0

Step 2 :

sudo apt-get update
sudo apt-get upgrade


64-bit :
sudo apt-get install nvidia-cuda-gdb nvidia-cuda-toolkit nvidia-compute-profiler libnpp4 nvidia-cuda-doc nvidia-current-modaliases libcudart4 libcublas4 libcufft4 libcusparse4 libcurand4 nvidia-current nvidia-opencl-dev nvidia-current-dev nvidia-cuda-dev nvidia-kernel-common opencl-headers

32-bit :
sudo apt-get install nvidia-cuda-gdb nvidia-cuda-toolkit nvidia-compute-profiler lib32npp4 nvidia-cuda-doc nvidia-current-modaliases lib32cudart4 lib32cublas4 lib32cufft4 lib32cusparse4 lib32curand4 nvidia-current nvidia-opencl-dev nvidia-current-dev nvidia-cuda-dev nvidia-kernel-common opencl-headers

Step 2a :

If you do not have any nVidia driver installed before, you need to do the following command. Otherwise, this step is not required at all.

sudo nvidia-xconfig

Step 3 :

Reboot your system.

Step 4 (Optional) :

To install SMPlayer.

sudo apt-get install smplayer smplayer-translations smplayer-themes

Then set it to use "vdpau" at "Output Driver" at "Preference".

Step 5 - Compiling of nVidia CUDA sample codes (Optional)

Some sample codes at gpucomputingsdk_4.0.13_linux.run cannot be compiled successfully. However, I would like to share how I compile some of them.

(a) Install the gupcomputingsdk with the following command and accepted the default setting that it provides.

sudo apt-get install freeglut3-dev libxi-dev libXmu-dev

Go to the following link :
http://developer.nvidia.com/cuda-toolkit-40#Linux

wget http://developer.download.nvidia.com/compute/cuda/4_0_rc2/sdk/gpucomputingsdk_4.0.13_linux.run

sudo chmod +x gpucomputingsdk_4.0.13_linux.run
sh gpucomputingsdk_4.0.13_linux.run

(b) Set the environment :

sudo nano /etc/environment

Append the following at the end of the entry.

:/usr/lib/nvidia-current:/usr/lib/nvidia-cuda-toolkit

source /etc/environment

(b1) Set LD_LIBRARY_PATH :

sudo nano /etc/ld.so.conf.d/cuda.conf

Append the following lines to the file.

/usr/lib/nvidia-current
/usr/lib/nvidia-cuda-toolkit

sudo ldconfig

(b2) Create a softlink of libcuda.so :

sudo ln -s /usr/lib/nvidia-current/libcuda.so /usr/lib/
sudo ln -s /usr/lib/nvidia-current/libcuda.so.1 /usr/lib/


(c) Make softlink to the /usr/include/thrust :

sudo mkdir /usr/lib/include
sudo ln -s /usr/include/thrust /usr/lib/include/


(c1) Add the path of new location of thrust to the common/common.mk :

sudo nano ~/NVIDIA_GPU_Computing_SDK/C/common/common.mk

Go to line 64 and add "-I/usr/lib/include" :

Change from -
INCLUDES += -I. -I$(CUDA_INSTALL_PATH)/include -I$(COMMONDIR)/inc -I$(SHAREDDIR)/inc

Change to -
INCLUDES += -I. -I$(CUDA_INSTALL_PATH)/include -I/usr/lib/include -I$(COMMONDIR)/inc -I$(SHAREDDIR)/inc

(d) Compiling of the sample code :

cd NVIDIA_GPU_computing_SDK/C
make


The executable sample codes will be situated at ~/NVIDIA_GPU_Computing_SDK/C/bin/linux/release/

Run the sample codes as the following, e.g. nbody and deviceQuery :

./nbody
./deviceQuery

(e) According to the developer of the PPA, this issue (Step 5(b) to Step 5(c1)) (Step 5(c) to Step 5(c1)) may be caused by the SDK itself and nvcc compiler. However, if you install the official SDK, there is no such problem.

***(f) The CUDA 4.0 PPA just updated today (April 26, 2011 GMT+8) and it solved the Step 5(b) to Step 5(b2) problem.

That's all! See you.

Thursday, April 21, 2011

HOWTO : Undelete files and directories on Ubuntu

extundelete is a utility that can recover deleted files from an ext3 or ext4 partition.

Hereby, I am going to show to how to compile and install this utility from source on Ubuntu 10.10. The current version of extundelete is 0.2.0 at this time of writing.

Step 1 :

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install build-essential libtool e2fslibs-dev autoconf automake autotools-dev m4 e2fslibs e2fsprogs


wget http://sourceforge.net/projects/extundelete/files/extundelete/0.2.0/extundelete-0.2.0.tar.bz2/download

tar -xvjf extundelete-0.2.0.tar.bz2
cd extundelete-0.2.0
./autogen.sh
./configure
make
sudo make install


Step 1a : (Alternative)

If you want to generate a debian installable file instead of install from source, you can use this step.

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install build-essential libtool e2fslibs-dev autoconf automake autotools-dev m4 e2fslibs e2fsprogs checkinstall


wget http://sourceforge.net/projects/extundelete/files/extundelete/0.2.0/extundelete-0.2.0.tar.bz2/download

tar -xvjf extundelete-0.2.0.tar.bz2
cd extundelete-0.2.0
./autogen.sh
./configure
make
sudo checkinstall


Follow the instruction on screen to complete the debian executable file generation.

sudo dpkg -i extundelete_0.2.0-1_amd64.deb
or
sudo dpkg -i extundelete_0.2.0-1_i386.deb

Step 2 :

Usage :

Help -
extundelete --help

To undelete test.png file at /dev/sda3 and /home/samiux -
extundelete /dev/sda3 --restore-file /home/samiux/test.png

To undelete test directory at /dev/sda3 and /home/samiux -
extundelete /dev/sda3 --restore-directory /home/samiux/test

To undelete all files and directories at /dev/sda3 -
extundelete /dev/sda3 --restore-all

That's all! See you.

Tuesday, April 19, 2011

HOWTO : Change mode of files and directories in batch

To change the mode to 777 for all directories under /var/www/drupal.

sudo find /var/www/drupal/*/ -type d -exec chmod 777 {} \;

To drop the execution rights of the all files under /var/www.

sudo find /var/www -type f -exec chmod -x {} \;

That's all! See you.

HOWTO : Performance tuning on Ubuntu

This tutorial can be applied to Desktop and Server. Make sure you have at least 512MB RAM on your system beofre doing so.

Step 1 :

sudo nano /etc/sysctl.conf

Append the following lines at the end of the file.

kernel.sem = 250 32000 100 128
kernel.shmall = 2097152
kernel.shmmax = 2147483648
kernel.shmmni = 4096
# If you have more than 512MB RAM, use this setting (uncomment it and comment the setting just below)
fs.file-max = 262140
# If you have 512MB RAM or less, use this setting
#fs.file-max = 65535
vm.swappiness = 1
vm.vfs_cache_pressure = 50
vm.min_free_kbytes = 65536

net.core.rmem_default = 33554432
net.core.rmem_max = 33554432
net.core.wmem_default = 33554432
net.core.wmem_max = 33554432
net.ipv4.tcp_rmem = 10240 87380 33554432
net.ipv4.tcp_wmem = 10240 87380 33554432
net.ipv4.tcp_no_metrics_save = 1
net.ipv4.tcp_window_scaling = 1
#net.ipv4.tcp_timestamps = 1
#net.ipv4.tcp_sack = 1
#net.core.netdev_max_backlog = 5000
#net.ipv4.tcp_mem = 786432 1048576 26777216
net.ipv4.ip_local_port_range = 1024 65535
net.ipv4.tcp_max_tw_buckets = 360000

net.ipv4.tcp_max_orphans = 3276800
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_tw_recycle = 1
net.ipv4.tcp_syn_retries = 2
net.ipv4.tcp_synack_retries = 2
net.core.somaxconn = 32768
net.core.netdev_max_backlog = 32768
net.ipv4.tcp_max_syn_backlog = 65536
net.ipv4.tcp_mem = 94500000 915000000 927000000
net.ipv4.tcp_timestamps = 0
net.ipv4.tcp_fin_timeout = 15
#net.ipv4.tcp_sack = 0
net.ipv4.tcp_orphan_retries = 2
net.ipv4.conf.all.accept_redirects = 0
net.ipv4.conf.default.accept_redirects = 0
net.ipv4.conf.all.secure_redirects = 0
net.ipv4.conf.default.secure_redirects = 0
net.ipv4.conf.all.log_martians = 1
net.ipv4.conf.default.log_martians = 1
net.ipv4.conf.all.accept_source_route = 0
net.ipv4.conf.default.accept_source_route = 0
net.ipv4.conf.all.rp_filter = 1
net.ipv4.conf.default.rp_filter = 1
net.ipv4.tcp_syncookies = 1


Save and perform the following command.

sudo /sbin/sysctl -p

Step 2 :

sudo nano /etc/rc.local

Insert the following lines just before "exit 0". This requires to reboot the system to make it works.

echo 1024 > /sys/block/sda/queue/read_ahead_kb
echo 256 > /sys/block/sda/queue/nr_requests


Step 3 :

To do the following step is in your own risk. It works for ext4 only.

sudo nano /etc/fstab

add "discard,norelatime,noatime" just before "errors=remount-ro" and "defaults".

If there is any problem or error when applying the commands, please do not reboot the system. Correct the problem or typo before reboot. Otherwise, your system cannot be reboot.

sudo mount -a
sudo mount -o remount /


Step 4 :

You can now reboot your system if there is no error at Step 3.

That's all! See you.

Friday, April 01, 2011

HOWTO : Latest Adobe Flash for 64-bit Ubuntu 10.10

When you upgraded your Firefox to version 4 on your 64-bit Ubuntu as per this tutorial, you may find that the flash is operating abnormally. Now, we can fix this by installing the latest Flash from PPA.

As I do not have any 32-bit system, I do not know what happen to 32-bit when Firefox is upgraded to version 4.

Your 32-bit version of Flash will be uninstalled automatically from your 64-bit system.

sudo add-apt-repository ppa:sevenmachines/flash
sudo apt-get update
sudo apt-get install flashplugin64-installer


That's all! See you.