Category: ไม่มีหมวดหมู่
Startup WebSite
Redirect Output “/dev/null”
/dev/null
มันคือการ redirect output ให้ไปอยู่ในที่ๆเราต้องการ
ปกติ เวลาเราเขียนโปรแกรมนะครับ
เวลาเราจะ output อะไรบางอย่างออกมา
มันจะมี 2 channel ที่ใช้กันคือ
stdout กับ stderr (1 กับ 2 ตามลำดับ)
สมมติผมรันคำสั่งนึง แล้วมีทั้ง stdout กับ stderr ออกมานะครับ
somecommand 1>1.txt 2>2.txt
output ของ stdout ทั้งหมดจะถูก redirect ไปยังไฟล์ที่ชื่อ 1.txt
output ของ stderr ทั้งหมดจะถูก redirect ไปยังไฟล์ที่ชื่อ 2.txt
การ redirect ไป /dev/null ก็คือ โยนมันทิ้งไปนั่นแหล่ะ
ฉะนั้น somecommand > /dev/null คือการโยน output ทิ้งไปให้หมด
2>&1 คือ สั่งให้ output จาก stderr ออกไปยัง stdout
> /dev/null คือการสั่ง redirect stdoutput โยนทิ้งไป
ฉะนั้นไม่ว่าจะมี output จาก stderr หรือ stdout ก็จะโดนโยนทิ้งหมด
Install RPM File On Ubuntu Linux
Install RPM File On Ubuntu Linux
– sudo apt-get install alien dpkg-dev debhelper build-essential
– sudo alien packagename.rpm
– sudo dpkg -i packagename.deb
Install WIne 1.5.6 In Ubuntu
Install Wine 1.5.6 In Ubuntu
Add Repository
– sudo add-apt-repository ppa:ubuntu-wine/ppa
Update
– sudo apt-get update
Install Wine
Start Stop firewall centos
# /etc/init.d/iptables save# /etc/init.d/iptables stop
วิธีตรวจสอบ IP Address & DNS Linux
ifconfig ดู IP Address
cat /etc/resolv.conf ดู DNS Server หรือ Name Server
เปลี่ยน Repository Thai Ubuntu For Lucid & Natty
Download File .Deb
Install File
sudo gdebi suriyan-repository_1.0-8_all.deb
Update Cache
sudo apt-get update
How To Install Flash Player 10 On Ubuntu
sudo apt-get install adobe-flashplugin
Install Samba On CentOS
How do I use samba as file server?
Samba is a free software re-implementation of SMB/CIFS networking. Windows XP/2000 use samba as file server. It runs on both Linux and UNIX oses.
First install samba on Linux using yum command:
# yum install samba samba-client samba-common
# chkconfig smb –level 345 on
# chkconfig smb on
# /etc/init.d/smb start
How do I use NFS as file server?
Network File System (NFS), a protocol originally developed by Sun Microsystems in 1984. NFS server use to share files and directories from Linux system to rest of UNIX/Linux and Windows (using MS- UNIX services or third party tools) workstation.
First install NFS on Linux using yum command:# yum install nfslock portmap nfs
เปลี่ยน repo มาใช้ในไทย CentOs 5 ของเกษตร
cd /etc/yum.repo.d
mv CentOS–Base.repo CentOS–Base.repo.bak
wget http://mirror1.ku.ac.th/yum-centos/5/CentOS-Base.repo