將所有的,替換成,
:%s/, /,/g
目前分類:不分類Linux (19)
- Dec 10 Mon 2007 19:57
【Linux】vim 代換
- Oct 25 Thu 2007 13:23
【Linux】設定Socket Receive Buffer大小
預設值為105472 (單位: bytes)
# cat /proc/sys/net/core/rmem_max
131071
# cat /proc/sys/net/core/rmem_default
105472
# sysctl -w net.core.rmem_max=262142
# sysctl -w net.core.rmem_default=210944
# cat /proc/sys/net/core/rmem_max
262142
# cat /proc/sys/net/core/rmem_default
210944
- Sep 18 Tue 2007 16:58
【Linux】查詢與修改File Descriptor上限
(1) 查詢File Descriptor上限
# ulimit -a
time(seconds) unlimited
file(blocks) unlimited
data(kbytes) unlimited
stack(kbytes) 8480
coredump(blocks) 0
nofiles(descriptors) 256
vmemory(kbytes) unlimited
表示file descriptor的上限為256
(2) 修改File Descriptor上限 (需有root權限)
# ulimit -n [number]
- May 24 Thu 2007 15:09
【Linux】修改IPv6 Neighbor MAC Table
#sudo ip neigh add [IPv6 Address] lladdr [MAC Address] dev [Interface]
- May 08 Tue 2007 21:39
【Linux】iptables常用指令
# iptables -L
列出所有的rules
# iptables -F
清除所有的rules
- Apr 29 Sun 2007 21:27
putty中文
putty設定
Window > Appearance > Font settings > Change
選中文字型(ex.細明體或標楷體),字集選擇CHINESE_BIG5
登入後設定環境變數
#setenv LANG zh_TW.Big5
or
#LANG=zh_TW.Big5
- Apr 16 Mon 2007 16:53
【Linux】搜尋有某字串的檔案
grep -R 'String' .
- Mar 15 Thu 2007 12:44
【Linux】尋找檔案
find . -name "file-name"
- Feb 07 Wed 2007 16:17
【Linux】登入自動執行指令
看目前使用的shell
# env | grep SH
更換使用的shell
修改/etc/passwd的最後一欄
# vim /etc/passwd
XXXXXXXXXXXX:/bin/tcsh
設定登入自動執行某些指令
如果使用的是tcsh的話
# vim .tcshrc
如果使用的是bash的話
# vim .bashrc
- Jan 18 Thu 2007 18:18
【Linux】看網卡是否有開啟Rx/Tx Checksum Offload的功能
#ethtool -k ethX
#ethtool -K ethX rx on
- Dec 29 Fri 2006 11:38
【Linux】與NTP Server對時
# sudo ntpdate time.stdtime.gov.tw
- Dec 14 Thu 2006 14:39
【Linux】Linux IPv6 Routing Configuration
確定是否有IPv6 function:
> ping6 或
> route -A inet6 或
> /sbin/ip -f inet6 addr
看IPv6 Routing Table
> route -A inet6
測試是否有 IPv6 module :
> lsmod | grep -i ipv6
否則手動編輯 /etc/rc.d 加入
# modprobe ipv6
# sysctl -w net.ipv6.conf.eth0.forwarding=1
# ssysctl -w net.ipv6.conf.eth1.forwarding=1
# sysctl -w net.ipv6.conf.all.forwarding=1
# route -A inet6 add ::192.85.4.3 dev eth1
- Dec 14 Thu 2006 14:38
【Linux】Linux IPv4 Routing Configuration
ifconfig eth0 192.168.0.2 netmask 255.255.255.0
ifconfig eth1 192.168.0.3 netmask 255.255.255.0
route add 192.168.0.4 eth1
sysctl -w net.ipv4.ip_forward=1
- Dec 14 Thu 2006 14:37
【Linux】Recompile Linux Kernel
IPv4
cd /usr/src/linux-2.6.12.6
sudo make
sudo make install
IPv6
由於IPv6是Module,所以步驟不同
cd /usr/src/linux-2.6.12.6
sudo make modules
sudo make modules_install
- Dec 14 Thu 2006 14:34
【Linux】關閉PC喇叭的逼聲
setterm -bfreq
man setterm
- Dec 14 Thu 2006 14:22
【Linux】ethereal執行問題
Could not set capabilities: Operation not permitted
Sol:
# modprobe capability
- Dec 14 Thu 2006 14:19
【Linux】安裝gcc-3.4.0
cd /usr/local/src
wget ftp://ftp.cs.cuhk.edu.hk/pub/gnu/gnu/gcc/gcc-3.4.0/gcc-3.4.0.tar.gz
tar zxvf gcc-3.4.0.tar.gz
mkdir gcc-build
cd gcc-build
../gcc-3.4.0/configure --prefix=/usr/local/gcc-3.4.0 --enable-threads=posix --disable-checking --enable--long-long --host=i386-redhat-linux --with-system-zlib --enable-languages=c,c++,java
make (P4-1.6花50分鐘)
make install
% cd /usr/bin
% ln -s ${destdir}/bin/gcc gcc-3.4
- Dec 14 Thu 2006 14:16
【Linux】tethereal 使用方式
寫入檔案
tethereal -wfilename -i interface
讀檔
tethereal -rfilename -V
- Dec 14 Thu 2006 14:15
【Linux】Linux IPv6 Bug
sendto中sin6_addr的欄位
填::1、ff04::1沒問題
填::c055:302ff05::1會出現sendto: Cannot assign requested address的錯誤訊息