Evil to do lists

Front burner…

  • Do my home work (ARRGGH)
  • Shift threw the admin to do list
  • Do some home work on the admin matter I’m all ready ‘dealing with’
  • Do my moms data entry work (oh joy)
  • Work on my (software) backup plans

Back burner…

  • Finish work in the SNCO project
  • Set up Samba
  • Set up PF, the OpenBSD Packet Filter firewall
  • Finish my private reading (I love books… never get to read’em any more)

edit later as needed.

Diff and Patch

Tests have shown, that using diff to create a patch file and using the patch file to patch the origenal. Have been largly successful so long as the origenal has not been edited since the diff was made.

Notes

archive: pax -wf archive /what
append to archive: pax -waf archive /more
unpack: pax -rf archive # unpacks in current directory
list: pax -f archive | $PAGER

the -z option adds gzip compression as with tar.

Also the -i and -v options work as per convention.

exclude file with the -c ‘file’ command or only file with -n ‘file’. Like:

pax -rf archive -c ‘ignoreme’ && pax -rf archive -n ‘onlyme’

gzip -# works well for the archives, where # is 0-9 low-high compression.

Quotes

Hehe I think these rock

    * "Unix is simple. It just takes a genius to understand its simplicity." – Dennis Ritchie
* "UNIX was not designed to stop its users from doing stupid things, as that would also stop them from doing clever things." – Doug Gwyn
* "Unix never says 'please'." – Rob Pike
* "Unix is user-friendly. It just isn't promiscuous about which users it's friendly with." – Steven King
* "Those who don't understand UNIX are condemned to reinvent it, poorly." – Henry Spencer

The funny thing, is th last one is true in a way lol.

back up war

http://www.phenix.bnl.gov/~purschke/RescueCD/
http://www.cpqlinux.com/ddbackup.html

Some good links for later 🙂

*wink*

$MYVIMRC

My current ~/.vimrc file. The {{{ & }}} mark the locations of folds, I elected to ues folding marks for my rc file. And when I have time to read how, I probably will set it to allow sectional jumping.

In short form, the file ensures that Vim does not read my .exrc file, does not try to be strictly vi compatible. Auto reads changes to files, keeps files at 80 char width (see tw), make for a more comfortable movement pattern near EOL. Yank into the clipboard, enable syntax folding on new files (my preference for sources), DOS EOL for new .txt files. Set somes sizes, enable my ‘HUD’ ^_^, turn on a nice colour scheme, and syntax highlighting. Set fonts, and a few useful keymaps. :help <option> generally works for looking things up in the manual (help can be shortened to he. with no sexist intent.)

"Terry M. P***** personal vimrc file

" vim: set ts=6 sw=6 expandtab foldmethod=marker foldcolumn=1 foldlevelstart=99:
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" WARNING !!!
" This file must have UNIX end of lines to avoid errors when starting
" under unix. Use the pdos2unix and punix2dos sh scripts to convert or
"
" perl -p -e 's/n/rn/' inputfile > outputfile # UNIX to DOS
" perl -p -e 's/rn/n/' inputfile > outputfile # DOS to UNIX
"
" on the command line
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Abstract
"
" Editing Preferences - set options related to editing tasks
" User Interface Preferences - set options related to appearance
" Keybinds & Commands - mappings / created


"""""""""""""""""""""""""""""""
"Editing Options {{{
"""""""""""""""""""""""""""""""

"Don't be VI compatible - Keep this at top of file !
set nocompatible
set noexrc

"automatic re-reading of changed open files
set autoread


"ingore case when searching
set ignorecase

" Use the system clipboard as the default register
set clipboard=unnamed

"Buffer related {{{
"Allow backspacing over everything in insert mode
set backspace=indent,eol,start
"Allow to go one space past EOL
set virtualedit=onemore
"Allow left/right movement at EOL to move to start of next line
set whichwrap=hl<>
"Wrap text at n chars with a line break
set textwidth=80
"set wrap
set linebreak

"Folding
if has("gui_running")
set foldmethod=manual
set foldcolumn=0
else
"Use sytanx folding in console mode
autocmd BufNewFile,BufRead *set foldmethod=syntax foldcolumn=1
endif

"}}}

"Size stuff {{{
"Tab length and shift lengths
set tabstop=8
set shiftwidth=4

"Set min # of spaces for numberwidth. It grows as needed
set numberwidth=2

"Set tab menu 0=never, 1=when more then one, 2=always
set showtabline=1

" Start with folds open
set foldlevelstart=99

"}}}

"File related {{{

"Set prefered line file formats
set ffs=unix,dos,mac
"Enable filetype detection
filetype on
"Turn off ft plugin and indent
filetype plugin off
filetype indent off

" Create new.txt files notepad ready
autocmd BufNewFile *.txt set ff=dos

"Enable syntax highlighting
if &t_Co > 2 || has("gui_running")
syntax on
endif

" Highlight strings inside C comments
"let c_comment_strings=1


"}}}

" }}}
"""""""""""""""""""""""""""""""
" Keybindings {{{
"""""""""""""""""""""""""""""""

"Maps {{{

"Use the ";" as a duplicate of ":" makes life so much easier
"for some odd reason it cannot be followed with a comment on it's line!
:nma ; :

"F1 turns on spellchecking in current buffer
map :setlocal spell spelllang=en_us

"F2 turn on line numbering
map :set number

"F3 turn on self indenting magic
map :set smartindent autoindent

"F10 rids us of ^M after carriage returns
map :%s// /g

"}}}

"}}}
"""""""""""""""""""""""""""""""
"User Interface Options {{{
"""""""""""""""""""""""""""""""

"Always show the status bar with file name e.t.c.
set laststatus=2
"Show %of file in statusbar
set ruler

"Command line completion lists possible matches
set wildmode=list:full

"Start with mouse support
set mouse=a
"Hide the mouse when typing text
set mousehide

" Dependant on GUI on/off {{{
if has ("gui_running")
"Set colo and options
colorscheme denim
" Set 'go' to:
"autoselect, console dialogs, tabpages, icon, menubar, show grey menu
"items, tearoff menu items, Toolbar, always right scrollbar.
set guioptions=aceimgtTr

"Make pointer an I-Beam in insert mode
set mouseshape=i:beam
"for spellchecking
set mousemodel=popup_setpos
"set cmd line size
set cmdheight=2

"Set windows specifics
if has("win32")
"Windows font
set guifont=Fixedsys:h7:cANSI
"Set x11 specifics
elseif has("x11")
set guifont=Fixed Semi-Condensed 13
set columns=80
set lines=35
endif
else
"set colors for terminal
colo advantage
"set cmd line size
set cmdheight=1
endif

"}}}

" }}}

OpenBSD

The day before yesterday I backed up Vectra, /kolab, /etc, /usr/local/etc. And reformatted the computer and installed OpenBSD 4.0.

http://www.openbsd.org/

The worlds most secure OS, with only two remote holes in the default install found in over 10 years. And a heck of a lot of looking !!!

With out a doubt, this is the easiest to install OS I have ever worked with. I downloaded floppy40.fs from one of the FTP Mirrors. There are 40, 40A, and 40B. For most ‘Desktop’, ‘Server’, and ‘Laptop’ hardware sets respectfully.

I put one of my 3.5″ Stiffies in floppy disk drive #1 (/dev/fd0). Formated the disk and did a byte exact copy with the dd command.

Vectra# fdformat /dev/fd0
Format 1440K floppy `/dev/fd0'? (y/n): y
Processing VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV done.
Vectra# dd if=floppy40.fs of=/dev/rfd0c bs=32k
Vectra# cmp /dev/fd0 floppy40.fs
Vectra#

As per the OpenBSD documentation I used the compare utility to make sure I had a clean disk. Gotta remember about ol’cmp(1) hehe.

I ejected the disk and labeled it, ‘OpenBSD 4.0 Floppy40.fs’. Reinserted it and rebooted my computer. (After swapping monitors and keyboards).

The PC booted off the stiff disk, giving me a boot> prompt. Very sweetly I could use ‘ls’ to see what was on the disk, boot and bsd. Knowing that bsd was the kernel (from reading tfm) I booted it.

boot> boot bsd

Of course it will auto loaded the kernel into memory if you let it sit for a few seconds. Afterwards it asked for an install, upgrade, or shell prompt. I could have used a CD-ROM, but for just making a boot disk with an installer I felt it was kind of wasteful. Especially when Vectra is the only _personal_ computer I have /w a floppy drive. Ma’s has one but she’d freak if her PC booted to a getty prompt !

The installer reminds me some what of Slackware GNU/Linux’s way of asking which kernel to boot. But for the whole installer xD. I’m sorry to say that OpenBSD, while being the easiest to install OS I have _ever_ seen. Is not for the faint of heart to install !

The installer asked me for a terminal type, defaulting to vt220. I’m not really very smart about the old terminals having never used one. But the internet helps. The vt220 came with a LK201 keyboard with a layout close enough to the modern US Standard keyboard layout for my tastes. The only sad thing is that one cannot press scroll lock and page back to read stuff that flew by. At least on my system so, I’d recommend having the manual handy during partitioning.

The installer prompted for a kbd map, I took the default ‘us’ layout.

Welcome to the OpenBSD/i386 4.0 install program.

This program will help you install OpenBSD in a simple and rational way. At
any prompt except password prompts you can run a shell command by typing
'!foo', or escape to a shell by typing '!'. Default answers are shown in []'s
and are selected by pressing RETURN. At any time you can exit this program by
pressing Control-C and then RETURN, but quitting during an install can leave
your system in an inconsistent state.

Specify terminal type: [vt220]
kbd(8) mapping? ('L' for list) [none]

OpenBSD even supports using a serial console with a little hanky panky. One of the things, that in my opinion was very professional and a great change. It asked me _if_ I had a backup of my data. Normally (in my exp) you only get a warning about how dangerous it can be to any data on disk (which of course OpenBSD did). We then proceeded into the partitioning phase.

It listed the available disks (wd0) and asked for the root disk. I was prompted to use all of the disk or (default) not to use the whole disk for BSD. Being a dedicated machine, I wanted the whole disk used. If you want to multi-boot or make multiple slices (primary partitions) you’ll need to elect for a fdisking nightmare. Generally OpenBSD supports disks up to one Terrabyte, thats about 1,000,000 MB. Wwell, not really but close enough and easier to remember :-P. I chose to use the whole disk, so I was allowed to skip fdisk and go on to disklabel maker 9.0 pro.

I must warn ya, the fdisk/disklabel software has not advanced much in terms of interface. Since the ex(1) line editor was mans best friend. FYI, vi is a ‘visual’ interface to the ‘extended’ editor 🙂

I created a group of bsd partitions in my slice, following the suggestions most of the time.

From my installed system:

Terry@vectra-$ df -h
Filesystem Size Used Avail Capacity Mounted on
/dev/wd0a 147M 28.0M 112M 20% /
/dev/wd0h 393M 628K 372M 0% /home
/dev/wd0d 98.3M 2.0K 93.4M 0% /tmp
/dev/wd0g 6.7G 426M 5.9G 7% /usr
/dev/wd0e 148M 5.8M 135M 4% /var

One can set the offset, size, FS Type, and mount point when adding a new partition. Very lucky for me, it was smart enough to find the offset itself. I don’t really like working in cylinders so I was pleased to be able to specify the size in a more friendly manor. Such as 150M for 150 Megabytes 🙂

The file system type is ‘4.2BSD” or swap. wd0a and wd0b default to the root / partition and swap partitions respectfully. Also the wd0c refers to the _entire_ slice (primary partition). When done, I wrote the label and exited. It prompted me to confirm the mount points, kind of handy. After confirming my 5 mount points I issued a ‘done’.

Yet again, it wanted me to confirm that I wanted to continue with the formating. It auto formated each partition in the label and took me to the configuration phase.

I have never seen such a simple configuration phase, all it really amounts to is setting up enough data for the machine to attach to the network, or at least use the ‘hostname’ command. I set the short hostname when prompted to ‘vectra’. I then had a boolean problem, do I configure the network or not? Since I don’t see any point in waiting till first boot or chrooting after install and doing it before first boot. I decided to set up the network settings. Be warned, the only text editor you have to work with is ed(1). I really hate ed, but its a good little editor when you think about how tight the space is on a 1.44MB boot disk.

I set up my 3Com ethernet NIC (xl0) using DHCP, when prompted and worked the following.

  DNS domain name? (e.g. 'bar.com') [my.domain] my.domain
DNS nameserver? (IP address or 'none') [my name servers] Enter
Use the nameserver now? [yes] yeskbd>
Default route? (IP address, 'dhcp' or 'none') [dhcp] dhcp
Edit hosts with ed? [no] Enter
Do you want to do any manual network configuration? [no] yes

A very nice set up, I then used the shell and ed to take a look at my network configuration, all was right. After exiting the shell, I was ordered to set roots password. That completed the configuration phase ! Yeah thats it, all you really have to set up is enough to get a network connection and a password for root.

Not having been able to afford a disk set, when prompted for the install media (i386 supports cd, disk, ftp, and http). I took up an ftp install, electing _not_ to setup ftp/http proxy connection details. As I do not have one to worry about when doing this stuff ^_^

I installed using the ftp.openbsd.org mirror with the default package sets. Be warned it does take a little while for it to connect to the server and let you choose packages. The required are:

  • bsd - The Kernel
  • base40.tgz - The base system (think /bin:/sbin:/usr/bin:/usr/sbin e.t.c)
  • * bsd.mp - Multi-processor (SMP) kernel (only some platforms) * bsd.rd - RAM disk kernel

  • etc40.tgz - System Configuration files (/etc)

The other packages are: comp40, development tools (gcc, headers, libs e.t.c.), man40 (man pages), misc40 (extra docs), games40 (simple games), and a slew of x* packages required for using the X Windows System. Being intended for a SMB/NTP/Print server, I don't need an X Server eating my 8GB disk.

The system fetched and installed each package I selected from the ftp mirror and took me to the 'startup' phase. Where I could adjust settings related to what would turn on automatically at boot. Namely.

Do I want SSHD (default yes), my LAN requires this since I can't get a KVM switch.

Do I want NTPD (default no), I want vectra to be a time server for my lan.

Do I expect to run X (default no), which if yes would tune a few things to make the XxX life easier.

Should the default console be com0, *nix starts numbers at 0, so BSDs com0 is DOS/Winsucks com1 !

And a would've been nicer to ask during configuration: Time Zone setup. I elected for 'Zulu' time. I don't use local time for much, and try to use UTC when ever I can.

A little BSD Magic and vola

CONGRATULATIONS! Your OpenBSD install has been successfully completed!
To boot the new system, enter halt at the command prompt. Once the
system has halted, reset the machine and boot from the disk.

The manual did mention chroot'ing and doing configuration before reboot, but I found that it was unnecessary for my needs.

On reboot I had a very good working system, checked the afterboot man page, confirmed I had a solid network connection, added a regular user(s), and could SSH in from it/them.

All was well and good, but after like 10-15 mintues the system would drop off the LAN. I couldn't figure it out, but putting a KB or monitor back on it fixed it. After a poke in the BIOS the next morning. I found a very interesting option 🙂

The system was set to stand by after n minutes, I tested with both standby and suspend set to 15 minutes. And sure enough after 15 minutes my SSH session would time out. And I'd have to physically type a key on the keyboard, or insert one into the port. After I cleared this, all was well ! FreeBSD never cared a rats behind but FreeBSD is not OpenBSD 🙂

I had thought maybe the kernel thought there was a problem /w the default console, but I figured that'd leave some viable info or a crash. Apparently the BIOS was the problem hehe.

PC-BSD, an easy to install FreeBSD based desktop has a great GUI installer. Very easy and simple, but I think OpenBSDs was easier. Since I elect to do 'advanced' installs with PC-BSD rather then the short basics. Never the less, the effect was the same.

PC-BSD, a fully working KDE Desktop on the first boot.

OpenBSD, a fully working Console System on the first boot.

I didn't really have to configure a bloody thing after running adduser on the OpenBSD box 😉 Of course theres more work to do, but not as a case of getting a _working_ system. I find OpenBSD so far to be a great system.

Yippers

You know… a mixture of tired/bored is very dangerous when you start:

Reading about sockets programming
and learning how to get a dump of pages html via telnet

and sockets start sounding like a very bloody good idea….