Home arrow Journal
Journal
Today Quick Tip: Show Process IO Load PDF  
Digg Reddit Ma.gnolia Stumble Upon Facebook Twitter Google Yahoo! MyWeb Furl" BlinkList Technorati Mixx Bookmark

To see processes that consume lot of I/O use top command:

top -mio

 
Today Quick Tip: Add a user to a group PDF  
Digg Reddit Ma.gnolia Stumble Upon Facebook Twitter Google Yahoo! MyWeb Furl" BlinkList Technorati Mixx Bookmark

If you have the user john and you want to add that user to group managers, in FreeBSD use pw command:

pw groupmod managers -M managers,john

This is how to add a user to a group in FreeBSD.

 
Today Quick Tip: Redirect stdout and stderr to the same file PDF  
Digg Reddit Ma.gnolia Stumble Upon Facebook Twitter Google Yahoo! MyWeb Furl" BlinkList Technorati Mixx Bookmark
For example if you want to write a script and all your error and other messages to be redirected to a file you can use in every command at the end of the command the following: >/tmp/install.log 2>&1

For example if in a script you clone a hard drive you can use this:

dd if=/dev/ad0 of=/dev/ad1  bs=8M   >>/tmp/install.log 2>&1

This will log your output of the dd command to install.log.
 
Remove a TCP connection for a zombie process PDF  
Digg Reddit Ma.gnolia Stumble Upon Facebook Twitter Google Yahoo! MyWeb Furl" BlinkList Technorati Mixx Bookmark
If you've stopped a service on a port but you still see the connection you can remove it with tcpdrop.

For example if you do not have any process running on 8080 but doing:

netstat -n | grep 8080
tcp4       0      0 10.0.0.104.8080        10.0.0.20.1217         LAST_ACK

you can close that connection with:

tcpdrop 10.0.0.104 8080 10.0.0.20 1217

Note1: The syntax is:
usage: tcpdrop local-address local-port foreign-address foreign-port

Note2: After a while the operating system will close that connection that belongs to a zombie process.

Note3: You can also use it to close connection for legitime/working processes, if a connection eats to many resources on the server.
 
Today Quick Tip: Find package name without compiling PDF  
Digg Reddit Ma.gnolia Stumble Upon Facebook Twitter Google Yahoo! MyWeb Furl" BlinkList Technorati Mixx Bookmark

To find port/package full name (name and version) from ports use:

  make package-name


To build package from ports

  make package


To build package and needed packages for a port:

  make package-recursive

 
Today Quick Tip: Find dependencies for a port without compiling PDF  
Digg Reddit Ma.gnolia Stumble Upon Facebook Twitter Google Yahoo! MyWeb Furl" BlinkList Technorati Mixx Bookmark
Here are some usefull commands to find dependencies for a port without compiling that port:

make build-depends-list

make run-depends-list

make missing

 
Today's Quick Tip: See open ports PDF  
Digg Reddit Ma.gnolia Stumble Upon Facebook Twitter Google Yahoo! MyWeb Furl" BlinkList Technorati Mixx Bookmark
To see open ports on a FreeBSD machine:

sockstat -4
 
Today's Quick Tip: How to clear states in PF Firewall PDF  
Digg Reddit Ma.gnolia Stumble Upon Facebook Twitter Google Yahoo! MyWeb Furl" BlinkList Technorati Mixx Bookmark
To clear states for a PF Firewall:

pfctl -F state
 

Other BSD Systems

OpenBSD

Polls

Best BSD firewall?
 

News FreeBSD.org