Thursday, February 26, 2004

ipfw HOW-TO links

Nice list of links on using ipfw, as posted to the freebsd-questions list by "W.D.". Mind you, I haven't checked them, just thought I'd pass it along and archive it. And no, I haven't done my firewall yet....





freebsd-update port

An interesting looking client that will do a binary update of your FreeBSD machine, ala Windows Update.


Port description for security/freebsd-update



Setting keyboard & font

One thing I've been trying to get "just so" has been my terminal setup. I don't use X, as my FreeBSD machine is basically a server, and I'm perfectly comfortable using Emacs and a command line. But I've been trying to get the font, video screen and keyboard mapping to work for me, and I still don't have it 100% my way.



I currently have the following in my rc.conf:


#

# vidcontrol stuff

#

font8x8="swiss-8x8"

font8x16="swiss-8x16"

allscreens_flags="80x60 lightwhite blue"



This sets my fonts to be the 'swiss' fonts, and screen to be in 80x60 mode, bright white on blue screen. Mind you, this is for all the virtual terminals (the ones you get to via Alt-F keys), and doesn't work in the X Terminals. I haven't been able to get the 132 column modes to work correctly yet.



Anyway, the following man page documents vidfont and kbdmap, two commands you can run interactively from the command line to let you select which video font and keyboard mapping to use. I haven't yet found a keyboard mapping that works right for me, so I'm still playing with this one too.



FreeBSD Hypertext Man Pages: kbdmpa, vidfont



You also should set the correct variables in /etc/rc.conf so the changes stick. See /etc/defaults/rc.conf for all the "System console options". That is what you do with the strings hat vidfont and kbdmap echo back for you, put them right into your rc.conf.



Disk Usage

Quick and easy du command to find the space used by each folder found in another folder:


$ du -hx -d 1 /



This command tells du to start in the root folder, do down 1 folder deep (-d 1), and give out stats in "human readable" form (-h) and to not traverse mounted file systems (-x). In a nutshell, it tells you which folders are taking up the most space on your root partition, something that is real nice to know.



FreeBSD Hypertext Man Pages: du



Monday, February 16, 2004

Mount root filesystem read-only

Sometimes, it can be useful to mount the root (ie, the '/') filesystem read-only. Usually, this is to run fsck on it, to fix it up after a horrible crash. Here's how to do it:



# mount -u -o ro -f /



Of course, you do this as root (hence the '#' prompt).

Friday, February 13, 2004

Mail archive search

I am just on a roll today, aren't I? And I'm still only up to last December in my freebsd-questions mail backlog!


Anyway, this is a page to simply search the FreeBSD.org mailing lists. The search page on the FreeBSD site is more than just a little flakey. Depending on how you limit the search, you may or may not get a hit, even though the filter you put on your search should've had nothing to do with suppressing the message in question. This one, perhaps, works a little better.



Rambler: FreeBSD mail archives search



ports Makefile args

Here's the man page for ports(7). It gives a nice overview of ports, but most importantly, it documents the various arguments you can pass to make when you are in the port's directory. Flags like deinstall, reinstall, and configure are all explained.



FreeBSD Hypertext Man Pages: ports



Useful scripts

A list of (free) scripts and programs to use with FreeBSD. See especially the cleanbw script, which runs and logs a complete buildworld cycle:


Computer - Programs Scripts



leave

Quicky little command that will give a prod when it is time to leave:



FreeBSD Hypertext Man Pages: leave



FreeBSD Basics articles

Here's a list of the articles written by Dru Lavigne on using and running FreeBSD. Very informative stuff!



ONLamp.com: FreeBSD Basics [Mar. 14, 2002]



Realtek network cards

Realtek-based network cards are the bane of any OS, but they especially seem to be a problem on FreeBSD. They are the lowest of low end cards, and any simple google search will unearth dozens of problems found with them. Just search the freebsd-questions message archive! I have one in my server that I use as the local connection (I have two cards, one for the outside world and one that connects my internal network). I seem to recall my own problems getting the realtek to work, and I'm not sure of my workaround. But one that seems to have an excellent track record is to disable plug-n-play at the bios level. Here's a short answer that says as much:



Geocrawler.com - freebsd-hardware - rl0: couldn`t map ports/memory



atacontrol

atacontrol is a useful little command that will tell you a little about the IDE (ata) devices you have attached to your computer. For instance:



$ atacontrol list


will list all the IDE devices attached to your computer. It talkes about the 'channel', which is usually at least 0 and 1. When I do it on my computer, I get:



$ atacontrol list
ATA channel 0:
Master: ad0 ATA/ATAPI rev 4
Slave: ad1 ATA/ATAPI rev 5
ATA channel 1:
Master: acd0 <4X4X32/3.VR> ATA/ATAPI rev 0
Slave: no device present


Then you can set and adjust parameters for the various channels and devices. See the man page for more info.



FreeBSD Hypertext Man Pages: atacontrol



init.d and security levels

In the man page for init.d, there is a discussions of FreeBSD security levels. This is a number from -1 to 3 (least to most secure), which allow you to limit things like kernal module loading all the way up to sealing it down at the network packet level. You can set the security level via a variable in the rc.conf file in /etc:


kern_securelevel="1"


FreeBSD Hypertext Man Pages: securelevel



Thursday, February 12, 2004

Recovering forgotten root password

How to reset the root password if you forget it:



First, reboot the machine into single user mode. You do this by hitting space when FreeBSD says to "Hit [Enter] to boot immediately or any other key for command prompt", leaving you with the very cryptic "ok " prompt. Then type in :


ok boot -s


Once it finishes booting, then you can do:


# mount -u / ... mount root file system read/write

# mount /usr ... mount /usr file system (if seperate)

# passwd root .... change the password for root

Enter new password:

Enter password again:

# ^D ... enter ctrl-D to continue with startupbr>


This is all courtesy of the Complete FreeBSD book, by Lehey. I particularily love the chapter where he goes over the boot screen line by line, telling you what FreeBSD is doing.




Tuesday, February 10, 2004

How to use FreeBSD Questions

Greg 'Groggy' Lehey's excellent FAQ for the FreeBSD Questions list. He's the author of the excellent FreeBSD Handbook book.


How to get best results from FreeBSD-questions





Terse sysctl.conf doc

A terse text document that gives a quick overview of many (most? all?) the variables that can be set in /etc/sysctl.conf :


sysctl descriptions



You can find more docs on sysctl, although not much more, in the man pages:

FreeBSD Hypertext Man Pages: sysctl



Another blog and "Content Management"

Another man's weblog, mostly about Linux with a smattering of tech notes and other personal things. A cool example of blogging, using this same Movable Type system we use here:



Mark's Weblog



In addition, he mentiones both Zope and a CMF (Content Management Framework) that sits on top it it called Plone, both of which are, of course, available in ports (see www/zope and www/plone). I'm not exactly sure where something like Movable Type ends and a CMF like Zope/Plone begins, but it is something I've been meaning to investigate further.


Port description for www/zope


Port description for www/plone





Tuesday, February 3, 2004

apachetop - realtime apache stats

I was just browsing the sysutils ports:

FreeBSD Ports: Sysutils


and I read about apachetop, which purports to show a real-time (a la top) display of the current apache session; something I've been thinking I needed. So I'm going to give it a try.



Port description for sysutils/apachetop




webmin

A port to admin Unix (and, of course, FreeBSD) systems via the web. I'm going to give this a try, as I do not run any graphical interface on my FreeBSD box. I do everything via the command line; the shell in emacs to be exact. This might be a nice thing to admin the system from my other interior system, via a local web connection.



Port description for sysutils/webmin




dig - find DNS info

Cool little command line tool I just found out about:



FreeBSD Hypertext Man Pages: dig



You can get all kinds of neat info about a domain names (dig stands for Domain Information Groper) and DNS servers. Ask them about your domain name, get info on mx records, etc.





phpbb - forum software

phpbb is a PHP-based bulletin board system. I"m thinking of installing something like this on my system, just to try it out.



Port description for www/phpbb


phpBB.com :: Creating Communities