ติดตั้ง Oracle java 6 jdk 64-bit บน Ubuntu 12.04

ดาวน์โหลด Java SE 6u45 (JDK) ที่

www.oracle.com/

ติดตั้ง

$ chmod u+x jdk-6u45-linux-x64.bin (ทำให้สามารถ execute ไฟล์นี้ได้)
$ ./jdk-6u45-linux-x64.bin (จะได้ไดเร็กทอรี่ jdk1.6.0_45)
$ sudo mv jdk1.6.0_45 /opt (ย้ายไปไว้ที่ /opt)

สร้าง symbolic  links ด้วยคำสั่ง update-alternatives

นิยาม update-alternatives – maintain  symbolic  links  determining  default commands
วิธีการใช้งาน update-alternatives –install <link> <name> <path> <priority>

$ sudo update-alternatives –install “/usr/bin/java” “java” “/opt/jdk1.6.0_45/bin/java” 1
$ sudo update-alternatives –install “/usr/bin/javac” “javac” “/opt/jdk1.6.0_45/bin/javac” 1
$ sudo update-alternatives –install “/usr/lib/mozilla/plugins/libjavaplugin.so” “mozilla-javaplugin.so” “/opt/jdk1.6.0_45/jre/lib/amd64/libnpjp2.so” 1
$ sudo update-alternatives –install “/usr/bin/javaws” “javaws” “/opt/jdk1.6.0_45/bin/javaws” 1

กำหนด Java ตัวที่ติดตั้งให้เป็น Default

ถ้าติดตั้ง Java ไว้หลายตัวในเครื่อง ให้ทำการกำหนดให้ Java ตัวที่พึ่งติดตั้งไปเป็น default (แต่ถ้าติดตั้ง Java แค่ตัวเดียวก็ไม่ต้องทำคำสั่งด้านล่างนี้)
$ sudo update-alternatives –config java
$ sudo update-alternatives –config javac
$ sudo update-alternatives –config mozilla-javaplugin.so
$ sudo update-alternatives –config javaws

ที่มา : help.ubuntu.com/

How to create a bootable USB stick on Ubuntu

To create a USB stick from which you can install Ubuntu, you must first download Ubuntu. Then, follow these instructions:

  1. Insert a USB stick with at least 2GB of free space.
  2. Open the dash and search for Startup Disk Creator.
  3. Select the Startup Disk Creator to launch the app.

  4. Click ‘Other’ to choose the downloaded ISO file.

  5. Select the file and click ‘Open’.

  6. Select the USB stick in the bottom box and click ‘Make Startup Disk’.

  7. That’s it! When the process completes, you’ll be ready to restart your computer and begin installing Ubuntu.

ค้นหาคำที่ต้องการในไฟล์

เคยสงสัยไหมว่าถ้าเรามี text file เยอะๆในเครื่องแล้วเราเกิดอยากหาคำหนึ่งคำว่ามันอยู่ใน text file ไหนบ้างเราจะทำยังไง เช่น สมมติผมอยากหาคำว่า iframe ในไฟล์เว็บของผม โดยอยากรู้ว่าในไฟล์ในไหนบ้างที่มีคำว่าiframe อยู่ ไม่ต้องไม่หาโปรแกรมตัวไหนมาติดตั้งเพิ่มครับ Command line ช่วยคุณได้
โดยผมจะใช้คำสั่ง grep ช่วยเหลือโดย systax จะเป็นดังนี้

grep “text string to search” directory-path

ตัวอย่างครับ
หาในไฟล์ที่ต้องการ
grep "iframe" /var/www/html/*.php
ค้นหา subdirectory ย่อยทั้งหมดให้เพิ่ม “-r”

http://snappytux.com/linux/command-%E0%B8%84%E0%B9%89%E0%B8%99%E0%B8%AB%E0%B8%B2%E0%B8%84%E0%B8%B3%E0%B8%97%E0%B8%B5%E0%B9%88%E0%B8%95%E0%B9%89%E0%B8%AD%E0%B8%87%E0%B8%81%E0%B8%B2%E0%B8%A3%E0%B9%83%E0%B8%99%E0%B9%84%E0%B8%9F%E0%B8%A5%E0%B9%8C

 

Installing ImageMagick in Ubuntu 11.04

I am working in a project , which includes some image maniputaion functions.After a quick googling i found ImageMagick is best to satisfy my needs.
I installed ImageMagic using sudo apt-get install imagemagick.
After installation i tested some of the commands provided by imagemagick ( convert , identify). But it is not working and causing an error “No Delegates for this image”.
Then i realised that there may be some dependencies for ImageMagick and  i searched for delegates, http://www.imagemagick.org/download/delegates/
I have tried the wiki page http://wiki.helioviewer.org/wiki/Setting_Up_ImageMagick for setting up ImageMagick but failed again
So decided to install it from source.
You’ll need to install a number of dependencies in addition to ImageMagick in order to have a fully functional ImageMagick installation. It’s important that these dependencies are installed before you start configuring and compiling ImageMagick, because the configure script for ImageMagick will disable functionality that isn’t available because of missing dependencies at compile time.
The list of dependecies which found usefull for my use case are
sudo apt-get install libjpeg8-dev libpng12-dev libglib2.0-dev libfontconfig1-dev zlib1g-dev libtiff4-dev
After installing the above dependencies i just started to compile ImageMagick from source.
You can download the ImageMagick source from any mirrors http://www.imagemagick.org/script/download.php
ImageMagick-6.7.5-6 is the latest version.
After downloding the source then tar it.
tar xvfz ImageMagick-6.7.5-6
cd ImageMagick-6.7.5-6
./configure
If you need to do some advanced configuration then follow this link http://www.imagemagick.org/script/advanced-unix-installation.php
sudo make
sudo make install
Installation completed ,Hooray..:) I checked ImageMagick commands and found the same delegate problem again.:(
Compiling should restart from step ./configure and i added a –disable-shared option
./configure –disable-shared
Installtion completed again..No emotion.
I checked whether all the delegates and dependencies configured with ImageMagick properly
You can check it using convert -list configure
again.Delegates are configured properly.
DELEGATES fontconfig freetype jpeg jng mpeg png x11 zlib
SO time to run some ImageMagick commands.
Started with identify command.
identify a.jpg
its working..WOWWW..
a.jpg JPEG 321×400 321×400+0+0 8-bit DirectClass 28.9KB 0.000u 0:00.000
then i tried convert one image to another format
convert a.jpg a.gif
WOOOWWW again, its working..:)
So happy emotions again.:) . ImageMagick set up.
Now i am going to get my hands dirty with ImageMagick. Courtesy : My Guru Jaganadhg , he usually says so , if he started learning new things.

http://srijiths.wordpress.com/2012/02/17/installing-imagemagick-in-ubuntu-11-04/

วิธีติดตั้ง package .deb บน ubuntu

Ubuntu นั้นพัฒนามาจาก debain ฉะนั้น package ส่วนใหญ่ที่อยู่บน ubuntu จึงเป็นแบบ .deb ซึ่งสามารถติดตั้งได้ง่ายมากๆ เพียงแค่ดับเบิ้ลคลิกไปที่ไฟล์ .deb ของเราก็สามารถติดตั้งได้แล้ว
หรือถ้าเราอยากติดตั้ง Debian (.deb) ผ่าน command line บน ubuntu ก็สามารถทำได้ด้วยเช่นกัน
ติดตั้ง Debian (Ubuntu) package (.deb):
$ sudo dpkg -i packagename.deb
ถอนการติดตั้ง Debian (Ubuntu) package (.deb):
$ sudo dpkg -r packagename
แก้ไขไฟล์ Debian (Ubuntu) package (.deb):
$ sudo dpkg-reconfigure packagename
อ้างอิง: http://snappytux.com/ubuntu/%E0%B8%A7%E0%B8%B4%E0%B8%98%E0%B8%B5%E0%B8%95%E0%B8%B4%E0%B8%94%E0%B8%95%E0%B8%B1%E0%B9%89%E0%B8%87-package-deb-%E0%B8%9A%E0%B8%99-ubuntu

VirtualBox on Ubuntu 12.04.1

VirtualBox
https://www.virtualbox.org/

Download VirtualBox

ติดตั้ง VirtualBox

  •  sudo dpkg -i PackageName

Download Extension Pack

ติดตั้ง Extension Pack

  • sudo /usr/lib/virtualbox/VBoxManage extpack install Oracle_VM_VirtualBox_Extension_Pack-4.x.x-xxxxx.vbox-extpack

เพิ่ม library path in ubuntu 12.04

การ set library path ที่ terminal ขณะกำลังใช้งาน คือค่าที่ set จะหายไปเมื่อ reboot
$ export LD_LIBRARY_PATH=”/list/of/library/paths:/another/path”

การ set library path ให้กับ user เฉพาะคน คือค่านี้จะถูกเรียกทำงานเมื่อ boot เครื่องให้ set ค่านี้ไว้ที่ไฟล์ /home/user/.bashrc
$ export LD_LIBRARY_PATH=”/list/of/library/paths:/another/path”

การเพิ่ม library path ให้กับระบบ คือ boot ทุุกครั้งจะสามารถใช้งานได้ ให้ทำดังนี้

To add new library path, create new file in /etc/ld.so.conf.d folder and open it in your favorite editor
$ sudo gedit /etc/ld.so.conf.d/jacklib.conf
Add the path to file and save it
/path/to/new/lib
Run ‘ldconfig’ to update the necessary links and cache
$ sudo ldconfig
ที่มา:
https://www.linux.com/community/blogs/130-distributions/417386-to-add-new-library-path-in-ubuntu-1010
http://www.cyberciti.biz/faq/linux-setting-changing-library-path/

CoovaChilli

NOTE: both coovachilli and chillispot don’t work with 64bit OS. RADIUS authentication is flawed in those setups.

Keyword: Coova Chilli  Ubuntu

Ubuntu Server + Freeradius 2.0.x + coovachilli + Daloradius
http://network-scratch.blogspot.com/2011/09/ubuntu-server-freeradius-20x.html

WifiDocs/CoovaChilli
https://help.ubuntu.com/community/WifiDocs/CoovaChilli

How to Setup CoovaChilli 1.2.4, FreeRadius, MySQL on Ubuntu 10.04
http://manajung.blogspot.com/2010/09/ubuntu-wi-fi-hotspot-using-coovachilli.html