Tuesday, July 26, 2011

Display GUI from other source on localhost

จาก user อื่นที่เรา su ไป


เจอ error ประมาณนี้

.... : Gtk-WARNING **: cannot open display: ...

ให้ run คำสั่ง "xhost +"

เพื่อ "access control disabled, clients can connect from any host"

จะ enable อีกครั้งก็ "xhost -"

access control enabled, only authorized clients can connect

จาก remote host ที่ connect ด้วย ssh


ssh -p 2222 -X username@remote-host

X = Enables X11 forwarding.
p = port

Friday, July 22, 2011

file sharing on debian

# Using NFS

# Server side
sudo apt-get install nfs-kernel-server

sudo vi /etc/exports
/path/to/public *(rw,sync,anonuid=1000,anongid=1000,no_subtree_check)

sudo service portmap restart

sudo /etc/init.d/nfs-kernel-server restart

if there is a firewall between the hosts, or to fix ports of communication

# Client side
sudo aptitude install nfs-common

sudo mount -v -t nfs {Server-IP or Server Name}:/path/to/public /mount/directory


# Using Samba



If you have an SSHD running, you can sftp to that.
Protocal : SFTP
Port : {Same port as ssh}

Thursday, July 21, 2011

Dual-booting Windows and Linux

= Wait until user choose the os

# Make Windows to be the first choice
sudo mv 30_os-prober 07_os-prober

# Apply change
sudo update-grub

# mount ntfs partion

# list your devices by UUID
sudo blkid

# fstab
UUID="....." /mount/path ntfs-3g defaults,locale=en_US.utf8 0 0

No Sound from 82801I (Vostro-V13) on debian

sudo aplay /usr/share/sounds/alsa/Noise.wav

Device Info
lspci | grep Audio
00:1b.0 Audio device: Intel Corporation 82801I (ICH9 Family) HD Audio Controller (rev 03)

Module Version
uname -r

apt-cache policy alsa-base
Installed: 1.0.23+dfsg-4

aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: Intel [HDA Intel], device 0: ALC269 Analog [ALC269 Analog]
Subdevices: 1/1
Subdevice #0: subdevice #0

vi /etc/modprobe.d/alsa-base.conf
options snd-hda-intel model=laptop-amic


Wednesday, July 20, 2011

Burning Tools


กราฟ PIE + PIF , ค่า POF , กราฟ Jitter



ตัวอย่างผลกราฟ Advanced Disc Quality ที่ครบถ้วน

ปล. สแกนได้ ไม่ได้หมายความว่า มันให้ผลออกมาถูกต้อง

'dvd identifier' offers a reliable method of accurately identifying a disc's real manufacturer.

EEPROM Utility : save and restore of the eeprom, plus resetting of the learnt media calibration data...

XFlash Utility : Extracts raw firmwares (.BIN format) from LiteOn's Windows firmware flashers

IDE Location Changer for Slimtype Drives : Changes the master/slave setting for jumperless LiteOn laptop drives


Saturday, July 16, 2011

General Notes about WRT54GL with DD-WRT

Recommended Build?
Beta 13064 dated Oct 2009 - poor wireless performance
So go to 14929
Download at ftp://dd-wrt.com/others/eko/BrainSlayer-V24-preSP2/2010/08-12-10-r14929/broadcom/
Ref: http://www.dd-wrt.com/phpBB2/viewtopic.php?t=52043

Upgrading to a Newer Version of DD-WRT
If DD-WRT is already installed on your router,
you can simply upgrade to a new version via the web interface or TFTP.
However, it is highly recommended that you restore the router to defaults using the reset button before and after flash.
Ref: http://www.dd-wrt.com/wiki/index.php/Installation

Ref: http://www.dd-wrt.com/phpBB2/viewtopic.php?t=51486

Your default username/password is always root/admin.

If you can't get into your webgui, try telnet or ssh, where the username is always root.

You have to hit "apply" for your changes to be made permanent.
"Save" just stores them temporarily in memory without actually writing them.

Assign WAN Port to Switch : Optionally enable this to use the WAN port as another LAN port

Static DHCP address assignments = (จ่าย ip เดิมให้กับ client)

Additional DDNS support (รองรับ dyndns ทำให้เข้าถึง router ได้ถึงแม้ว่า ip address จะเปลี่ยน)

Client isolation mode (กันไม่ให้ลูกข่ายที่ใช้งาน wireless ต่อถึงกันได้ จะติดต่อได้กับ access point เท่านั้น)

Do not raise your TX value
should fix signal issues with better antennas not power.
Many routers do much better with LOWER TX values,
around 40-50 especially those with the crappy internal antennas (linksys ashtrays).

ยิ่งปรับ tx power เยอะ, speed รับส่ง ยิ่งต่ำ

Ref: http://www.overclockzone.com/forums/showthread.php/548956-WRT54GL-V-1.1-ของใหม่ยังไม่แกะชีลล์-2-050-ครับ

Advanced Wireless Settings Reference Guide

When asked for the username, enter root (even if you changed username in web interface)
When asked for the password, enter your router's password (default "admin")
Ref: http://www.dd-wrt.com/wiki/index.php/SSH

รายละเอียดของ embeded linux เช่น nvram, Common Firmware Environment (cfe)

Forward Port
คืออะไร และ ตัวอย่างการใช้งาน http://www.electoday.com/home/space.php?uid=59&do=blog&id=146

IP Addr and Internet Name - Part 1 Commands

cat /etc/resolv.conf

BIND is an acronym for the Berkeley Internet Name Domain project,
which is a group that maintains the DNS-related software suite that runs under Linux.
The most well known program in BIND is named, the daemon that responds to DNS queries from remote machines.

ref: http://www.linuxhomenetworking.com/wiki/index.php/Quick_HOWTO_:_Ch18_:_Configuring_DNS

The Host Command
The host command accepts arguments that are either the fully qualified domain name
or the IP address of the server when providing results. To perform a forward lookup,
use the syntax:

[root@bigboy tmp]# host www.linuxhomenetworking.com
www.linuxhomenetworking.com has address

The nslookup Command
The nslookup command provides the same results on Windows PCs. To perform forward lookup, use.

sudo apt-get install dnsutils

s@penguin:~$ nslookup portal.trueinternet.co.th

Non-authoritative answer:
Name: portal.trueinternet.co.th

authoritative = ซึ่งเชื่อถือได้

dig {domain.to.lookup}

>> look in /etc/resolv.conf file and querying the DNS servers listed there.

s@penguin:~$ dig portal.trueinternet.co.th +nocmd +nostats +noquestion

; <<>> DiG 9.7.3 <<>> portal.trueinternet.co.th +nocmd +nostats +noquestion
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 47978 ;; flags: qr rd; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0 ;; WARNING: recursion requested but not available ;; ANSWER SECTION: portal.trueinternet.co.th. 531 IN A s@penguin:~$ dig portal.trueinternet.co.th ; <<>> DiG 9.7.3 <<>> portal.trueinternet.co.th
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 27376
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;portal.trueinternet.co.th. IN A

portal.trueinternet.co.th. 243 IN A

;; Query time: 4 msec
;; WHEN: Thu May 26 09:25:52 2011
;; MSG SIZE rcvd: 59

Lines beginning with ; are comments that are not part of the information received from the DNS server

the RA flag shows that recursive queries are available.

The IN means this is an Internet lookup (in the Internet class).

The A record stores the host IP address.
The CNAME is an alias record, which is used to give multiple aliases to a single computer.
The MX record is the mail exchange record, which tells mail servers how to route email for this domain.

* to query other DNS servers
dig @ns.hosteurope.com www.hungrypenguin.net

Ref: http://www.linux.com/learn/tutorials/442431-check-your-dns-records-with-dig

List open ports and listening services
$ netstat -an
# -n : to get port numbers instead of having the utility try to provide names for services
$ netstat -lnptu

$ sudo apt-get install nmap
$ nmap localhost

$ sudo apt-get install sockstat
$ sockstat

$ grep -w 631 /etc/services

Fix IP
sudo vi /etc/network/interfaces
  allow-hotplug eth0
  iface eth0 inet dhcp
  auto eth0
  iface eth0 inet static

sudo ifconfig eth1 netmask
sudo route add default gw eth1

more info: http://www.cyberciti.biz/faq/setting-up-an-network-interfaces-file/

How do I find out my DHCP server address?

ถ้าเชื่อมต่อด้วย dhclient

ls -t -l /var/lib/dhcp/
# List ไฟล์ โดยเรียง modification time ด้วยคำสั่ง

แล้วก็ vi ดูไฟล์ที่ถูกแก้ไขล่าสุด

ตัวอย่าง output

lease {
interface "eth0";
option subnet-mask;
option routers;
option dhcp-lease-time 86400;
option dhcp-message-type 5;
option domain-name-servers;
option dhcp-server-identifier;
option vendor-class-identifier 0:0;
option vendor-encapsulated-options 1:4:43:54:43:30;
option domain-name "domain.name";
option vendor.unknown-3561 4:6:30:30:45:30:34:43:5:8:30:30:30:30:30:30:30:31:6:3:49:47:44;
renew 4 2011/05/26 11:52:46;
rebind 4 2011/05/26 22:46:45;
expire 5 2011/05/27 01:46:45;

Tuesday, July 12, 2011

install debian squeeze with xfce4

Some of firmware are free and open-source, and some of them are non-free.
For example, firmware-realtek is in the non-free archive area, so download them beforehand.
1) download the firmware tarball for your installation, extract, and have them available on removable storage.
When the installer starts, it will automatically find the firmware tarball on the removable storage and, if needed, install the firmware for your hardware.
2) the versions of the "netinst" CD images that also include all the non-free firmware packages directly
More at Firmware during the installation

the sources.list file if you don't want to type the whole file yourself after fresh installation.

Plan you partitions

make a bootable usb
as of http://www.debian.org/releases/stable/amd64/ch04s03.html.en
cat debian- > /dev/sdb

Install base system
follow instruction on

uncheck "Graphical desktop environment"
because default GUI is GNOME
(I also unchecked the "Standard system utilities")

after restart and login as root

connect network
ifconfig -a
ifconfig eth0 up
dhclient eth0

# ethtool -s eth0 speed 100 duplex full autoneg off
# ifrename: Rename network interfaces based on various static criteria
# echo 'eth0 mac e0:*' > /etc/iftab
# http://www.science.uva.nl/research/air/wiki/LogicalInterfaceNames
sudo apt-get install ethtool ifrename

sudo apt-get install wpasupplicant

select the best mirror
apt-get install netselect
netselect -vv ftp.th.debian.org mirror1.ku.ac.th mirror.kku.ac.th debian.rmutsv.ac.th ftp.linux.in.th
แล้วดูที่ บรรทัดสุดท้าย ว่า mirror ไหนเร็วสุด
the best will be shown at the last line
more info http://www.debianclub.org/mirrors

modify sources.list
vi /etc/apt/sources.list

# deb http://security.debian.org/ squeeze/updates main
# deb-src http://security.debian.org/ squeeze/updates main
deb http://ftp.linux.in.th/debian-security squeeze/updates main
deb-src http://ftp.linux.in.th/debian-security squeeze/updates main

deb http://ftp.linux.in.th/debian/ squeeze main contrib non-free
deb-src http://ftp.linux.in.th/debian/ squeeze main contrib non-free

# Some packages from proposed-updates may also be made available via the squeeze-updates mechanism.
# This path will be used for updates which many users may wish to install on their systems before the next point release is made.
deb http://ftp.linux.in.th/debian/ squeeze-updates main contrib non-free
deb-src http://ftp.linux.in.th/debian/ squeeze-updates main contrib non-free

# Backports archive contains packages from testing and unstable that have been recompiled for stable.
deb http://backports.debian.org/debian-backports squeeze-backports main contrib non-free
deb-src http://backports.debian.org/debian-backports squeeze-backports main contrib non-free

# deb http://ftp.linux.in.th/debian/ testing main contrib non-free
# deb-src http://ftp.linux.in.th/debian/ testing main contrib non-free

increase cache size for repos
echo "APT::Cache-Limit "888388608";" >> /etc/apt/apt.conf

non-free firmware
# Any firmware loaded during the installation will be copied automatically to the installed system.
# In most cases this will ensure that the device that requires the firmware will also work correctly after the system is rebooted into the installed system.
# However, if the installed system runs a different kernel version from the installer there is a slight chance that the firmware cannot be loaded due to version skew.
# If the firmware was loaded from loose firmware files, the firmware copied to the installed system will not be automatically updated
# unless the corresponding firmware package (if available) is installed after the installation is completed.
# Ref: http://d-i.alioth.debian.org/manual/en.i386/ch06s04.html
aptitude install firmware-linux-nonfree
aptitude install firmware-realtek

apt-get update

apt-get install sudo
usermod -a -G sudo {username}

apt-get install alsa-base alsa-utils cpufrequtils

# to enable hibernate
apt-get install pm-utils

vi /etc/default/grub
GRUB_CMDLINE_LINUX_DEFAULT="quiet resume=/dev/sda6"

apt-get install --no-install-recommends xorg xfce4

apt-get install xfce4-xkb-plugin xfce4-mixer xfce4-notifyd xfce4-clipman-plugin xfce4-datetime-plugin xfce4-power-manager
# xfce4-clipman-plugin keeps the clipboard contents around while it is usually lost when you close an application.
# xfce4-power-manager for enabling Hibernate and Suspend

# xfce4-wavelan-plugi xfce4-battery-plugin xfce4-indicator-plugin

# arandr is used for handling multi monitors
aptitude install arandr

# in order to avoid problem of http://forums.debian.net/viewtopic.php?f=6&t=63554
apt-get install --no-install-recommends lightdm

sudo apt-get install --no-install-recommends nautilus

apt-get install ttf-mscorefonts-installer ttf-thai-tlwg
apt-get install --no-install-recommends xfce4-artwork gnome-icon-theme
apt-get install --no-install-recommends thunar-archive-plugin

apt-get install xfce4-terminal xfce4-screenshooter leafpad

apt-get -t squeeze-backports install --no-install-recommends libreoffice libreoffice-presenter-console

# http://sourceforge.net/projects/ooop/files/Extension/
# extension that provides impress templates
# OOOP-templates-unified-en-US- is valid for libreoffice 3.3.3

# http://libreplanet.org/wiki/Group:OpenOfficeExtensions/List
# http://libreplanet.org/wiki/Group:OpenOfficeExtensions/NonFree

# Diagram editor = Visio
# http://gnomediaicons.sourceforge.net/ beauty icons to Dia program
apt-get install dia


# gnome-system-monitor : display cpu usage graphs
apt-get install gnome-system-monitor

apt-get install xscreensaver xscreensaver-gl

apt-get install bzip2 zip unzip unrar-free unrar p7zip-rar file-roller
# thunar-archive-plugin : allows you to create and extract archive files using the file context menus
# apt-get install squeeze << archive manager for Xfce

# dnsutils : nslookup
# nmap : port scanning, ping scanning, and more
apt-get install telnet dnsutils nmap

# wired and wireless network manager
apt-get install wicd wicd-gtk
or network-manager-gnome

sudo iwconfig
and add the wireless interface name e.g. wlan0 or eth1 as shown in

apt-get install synaptic

# utilities
apt-get install gparted

# epiphany-browser using the WebKitGTK+ rendering engine
# (which is based on the engine used by Apple Safari and Google Chrome)
# http://thep.blogspot.com/2006/11/epiphany-guide-for-firefox-users-1.html
# http://thep.blogspot.com/2006/11/epiphany-guide-for-firefox-users-3.html
apt-get install epiphany-browser
apt-get install chromium-browser chromium-l10n

# Firefox (iceweasel)
# rendering engine = Gecko
sudo echo 'deb http://mozilla.debian.net/ squeeze-backports iceweasel-release' > /etc/apt/sources.list.d/mozilla.list
wget -O- -q http://mozilla.debian.net/archive.asc | gpg --import
gpg --export -a 06C4AE2A | sudo apt-key add -
sudo apt-get update
sudo apt-get install -t squeeze-backports iceweasel flashplugin-nonfree

update-alternatives --list x-www-browser
sudo update-alternatives --set x-www-browser /usr/bin/iceweasel

# Fix: Firefox cannot load websites but other programs can
http://support.mozilla.com/en-US/kb/Firefox cannot load websites but other programs can

# IE's Render Engine = Trident
# Opera's Render Engine = Presto

# Related Info http://en.wikipedia.org/wiki/JavaScript_engine

# Thunderbird
sudo echo 'deb http://mozilla.debian.net/ squeeze-backports icedove-release' >> /etc/apt/sources.list.d/mozilla.list
sudo apt-get update
sudo apt-get install -t squeeze-backports icedove

sudo apt-get install filezilla

# thunar-thumbnailers : generates thumbnails for PDF, DVI, PSD, Video files etc.
apt-get install thunar-thumbnailers ffmpegthumbnailer

# gthumb : an ACDSee like image and video browser
# Fotoxx = photo editing and collection management
apt-get install geeqie gthumb fotoxx gimp

# Media player & codecs (Ref: http://wiki.debian.org/MultimediaCodecs)
# totem with gstreamer0.10-ffmpeg will be able to decode samr 3gp
wget http://debian-multimedia.org/gpgkey.pub -O - | sudo apt-key add -
echo 'deb http://www.debian-multimedia.org/ squeeze main non-free' > /etc/apt/sources.list.d/debian-multimedia.list
sudo apt-get update
aptitude install w64codecs libdvdcss2 gstreamer0.10-fluendo-mp3 gstreamer0.10-ffmpeg ffmpeg sox twolame vorbis-tools lame faad mplayer-gui vlc mozilla-plugin-vlc totem

# PDF ( acroread is in debian-multimedia repo)
apt-get install evince acroread

# Dropbox
wget -O dropbox.tar.gz http://www.dropbox.com/download\?plat=lnx.x86
wget -O dropbox.tar.gz http://www.dropbox.com/download\?plat=lnx.x86_64
tar -zxvf dropbox.tar.gz
wget -nd http://dl.dropbox.com/u/6995/dbmakefakelib.py
wget -nd http://dl.dropbox.com/u/6995/dbreadconfig.py
python dbmakefakelib.py
thanks http://www.reddeadresolve.com/2010/04/how-to-install-dropbox-in-xfce.html

# a VNC Client for the GNOME Desktop
apt-get install vinagre

# Virtual Box
wget -q http://download.virtualbox.org/virtualbox/debian/oracle_vbox.asc -O- | sudo apt-key add -
echo 'deb http://download.virtualbox.org/virtualbox/debian squeeze contrib non-free' > /etc/apt/sources.list.d/virtualbox.list
sudo apt-get update && sudo apt-get install virtualbox-4.1
usermod -a -G vboxusers {username} <<<<< To Fix USB Error

sudo apt-get install openssh-client openssh-server

Network File System, Samba

lightdm Auto Login

SLiM Auto Login

# Purge unwanted program
# avahi : With it, you can plug into a network and instantly find printers to print to, files to look at and people to talk to.
# cups : Common UNIX Printing System
# sane-utils : API library for scanners
sudo apt-get purge avahi-daemon cups cups-common sane-utils
sudo apt-get autoremove

to enable compiz fusion on xfce

Unable to mount an external drive
verify /etc/fstab to make sure that there is no a strange line like
/dev/sdb /media/cdrom0 udf,iso9660 user,noauto 0 0

Useful cmd for keyboard binding
Print Screen = xfce4-screenshooter -f


Saturday, July 2, 2011

Save our valuable time with ThunderBird & RSS

จากเดิม ตอนเช้าก็เข้าไปตามอ่านข่าวจาก web ต่างๆ
1) เวลาไปอ่านทีก็มาไล่ chk ว่าอันไหนอ่านแล้ว อันไหนยังไม่อ่าน
2) บางเว็บเราติดตาม แต่เขาไม่ค่อย update
เข้าไปตามอ่านตอนสุดสัปดาห์ หลายสัปดาห์แต่ก็ไม่เห็นมี update
(ช่วงที่เขา update เราก็ไม่ได้เข้าไป ทำให้พลาดโอกาส)
3) หลงลืม เข้าไม่ครบ พลาดข้อมูลสำคัญ พลาดโอกาสทางธุรกิจ

เลยมาใช้ ThunderBird ซึ่งเป็นทั้ง email client ในการ chk mail
และ RSS Reader

1) เช้ามาใช้โปรแกรมเดียวในการอ่านเมล + อ่านข่าว
(ซึ่งมันก็จะเหมือน mail คือ ดูดมาก่อน ไว้มีเวลาก็มาอ่านย้อนหลัง)
2) set สถานะได้ว่า todo, important เป็นต้น
3) จัดกลุ่มได้ เช่น จาก บันเทิงจาก sanook.com , fail.in.th อยู่ในกลุ่มบันเทิง เหมือนกัน
4) ไม่พลาดโอกาสทอง อีกต่อไป
ไม่ว่า web นั้น update ทุกวัน หรือนานๆ update ก็ไม่มีลอดพ้นสายตาเรา
(แต่ต้องเปิดให้มัน ดูดบ่อยๆนะ)
5) ประหยัดเวลาขึ้นเยอะ

ชีวิตน่าจะสะดวกขึ้น ^___^


มองหาสัญลักษณ์นี้ หรือ ที่มันเขียนว่า RSS ดังรูป

click ที่มัน จะปรากฏหน้าต่าง ประมาณนี้

copy url ไป subscribe ใน thunderbird



Have a nice day,