Posts Tagged ‘freebsd’

From: http://uw713doc.sco.com/en/FS_admin/_Time_and_Space_Optimization.html
If you are using a ufs filesystem, the system attempts to optimize the time it takes to perform operations on the filesystem. In certain circumstances, the system attempts to optimize the space on the storage media being used by the filesystem.
Space optimization occurs when file fragmentation exceeds: (free – 2) % of free disk [...]

在FreeBSD里设置第二块网卡为内网网卡,同时又不经过路由器连接另一台机器的话,dmesg经常会收到如下的信息:
System: arp: [ip] is on [if 0] but got reply from [mac] on [if 1]。
其意思就是IP地址本来在网卡if0上,但返回的MAC地址却是if1的MAC地址。这种情况也是受到arp病毒攻击时的会表现出来的状况。对这种情况,解释是这样的:
A switch works on a low level: it only knows MAC addresses. When it receives a broadcast message it will send that message to all of its ports (like it is supposed to do). Your machine maneges an arp table (try [...]

Need to see which daemons are listening for connection requests? Use
"sockstat -4l" for IPv4, and "sockstat -l" for IPv4 and IPv6.
                — Dru <genesis@istar.ca>

Need to remove all those ^M characters from a DOS file? Try
        tr -d \r < dosfile > newfile
                — Originally by Dru <genesis@istar.ca>

在FreeBSD下,像Linux一样加载/proc分区:
 mount_linprocfs linprocfs /proc
就这一句,NB,谢谢mudone ,谢谢那位我不知道的混smth的牛。

FreeBSD is started up by the program ‘init’.  The first thing init does when
starting multiuser mode (ie, starting the computer up for normal use) is to
run the shell script /etc/rc.  By reading /etc/rc, you can learn a lot about
how the system is put together, which again will make you more confident about
what happens when you [...]

Need to see your routing table? Type "netstat -rn". The entry with the G
flag is your gateway.
                — Dru <genesis@istar.ca>

Want to use sed(1) to edit a file in place?  Well, to replace every ‘e’ with
an ‘o’, in a file named ‘foo’, you can do:
        sed -i.bak s/e/o/g foo
And you’ll get a backup of the original in a file named ‘foo.bak’, but if you
want no backup:
        sed -i ” s/e/o/g foo

You can use aliases to decrease the amount of typing you need to do to get
commands you commonly use.  Examples of fairly popular aliases include (in
Bourne shell style, as in /bin/sh, bash, ksh, and zsh):
        alias lf="ls -FA"
        alias ll="ls -lA"
        alias su="su -m"
In csh or tcsh, these would be
        alias lf ls -FA
        alias [...]

If you are running xterm, the default TERM variable will be ‘xterm’.  If you
set this environment variable to ‘xterm-color’ instead, a lot of programs will
use colors.  You can do this by
        TERM=xterm-color; export TERM
in Bourne-derived shells, and
        setenv TERM xterm-color
in csh-derived shells.