SSMTP/Getmail how-to part I

This is a short how to for kicking sendmail in the buttocks and setting up a micro-replacement for send-only usage on a FreeBSD (post 5.x) system. Plus using the getmail utility to check for new messages. I spent long enough screwing with it after I miss-read some documentation (fbsd handbook/ssmtp).

The goal is to be able to use utilties such as mailx, mutt, and other MUA’s dependant on sendmail (or exteneral) MTA(s) and be able to check mail easy and automaticly. I assume you at least know how to setup a mail client such as Mozilla Thunderbird or Outlook Express (or can get the relivent info) and know how to edit files as root when needed.

First we have to kill sendmail. For this we need to edit the /etc/rc.conf file, since I’ve cleaned mine up to place various options in related ‘sections’ heres the relivent one from my rf.cofing. Note all the sendmail_* options at the bottom.

#########################################################################
# SERVICES #
#########################################################################


#cupsd_enable="YES"
#background_cupsd="YES"

samba_enable="YES"

ntpdate_enable="NO"
ntpd_enable="YES"
ntpd_falgs="-c /etc/ntp.conf -f /var/db/ntpd.drift"

# Completly kill sendmail
sendmail_enable="NONE"
sendmail_submit_enable="NO"
sendmail_outbound_enable="NO"
sendmail_msp_queue_enable="NO"

Save rf.config with those sendmail lines in it and we can stop sendmail from working. Sendmails probably the worlds most used Mail Transfer Agent but for a desktop we don’t really need it. While its well known for its history of security problems according to some OpenBSD people, at least they still patch it. Now with sendmail gone we have two problems.

  1. Daily run messages are usually mailed to root and this might break that a tad.
  2. MUA’s dependant on external MTA or utils dependant on sendmail may require configuration changes or stop working

Now to fix this we want some thing small that will allow us to send e-mail through some thing sendmail compatible’ish. I’ll assume that you have ports installed or know how – so go do it and update them. Personally I try to update my ports tree every few days or just before building a port if I rarly install stuff on the machine. I also prefer cvsup/csup 🙂

Ok, now that you have ports ready to go lets install some software. Open a shell (or use a GUI) to cd into /usr/ports/mail/sstmp/ so we can build it. Run the commands

make install replace clean

it shouldn’t take long to install so no need to go on coffee break 😛
In case your wondering what ssmtp is heres the pkg-descr:

A secure, effective and simple way of getting mail off a system to your
mail hub. It contains no suid-binaries or other dangerous things – no mail
spool to poke around in, and no daemons running in the background. Mail is
simply forwarded to the configured mailhost. Extremely easy configuration.

WARNING: the above is all it does; it does not receive mail, expand aliases
or manage a queue. That belongs on a mail hub with a system administrator.

WWW: http://packages.debian.org/testing/mail/ssmtp.html

Basically it doesn’t handle fetching or checking mail or reading it but it lets you send it. While some thing like sendmail, qmail, or postfix should at least provide send/recieve if you want to go bugger setting up a full blown mail server be my guest 🙂

sSMTP is really s send-only app that tries to emulate sendmail, most of the command line options to sendmail are accepted but many are just ignored. Some MUA’s can check mail for us, mutt springs to mind but I rather like using getmail so far. At first I thought I would use sendmail/fetchmail/ but I saw an app called ‘getmail’ in ports and checked it out. Its not as buggy as fetchmail is *said* to be, its got great documentation, and its really simple. So if your going to use getmail once ssmtp is done building start on /usr/ports/mail/getmail/ while we open another terminal to configure ssmtp while getmail compiles.

Using a shell or file manager like konqueror cd over to /usr/local/etc/ssmtp/ . We can ether use the .sample files here or create new ones from scratch. We to create a ssmtp.conf file that tells ssmtp how to send e-mail to our out going mail server. The config file syntax is a cake walk, its key=value and # for comments to end of line like many a language or file has.

# Your E-Mail _address_
root=email_username@isp.net
# Your outgoing mail server, normally the TLD is .net, .com, or .org
mailhub=mail.isp.topleveldomain
# Where mail looks like it came from, just stick in your e-mail address.
rewriteDomain=email_username@isp.net
# Your hostname, your e-mail address should be fine if your not a mail server
hostname=email_username@isp.net
# Set this to never rewrite the "From:" line (unless not given) and to
# use that address in the "from line" of the envelope.
FromLineOverride=YES

save as /usr/local/etc/ssmtp/ssmtp.config and that takes care of that. You might want to nuke sendmail or reboot of course for this to take effect. Now since we do want our daily run stuff to still work we will set up an alias so mail sent to our user account locally will actually be sent to our e-mail address. We’ll do this with the revaliases file in the same directory.

This ones a little bit og a bug but its not once you figure out how. Basically the syntax is like this

your_login_name_on_this_computer:your_email_address_to_send_to:the_out_going_mailhub_to_use

# Alias e-mail to the system root account to go to my private e-mail
root:myemailaddr@myisp.tld:mail.myisp.tld
# Alias my_username to my email address so I get my cron-job reports
my_username:myemailaddr@myisp.tld:mail.myisp.tld

This way the daily run and cron e-mail messages will still work and they will be in my e-mail rather then /var/mail/${USER} where I often forget to check 8=)

I’ve yet to figure out how to set up ssmtp for multiple outgoing mail servers but I’ll figure it out later & post it.

Ok, now lets get back to getmail

PC-BSD Backup-Howto

/****************************************************************************
* NOTICE *
****************************************************************************
* This is still under construction. Having gotton very tired before getting*
* this far. Makes this less then optimal. Also since I have little in the *
* way of practical exp. It will probably show. I've never had need or using*
* any of my backups. *
* *
* I did enjoy learning a few new things like basic cpio usage, well. *
* I've read about using tar/cpio/afio/dump before. But I've only really *
* used bsdtar with / without gzip/bzip2 for the most part. *
* I will get stuff cleaned up as soon as I can. Feedback/comments always *
* Welcome. *
* *
* Chow *
***************************************************************************/

The most important policy a computer owner ever works on. Is his/her backup
plan, what happens if that hard drive blows up or you erase all your mp3s ?

Since PC-BSD is a desktop based OS, I’ll think more so from a desktop users
perspective then a server. I also don’t know of many people that have ‘tape’
drives at home so I’m not saying any thing about what I don’t own.

Why should I back up my data ?

0.) In case of hard ware failure, namely the hard drive

1.) In case of disaster. Such as fire/flood/electric surge

2.) In case of accidental deletion, oops I just shredded my tax returns the
night before tax day !

3.) In case you have to reinstall the Operating System and want your data.

4.) Just in case you install another Operating System and it over writes some
data.

All good reasons to have a plan, further more its generally assumed that before
you go installing OSes, partitioning drives, e.t.c. that you got back ups.

Ok, so I need backups but where to put them?

Good question, depends on the type. I generally use a mixture of drives and
disks. You should keep them in a safe place, probably not in the same area as
the computer. In case of a fire or burst pipe. You might loose the computer but
not the backups on a shelf down the hall. A fireproof safe would be nice if you
got one.

Remember, while it can be secure on your computer behind passwords and access
controls. Once your data is backed up there is no protection. Although you can
backup encrypted user files with luck and decrypt them after restore. Such as
ones Documents. If your backups contain sensitive information be _sure_ to keep
them in a secure location. It can be just as easy for a smart thief to restore
a backup of yours on his/her computer as it is for you. If given access to the
backup media.

When to backup ?

The question is how much could you afford to loose? If you work on files
often such as a writer, programmer, or an artist. You might want to backup
daily. If your a casual user more worried about bookmarks and mailboxes. Ever
two weeks to two months might do it. Really your the only one who would know.

If you want to automate the task we will be looking at tools meant for that
purpose.

What to backup ?

This is all a matter of personal preference. The most important things for the
desktop user are files. Namely one would rather save a few 1000 family photos
then installed software that can be reinstalled. My suggestion is at the bare
_minimal_ that you backup your home directory and any major file storage
folders or collections.

System configuration can also be important. Maybe you had to make some changes
to get your system working right or theres just some stuff you don’t want to
tinker with again. Hopefully you did write down any changes you had to make,
like wireless configuration details e.t.c. But a backup never hurts ! I’d
suggest you backup the /etc directory, the loader.conf file and modules
directory in /boot/ if you have drivers there, as well relevant directories
under /usr/local/ if your software requires it (like global configuration
files). It might also be of interest to grab the /var directory and system logs.

At best

/boot/loader.conf
/boot/modules
/etc
/usr/home/

What to backup to!

Any proper safe location. If you do use a tape drive, I suggest you take _good_
care of the thing and don’t use it very often. If you don’t know what tape
drives are don’t worry, I’ve never used one ether.

The best storage medium you can get would be CD-R, DVD-R, CD-RW, DVD+R, or Hard
Drive. You will need a burner to write files to a disk but heres a run down.

CD-R, needs a CD Burner. Holds about 650MB of data and files burned to it are
stored for as long as the disk lasts.

CD-RW, needs a CD Burner, works just like a CD-R but you can erase files from
itand reuse the disk. Costs a little more but can be well worth it.

DVD-R / DVD+R, needs a DVD burner but tends to hold much more data, a bit over
4.3GB or over 4,400 MB. Most burners to day support both -R and +R formats, I’d
suggest DVD-R but what ever your systems support.

There are also DVD-RW and Dual Layed DVD media that your drives may support. A
DVD Burner will also burn CD-R and CD-RW 🙂

Another good medium is the external USB hard drive or large capacity USB
sticks. These are good in that they can be used just like hard drive space, but
taken else wheres for storage. If you often use a USB stick for file shares,
you should back it up as well in case of loss or damage.

You can also use hard drives, if you have several computers a reliable one can
be tasked with a high capacity hard drive for the purpose.

My greatest fear is generally for hardware failure rather then accidental
deletion, I’m kinda careful. So I generally make use of hard drives then
optical media for storing long-term backups.

How to backup ?

Interesting question, lets think a few. We have a few options we can

Archive the whole system and stick it some where safe.

Take a snapshot of the file system, good if your prone to erasing stuff

Copies of the disks, poor mans RAID.

If for some reason you are working with a Database, stop the thing before you
back it up. Or at least check the documentation on it before backing it up.
Trust me you don’t want to break that local copy of a website your developing
do you ? Hehehe. Our major software will be dump, cpio, and a few
archive/compression systems.

Dump, the real way to backup a toilet bowl !

Sorry just had to say it. Dump writes raw data blocks that make up
files/folders I’d suggest reading the man page on dump(8) and restore(8) if you
have need of it use it. If you know how to, I’d really say use it. The manual
pages are very good but feel tape-drive centric. Perhaps some one with more
experience with dump/restore can provide better info.

Here is a
good article

If you don’t understand a lick of that or the manual page, do not bother with
dump unless you have to. Trust me, you’ll only get a headache. Learning the
details of dump/restore is also on my to do list.

That being said, dump and restore are probably the _best_ thing you have in the
arsenal of backup and restore tools.

Tar and Friends, the zippy way.

This is probably my most used method and it should prove usable for most
desktop systems. The basic idea behind tar is you take many files and create
one. For example tar can take the files tom, dick, and harry. And turn them
into the file ‘names.tar’, when unpacked you get your tom, dick, and harry
files back. The problem here is tar does not compress data to save space. For
this if we are not working with just a few small files. We probably want to
archive it with tar, then compress it using a program like gzip or bzip2.

PC-BSD uses BSDTar but includes GNUTar as tar and gtar respectively. See the
man page tar(1) and the info file on tar (GNU info page). If your used to
advanced tar usage under GNU/Linux you might find gtar more to your liking.
For basic usage the differences are not worth noting.

We can create a tar archive like so in the konsole

tar -cf files_to_add tarfilename.tar

If we want to be quick about compressing this file we can do it in one line and
use ether gzip (tar.gz) or bzip2 (tar.bz2) like so:

tar -czf filename.tar.gz files_to_add
tar -cjf filename.tar.bz2 files_to_add

GZip is faster but BZip2 may offer smaller files but use more resources when
dealing with bigger files. One can also backup over the network using ssh or
rsh if necessary. For simple usage like this we can use the graphical program
‘ark’ but it may take longer to process the operation (imho). To extract the
files we can open it in ark and extract it or simply run

tar -xzf filename.tar.gz
tar -xjf filename.tar.bz2

A quick and dirty way to back up ones home directory would be to run ark as the
root user from the run dialog or konqueror in super user mode. Add the folder
/usr/home/ to a new archive of given format or to create it like so from
a root konsole.

cd /usr/home
tar -cpzf Terry home-Terry.tar.gz

That is, create a tar archive of my home directory, preserve my file
permissions, and gzip it from the file ‘Terry’ in the current directory.

A far bit of warning, the manual on tar will make your eyes bleed so its
probably best to look for examples or use ark until your used to the command.

See Pee Eye Oh, I see you.

The program cpio or ‘copy input / output’ is the backup tool I recommend along
with pax. Its usage is more complex then tar but more useful. The version
included with PC-BSD/FreeBSD is GNU cpio.

A simple way to create a file with cpio from a konsole is like this

find ./ -print | cpio -vo –format=crc > filename

Will make a ASCII cpio archive in the new portable SVR4 format with a checksum
of all files/folders in the current directory. To restore it to the current
directory.

cpio -vidm < filename The v option means be verbose, that is show us what its doing. The -o option is create, -i is extract. -d is make directories as needed, -m is preserve modification times, and --format= is the archive format. Thumb
around the manual page for more details. Sadly this lacks compression 🙁 The
sysutils/afio port is an updated cpio program with more options including built
in compression.

Any one seen K-PAX?

Since the many versions of tar and pax in use by commercial UNIX and Free Unix
likes such as HP-UP & Solaris on one side. And GNU and BSD on the other
userland side. Have various compatiblity issues from time to time. POSIX UNIX
standards people. Created their own program called ‘pax’

If your prone to ‘Distro’ hopping or having to deal with several different Unix
systems you probably would prefer pax to cpio. Dru Lavigne has a great article
about it, so rather then write about it I suggest you read
hers
🙂

Heres a simple usage of it just for the same of this document.

pax -wf archivename /what_to_archive

cd /where/to/restore/to
pax -rf /to/archivename

Direct Device Access
dd(1) is a utility to convert and copy files. It has more use then it sounds
really. dd is a powerful tool and a dangerous one. If your not used to it,
please don’t make a typo trust me it could be bad. This program can do some raw
disk copy jobs and even has use in computer forensics to get byte exact copies
of drives. It is also some what hated in that it is used very diffrent from
other UNIX programs. Rather then -options you use a option=value method for
setting options. Here is a demostration of coping a mounted floppy disk in drive fd0.

dd if=/dev/fd0 of/tmp/floppy.image

Which very well may take awhile, we can add the obs= option to write
‘bytes’ at bytes at once and ibs= to read at ‘bytes’ at bytes per once.
Or we can just use the bs= option to set both the same. Thus to speed up
stuff.

We now have a copy of the sucker as I’ll show with the file and Disk Usage
programs.

file /tmp/fd.image
fd.image: x86 boot sector, code offset 0x3c, OEM-ID “BSD 4.4”, sectors/cluster 8, root entries 512, sectors 2880 (volumes <=32 MB) , sectors/FAT 2, serial number 0x742c15e2, unlabeled, FAT (12 bit) du -h /tmp/fd.image 1.4M /tmp/fd.image I only had 96K of data on the floppy but it is a byte for byte copy of the disk. So the image is a full 1.4 megs. Now I will copy it to another blank disk, raw. At approx 16 Kilobytes per. First unmount the disk and insert a blank floppy. dd if=/tmp/fd.image of=/dev/fd0 bs=16384 Now we can mount it and bingo its the mirror image of our old disk complete with the free space on it. mount_msdosfs /dev/fd0 /mnt/fd0/ We can even use rsh or ssh to do this over a network. Remember if you want to 'dd' an image of your hard drive. It will be the same size. For example if I used my systems ad0s1a partition as the In File (if=/dev/ad0s1a) and my ad0s1a partition is 7GB in size with 4GB free space and 3GB used space. The resulting image would be 7GB in size _not_ 3GB. So one must have space to store the image. You would probably be better off with dump but dd has its value. Since dd will probably need to be run as root for much of its usage as a backup tool. I suggest that you _read_ this section of Wikipedia on *WHAT NOT TO DO WITH DD* before using the command and erasing data instead of cloning it! dd
Anti-Examples

Once PC-BSD has released a GUI program for making backups things will get
simpler. In the mean time here are some ports you might research:

rchivers/mtf             A Unix reader for the Microsoft Tape Format used by NT Backup
archivers/rvm An archive manager that uses rsync to manage backups
databases/usogres Real-time backup utility for PostgreSQL
deskutils/multisync-backup Multisync backup plugin
emulators/vmsbackup Reads VMS BACKUP tapes
misc/afbackup AF's backup system
misc/afbackup-client AF's backup system
misc/afbackup-server AF's backup system
multimedia/streamdvd A fast tool to backup Video DVDs 'on the fly'
palm/pilot-link PalmPilot communications utilities (backup/restore/install/debug/...)
sysutils/afio Archiver & backup program w/ builtin compression
sysutils/bacula-client The network backup solution (client)
sysutils/bacula-client-devel The network backup solution (client) - DEVELOPMENT Version
sysutils/bacula-server The network backup solution (server)
sysutils/bacula-server-devel The network backup solution (server) - DEVELOPMENT Version
sysutils/be_agent VERITAS Backup Exec (tm) UNIX Agent
sysutils/bksh Backup-only shell
sysutils/boxbackup An open source, completely automatic on-line backup system for UNIX
sysutils/cdbkup Simple but full-featured backup/restore perl scripts (uses gnu tar)
sysutils/cpbk Backup Copy programm
sysutils/dar A full featured command-line backup tool, aimed for disks
sysutils/dirvish Network backup system based off of rsync
sysutils/duplicity Untrusted backup using rsync algorithm
sysutils/dvdbackup Backup content from DVD to hard disk
sysutils/flexbackup Perl-based flexible backup system that can use dump/afio/cpio/tar/star
sysutils/fsbackup File system backup and synchronization utility
sysutils/hdup The little, spiffy, backup tool
sysutils/kdar KDar is KDE-based backuptool using libdar
sysutils/pdumpfs A daily backup system similar to Plan9's dumpfs
sysutils/pdumpfs-clean A utility to clean up old backup files of a pdumpfs archive
sysutils/rdiff-backup Local/remote mirroring+incremental backup
sysutils/rdiff-backup-devel Local/remote mirroring+incremental backup
sysutils/reoback Simple but flexible ftp/nfs backup script

Some links that may be of interest

Stress
testing the backup utilities

FreeBSD Backup Strategies
FreeBSD Backup Basics

QEMU

How to install PC-BSD using the QEMU Emulator

What is QEMU?

QEMU is software that allows you to emulate another computer in order to
install and use an operating system on your physical machine without actually
installing it. Much like a Famcom emulator uses software to create the
impression to a game ROM that it’s really running on a Nintendo 8-Bit console.
It’s really running on your PC. It’s basically the same thing.

For Windows you can download QEMU as a ZIP archive and unpack it to any working
directory. If your using an older version of windows you may want to install a
program such as 7-Zip or WinZip (I reccomend the former). In order to use the
accelerator module you need to download it as well. You can find a link to it
on the main QEMU web site. Un pack the archive (it’s tared and bzipped, try
7Zip or WinRar). Copy the kqemu.inf and kqemnu.sys files to your QEMU
installation.

If you are using a Unix/Linux system it is best to use what ever package
management system you have to install it. One should be able to find an RPM or
Deb for there system. PC-BSD users can install QEMU and KQEMU via PBI which
includes a simple GUI for setting it up.

The KQEMU module will make the installed system faster but it is not open
source software. Qemu is Open Source and Free Software. Installing this will
likey vary from system to system.

Qemu Website
http://fabrice.bellard.free.fr/qemu/

Qemu for Windows
http://www.h7.dion.ne.jp/~qemu-win/

I will deal with using QEMU at the command line since it is the only portable
interface (Win, Lin, BSD, Mac). If your using a Unix/Linux system strip off the
“.exe” every where.

Find the location of QEMU on your system once it’s installed. Open a terminal
emulator (command prompt window) and change directory to it’s location like
this, cd “C:Program FilesQEMU” or if using a Uinx/Linux system you can check
it’s installed location with the command “which qemu” -> C Shell users may have
to “rehash” after installing qemu before they can run it.

Now since QEMU does not use your actual hard ware (it emulates it’s own) you
need to create a file that QEMU can use to store data (acts like a hard drive
or swap file). We can create a harddisk image file in several different
formats. “raw” which should be portable between emulation software. “qcow”
which is probably the best choice for Windows systems. “cow” for Linux systems,
“vmdk” which makes a VMWare image, and cloop which ya don’t want to toy with
right now !

Depending on the format used the size of the file should grow till it reaches
the limit we give it. Now PC-BSD should fit on a 6GB hard drive but to get any
real work done 15GB would be more realistic, assuming you like to store a lot
of photos, music, and video files. Then again for getting real work done you
should install an operating system not use an emulator (in my humble opinion).
It is good for testing things though but a few things to remember.

0.) Emulated hardware does not relate to YOUR hardware. So some things may work
or not work after really installing an operating system. Just the same some
things may not work in the Emulator but may work on the real system as the
emulator is simulating hardware.

1.) The system will run much slower then had you really installed it. Not only
is it going to use an alloted amount of memory (RAM) your computer will all
ready be running it’s current operating system and other softwares. This is not
suitable for the “faint hearted” machines. The test system I have runs a
Pentium D 930 (2 x 3.0Ghz) CPU and 2048MB (2GB) of fast DDR2 Memory.

3.) With virtual solutions some times odd things about software just “don’t”
work but are fixed when installed on the real system. Like wise it can be the
other way around.

4.) A lot of things won’t work under emulation or not well, i.e. 3D Games e.t.c.

Ok phase one we will create a disk image to install an operating system on. I
suggest 5GB minimal, for this I will use an 8GB image file. Thanks to having a
500GB hard drive xD

qemu -create -f qcow acd.img 8G

The syntax as you can see is `qemu-img -option -f format filename sizeG. Now we
have to basic options on how to install, we can boot the emulator off a CD/DVD
or an ISO image.It’s rather nice if you can use the ISO image and save your
self from burning a CD-R just for testing the system.

If using a Windows system

qemu -L . -cdrom “\.E:” -hda acd.img -m 512 -boot d

If using a FreeBSD system

qemu -cdrom /dev/acd0 -hda acd.img -m 512 -boot d

The device names vary from Unix to Unix some tiems even Linux Distro to Distro.
It will probably be some thing like /dev/scd0 on a Linux based system.

Now this is very important the number after the -m is how many megabytes of
memory to give the emulated “virtual” PC. In my case I chose to allow 512MB of
Memory to run PC-BSD under emulation.

Now if you want to use the ISO image file it’s slightly different.

Windows
qemu -L . -cdrom Imagefile.iso -hda acd0.img -m 512 -boot -d

Unix/Linux
qemu -cdrom Imagefile.iso -hda acd0.img -m 512 -boot -d

After the system is installed you can run it like so

Windows
qemu -L . -hda acd0.img -m 512

Unix/Linux
qemu -hda acd0.img -m 512

To try and enable KQEMU for more speed add a “-kernel-kqemu” option like so

qemu -hda acd0.img -m 512 -kernel-kqemu

The system should now boot and you can see how it works.

I’ve installed the system but it is very slow, taking about 2 times longer to install then normal and many minutes to boot + without sound or network. I don’t have KQEMU so it makes emulated hardware feel faster then our first Pentium PC (with 32MB of memory). If my laptop wasn’t so slow I might try it out that way. For running WinVista I’d say go with KQEMU on a system with 4GB of RAM and a lot 3.5 GB for it hehehehahhA !

Vi User How-To

Welcome to an introduction and usage study of one of the worlds most common text editors. It is also my favorite style of editor. We cover several sections each detailing a given aspect of the Vi editor.

Table of Contents

Short history
Which Vi is my Vi ?
Initial Fear
Learning Vi
Required Commands
Helpful Functions
A few extra commands
Making sense of Vi options
Deletion Wars
Cut, Copy, and Paste the Vi style !
Options and configuration
How to make a exrc file

Document Version: 0.90.0

This post has the underlying assumption that you want to learn to use the Vi text editor but know jack about it. I won’t insult you but I’ll try to teach it without being to terse or “hand holding”. We all need help but one has to put in a little bit of effort to master a program.

I have always cared more for content and understandable English then for closely following the “laws of the English anguage” so forgive any grammatical errors and ether curse or help improve the content 😛

Short History
In 1976 a man named Bill Joy wrote the Vi text editor for an early BSD release. It took the existing ed and ex line editors and created a visual interface. While ex was a simple line editor vi gave us an interface much more like what we are accustomed to in this era.

Vi is a modal text editor which means that depending on what editing mode one is in at any given time what each key does changes. Vi has thankfully only two editing modes of importance command and insert. Unlike common editors such as Emacs or Kate commands are entered by shifting the entire keyboard into command mode and back into insert mode to continue inserting text. This modal concept is probably the biggest adjustment new users have to make when learning Vi. Some notable influences on the Vi command set was the ADM3A terminal which had the Esc and left Control keys where the Tab and Capslock keys are on modern US_QWERTY keyboards. There was also arrows on the H, J, K, and L keys which intern became the Vi movement keys.

Picture of ADM3A Keyboard

Which Vi is my Vi ?
There have been many vi implementations and clones through the years and on many systems but you can always count on an Unix to have a Vi. By high decree of the POSIX (Portable Operating System Interface for uniX). It would be best that before you try to start learning how to use Vi you learn what type of Vi editor you have. Many GNU/Linux systems will use a Vi clone in place of Vi while BSD Unix’s use nvi. This how to should be relivent to every Vi/Vi Clone but most Vi Clones have a lot more to offer then Vi does.

Vi is the classic BSD
implementation now free and open source under a BSD style license.

Nvi is a re-implementation of Vi used for the 4BSD release when the original Vi was considered encumbered code. This is what is like wise used on Free, Net, Open, PC, and Desktop BSD and the focus of this how to.

Elvis is a Vi clone that adds a number of features and commands. Elvis functions on Unix, Dos, NT, and OS/2 systems both as a console and graphical application. It is standard issue on Slackware Linux for the systems vi program.

Vim or Vi IMproved is a Vi clone that implements many additional features and options. It’s known to run on many platforms including Amiga, GNU/Linux, Mac OS X, Windows, OpenVMS, OS/2, and Unix like systems. Vim supports several graphical user interfaces including Motif, GTK1, GTK2, and Athena versions. It is also what this post was written with.

Vile was initially derived from an early version of Microemacs in an attempt to bring the “modern” benefits of the Emacs multi-window/multi-buffer editing paradigm to users more comfortable with the vi command-set. Vile functions on DOS, Windows, OS/2, GNU/Linux, Mac OS X, and Unix like systems.

Viper-mode of the popular Emacs editor tries to emulate many common vi commands and may prove interesting to emacs users and humorous.

It does not matter what Editor one uses as long as one is happy, productive, and effective but I would recommend using a Vi Clone with good documentation. So know any good jokes about Vims 25,000,000,000 page manual ? Hehehe.

You may invoke the vi editor from a console window by typing “vi”, if your using another type of editor or “vi clone” please consult it’s documentation.

Initial Fear
The traditional vi runs in a command window which is enough to scare off many new users. While newer Vi Clones such as Vim and Elvis have graphical user interfaces that can run with such luxurious features as tool bars and menus it is important to know that the editors are still available in the command line environments without loss of functionality.

One of the most confusing things to scare you about learning Vi is the concept of editing modes. Most users are used to an editor that starts with and is always in “insert-mode” that is you type on the keyboard it and writes text to the screen. Vi by default starts in a command mode where the keys are used to issue editing commands such as delete, replace, yank (copy), paste, cut and movement keys and such. When one wants to start writing text they have to enter insert mode. Once you get sed to this idea you will start to grasp Vi much better. When you are working in insert mode Vi will behave in a similar manor to what most users expect a few differences aside (like the Esc key and copy/paste commands). To indirectly quote a man named Jon Lasser about vi editing modes.

When you move your (mouse) pointer out of the screen area, you can’t type in text. You have, in effect, moved from insert mode to command mode. “It’s the same thing,”

Most implementations of Vi including nvi should be able to make use of ones cursor (arrow) keys and the insert/home/pgup/del/home/pgdwn clusters we take for granted but using the arrow keys are less effective then using command mode & the classic movement keys. I’d say you should try to use the cursor keys for simple movement at first because they work in any mode and are less foreign. When some day you find yourself without working cursor keys you will be bloody
happy you learned to use H,J,K,L instead of LEFT, UP, DOWN, RIGHT. Trust me it can happen, I once had a very bad system boot the kind your usually lucky to be able to fix without a rescue disk kind. I had to edit a file and my choices of editors were rather limited (ed, ex, vi, ee). When I ran vi it could not use my cursor keys forcing me to use the H,J,K,L cluster in it’s place. Never before was I so glad to know two ways of doing the same thing in a text editor !

Learning Vi

I will split this section into several groups of commands. When I first tried to learn Vi(m) I didn’t like it because I could not figure it out at the time. After a while on the FreeBSD command line I learned how to use it. In the process I also learned the easiest way to learn how to use Vi, aside from using Vim instead (:help) was to learn things in small pieces. It won’t do you any good to try and learn Vi all at once but if your able to just sit down and inhale it I’ll probably edit in a cheat sheet or a link to one at the end of this how-to.

Required Commands

So named because these are what I feel are the fewest commands one needs to know in order to use Vi. Maybe not use it well but use it as well as Notepad is a good editor. While we are on the subject of Notepad. Just to say it, notepad is a good editor for several reasons:

It is on nearly any Windows system, it’s very simple and light weight.

You don’t need a Ph.D to use it.

It’s also very week and very basic.

Vi like many Vi users prefer Speed, Power, and Efficiency over a small inertial learning curve. Many people say Vi is not intuitive to learn but I must disagree it is only a matter of adopting ones mind to shifting between insert and command modes. The more one learns with Vi the more productive they will be but no one need learn every thing on day one !

These are the core super simple commands you have to know to use Vi like most editors.

Key         Action

h Move left one character - the left arrow does this as well
j Move down one line - the down arrow does the same thing
k Move up one line - the up arrow does this too!
l Move right one character - Right arrow yet again.
Esc Enter Command Mode /or cancel commands
i Enter insert mode - the Insert key will also work
x Delete the character under the cursor - just like the Delete key.
ZZ Save file and quit Vi

To tell the truth compared to using Notepad you only learned 3 commands. Esc, i, and ZZ or enter command mode, enter insert mode, and write file and get me out of this crazy editor!

The h, j, k, l, and x keys are analogous to the arrow keys and the insert and delete keys on your keyboard. The only difference is these keys work when nothing else does. Some terminals don’t support luxuries well such as home and end keys so when working on a machine from a remote session or laptop these can be your best friends. You should be able to live with having to press ESC to use commands and go to insert mode to input text.

Helpful Commands

These are more keys and commands that are not necessary to edit a file but do make live a lot easier especially if you often find your self editing text not just creating it. If you have some experience with some thing called regular expressions a few of these might even seem familiar to you.

Key         Action

: Enter "ex" like commands in a "command line" mode
:w Write changes to file
:q Quit Vi
:e file Open file for editing

/word Find "word" much like Control+F in many other editors
n Go to next occurrence of the search term below the current
N Go to next occurance of the search term above the current one

a Enter insert mode right of the cursor
A Enter insert mode at the end of line
o Insert line below cursor
O Insert line above cursor
w Move forward one word
b Retreat one word
$ Move cursor to the end of the line
^ Move the cursor to the start of the line
Control+u Page up half a screen
Control+d Page down half a screen

u Undo previous command(s) - some Vi clones have unlimited undo/redo
Control+r Redo the undone command(s) - same as above ^

r Replace one char and return to command mode
R Enter Replace mode - works like pressing insert in most editors
c Change, takes an operator like d. example: cw=changes a word
d Delete using a following movement command (see below)
dd Delete entire line

None of these commands are necessary to know but they sorta make life easier. Personally I find these much easier on the wrists then Emacs which uses key combinations using the Control and Meta keys instead of a command mode.

A few words about the “:” key, it enters a little command line mode. When you press the : key in command mode it gives you a command line to type an ex (extended editor) type of command. After you have typed the command you press enter to run it and should return to normal mode. If you need to force a write or quit you can append the “!” Symbol to it. If you are a ex guru or need to enter many commands in this way you might try the “Q” command to enter Ex mode. For example the ZZ command is the same as :wg. One can mix and match actions and movements very well in Vi, for example if one wanted to delete to the end of the line you could use command mode to enter d$ and delete from the cursor to the end of the line. When one shifts between command and insert modes often in there editing style you soon find the a, A, r, o, and O keys very useful. I’ve mentioned a few other modes then command and insert but they are of little importance to you unless your into reading good ocumentation. Consult your Vi implementation for details, for users of nvi it’s nothing to fart about at this stage of learning. Many commands allow one to specify a location or a movement. This is especially true for using the commands for deletion, joining text, copy/cut/paste, and multiple editing buffers (windows) if your vi supports it.

You might want to get used to using most of these commands or at least the concepts be fore we try to tackle such tasks as more advanced delete or copy/paste commands. A coffee break about now is a very good idea.

A few extra commands

These are other commands useful to users but I broke them off from the above list to ease session based learning.

Key         Action

:!cmd Execute shell command cmd.
:command! Force command to run, such as force write-quit (:wq!)
:r!cmd Run cmd in shell and insert it's output in the file

G Go to end of buffer (the bottom of the file)
1G Go to line one in the file
nG Go to line n. So 10G means go to line 10

>> Shiftwidth text over one indentation level to the right
<< Shiftwidth text over one indentation level to the left

One cane execute commands from vi that one would usually run in a shell such as bash or cmd.exe. :!dir b “C:Program Files” would be executed just as if one ran the dir command from cmd.exe or command.com. If you want to nab the output of a command into your file use :r!command this is very good if one needs to quickly grab some data thats a fast pipe away. The G command is a go to without any arguments it goes to the bottom of the file. If one was to type a number before it it would go to that line number. The >> and << are useful for shifting text around but have likely little need for users not into programming or scripting e.t.c. So I have nothing to say about these commands. Making sense of Vi optionsOne of the worst things is that by default vi generally does not tell you what mode you are in or where the cursor is this can make life harder. Lucky for us Vi has the ability to set options. Really this belongs in a customizing vi section and I’ll probably paste it there but I think knowing some of this now will help you. You can set options thus turning them on, off, or setting a value :set option :set nooption :set option=10 If you want to see all the options available you can type :set all if you have a good Vi clone you should be able to get some documentation on what all of these do, for the sake of making Vi more friendly we will cover some good stuff here. :set showmode :set ruler ;set ignorecase These three options (in order of appearance) will make vi show you the current mode at the bottom of the screen, show you the cursors position as line,character at the bottom of the screen, and turn off case sensitivity when searching in a file. You can make a startup file that vi will read when it starts that will set options for you. Ex/Vi and Nex/Nvi use the /etc/exrc and ~/.exrc files but depending on your implementation it may be different such as Vim or Elvis. I don’t have much experience with Elvis but for Vim it reads the .vimrc file(s). You can turn these off pretty easy like so :set noshowmode :set noruler :set noignorecase If you want to make a .exrc file for your self you can store commands in it that are what you would type after hitting : so a .exrc file enabling showmode would look like this: set showmode and saved as ~/.exrc if you want to leave a comment in the file preside it with a single ” quote. The ” Comment marks that entire line after the ” character not to be read when starting up. A few options that may interest you are autoindent, tabstop, shiftwidth, wrapmargin, and warplen. By default when one tries to type past the end of the screen it rolls to the line below on screen but is treated as one long line. One can try and make this more like most editors word wrapping with some play time. I will only discuss the autoindent option since it is some thing you will ether long for or hate if you use vi for editing code, scripts, web sites e.t.c. When one sets autoindent on vi starts a new line with the same indentation as the last. The word indentation is a little odd in my opinion if your not a programmer so I’ll give a short example of how it goes.

if i is-greater-then 0
do this code
and this code
else
do this instead
endif

If typing that with autoindent on pressing return after typing “do this code” would automatically indent the next line to the same level. You can press Control+D to kill the autoindent such as if you wanted to place the “else” in our pseudo code at the same level as the “if” and “endif”. Deletion WarsIf you remember awhile ago when we both were still sane. I mumbled about being able to combine a command and a movement. This is pretty much true with most movement, deletion, and “visual” commands (visual as in cut, copy, paste). x deletes the letter under the cursor but what if we want to delete some thing else? We can use the d key along with a movement specifier if you recall the movement keys h, j, k, l, $, ^ we can combine them all with d to make it mean delete this way. So d^ really means delete to-start-of-line. This makes for very versatile work and it’s not just limited to deletion. Much like we can use a number and G to go to a line like 275G to go to the 275th line of a file. Nvi users will especially need to know this for dealing with copy/paste as it lacks a Visual mode that makes it more like other editors. A very fast way to delete an entire line is the dd command or deadly delete 🙂 You can prefix a number of lines to a command as well, so for example 10dd will delete the current line and the next ten for you. Unlike most editors Vi does not really know you have a mouse, although Vi Clones should if they have a GUI. Some like Elvis and Vim have a “visual” mode that can highlight text using movement keys and then delete it or do the cut, copy, and paste antics with it.

Key         Action

y Yank (copy) - selects text in a similar manner to the d command
yy Yank line - selects text in a similar manner to the dd command
yyp Duplicate line - copy/paste current line on the line below.
p Put (paste) text
v Enter visual mode - for some Vi Clones

One should really know both ways if possible. Personally I prefer visual mode, it’s more like what we are all used to. That is you select (aka highlight) text then do with it what you want, such as copy or delete. With classic Vi as included in FreeBSD at least one will get an error. If one wanted to copy the current line and the next tree. You would type 3y in command mode. Go to where you want to paste it and press p key in command mode. This is more or less how it works in traditional Vi. This is how it can also be done in a Vi clone like Vim. You can enter visual mode (v key). Once you do that the editor starts treating the cursor movements just like when you old the left mouse button and start dragging the pointer around. Only it works without a mouse ! Once you’ve high lighted some text you can act on it.So for example if you pressed “vwwd” you would have just deleted from the current cursor position to the next two words. You can use the “c” command to “cut” in visual mode. I have not tried elvis much but it should be similar to vim. Search and Replace If you are familiar with regular expressions, sed, awk, ed, or ex you should be at home right here. The search & replace takes syntax like this ‘n,m s/find expression/change expression/cmd’. So if I wanted to change every occurrence of ‘vi’ to ’emacs’ in this file I could do this. :1,$s/vi/emacs rules/g That is from line 1 to end of lines search for the string vi and replace it with emacs globally. If I only wanted to change it for n through m lines I could have tried some thing like this :260,285s/emacs/vi/g Regular expressions are similar to the wild cards used by the shell but they are different. Same concept (imho) but different syntax. Much like C and C++ maybe. A detailed Analise of regular expressions would be out side the scope of this how-to and totally irregular 🙂 I suggest the following links for more info about regex (regular expressions) http://en.wikipedia.org/wiki/Regex http://www.regular-expressions.info/ Back in the days before operating systems when software ran on the bare hardware. Stuff like this “regular expression” mumbo-jumbo was a thing just for the uber-nerdy scientist but now it’s in the power of your editor. It should also be worth learning how to use regex. As it is a common syntax with many uses. The better you know regular expressions the better you will be able to use tools like sed, grep, awk, find, perl, ex, and many more. Options and Configuration We touched on this back in section 4.4.Making Sense of Vi options but will go over a few things again. Saves your scroll bars eh? 🙂 Vi has a number of options that adjust the way it behaves, here is screen dump of the default setup of nvi. As used on FreeBSD 6.1-Release.

~
+=+=+=+=+=+=+=+
noaltwerase noextended matchtime=7 report=5 term="xterm"
noautoindent filec="" mesg noruler noterse
autoprint flash nomodeline scroll=12 notildeop
noautowrite nogtagsmode noprint="" nosearchincr timeout
backup="" hardtabs=0 nonumber nosecure nottywerase
nobeautify noiclower nooctal shiftwidth=8 noverbose
cdpath=":" noignorecase open noshowmatch warn
cedit="" keytime=6 optimize noshowmode window=24
columns=85 noleftright path="" sidescroll=16 nowindowname
nocomment lines=25 print="" noslowopen wraplen=0
noedcompatible nolisp prompt nosourceany wrapmargin=0
escapetime=6 nolist noreadonly tabstop=8 wrapscan
noerrorbells lock noredraw taglength=0 nowriteany
noexrc magic remap tags="tags"
directory="/tmp/"
msgcat="/usr/share/vi/catalog/"
paragraphs="IPLPPPQPP LIpplpipbp"
recdir="/var/tmp/vi.recover"
sections="NHSHH HUnhsh"
shell="/usr/local/bin/ksh93"
shellmeta="~{[*?$`'""
Press any key to continue [: to enter more ex commands]:

You can get a screen like this by using the :set all command. Every option or “variable” can be turned off by appending ‘no’ to the command. So if we wanted to turn on autoindent we would :set autoindent We could also have used the short form and typed :set ai but that makes it harder to read. Why this matters I’ll tell you in a sec 😛 To turn it off we would then type this. :set noautoindent Some options take a numeric value and are set like this :set shiftwidth=4 I’ll try to quickly document each of these options the best I can ones of value. So you can choose what you prefer. I’d suggest if you want to modify Vi’s behavior to test a few options to see how you like the changes. If I have no information about the option, it is not listed. Option: autoindent Short form: ai Value: on/off Default: noautoindent Description: When turned on ‘ai’ will automatically start the new line to at the same depth as the previous line when breaking lines (i.e. pressing enter). The value of the ‘shiftwidth’ variable is used when inserting tabs. When your done you can undo the autoindent by pressed the control+d. I’ve yet to figure out if it is a bug or a configuration error but if tabstop and shiftwidth have different values. Control+d will not un-indent the line correctly if sw and ts are not equal. Line one line two Autoindented Cntrl+D Option: autoprint Short Form: ap Value: on/off Default: noautoprint Description: I don’t see any effects but my reference says ‘Display changes after each command.’ Option: autowrite Short Form: aw Value: on/off Default: off Description: Automatically write changes to file after certain events. Option beautify Short Form: bf Value: on/off Default: off Description: Ignore all control characters during input (except tab, newline, formfeed). Pressing control+letter in insert mode when no command exists will result in text like this by default. How to delete a tpyo�� No I’m not trying to insult emacs users, I would probably use M-B M-D to fix such a typo when using Evil Macs. Option: columns Shot Form: col Value: numeric Default: varies Description: The number of columns to use for the text area. Example, how to set vi to 85 columns wide. :set columns=85 Option: edcompatible Short Form: ed Value: on/off Default: off Description: Use ed-like features on substitute, probably more useful for Bill Joy then you or me. Option: errorbells Short Form: eb Value: on/off Default: on Description: Sound the system bell when you make a booboo. Option: exrc Short Form: ex Value: on/of Default: off Description: Vi can read an exrc file that will run a set of commands at startup. Basically a configuration file for setting your options (see next chapter). Option: hardtabs= Short Form: ht= Value: numeric Default: 8 Description: Set boundary for hardware tabs, may be useful for a Teletype. Option: ignorecase Short Form: ic Value: on/off Default: off Description: Ignore case in regex expressions. Option: lisp Short Form: ? Value: on/off Default: off Description: Turn on lisp mode, I think it aids the formating of old lisp code. Option: list Short Form: ? Value: on/off Default: off Description: Display all tabs, end of lines. Turn this on for fun 🙂 Option: magic Short Form: ? Value: on/off Default: on Description: Enable more regex expressions Option: mesg Short Form: ? Value: on/off Default: on Description: Allows mesgs to be sent to terminal, see man mesg(1) Option: number Short Form: nu Value: on/off Default: off Description: Enables line numbering, this can help when debugging files. I usually have a mapping to enable it with the F2 key in my ~/.exrc file. Option: prompt Short Form: ? Value: on/off Default: on Description: Enalbes the ‘:’ prompt, if you disable this you can make ex behave more like ed. You probably don’t want this. Option: readonly Short Form: ro Value: on/off Default: off Description: Prevents you from writing the file unless you override it like so. :w! Option: redraw Short Form: ? Value: on/off Default: off Description: Redraw screen when edits are made, probably works like the Control+L command (refreshes screen). Option: report= Short Form: ? Value: numeric Default: =5 Description: Report changes if they effect more lines then report=n. Such as when using the delete/yank/join commands e.t.c. Option: shiftwidth= Short Form: sw= Value: numeric Default: 8 Description: How many characters to use when shifting width with the >> and << commands e.t.c. If you plan to use autoindent, the value of sw and ts should be the same (see below). Option: showmatch Short Form: sm Value: on/off Default: off Description: The cursor will flash and move to the openning {, }, (, ), [, or ] when typing a closing one on screen. Option: showmode Short Form: ? Value: on/off Default: off Description: Shows which mode you are in such as command, insert, append, or replace. This is so useful its a perfect choice for the beginners exrc file. Option: tabstop= Short Form: ts= Value: numeric Default: 8 Description: How many characters to display a 'tab' as, mostly of use for programmers. Common choices are 2, 4, 6, 8, 10, 12. It has been suggested that one should not change this setting but instead adjust the shiftwidth setting. I can only say from personal experience if you change tabstop but forget to change shiftwidth to the same. Auto-indent will be a bit off :-) Option: wrapmargin= Short Form: wm= Value: numeric Default: 0 Description: Set the right margin. Setting a value greater than 0 will word wrap n spaces from the edge of the screen. So :set wm=5 would make the display wrap lines when ever it hit the 5th to last line of the terminal. Option: wrapscan Short Form: ws Value: on/off Default: on Description: Searches wrap around end of file How to make a exrc fileThe exrc file is very simple. Commands are read from the ~/.exrc file just as they are from the ‘:’ command line in Vi. Placing this line in your exrc file set autoindent Is the same as tying :set autoindent in command mode. You can use the double qoute or ” character to comment a line. ” This line is not read by Vi set tabstop=6 Here is an example of what my ~/.exrc file might look like with extra comments.

" Tell me what mode I'm in between coffee breaks
set showmode
" Press F2 to turn on line numbering, make the ^M with ctrl+v ctrl+m
map :set number
" Alias ';' to :
map ; :

UNDER CONSTRUCTION

__            ___      ___  
| | / / / /
| || / / / /__/ /
| || / / / __/
| || / / / ___
| || / / / / /
| || / / / / / /
| || / / / / / /
| || / / / / / /
| || / / / / / /
| ||/ / / / / /
| |/ / / / / /
| / / / / /
| / / / / /
| / / / / /
|__/ / /__/ /
__/ __/

PC-BSD Users Review

Well, I thought it was about time I got around to doing this properly.

I’ve been using PC-BSD for approx. 10 Months so I’ve had enough time to see what life throws at me with it. My first install was 1.0 Release Candidate (RC) 1 and I currently run PC-BSD 1.2 (the current release) on my laptop and have a beta version of 1.3 installed on my desktop for testing. This will cover PC-BSD 1.2 and PC-BSD in general.

PC-BSD is primarily for desktops but makes a darn good laptop/workstation system. I won’t cover installation details as this is changing in future versions and often reviewed. My reviews sole interest is in a End User perspective (imho).

The Desktop. Well the default desktop on PC-BSD is pretty simple, it uses a program called “KDE” to put it simply to offer use a sweet system. The prepared setup is what most users should feel comfortable with, bottom bar with a applications menu and a few icons (personal files and web browser/file manager IIRC). A system tray and a clock, task bar in the bottom bar showing all running windows e.t.c. Trashcan and a few Icons on the desktop with (currently) a nice blue PC-BSD wall paper, in the old days there was a yellow field of flowers on a mountain top. For stuff a new user might not be familiar with let me explain some stuff. We have a simple applications or “K-Menu” that you click on the icon (the red one, bottom left corner.) and it presents the usual. Neatly grouped into catagories such as Games, Internet, Multimedia e.t.c This is a lot more logical then a certain other OS which tries to hide and poorly sort it’s start menu by default 😛

You should probably have a “House” like icon, clicking this opens Konqueror in file manager mode to your home directory. A home directory is a users personal space, by default you have folders such as Documents, Images, Music, e.t.c. You should have another icon next to this that when clicked should open Konqueror ether as a File Manager or a Web browser (it does both). You can think of Konqueror as the Windows/Internet Explorer and Finder/Safari of PC-BSD. It’s got a Mozilla Firefox feel to its web browsing but is not a Mozilla. Useful options for it include tabbed browsing (soon to hit Internet Explorer via Suggested Updates), spell checking, downloader, password/form manager, Google tool bar and quick Wikipedia lookups and more. In your system tray you should see a number of little icons. A clip board named “Klipper” that helps with cut, copy, and paste operations. You can cut (control+x), copy (control+c), and paste (control+v) like normal and you can highlight text with your mouse and press in the mouse wheel (button 3) to paste it without using your usual CC&P stuff -> And keep two things copied ! If you ever want to recall some thing you copied you can click on klipper and find it to use again quickly. It can also be cleared for privacy needs.

You will have a network applet giving status of your internet connection, you can open it give it the admin password and toy with your network settings if needed. The tool is borrowed from DesktopBSD and supports WEP crypto for Wifi users. (PC-BSD supports real crypto but not in the DBSD gui). Laptop users are least, a battery monitor, KOrganizer a nice Organizer program and possibly a volume control. A number of programs can be made to use or not use the system tray, so with things like Kopete (instant messenger) you can choose if you want a system tray icon or not. You might notice a little set of boxes around ether side of the panel. This is called a “Pager”, how it works is simple. If you open konqueror it is on the current “Virtual Desktop”, you click one of the boxes and your on another “Virtual Desktop”, you can open KMail and check your mail then click the first box again and go back to konqueror. Completely different sets of windows on different work spaces. For new computer users this is not some thing you need to care about but for “Multi-taskers” it rocks and rolls. Theres also some eye-candy replacements for the pager you can install. (I recommend kompose).

Configuring your desktop is pretty easy, right click on the desktop and click configure desktop. It’ll open a nice window to setup options such as: Desktop background (Wallpaper), which can be set to a different one for each virtual desktop. A number of expected options are available including the option of making your wallpaper change over time automatically (Slide show). On the behavior tab you can change how the desktop works. Things like what the mouse buttons do, device icons e.t.c. On the Multiple Desktops tab you can specify the number and names of the Virtual Desktops you want. I’ll have 2 to 4 depending on wall paper moods. Currently I run 3 Virtual Desktops. On the Screen saver tab you can set your screen saver and it’s settings. Clicking the Display tab lets you adjust your screen resolution, refresh rate, and monitor power saving scheme. Usually you should have 800×600 or 1024×768, on the PC-BSD beta I got about 1280×1024 out of the box. If you can’t select the res you want you will need to edit a settings file with the details of your monitor. (You can try to have it do auto-detection). You can click on the bottom bar or “Panel” to configure it as well as add extra “applets”, icons, more panels, external task bars, a kasbar (which would be more familiar to Windowmaker users) and all kinds of stuff – as well as configure your panel. I usually run my panel(s) transparent. Currently I have 3, a really small one lower left-hand for the K-Menu, a Konqueror profiles applet, and Seamonkey. One lower right hand for a system tray and one up top that is a “External task bar” that I have set to auto hide it self. By default you just get one panel across the bottom of the screen. If you click the little arrow on the edge you can hide/unhide it all together.

A lot more settings can be tuned from the control center under the K-Menu or there applets listed in the K-Menu under “Settings” including user management.

Ok lets talk turkey, uh software. What can we do out of the box with PC-BSD? Well lets have a look see. We have a number of games listed in Games-> Arcade, Board Games, Card Games, Tactics & Strategy, and one under Kids in the K-Menus games folder. Good fun for wasting time, I’ll let you decide what to play. My only complaint is no Chess or Centipede included out of the box :@ But for solitaire lovers there is kpatience which is like 20 different solitaire games in one, found in Games->Card Games on the K-Menu.

If you need some graphical software we can use Kolour Paint for simple art, KSnapshot for taking a screen shot of the desktop. As well as a bunch of image/file viewers including decent software for viewing .pdf and .ps files. I suggest Inkscape or Gimp for real work, see www.pbidir.com or ports.

For the Internet lover in all of us we have a lot of software. We have Akregator a RSS/Atom news reader – I like it and it exports/imports to OPML and XML. KGet download manager, a nice app if you need it which also has konqueror and system tray embedding options. KMail the default E-Mail client. It’s nothing special but it does have Pretty Good Privacy (Crypto) support built in afaik. Works ok but I prefer Seamonkies mail&newsgroups. It has import for *Mozilla/Netscape, Outlook Express, Evolution mailboxes and more. KNetAttach a Wizard for network resources. KNode a rock’n News reader (USENET or NNTP Newsgroup). I like it very much although I’ve yet to be able to find a decent news server. KPPP a GUI for dealing with Dial up. Best forget Dial up in this age IMHO but if it’s all you got… Ksirc a very simple, user friendly if not feature full IRC (Internet Relay Chat) Client. Konqueror a web browser and file manager with good standards compliance. Safari or Firefox users should feel homey with it (layout and UI respectively). Kopete a Instant Messaging Client that supports MSN, AIM, Gadu-Gadu, Novell Groupwise, ICQ, IRC, Jabber, SMS, Yahoo, and it’s own prototype protocol out of the box. You can be logged into multiple networks at once in one buddy window. I don’t care to much for the client, it feels more like traditional MSN/AOL/IMs in general. – I like Gaim which is like the new AOL AIM client but without the adds or bloat. Kopete is great for Joe user though. A few MSN clones are available on www.pbidir.com as of this writing called. One called aMSN is made to make MSN users feel at home in many ways. You also have Remote Desktop connection and sharing. You can even connect via VNC and RDP. On Windows XP Pro you can use RDP for desktop sharing but on Home and older systems you basically can only connect not share I think. KDE has two programs one to share one to connect. The X Windows System offers a limited form of this as well using it’s own technology.

For Multimedia work we have a few nice apps. Since various countries have laws and such you may as well go to www.pbidir.com, run a search for codecs & download the “Essential Codecs PBI” so you can watch encrypted DVDs and play MP3/WMV/WMA files and the like. We have KAduioCreator for CD Ripping. You will need to setup the encoders. I’ve never used it as I don’t really buy or download music often but you can setup most you will need. You have OggEnc (.ogg files), Lame (.mp3 files), and FLAC (.flac files). KMix for adjusting sound settings. KRec a recording tool, Kaffeine the standard media player. I personally find kaffeine a bit jumpy but in PC-BSD 1.3 it’s looking at better stability as it’s been upgraded but still not perfect. You can play DVD, .avi, .mkv, .wma,.wmv, .wav, .ogg, .flac, .mpg, .m4a, allot of stuff basically if you install the Codecs PBI. I personally prefer Amarok for music and MPlayer for video. You have KsCD a Analog CD Player – if you can’t use this it’s because your computer does not have the cable between CD-ROM and Sound card for analog playback, use kaffine instead. I think KsCD will be dropped soon ! Theres a few more stuff here but it’s not important. There is also MPlayer for the advanced Move Player in all of us. The new All Codecs PBI works with MPlayer unlike the Essential Codecs PBI and should be able to replace Essential Codecs. If you uninstall the Essential Codecs you’ll have to change settings in Kaffeine to play *WMV files. In 1.2 MPlayer was poorly compiled and doesn’t have GUI support but in the 1.3Beta it’s done right (includes gui support). I recommend the Amarok and VLC PBIs as well as the codecs:)

For Office users we have basically a few good apps including Kontact which combines a number of programs into a single personal information manager. From it you can use the supplied E-Mail, Notes, Newsgroups reader, RSS/Atom news reader, To-Do Lists, Organizer, Alarm clock, Address book, and theres even a few tools for Palm pilot people, I don’t own a PDA that advanced so I can’t help you there brother. If you want some solid office work go to www.pbidir.com and look in the office category. You can find word processors, spread sheets e.t.c. There is also the OpenOffice.org and KOffice office suites that each give you a full featured office suite. I love MS Word as much as the next person but I prefer OpenOffice to the other options. Especially since Open and K Office are Free and Open Source where most Office suites are closed source and cost ALOT. OO.o gives a word proc, spread sheet, database, image, formulas, and presentation program at least. KOffice gives you the mother load.

A number of basic utils are around including. KSysGuard a task manager, KInfoCenter a detailed system information tool, KNotes sticky notes for your desktop (I love this app), KJots out liner, KCron task scheduler, Disk Usage, Floppy formatter, and a removable media util. USB, CD/DVD disks should auto-mount with a pop-up asking what to do (usually).

We have a bunch of accessibility tools which I hope will be expanded in future releases. For utils and candy – We’ve got KCalc the most important item (a calculator), SuperKaramba desktop widgets which might be familer to Mac OS X users more so. You can have little applets on your desktop like system monitors or Media player controls e.t.c. You’ve got KPGP a crypto tool and shedder (hoozah), Groupware Wizard, Alarm program, news ticker and a few other apps. Theres an Archiving tool named “ark” that will handle compressed archives. It can handle Gzip, BZip2, Zip, Tar, LHA, LZopped, BZip, Debian pkg, AR Archive (.a), and with support tools added via PBI or ports 7z and RAR files, Users of OLD versions of PC-BSD had to install support for .ZIP but now it’s included. You’ll still need 7Zip and RAR from www.pbidir.com though 😀

Most people should be familiar with .Zip no matter what OS your used to. I reccomend using GZip which gives .tgz or .tar.tgz files depending on how you use it. For when your making a compressed file on PC-BSD. Use the .zip for sharing with Windows users. Bzip2 (.bz2, .tar.bz2) or 7Zip (.7z) is nice if you need smaller files too. Unix likes are a bit different about this then just Zipp’ing it and that warrants an article on it’s own. I just suggest Zip and GZip formats depending on your needs.

For the most important programs we have the Text Editors. KEdit, KWrite, and Kate. KEdit is a very simple editor, think of it like Notepad. It’s ok for quick edits and supports some basic key combos. KWrite is a more powerful editor and what I recommend. It has syntax highlighting which makes life easier when you edit a config file or if your writing HTML or a script e.t.c. I think you can also do spell checking IIRC. My favorite is Kate, you could say it’s the Midnight Commander of editors. It has a small file browser, terminal, and embedded KWrite editor in one window. It’s very good for writing console software and it’s geared towards programmers. It uses KWrite for editing afaik but with more just for programming 🙂

Kate is very nice and is more configurable then KWrite or KEdit. Also last but not least you have the humble “Konsole” a Terminal Emulator like cmd.exe or XTerm. It’s very nice and supports tabs, my favorite way to use the command line. CLI Warriors and GNU/Linux/BSD/Unix avids will find a Bourne style shell as sh, the Tenix C-Shell (tcsh), and he Bourne Again Shell (bash) installed. The “sh” is based on ash not linked to bash so be careful when scripting.

I find that PC-BSD is very configurable and allots me a lot of freedom without me having to break it’s arm. A lot of the software is Free and Open Source (two different things). Theres a few commercial apps that come as PBI as well. Underneath PC-BSD you have a full FreeBSD 6.1-Release (as of this writing) system. You can do every thing with it you can on PC-BSD but keep aware that PC-BSD add ins are centered around KDE/QT. So if your heart is set on running GNOME your likely to run into problems here and there. In my humble opinion the weakest point for PC-BSD is multimedia. Generally you can play any thing but some times it can be a little bit of a hassle if you don’t like Kaffine and Realplayer (see www.pbidir.com or ports). The biggest issue is that it’s currently limited to flashplayer7 which only works in Konqueror. For some reason it crashes all other browsers. Some people have had better luck using ports but I don’t like flash content very much so I have not toyed with it. As GNU/Linux gets flashplayer9 support so will we soon. After all you can run GNU/Linux binaries on *BSD hehehehehehe.

I’ve found you oh most never need to use the command line but it does make life easier. It’s so much more powerful then DOS based stuff it rocks. Usually you can do a lot of “hand tweaking” by editing files, this is also how a lot of special operating system oriented changes are done (system admin stuff). Yet most programs you can modify it by text files as well if you wish. Some times you can access settings not tunable from the GUI 🙂

There is full access to PBI, FreeBSD ports, packages, and even GNU/Linux RPMs via a Linux Compatibility loader but that means dealing with GNU/Linux Redheaded Pest Management (RPM) or installing other GNU/Linux packmans by hand. You will find approx 16,000 programs available for PC-BSD right now and many GNU/Linux applications. The stock of PBI are picking up as well but still are very few in comparison.

What about security? Well we have 3 professional grade firewalls included, they are a little bit involved to setup but heck if it’s good enough for Yahoo’s security it should be ok on a desktop <_> In the next release or the one after we should be getting an easy way to configure the OpenBSD firewall “pf”, the foundation of which I feel has been laid in the 1.3 Beta1 installers advanced mode.

The system follows the old school approach to user security. The core concepts dates back to like MULTICS in the late 1960s for Multi-User systems – they still are as useful today as they where then. By multi-user I mean any computer used by more then one person. If your the only user of it, user management is only as much concern as what you have on the system. You see back in the days when a Computer cost so much no one could own one. You had to be like a University or IBM to have one. So time was very valuable and one computer had to serve many users. Once a true “Multi-User” oriented systems came about instead of the limit of one user at a time, computers could have many users using them at once. PC-BSD supports this as well in modern style. You could actually have 10 people working via a Remote Desktop or Secure Shell (or both) setup on 1 box + some one sitting on it while the others are logged in via the network. To be honest outside of business use, all this matters to use is the concepts that makes the system inherently more secure by default practice.

Every person has a user “account” to log on with, preferably with a password. You can use a blank password but it defeats the purpose of security -> Any one can then use the account. The account should consist of your login name and password. Your first name or your initials are good choices for a account name. Passwords should be 6 to 10 characters and contain more then numbers or letters. Because of internationalization you can only use letters and numbers in the installer but you can change it to any thing you want after boot up. Ever user has a group, a group is like a department. At a small business you might groups like accounting, clerks, billing, e.t.c. Every file is owned by both a user and a group and has certain permissions for three kinds of users. Permissions for the owning user, the owning group, and permissions for every body else. You can be a member of any number of groups. Permissions are for Read, Write, and Execute. So you can control who can do what with your files. A good example:

User           Group
Joe Joe
Jane Jane
Tim Tim, Joe

If Joe wants Tim to be able to edit one of his documents he can set the file permissions to allow members of his group Read and Write access. So if the file “Tax Returns.doc” was owned by Joe of group Joe. With permissions Read&Write for Joe User, and Read&Write for Joe Group, and Read Only for every body else. Tim could edit the file because he is a member of Joes group. Thats the basic thing about it, it’s really very easy to set up such things if you own the file. PC-BSD uses FreeBSD underneath so you have support for Mandatory Access Controls if you want to set those up.

Every user account has it’s own folder called a “Home Directory” for there personal files, for the most part you can’t delete or edit any thing outside this directory from your user account. So no worries about some one trying to delete part of the Operating System or installing some program globally without a heck of a good fight 😀

What if you want to do some thing like edit a configuration file? For that there is a special account called “root” or the super user account. This account is like the GOD account. As root you have unlimited power over the system – even files root does not own. This is why the root account is used for admin work, changing special settings for the OS, installing software e.t.c. You can create more if you want or make yourself a super user. It’s not worth it unless your prepared to risk screwbing up the box though. ^_^ You can switch user to root in the command line at any time if you belong to the group “wheel”. I don’t know why they call it that, you could change it if you really want as the computer only sees User ID and Group ID numbers (which you can set/change/view too). If you want to run a program as root, you can type “kdesu appname” into the run dialog (wihout quotes). Logging into the Desktop as root directly even over the network is disabled by default. You can allow this if you want to reduce security. PC-BSD is not the worlds most secure OS, OpenBSD is but it tries to make it reasonably secure for every one. You can make it as insecure as you want if that rocks you boat…

Using the “root” account directly is just like running as an Administrator on Windows XP only you never need to do so directly. When you try to reach an option menu only root can or install a PBI. The system will ask you for the root password in order to launch the program or applet. You can even have it remember the password if your lazy. For day to day work you shouldn’t need to care about this, it’s when you do some thing only the person who owns the computer should allow done or in the case of business the guy/gal who is responsible for every bodies computers at work. I use PC-BSD daily and usually don’t need to use a password after I’ve logged in unless I want to install software. It makes e feel better that malicious stuff can screw up my files easy enough if I let it but can’t delete my operating system so easy. Don’t even have to worry about your employees installing Doom behind your back if they are not admin and few have need to be. Nore do I have to put up with other people being able to edit my files out of the box unless they have my permission 😀

Pros:
It’s free
It’s Open Source under a BSD Style license
It’s a custom FreeBSD system not a Fork.
It’s Easy to use and intends to be
A lot of good software is available at no cost
Extremely limited Virus or Spy ware threats. (Currently)
Can run most GNU/Linux software (not tied into the kernel, i.e. drivers)
C/C++/Perl/Python developers should feel at home, QT/X11 Open Source Edition included.
Many languages and developer tools available.
Updates are easy (PBI) and full access to FreeBSD methods.
Solid update path between releases (no BETAs !)
It’s stable and has good reliability
Low total cost of ownership
Custom kernel builds for better Desktop use (Video support, PF, e.t.c.)
Includes a kernel build for Single Processor and SMP systems (Multi-processor and Dual Core machines).
Free Community tech support
PBI makes installing some software quick, easy, and painless
Most common desktop software needs met out of the box or with ease
Has a KDE based Desktop and Integration
A lot of information available online.
Can dual boot with many other OSes.
Java Runtime and SDK can be installed with a few mouse clicks
nVidia wants FreeBSD to have good drivers and PC-BSD makes installing them a snap.
Runs pretty well with a 500Mhz Pentium 3 and 384MB of Memory.
The FreeBSD handbook is very good for a lot of things
Can be good for Laptops/Desktops/Workstations, possibly small business file servers.

Cons:
It sucks for DirectX (Win) Gaming.
Getting a working flashplayer can be sticky (for now) this is a pro imho hehee.
May not support all hardware
Supports newer hardware slower then Linux.
Support for many popular multimedia formats require a easy install package.
Limited support for Windows software (via WINE) -> very crappy imho for any thing major
Wireless support takes some additional configuration right now, easy setup is limited to WEP – full support via conventional methods as of PC-BSDv1.2.
Professional phone support costs money.
PBI installed programs cannot interface with traditional FreeBSD ports/packages most times
Most “Special needs”, Shareware, and Mal ware softwares do not support GNU/Linux, *BSD, or Mac OS X.
Poor integration if Gnome desktop is wished (not fun to do, curse the Gnome heads for it though)
Most businesses only offer Wintel support (see below)
Uninstalling Windows or Mac OS will probably void your vendors warranty.
Included boot loader is poor for multi-hard drive setups (use GAG or GRUB)
Does not support VisualBasic or natively Microsoft/Apple extensions to languages
Don’t even think about DirectX…
Cannot run as a 64-Bit OS (but supports the 64-Bit CPUs in 32-Bit mode)
Intel graphics cards are poorly supported (but thats true any where !)
Does not support _very_ old CPU architectures(< i686). Such as AMD K6, Intel 80486, 80386, or 80286s. Needs at least 384~512MB of DDR Memory or 256+ MB of DDR2 memory to run fast enough for me. The FreeBSD handbook only covers traditional FreeBSD methods. PC-BSD website
The PBI Directory
PC-BSD Forums

More Unix basics are not within the scope of this review and are for another Blog entry.

If any one actually reads this, feel free to drop a comment or a question about PC-BSD or visit the PC-BSD support forums.

What better place to write a review of some thing then on my Blog 
^^<(^^__^^)>^^

As for parting words I’ve just got to say 🙂

We don’t have any Blue Screens of Death, we have a Blue Wallpaper !

Stable, Free, Open, Powerful, Functional, Secure, Easy, Customizable -> PC-BSD is fun muahuahuah.

Edit — as of 2008-09-09, comments have been closed. It’s been ~two years and I’m tired of managing spam-bots.

PC-BSD Quick Guide

This is the draft I sent in for the PC-BSD Quick Guides 4th chapter, I’ve replaced my HTML Comments with C Style /* Comments */

Common tasks

In this chapter we will go over a number of common tasks faced by every day users and administrators. We will discuss such matters using plain English and describe it using graphical user interfaces and the command line interfaces as well as configuration files. This will allow you to chose which method you prefer and to be more productive.

We have broken down common tasks into the following:

  • Installing applications
  • Adding new users
  • Adding custom fonts
  • Downloading system updates

Installing Applications

There are several methods of installing software on a PC-BSD system. Each method will be discribed in more detail below.

  • PBI Installer, the easy way
  • Packages, the quick FreeBSD way
  • Ports, the traditional FreeBSD way

When you install software from a PBI you will be presented with a simple graphical way to install software. Simular to many other popular operating systems you just click and go. Since PBI programs are created from traditional FreeBSD ports and packages they are fewer and less up to date then ports.

Ports and Packages are the traditional ways of installing software. You can get the most up to date software by compiling from ports. You may also quickly install allot software using packages, but not all software is available as a package or PBI.

Installing software via PBI

When you install a program through the PcBsdInstaller system it is placed with all required files in it’s own folder in /Programs and linked into the system. This is very simple and safe to the persons system as person is not changed more then necessary to allow the packages to function.

/* Update the URL if it ever changes */

To install a PBI we need to go to the PBI Directory and download a program

/* Stick screen shot(s) of PBIDir here */

Once the download is completed simply double click on the file to launch the installer. It will prompt you once for the super users password before beginning the installation process. This is to ensure you are installing the program and not any one that may have sat down at your computer. It’s both effective as a security measure and parental control.

Click next at the welcome screen, you will then be asked to read any license agreements that comes with the program you are installing. Check the I agree box and click next to continue installation. You may have the options of placing icons on your desktop and entries in the PBI Programs section of the K-Menu. Check all boxes that apply to what you wish done and click install. Once it has completed the installation click finished and tryout your program

If at a later date you wish to add an icon to your desktop for some thing you did do during a PBI install, or when using ports/packages you may do so by right clicking on the desktop and selecting “Create new link to application”. This will open a menu where you can set thename of the icon, it’s picture (click the cog image), click the Application tab. Here you will have to set the program you wish to create an icon for, you can also set a comment, disrisption, work path, and file types as you feel necessary. You can also install in text mode from a console by changing directory to the location of the PBI and run the following as the super user.

./PBI_File -text

Fetching packages

Packages are prepared files for installing software, they install software into the system and can cause dependancy issues. The package system is comparable to RPM, Dpkg, and Apt-Get used in several Linux Distros. Installing packages requires you to open a console with root permissions. You can type kdesu konsole in a run dialog from the K-Menu or open a konsole from the K-Menu in super user mode, or open a konsole and type su and press enter. You will be prompted for the root (super user) password, it will nto display the password on screen for security reasons. After switching to the super user account you have complete access to the system and can install software at will.

You can install a program using the package system like so:

#pkg_add -r irssi

will install the irssi program with all required files but not update the K-Menu or desktop. You can generally find the binary (executable) in /usr/local/bin, configuration files in /usr/local/share// or your home directory and the libraries (like .dll) will be placed into the system as needed and shared between applications. This is true for ports as well, the PBI system is favored by users wanting to avoid this at the minor expense of some disk space. As PBI install all files into /Programs/ but ports are kept up to date and contain many more programs.
/* Special thanks to adamant1988 on #pcbsd for coming up with the package. I don’t think a CLI IRC client is right for this but I needed a quick program thats not a PBI yet */

You can uninstall a package by using the pkg_delete command and the name and version of the package or a wild card.

pkg_delete irssi-0.8.10_2 and pkg_delete “irssi-*” are equavilent.

You can get info about an installed package the same way using the pkg_info command.

#pkg_info “irssi-*”

Installing software using ports

Traditionally BSD installs software from source, the ports collection is a easy to use system that makes this as painless as possible. You first need to install an up to date ports collection before you may use ports to install software. New users coming from Gentoo GNU/Linux will find this similar to the Emerge system which is based on FreeBSD ports.

To install the ports collection click on the K-Menu and navigate to settings, administration, PC-BSD System. Enter the super users password to access the admin panel and click on the tasks tab. Now click fetch ports and it will begin downloading the necessary files and installing them.
This will take awhile depending on your Internet connection and Processor speed.

/* picture of the tasks tab here */
/* Probably delete this part for the quick guide */

If you wish to do this from the command line open a console as the super user as described in fetching packages and run the following command

#cvsup -g -L 1 /root/ports-supfile

You can also use the portsnap method

#portsnap fetch && portsnap extract

If you install ports using portsnap you should not update the ports collection with cvsup, instead use:

#portsnap fetch && portsnap update

if you installed ports using cvsup you may update them in the same way as before:

#cvsup -g -L 1 /root/ports-supfile

You can edit the supfiles and set a download mirror closer to you, please see the FreeBSD handbook for more information on using CVSUP

Now that the ports collection is installed if you look in /usr/ports you will see a simple tree structure of folders. The structure is in the format of catagory, program name.


Adding new users

The two best ways to add a new user to your system is by using the User Manager program or the adduser script. User manager is a graphical program and easy to use with the mouse. Adduser is a very flexible command line method.

Open the K-Menu and go to settings, Security & Privacy, User Manager. Here you can add, remove, and lock users, change the super users (system) password). To add a new user you will need to have a user name and password, you may also input the full name of the user for reference.

/* Insert screen shot of user manager */

To add a new user with adduser open a konsole in super user mode and run:

adduser

Here is an example of running the adduser script, the options listed in side brackets are the default used when merely pressing enter to continue.

Dixie# adduser
Username: joe
Full name: Joe User
Uid (Leave empty for default):
Login group [joe]: wheel
Login group is wheel. Invite joe into other groups? []: operator
Login class [default]:
Shell (sh csh tcsh bash nologin) [sh]: bash
Home directory [/home/joe]:
Use password-based authentication? [yes]: yes
Use an empty password? (yes/no) [no]: no
Use a random password? (yes/no) [no]: no
Enter password:
Enter password again:
Lock out the account after creation? [no]: no
Username : joe
Password : *****
Full Name : Joe User
Uid : 1002
Class :
Groups : wheel operator
Home : /home/joe
Shell : /usr/local/bin/bash
Locked : no
OK? (yes/no):

Here we have added a new user named joe to the groups wheel and operator giving him greator access to hardware and the ability to switch user to root, that is run programs as the super user. The choice of shells include the bourne SHell, C Shell and the Bourne Again SHell. More shells can be installed using PBI, Ports, or Packages. You should only add users to the wheel or operator groups that you want to have administrator access to the machine. An example of this would be some one you would give the super user password too, is someone who should be in the wheel group. Some one who you do not want to have the ability to switch to the super user should not be in the wheel group!

. An example of this is a child you may not want to be able to modify important files should not be in the wheel group. While a spouse you wish to be able to install software should be.


Adding Custom Fonts

To install additional fonts that you have downloaded from the Internet. Open the K-Menu and go to Settings, System Administration and click Font Installer. You can install personal fonts for use with your account or you can install fonts to be used system wide. Only the super user can install system wide fonts.

/* Screen shot of font installer, admin mode */

To install a new font click add font and locate the .ttf font file you wish to add. If you click administrator mode you will be prompted for the super user or “root” password. Then you will be able to view and add system wide fonts in the same was as personal fonts. The font installer program only shows you fonts installed for yourself when not in administrator mode.


Downloading System Updates

Updating a PC-BSD system is a very simple process unlike many GNU/Linux distributions, PC-BSD is updated in a similar matter to installing software using PBI. You can check if your system is up to date by running the Online update utility.

Open the K-Menu and browse to Settings, System Administration and click Online Update. It will prompt you for the super users password before allowing you to alter the system. You will have the option of setting the system to check for updates at a specified time daily or weekly, default is not to check. However the system will always check for updates at startup and you can manually check here by clicking “Check now”. After editing any settings here be sure to click the “Save” button to save your changes. You will then be able to select, fetch, and install any updates it finds.

/* Screen shot of Online Update */

To manually download an update go to www.pcbsd.org and find the download system updates section (under the downloads menu on top of the site. As of this writing you can obtain updates from here. Download the patch for your version, such as PC-BSD 1.11a to 1.2. Once the download has finished double click on the PBI file to begin the installation, it works just like installing a PBI but simpular.

DO NOT cancel the update while a patch is running, restart the computer or other wise disrupt the update even if it appears to be stalled, an update can take time to complete. You will be notified when the update has been completed and be asked to reboot for all changes to take effect.

PC-BSD Quick Guide, draft part II

Continuing my work, I’ll get back to the installing applications part soon. I was going to include a thing about using kports but koorts from PBI is too unstable. I might append a pkg_add for portupgade and kports later I don’t know yet.

//Heres the next phase

Adding new users

The two best ways to add a new user to your system is by using the User Manager program or the adduser script. User manager is a graphical program and easy to use with the mouse. Adduser is a command line method.

Open the K-Menu and go to settings, Security & Privcary, User Manager. HEre you can add, remove, and lock users, change the super users (system) password). To add a new user you will need to have a user name and password, you may also input the full name of the user for reference.

To add a new user with adduser open a konsole in super user mode and run:

adduser

Here is an example of running the adduser script, the options listed in side brackets are the defualt used when mearly pressing enter to continue.

Username: rs
Full name: ^C
Dixie# adduser
Username: joe
Full name: Joe User
Uid (Leave empty for default):
Login group [joe]: wheel
Login group is wheel. Invite joe into other groups? []: operator
Login class [default]:
Shell (sh csh tcsh bash nologin) [sh]: bash
Home directory [/home/joe]:
Use password-based authentication? [yes]: yes
Use an empty password? (yes/no) [no]: no
Use a random password? (yes/no) [no]: no
Enter password:
Enter password again:
Lock out the account after creation? [no]: no
Username : joe
Password : *****
Full Name : Joe User
Uid : 1002
Class :
Groups : wheel operator
Home : /home/joe
Shell : /usr/local/bin/bash
Locked : no
OK? (yes/no):

Here we have added a new user named joe to the groups wheel and operator giving him greator access to hardware and the ability to switch user to root, that is run programs as the super user. The choice of shells include the bourne SHell, C Shell and the Bourne Again SHell. More shells can be installed using PBI, Ports, or Packages. You should only add users to the wheel or operator groups that you want to have administrator access to the machine. An example of this would be some one you would give the super user password too, should be in the wheel group. Some one who you do not want to have the ability to switch to the super user should not be in the wheel group!

PC-BSD Quick Guide, draft part I

Here is a draft of some thing I’ve been writing. Gotta love vim for text editing, it’s actually written in HTML so I’d get a little more used to using it. I know enough html and can look up enough to be able to get around, the only problem is any thing I cook up will have “Designed for lynx” written all over it. I don’t enjoy html enough to get fancy with it ^_^

//Start draft

Common tasks

In this chapter we will go over a number of common tasks faced by every day users and administrators. We will discuss such matters using plain english and discribe using graphical user interfaces and the command line interfaces as well as configuration files. This will allow you to chose which method you prefer and to be more productive.

We have broken down common tasks into the following:

  • Installing applications
  • Adding new users
  • Adding custom fonts
  • Downloading system updates

Installing Applications

There are several methods of installing software on a PC-BSD system. Each method will be discribed in more detail below.

  1. PBI Installer, the easy way
  2. Packages, the quick FreeBSD way
  3. Ports, the traditional FreeBSD way

When you install software from a PBI you will be presented with a simple graphical way to install software. Simular to many other popular operating systems you just click and go. Since PBI programs are created from traditional FreeBSD ports and packages they are fewer and less up to date then ports.

Ports and Packages are the traditional ways of installing software. You can get the most up to date software by compiling from ports. You may also quickly install allot software using packages, but not all software is available as a package or PBI.

Installing software via PBI

When you install a program through the PcBsdInstaller system it is placed with all required files in it’s own folder in /Programs and linked into the system. This is very simple and safe to the persons system as person is not changed more then necessary to allow the packages to function/*Footnote*/

To install a PBI we need to go to the PBI Directory and download a program

Once the download is completed simply double click on the file to launch the installer. It will prompt you once for the super users password before beginning the installation process. This is to ensure you are installing the program and not any one that may have sat down at your computer. It’s both effective as a security measure and parental control.

Click next at the welcome screen, you will then be asked to read any license agreements that comes with the program you are installing. Check the I agree box and click next to continue installation. You will now have the options of placing icons on your desktop and entries in the PBI Programs section of the K-Menu. Check all boxes that you wish done and click install. Once it has completed the installation click finshed and tryout your program

If at a later date you wish to add an icon to your desktop you may do so by right clicking on the desktop….. You can also install in text mode from a console by changing directory to the location of the PBI and run the following as the super user.
./PBI_File -text

/*Footnote*/ Some PBI do modify the base system beyond standard restrictions out of requirment. Examples of this include the Linux Compatiblity layer, Graphics and Audio drivers, e.t.c.

Fetching packages

Packages are prepaired files for installing software, they install software into the system and can cause dependancy issues. The package system is comparable to RPM, Dpkg, and Apt-Get used in several Linux Distros. Installing packages requires you to open a console with root permissions. You can type kdesu konsole in a run dialog from the K-Menu or open a konsole from the K-Menu in super user mode, or open a konsole and type su and press enter. You will be prompted for the root (super user) password, it will nto display the password on screen for security reasons. After switching to the super user account you have complete access to the system and can install software at will.

You can install a program using the package system like so:

#pkg_add -r irssi

will install the irssi with all required files. You can generally find the binary (execuitable) in /usr/local/bin, configuration files in /usr/local/share// or your home directory and the libraries (like .dll) will be placed into the system as needed. This is true for ports as well, the PBI system is favored by users wanting to avoid this at the minor expense of some disk space. As PBI install all files into /Programs/ but ports are kept up to date and contain many more programs

You can uninstall a package by using the pkg_delete command and the name and version of the package or a wild card.

pkg_delete irssi-0.8.10_2 and pkg_delete “irssi-*” are equavilent.

You can get info about an installed package the same way using the pkg_info command.

#pkg_info “irssi-*”

Installing software using ports

Traditionally BSD installs software from source, the ports collection is a easy to use system that makes this as painless as possible. You first need to install an up to date ports collection before you may use ports to install software. New users coming from Gentoo Linux will find this simular to the Emerge system based on FreeBSD ports.

To install the ports collection click on the K-Menu and navigate to settings, administration, PC-BSD System. Enter the super users password to acces the admin panel and click on the tasks tab. Now click fetch ports and it will begin downloading the necessary files and installing them.
This will take awhile depending on your internet connection and Processor speed.

If you wish to do this from the command line open a console as the super user as discribed in fetching packages and run the following command

#cvsup -g -L 1 /root/ports-supfile

You can also use the portsnap method

#portsnap fetch && portsnap extract

If you install ports using portsnap you should not update the ports collection with cvsup, instead use:

#portsnap fetch && portsnap update

if you installed ports using cvsup you may update them in the same way as before:

#cvsup -g -L 1 /root/ports-supfile

You can edit the supfiles and set a download mirror closer to you, please see the FreeBSD handbook for more information on using CVSUP

Now that the ports collection is installed if you look in /usr/ports you will see a simple tree structure of folders. The structure is in the format of catagory, program name.

//end draft

I need to start looking at KPorts and a few other things, I also have some notes in the text but Live Journal treats them as comments just liek HTML, although you don’t need any html skill at all to use LJ.