Friday, October 20, 2006

The day rolls on

Well I've finally gotton ntpd working the way I want it, I think. My laptop is showing Vectra as a peer in ntpq. As to SAL1600, windows can't nativly talk to ntpd on unix without a kick in the registry AFAIK. So instead of hacking apart my registry I've installed nettime after reading an article. It's an abandonded project but I'm lazy.

I installed nettime and set it up to start the service at boot and use my time serving machine Vectra. Since I run a firewall on Windows that is set to block any thing not matching a rule, I made one.

WARNING: low qaulity 1600x1200 Jpeg

I need to setup ntpd on Ubuntu and run a tcpdump in less I can find an equivulent for Windows XP. This fire wall rule will do for right now and I can edit it later if I find I need to.

Waiting on a full scale distclean of my ports collection on Vectra and a du after that. On the 15th Vectra dropped off the lan , was totally dead to the world in regards to the network. After work when I got back to the computer I unplugged the router for a short count of twenty sec then replugged it in. Five minutes later when I got back to my desk I powered Vectra up and she recived her DCHPOFFER from the router. Interestingly, a post I made about it on a forum I vist ocasionally the first reccomendation was what I was affriad it would be the ol'yank, wait, plug the router bit. Awhile after posting that it solved the issue the forum owner posted this:

"I should've elaborated my first answer when I said "reboot the router" unplugging it is the best way because it clears the excess voltage in its capacitors which causes invalid data in its memory therefore the router will not function properly! Good on you TerryP!"

I find this an interesting idea, I can see how excess voltage in the capacitors could be aproblem for it's memory (all 8MB of RAM and 2MB of flash memory of it). What I don't get is why it should be neccesary to flip a device on/off, why not design it to deal with it or some thing? Eh maybe I just don't know crap or it was made by a Windows fan.
I've been fooling with ntpd allot, if I'd stop editing the file maybe I could be sure of my configurations hehe. I keep the below blog entry fairly up to date.

Installed the PC-BSD 1.3BETA1 on my desktop heres a copy of the notes I wrote myself before posting on PC-BSD.

Notes:

First installer screen needs to say KDE is a DE not a WM, it will confuse people.

Installer didn't allow an option toggle autologin.

Glad to see installer says PC-BSD not FreeBSD in the ASCII art and boot menu which is also used now at boot up. < I never did a 1.2 install so I wouldn't know if this is new or not. Installer detected my SATAII (ad0) drive and some free USB ports (da0-3). Drive layout was 180GB NTFS (WinXP), 79GB Ext3 (Ubuntu), 120+GB Freespace, Extended partition /w 4 logical drives (linux swap, home, and backups) Partitions detected right, NTFS, EXT3, DOS Extended. -> Didn't detected my freespace ! Rebooted and manually fdisked me a UFS2 slice to use.

Installer doesn't make it clear in the adv. Setup if PF will (if it needs to) be configured accordingly if you choose to use NTPD.

Installer could use tooltips.

Using the quick guide pressing "Index" in pages sends you to /PCBSD/docs/guide/ on the FS not /PCBSD/docs/guide/index.html (Time for a sed script)

Icon setup is great opens the right profiles to, only the "Start" Menu should be named some thing less Windows like and more consistant with the documentation that refers to it as a "K-Menu" -> We don't need confused people saying "Whats a K-Menu" and it's probably patented by Microsoft or Apple.

The pictures in the quick guide do not match the window decore, K-Menu, or Panel of the actual system

~/looks good, although some sample images and/or a PC-BSD_theme_song.ogg would be nice as would be a Video interview with the dev's talking about the system. All in the right dirs of course.

There should be a fairly consistant (simular) rc file for each shell. (sh, csh/tcsh, bash). It should at least set the same basic env vars and the prompt.

/etc has a few .bak files and shells only shows bash by it's symlink in /bin not both /bin and /usr/local/bin.

The "Start" menu looks nice but is a bit scrungy looking, the PC-BSD side img that used to be used /was/ nice tho

nice to see GTK 1.2 and 2.8 installed along with gtkglarea and python bindings. gtk-qt-engine+ Control Center entry -> Nice !

Noticed the new style lipstik used, PCBSD style should be renamed PCBSD Classic or v1.2 or something. I like what you've done with the Crystal windecore, think I might clone it to my lappy next time I change my windecore.

I wish KDE would fix the Component Chooser. (installed version is 3.5.4)

ruby, portaudit, portupgrade are installed among the 255 pkg's (including a pair for the KDE style/windecore).

I see ispell is setup in KDE but pkg_info | grep spell only returns aspell dunno if thats right or not.

I get a default resolution of 1280x1024 just like in Ubuntu, I call it the "livable" res since I prefer 1600x1200 or larger + large fonts xD

Would be nice if NUMLOCK was turned on automaticly when booting a Desktop. It's kinda expected.

Printers section gives an error

root has a pair of msg from june and the MOTD is still FreeBSD

PCBSDv1.3 conf still references itself ontop as the GENERIC FreeBSD conf. It's set for machine i386 and cpu's 486-686.

There is no sound drivers being loaded in my loader.conf. Usually FreeBSDs OSS doesn't notice my audigy4 and I have to install the emu10kx driver. On Ubuntu ALSA can use it with the included standard driver (emu10k1 I think, or maybe emu10k3).

paths should be set to automatically have the users "Documents path" set to /usr/home/${USER}/Documents since you give them a dir for it.

There are no help items for the PC-BSD related Control Center entries. This is more a standard policy imho for PC-BSD. Want help? Get GNOME, want functionality? Get KDE !

I think the menu editor might be fixed finally !!!

Launching KDE reports it can't find the codecs or libdvdcss since they are in the Essential Codecs PBI.

It also reports "DVD Drive" Can't check DMA mode. Permission denied or no such device: "/dev/dvd"

I hope 0.8.2 fixes the stability problems in 0.8.1 (PC-BSD v1.2)

The X config file is XF86Config but we still use Xorg 6.9

Some interesting changes in /PCBSD/cardDetect which appear to come from RoFreeSBIE

__________________END___________________

Really I think they are making an improvement, I just don't care for what they have done with the K-Menu. Also for some odd reason Keramilk, crystal, and polyester window decore keeps coming back to me.

Saturday, October 14, 2006

NTPd

Well, today I noticed my windows machine was running 39 minutes past the hour, my freebsd machine 37 minutes past the hour (SAL and Vectra respectivly). I sync'd SALs clock with the defualt server and found my bsd box behind. Origenally I set the CMOS clock on Vectra to GMT time using my wristwatch, so a few min off after a month isn't bad.

I've desided to run ntpd (network time protocal daemon) on Vectra and use her to sync my other machines with. After a little researching I found out my ISP has a ntp server so I'm using that. The NTP daemon should come preinstalled on a FreeBSD box, it's also in ports if you need to update it without the whole computer. Since my ports tree is up to date and I need to update the system and ntpd takes less time to compile then FreeBSD this was my method of making sure it was up to date.

#cd /usr/ports/net/ntp && make install clean

That netted me ntp-4.2.2p3 which should be fairly current. Running portaudit tonite has showed me that python, ruby, and pgp have issues. Checking for outdated ports:

Vectra# portversion -v | grep "<"
fastest_cvsup-0.2.9_3       <  needs updating (port has 0.2.9_4)
portaudit-0.5.10            <  needs updating (port has 0.5.11)
portupgrade-2.0.1_1,1       <  needs updating (port has 2.1.3.3_1,2)
ruby-1.8.4_4,1              <  needs updating (port has 1.8.5,1)
Gotta love portupgrade giving some nice tools, gotta do some updates over the weekend of course. The NTP daemon is pretty simple, all the compucated stuff is basically done for you by the program and Network Time Protocol. We need to create a configuration file, being part of the system it's in the et cetera directory of the root file system (/etc). The only editors installed on FreeBSD I know of are ed, ee, and vi. Ed was the first unix editor I think and probably would be a good choice if your using some type of telitype terminal, for the sake of ease of use I suggest you use ee or vi. PC-BSD and DesktopBSD should include kwrite, kedit, and kate, xedit as well. I personally prefer vi as it's vim like (funny as vim is supposed to be vi like :-P ).
Vectra#vi /etc/ntp.conf
#Simple ntpd configuration for Vectra

driftfile /var/db/ntpd.drift

server ntp.bellsouth.net version 2

#Broadcast NTP signals over the LAN
restrict 192.168.1.255 mask 255.255.255.0 notrust nomodify

logfile /var/log/ntp.log
Like many config files and a fair number of scripting languages any use of "#" is a comment. To explain NTP quickly. You have a clock, like all clocks your lose accuracy as time goes on. Infact my wristwatches manual stats that it'll gain like 0.001 seconds a year. I'm not the most tech-headed person but I'd reckon a machine that's not up 24/7/365 a year is going to be less accurate them my watch. So we need to "syncronize" our watches to do that we need some thing to sync to, thats where time servers come in. A primary time server should be hooked up to a decent time source, like an atomic clock or GPS gizmo e.t.c. and filter down through things, need less to say primary/secondary time servers should be fairly accurate and NTP takes into account trying to keep it that way between systems. The configuration file specifies my ISP's time server using the syntax "server Server_To_Sync_With", you need to query at least one server, two is more reliable but you should be considerate of the server maintainers. The driftfile is used to help store information to keep accuracy of the time. The server is limited to broadcasting on the given LAN with several options (taken from the man page). notrust Treat these hosts normally in other respects, but never use them as synchronization sources nomodify Ignore all NTP mode 6 and 7 packets which attempt to modify the state of the server (i.e., run time reconfiguration). Queries which return information are permitted. We can start the daemon now using the command:
Vectra#ntpd -c /etc/ntp.conf -f /var/db/ntpd.drift
To get this setup at boot time we enable ntpd in /etc/rc.conf, edit it as root in your editor of choice. Add ntpd_enable="YES" and ntpd_falgs="-c /etc/ntp.conf -f /var/db/ntpd.drift", below is a copy of my rc.conf file including the ntpd lines.
# -- sysinstall generated deltas -- # Sat Sep  2 19:29:45 2006
# Created: Sat Sep  2 19:29:45 2006
# Enable network daemons for user convenience.
# Please make all changes to this file, not to /etc/defaults/rc.conf.
# This file now contains just the overrides from /etc/defaults/rc.conf.
hostname="Vectra"
ifconfig_xl0="DHCP"
saver="daemon"
sshd_enable="YES"
usbd_enable="YES"
update_motd="NO"

#Services

#enable CUPS
#cupsd_enable="YES"
#background_cupsd="YES"
#boot samba
#samba_enable="YES"
#enable ntpd
ntpd_program="/usr/local/bin/ntpd"
ntpd_enable="YES"
ntpd_falgs="-c /etc/ntp.conf -f /var/db/ntpd.drift"

#Security

#clear temp files
clear_tmp_enable="YES"
#Make sendmail  listin only on the local host
sendmail_enable="NO"
#Ignore ICMP redirect packets
icmp_drop_redirect="YES"

I've organized it in the form of things that came standard, services, and security for now. To sync my computers with Vectra I've to set them up to use ntpd with the FreeBSD box as the time server. If you've got to sync multiple machines you should use one as a local time server and sync the others on it rather then say ask your internet time server for the time 10 times ! Also you can use ntpdate timeserver for a one time update instead of running ntpd on the clients.

Ok, I think I've accidently not done my history test enough, time for bed I'll worry about getting windows clients syncing off it and the box updated tomorrow !!!

Saturday, October 7, 2006

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.