FreeBSD Hints & Kinks

Randy Pratt

This is a collection of notes that were made as part of keeping system notes for various projects and tasks.


Table of Contents
I. Installation Tips
1. Boot Managers
1.1. BootIt Next Generation
1.2. FreeBSD Booteasy
1.3. Partitions and Slices
1.4. Restoring MBR/Boot Manager
2. Installing FreeBSD Using PPPoE
2.1. Introduction
2.2. Configuring the Ethernet Interface
2.3. Configure PPP Interface
2.4. FreeBSD Installation
3. Cable Notes
3.1. Connecting with DHCP
3.2. Using NATD
4. Live CD Projects
4.1. FreeBSD LiveCD Project
4.2. Freesbie
4.3. Project Frenzy
4.4. System Rescue CD-ROM
II. Common Tasks
5. Useful Commands
5.1. Getting Started with Unix
5.2. Using Locate
5.3. Using Find
5.4. Using What
5.5. ENVIRONMENT Variables
5.6. Manual pages
5.7. Disk Utilities
5.8. Bash Shell Prompts
5.9. C Shell Prompts
5.10. Shell Command Aliases
5.11. Boot messages
5.12. Using Cron
5.13. Color in Xterms
5.14. Using Patches
5.15. Notes on steps
5.16. XFree86 and Root
5.17. Network Services (inetd)
5.18. Killing or Signalling a Process
5.19. Single User Mode
5.20. Debugging with gdb
5.21. Check for sendmail open relay
5.22. Forwarding Root's Mail
5.23. Hard Disk Information
5.24. Sockstat
5.25. Contents of lost+found
5.26. User Accounts
5.27. Text Pagers
5.28. Console Messages
5.29. Ghost for Unix
5.30. Sysctl
5.31. Opera
5.32. Fetch
5.33. Using Local Mail
5.34. Rsync Basics
6. RCS: Revision Control System
6.1. Using the FreeBSD Revision Control System Locally
III. Building Knowledge
7. Mailing Lists
7.1. Subscription Status
7.2. Reading Mailing Lists Online
7.3. Copying List Participants
7.4. Replying When Reading Online Lists
7.5. Searching Mailing Lists
IV. Network Operations
8. Configuring a Local Area Network with a DSL connection.
8.1. Network Layout
8.2. Gateway/Router
8.3. Connecting another FreeBSD machine to the network
8.4. Configuring Windows 95 as a Node on a FreeBSD LAN
8.5. Connecting to the DSL network with PPP
8.6. Checking the Network
8.7. Network Detection by ISP
8.8. Running Server Behind the Gateway
8.9. network syslogd
8.10. Living with a Dynamic IP
9. LAN FTP Server
9.1. Preparing the Host System
9.2. Accessing the Host System
10. Wireless Notes
10.1. Setting up a FreeBSD Wireless Gateway
V. Upgrading the Operating System
11. Binary Upgrade
11.1. Preparation
11.2. Getting started
11.3. Decide what to upgrade
11.4. Mount existing partitions
11.5. Upgrade backup locations
11.6. Choose media
11.7. After the upgrade
11.8. Using freebsd-update
11.9. FreeBSD Snapshots
12. Updating the System from Sources
12.1. Create a cvsup supfile
12.2. Read /usr/src/UPDATING
12.3. Check /etc/make.conf variables
12.4. Pre-buildworld Mergemaster
12.5. Single User Mode
12.6. Recompile the source: Buildworld
12.7. Compile and Install a New Kernel
12.8. Installworld
12.9. Using Mergemaster
12.10. Removing old files, libraries and directories
VI. Security Notes
13. Security Tips
13.1. FTP Only Users
13.2. Protecting SSH
13.3. Blocking remote login
13.4. Logging console messages
13.5. Monitoring Console Messages
13.6. Suggestions for securing a machine
VII. Ports and Packages
14. Using Packages
14.1. Introduction
14.2. Setting PACKAGESITE
14.3. Package/Port Dependencies
14.4. Misc stuff for pkgs
14.5. Removing Packages
14.6. Encountering problems with building packages
14.7. Creating Packages
14.8. Synchronizing the Ports Tree with Package Builds
14.9. Ports Database (INDEX-*.db) Updating
15. Centralized Package System
15.1. Introduction
15.2. Central Package Server
15.3. Remote Package Clients
15.4. Update Package Master
15.5. Remote Client Updating
16. Using the Ports Tree
16.1. Introduction
16.2. bsd.ports.mk
16.3. Installing a Port
16.4. Cleaning the Ports Tree
16.5. Adopting Ports Tree Sources
16.6. Updating the Ports Tree
16.7. Using make update
16.8. Rebuild Ports INDEX
16.9. Checking Ports Status
16.10. Deleting Ports
16.11. Updating All Ports
16.12. Generate a ports update list
16.13. Pre-fetching Ports Tarballs
16.14. Using /usr/local/etc/pkgtools.conf
16.15. Per-port Persistent Build Options
16.16. Port Options Methods
16.17. Using make.conf for ports build
16.18. Using pkgdb
16.19. Misc stuffs to be moved
16.20. ports problems
16.21. Searching the Ports Tree
16.22. Portaudit
16.23. Ports Makefile
16.24. Making Packages
16.25. Old Shared Libraries
16.26. Find Build Dependencies
16.27. Updating Ports Using a Script
16.28. Duplicate Ports
16.29. Forbidden Ports
16.30. Broken Ports
16.31. Port Authoring Tools
16.32. Port Maintenance Tools
16.33. Simultaneous Port Updates
16.34. Using Perl from the ports
16.35. Using CPAN to install Perl Modules
16.36. Installing ports using portinstall
16.37. portupgrade: Insert date into log filename
16.38. Automating Ports Updating
16.39. Tracing Ports Dependencies
17. Creating a Custom Ports Tree
17.1. Setting up a ports infrastructure outside of /usr/ports
17.2. Creating A Ports Tree Structure
17.3. Modifying A Custom Ports Tree
17.4. Adding the Custom Ports
17.5. Making a Custom Package CDROM
18. Local Patches and Ports
18.1. Local Ports Patches
18.2. Creating a local port
18.3. Include the local category
18.4. Rebuild Ports INDEX
19. Using glade and GTK
19.1. Installing glade using a gettext “Ugly Hack”
20. Internet Relay Chat (IRC)
20.1. Using Identd
20.2. XChat2
20.3. Irssi
20.4. Obsidian FServe
21. Torrents
21.1. Torrent Tools
21.2. btdownload
VIII. Upgrading System Documents
22. Maintaining System Documentation
22.1. The System Documents
22.2. Updating the Document Source Tree
22.3. Using /etc/make.conf for updating trees
22.4. Build and Install Updated Documents
22.5. Scripting the Doc Build
22.6. Accessing the Documents
22.7. emacs sgml
22.8. Updating Documentation with Docsnap
IX. FreeBSD 5.x Notes
23. General Jottings
23.1. Witness and Invariants
23.2. Lock Order Reversals - What do they mean?
23.3. Device Hints
23.4. 5.x ssh
X. Multimedia
24. Using Multimedia
24.1. User Mounting of removeable media
24.2. Multimedia Tools
24.3. VCD
24.4. SVCD
24.5. Using mjpeg tools
24.6. MPEG2 Notes
24.7. Quick Convert to DIV3 AVI
24.8. Video Definitions and References
24.9. Nero Files
24.10. DAT Files
24.11. Notes and tidbits not yet used
24.12. ISO9660
24.13. ISO Hints
24.14. Digital Cameras
24.15. Photo CD's
24.16. Using two sound cards
24.17. Transport sound across a network
24.18. VCHAN Virtual Sound Channels
24.19. OGMRip
24.20. Real Audio / Real Media
24.21. Streaming MP3
24.22. TV with mplayer
24.23. Aspect ratio
24.24. Movie Frames
24.25. Screen Capture
25. CDR media
25.1. Using SCSI Applications with IDE devices
25.2. Using Cdrdao
25.3. Using Cdrecord
26. Using DVD
26.1. DVD
26.2. The DVD (Video) file structure
26.3. miniDVD
26.4. Convert DVD to AVI
26.5. Convert DVD to MPEG1
26.6. DVD Data Discs
26.7. DVD Space
26.8. Burning DVD ISO images
XI. Miscellaneous Applications
27. Gphoto
27.1. Gphoto2
28. Festival
28.1. Installation and configuration
28.2. Audio output
28.3. Recording
XII. Appendices
A. Disk Partition Types
B. Date Formatting Codes
Index
Colophon
List of Tables
5-1. Manual Page Sections
24-1. VCD Specifications
24-2. SVCD Specifications
24-3. VCD/SVCD Comparison
26-1. DVD Specifications
A-1. Disk Partition Types
B-1. Date Formatting Codes
List of Figures
2-1. Do post-install configuration of FreeBSD
2-2. Configure Additional Network Services
2-3. Select Ethernet Interface
2-4. Configure Ethernet Interface
2-5. Exit the Network Services Menu
2-6. Select the Media
2-7. Select FTP Media
2-8. Select the FTP Site
2-9. Select ppp0
2-10. Configuration for ppp0
2-11. Start a Standard Install
8-1. Network Layout
9-1. Using sysinstall to add user
9-2. Options Editor
9-3. Using sysinstall to add user
9-4. Using sysinstall to add user
9-5. Using sysinstall to add user
9-6. Using sysinstall to add user
9-7. Using sysinstall to add user
9-8. Using sysinstall to add user
9-9. Using sysinstall to add user
9-10. Using sysinstall to add user
11-1. Kernel Configuration Menu
11-2. The Kernel Device Configuration Visual Interface
11-3. Expanded Driver List
11-4. Driver Configuration With No Conflicts
11-5. Sysinstall Main Menu
11-6. Select upgrade
11-7. dist1
11-8. dist2
11-9. dist3
11-10. dist4
11-11. Unmounted partitions available
11-12. Mounting a partition
11-13. Mounted partitions
11-14. etc-dir
11-15. media.scr
14-1. Viewing dependencies with Pib
16-1. Screenshot of Pib display
16-2. Searching with Pib
26-1. DVD Layout