Hardware Informations
# sysctl hw.model # CPU model
# sysctl hw # Gives a lot of hardware information
# sysctl vm # Memory usage
# dmesg | grep "real mem" # Hardware memory
# sysctl -a | grep mem # Kernel memory settings and info
# sysctl dev # Configured devices
# pciconf -l -cv # Show PCI devices
# usbdevs -v # Show USB devices
# atacontrol list # Show ATA devices
Load, statistics and messages
# systat -vmstat 1 # BSD summary of system statistics (1 s intervals)
# systat -tcp 1 # BSD tcp connections (try also -ip)
# systat -netstat 1 # BSD active network connections
# systat -ifstat 1 # BSD network traffic through active interfaces
# systat -iostat 1 # BSD CPU and and disk throughput
User
# pw groupmod admin -m newmember # Add a new member to a group
Limits
# sysctl -a # View all system limits
# sysctl kern.maxfiles=XXXX # maximum number of file descriptors
kern.ipc.nmbclusters=32768 # Permanent entry in /etc/sysctl.conf
kern.maxfiles=65536 # Typical values for Squid
kern.maxfilesperproc=32768
kern.ipc.somaxconn=8192 # TCP queue. Better for apache/sendmail
# sysctl kern.openfiles # How many file descriptors are in use
# sysctl kern.ipc.numopensockets # How many open sockets are in use
Reset root password
* Boot a live CD or installation CD into a rescue mode which will give you a shell.
* Find the root partition with fdisk e.g. fdisk /dev/sda
* Mount it and use chroot:
# mount -o rw /dev/ad4s3a /mnt
# chroot /mnt # chroot into /mnt
# passwd
# reboot
Kernel modules
# kldstat # List all modules loaded in the kernel
# kldload crypto # To load a module (here crypto)
# kldunload crypto # down module
Compile Kernel
FreeBSD
To modify and rebuild the kernel, copy the generic configuration file to a new name and edit it as needed. It is however also possible to edit the file GENERIC directly.
# cd /usr/src/sys/i386/conf/
# cp GENERIC MYKERNEL
# cd /usr/src
# make buildkernel KERNCONF=MYKERNEL
# make installkernel KERNCONF=MYKERNEL
To rebuild the full OS:
# make buildworld # Build the full OS but not the kernel
# make buildkernel # Use KERNCONF as above if appropriate
# make installkernel
# reboot
# mergemaster -p # Compares only files known to be essential
# make installworld
# mergemaster # Update all configuration and other files
# reboot
For small changes in the source, sometimes the short version is enough:
# make kernel world # Compile and install both kernel and OS
# mergemaster
# reboot
Disk usage
# du -sh * # Directory sizes as listing
# du -csh # Total directory size of the current directory
# du -ks * | sort -n -r # Sort everything by size in kilobytes
# ls -lSr # Show files, biggest last
Network
# netstat -rn # Linux, BSD and UNIX
Add and delete a route
FreeBSD
# route add 212.117.0.0/16 192.168.1.1
# route delete 212.117.0.0/16
# route add default 192.168.1.1
sexta-feira, março 28, 2008
quarta-feira, março 26, 2008
Livro
Faz cerca de 1 Mês em que adquiri mais um livro! Rede de Computadores de Tanenbaum, sempre quis ter este livro, finalmente eu o tenho.!!! :-)
Shell Colorido FreeBSD
$cd /usr/ports/misc/gnuls
$make install clean
$cd
Editar .profile
$ee .profile
Criar um alias
alias ls="gnuls --color"
$make install clean
$cd
Editar .profile
$ee .profile
Criar um alias
alias ls="gnuls --color"
segunda-feira, março 24, 2008
./configure
configure: error: Cannot find curses.h header file
solution:
apt-get install ncurses-dev
configure: error: Connot find pcap library
solution:
apt-get install libpcap0.8-dev
solution:
apt-get install ncurses-dev
configure: error: Connot find pcap library
solution:
apt-get install libpcap0.8-dev
domingo, março 23, 2008
./configure
"checking for C compiler default output file name... configure: error: C compiler cannot create executables"
solution: apt-get install g++
solution: apt-get install g++
segunda-feira, dezembro 17, 2007
sábado, dezembro 15, 2007
sexta-feira, dezembro 14, 2007
segunda-feira, dezembro 10, 2007
quarta-feira, dezembro 05, 2007
Livros...
Este mês tenho diversos livros para ler.. hoje mesmo eu começei e acabei de ler livro "O Motorista e o Milionário", agora só falta terminar o "Admirável Mundo Novo", logo em seguida começo a ler um livro que ninguém conheçe... eheheh... "O Mundo de Sofia".
Assinar:
Postagens (Atom)