目前分類:不分類Linux (19)

瀏覽方式: 標題列表 簡短摘要

將所有的,替換成,

:%s/, /,/g

eternalwind 發表在 痞客邦 留言(0) 人氣()

預設值為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

eternalwind 發表在 痞客邦 留言(0) 人氣()

(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]

eternalwind 發表在 痞客邦 留言(0) 人氣()

#sudo ip neigh add [IPv6 Address] lladdr [MAC Address] dev [Interface]

eternalwind 發表在 痞客邦 留言(0) 人氣()

# iptables -L
列出所有的rules

# iptables -F
清除所有的rules

eternalwind 發表在 痞客邦 留言(0) 人氣()

putty設定

Window > Appearance > Font settings > Change

選中文字型(ex.細明體或標楷體),字集選擇CHINESE_BIG5

登入後設定環境變數

#setenv LANG zh_TW.Big5

or

#LANG=zh_TW.Big5

eternalwind 發表在 痞客邦 留言(0) 人氣()

grep -R 'String' .

eternalwind 發表在 痞客邦 留言(0) 人氣()

find . -name "file-name"

eternalwind 發表在 痞客邦 留言(0) 人氣()

看目前使用的shell
# env | grep SH

更換使用的shell
修改/etc/passwd的最後一欄
# vim /etc/passwd
XXXXXXXXXXXX:/bin/tcsh

設定登入自動執行某些指令
如果使用的是tcsh的話
# vim .tcshrc 

如果使用的是bash的話
# vim .bashrc

eternalwind 發表在 痞客邦 留言(0) 人氣()

#ethtool -k ethX
#ethtool -K ethX rx on

eternalwind 發表在 痞客邦 留言(0) 人氣()

# sudo ntpdate time.stdtime.gov.tw

eternalwind 發表在 痞客邦 留言(0) 人氣()

確定是否有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

eternalwind 發表在 痞客邦 留言(0) 人氣()

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

eternalwind 發表在 痞客邦 留言(0) 人氣()

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

eternalwind 發表在 痞客邦 留言(0) 人氣()

setterm -bfreq

man setterm

eternalwind 發表在 痞客邦 留言(0) 人氣()

Could not set capabilities: Operation not permitted

Sol:

# modprobe capability

eternalwind 發表在 痞客邦 留言(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

eternalwind 發表在 痞客邦 留言(0) 人氣()

寫入檔案
tethereal -wfilename -i interface

讀檔
tethereal -rfilename -V

eternalwind 發表在 痞客邦 留言(0) 人氣()

sendto中sin6_addr的欄位

填::1、ff04::1沒問題
填::c055:302ff05::1會出現sendto: Cannot assign requested address的錯誤訊息

eternalwind 發表在 痞客邦 留言(0) 人氣()