I can’t believe I am reduced to this…

I finally decided to try something I’ve never bothered with before: X over SSH. Despite it’s pro’s and con’s, I actually do like the X Windows System for the most part, but rarely have time to go spelunking through X.Org.

I installed XMing on my Windows machine (sal1600), booted my laptop (dixie), and ran some tests using Xming.exe / PuTTY.exe – highly successful, and quiet a look on my face, when I saw gVim on FreeBSD, pop up on Windows XP!

Connection link is as follows:

WRT54G Router/Access Point  ->|
| <- WPA Personal /w AES algorithm
dixie -> ~54Mbps 802.11g ->|
sal1600 -> ~54Mbps 802.11g ->|

Personally, I would prefer Gigabit Ethernet connection and some good cat-6 cable, then drop the router for something a bit more direct… but I can’t lol.

dixie runs FreeBSD 7-STABLE; sal1600 runs Windows XP MCE (SP3).

A few quick batch files to make calling XMing easier then kicking XLaunch into ‘just what I want’:

==> xming-1win.bat <==
@echo off
cd /d P:NetworkRemoteXming

start /B .Xming.exe -clipboard -keyhook -lesspointer -unixkill -nowinkill -screen 0 1280x800@1 -swcursor

==> xming-multiwin.bat <==
@echo off
cd /d P:NetworkRemoteXming

start /B .Xming.exe -clipboard -keyhook -lesspointer -unixkill -nowinkill -swcursor -multiwindow

For SSH, I copied my setup in PuTTY for Dixie; enabling Compression and X tunneling, and bingo -> X11 over SSH. Launch Xming, run PuTTY -load Dixie-X11, and bingo! For the same of speed, I also changed PuTTY to using a faster encryption algorithm then what I normally use for a shell. Adding more fonts is quite a necessity, but rather limiting if you don’t like 12px fonts. I can’t help but wonder, if Xming would work with fonts installed on X.Org; only two ways I know to find out; grep X or test it. Note to self: double check memory of how X Servers handles fonts, against the documentation (it’s been awhile). IMHO running X this way is a liability, even over SSH, and a WLAN even worse. But it is quite nice to see, even under this kind of equipment, it’s actually quite usable. I so need a replacement keyboard for my laptop!!!

In my increasingly, ehh… ‘insane’ ? form of web surfing. I found this essay by Eric S. Raymond.

For one reason or another, I’ve been using TWO web browsers at one time lately. Flock for websites poorly styled, Google Chrome for as much else as possible ^_^. Multiple windows, several tabs on each, in both browsers hahaha !!! This has yet to slow down the rate at which I surf the web, instead I think I’m getting faster :

I found the article rather interesting. For me, I generally prefer editing configuration files. Because if they are actually well documented, I can usually find my way along faster. Most programs that I have used, usually do a poor job of documenting what various options do… The idea of using a GUI Wizard for setting up and configuring stuff is old as dirt, but so often done half-assed. I’ve seen many programs present Wizards, some do it very well, some do it to a point–that I’d rather do it the ‘hard way’, because it is easier!

The style of user interface I enjoy, is basically that offered by programs in /usr/bin. It’s often simple to use (if you actually document it) and it’s fairly easy to code. When I try to do a GUI, I usually try to create something that is simple to figure out, but still something that I *will* use. I typically will use what ever input method is closet at hand, if my hands are on the keyboard, I use it—one reason that I love vi! While if my hands on the mouse, I’ll probably click my way about: unless it takes more then a moment.

GUI’s all to often make simple tasks easy and complex tasks impossible.

A command line interface, you generally need to know how to use. It pays to at least ask for -h,–help, /? help, depending on what system your using. Most programs are fairly obvious in their behavior without arguments. And good programs that I’ve seen, try to make them intruitive to figure out. A GUI program by comparison, if you need to go much further then a tooltip for something that is almost obvious, but explicit. Then I think there is a problem. I generally pick up and use graphical programs without needing to read documentation, because using a spreadsheet is easy but the meanings of whats fed into them are not always so simple.

If I had to go through the same thing to setup a printer, I would probably say fuck it, and go do it in a way that actually deserves my attention, LPD lol. Although, I do admit: Windows does do printing well in my opinion, as long as you do not have to deal with print “jobs”, then it sucks.

If the designers were half-smart about UI issues (like, say, Windows programmers) they’d probe the local network neighborhood and omit the impossible entries[1]. If they were really smart (like, say, Mac programmers) they’d leave the impossible choices in but gray them out[2], signifying that if your system were configured a bit differently you really could print on a Windows machine, assuming you were unfortunate enough to own one.

The difference between doing the job, doing the job well enough[1], and going that extra mile to make it better![2]. Designing a good UI is much harder then a lot of other things, but when it does happen in a good way—it’s worth it.

I remember not to long ago, I replace my *nix based PDF/PS reader. I dropped KPDF along with most other KDE apps in my change over to blackbox. Gnomes Evince was one that had been on my list for awhile and the new Okular from KDE4 was not ready yet, so I tried Evince. The program turned out to be incredibly simple, so simple that there are no (real) settings to change. The only real configuration option is how you want to layout / size a page, namely fit to page, blah blah.

At first I found this quite disconcerting, but Evince has since become my idea of the worlds best PDF/PS reader. Evince is light, it’s fast (unlike Adobe or KDE’s offers), all of the important stuff is in quick reach, and all of the unimportant stuff is no where to be found. Like at long last, a PDF reader that just cuts the bullcrap and lets me read files gracefully…. without arguing with the PDF reader !

Yippie-Kay-Yay Micro$oft SFU !!!

Test one: I wonder if Console is a decent replacement for cmd.exe ‘s terminal emulator — It is

Test two: I wonder if the SFU pdksh can do completion? — It can, just had to find the ‘bind’ commands for it

Test three: I wonder if SFU’s pdksh will work with my %PATH% — it did

Problem one: SFU pdksh seems to require the formal name, e.g. ‘foo.exe’ for programs outside of it’s regular path and runwin32’s search path — That’s ok, I don’t mind much and can alias out stuff like flock.

Problem two: Because SFU follows the unix-style of open it, see if there is a she-bang line (e.g. #!/bin/sh) saying what to run it with, else pass it on to the shell…. It feeds .bat files into it’s pdksh unless they are manually executed, e.g. ‘runwin32 cmd /C foo.bat’ — that is bad, several programs I use wrap themselves in ‘batch’ files on Windows and ‘shell’ scripts on Unix.

Problem three: My universal bourne-based shrc (~/.${USER}_shrc) sets itself to the current Bourne-style shell (e.g. sh, bash, ksh-family, zsh) and Operating System (e.g. BSD, Linux, generic Unix) needs to inspect the $SHELL environment variable to determin what shell to set stuff for. — For some odd reason the SFU pdksh doesn’t seem to set SHELL !!!! To top it off, $USER is not set, but at least the Windows var: %USERNAME% is converted to $USERNAME.

Fix for problem one:

$ mkdir /dev/fs/P/bin      # creates P:bin
$ touch binmaker.sh && chmod +x binmaker.sh
$ vi binmaker.sh
#!/bin/sh
BINDIR=/dev/fs/P/bin

for CMD in `echo $PATH | sed 's/:/ /g' | awk '{ print $0 }'`
do
for EXE in `ls $CMD`; do
echo $EXE | grep -E '.*.exe$' > /dev/null &&
ln -s ${CMD}/${EXE} ${BINDIR}/`echo $EXE | sed 's/.exe$//g'` && echo "made link for: ${CMD}/$EXE"
done
done

$ ./binmaker.sh
.... # symlinks all foo.exe in $PATH to /dev/fs/P/bin/foo

Fix for problem two:

Launch a new session of cmd.exe through windows (e.g. not via SFU; use the run dialog, start menu, or desktop /or quicklaunch icon).

U:Terry> echo %PATH% > mypath.win

Return to SFU korn shell (pdksh):

$ touch batmaker.sh && chmod +x batmaker.sh
$ vi batmaker.sh

#!/bin/sh
BINDIR=/dev/fs/P/bin

make_wrapper() {
[ -e $2 ] && return # file exists, no wrapper needed
local MYFILE=`basename $2`
cd $BINDIR && [ ! -e $MYFILE ] && touch $MYFILE

echo '#/bin/sh' >> $MYFILE
echo 'exec cmd /C "set PATH=`cat ~/mypath.win` && `basename $0`"' >> $MYFILE

echo "${BINDIR}/$MYFILE created"
}

for CMD in `echo $PATH | sed 's/:/ /g' | awk '{ print $0 }'`
do
for EXE in `ls $CMD`; do
echo $EXE | grep -E '.*.bat$' > /dev/null &&
make_wrapper ${CMD}/${EXE} "${BINDIR}/`echo $EXE | sed 's/.bat$//g'`"
done
done

$ ./batmaker.sh
... makes wrapper shell scripts in /dev/fs/P/bin/ for all foo.bat in $PATH

The wrapper scripts this creates look like this:

Terry@SAL1600-$ cat bin/irb
#/bin/sh

exec cmd /C "set PATH=`cat ~/mypath.win` && `basename $0`"

Terry@SAL1600-$

it’s neccessary to set the Windows %PATH% before launch, so it can execute the program — using the path from the invocation environment won’t work, e.g. /dev/fs/P/Devel/Langauges/Ruby/bin/irb in SFU Shells but this woudl translate to CurrentDriveLetter:dev/fs/P/Devel/Langauges/Ruby/bin/irb which won’t work. Note, the program must be executed as P:DevelLanguagesRubybinirb.bat in Windows cmd shell, as that is where it is located on my system.

Fix for problem three:

I modified my ~/.profile from OpenBSD to take care of the $USER and $SHELL issues, which is also nice enough to load my custom initialization file.

$ vi .profile

export TERM HOME
USER=$USERNAME; export USER
SHELL="/dev/fs/P/Utilities/Services_For_UNIX/bin/ksh"; export SHELL

echo "Waiting for screen repaint...."
sleep 2
echo 'Korn power !!!'

ENV=${HOME}/.${USER}_shrc

I set the path to the physical rather then the /bin/ksh ‘shorty’ in SFU, so that if I later find any compatibility issues, I can always work around it ‘specifically’ if necessary.

I’m not sure if it is a problem with the Console2-Devel build I’ve installed or with how SFU’s korn shell expects to run. But a few seconds after startup the prompt disappears as if from a ‘clear’, giving any I/O that results in a line being drawn causes a fix. Since I haven’t figured this part out yet, I’ve just ‘side stepped’ the problem. It takes roughly the amount of time to sleep and echo the message before I am returned to my prompt. A quick parse of my $ENV and we’re ready to rock and all the output on the Console tab is from my ${USER}_shrc file.

I copied an old version of initialization file and made a quick edit. In the file I check for the systems unix name and use it to record the operating system type. The Services For UNIX subsystem still identifies itself as ‘Interix’ even though it’s been under Microsoft’s thumb for a bit.


case `uname -s` in
'FreeBSD') isFreeBSD=1
LSCOLORS='CxGxxxxxBxexExcxdx'; export LSCOLORS
;; # FreeBSD
'OpenBSD') isOpenBSD=1;;
'NetBSD') isNetBSD=1;;
'Linux') isLinux=1;;
'Unix') isUnix=1;;
'Interix') isUnix=1;isSFU=1;;
esac

I want to make a few changes to my shrc, but I don’t think they will work *properly* with SFU. My shrc file also pulls in a local ‘extension’ of itself, called ~/.site_shrc that makes things specific to the current system, for example adding the TexLive binaries to my $PATH on FreeBSD and noting the IP address or doing things that won’t work in the shells/v7sh that I use for testing. It looks like I’m going to have to write a site_shrc for Windows hahaha !!!

There’s more then one way to skin a cat, and this bloody hoge-podge of an operating system ain’t gonna best me !!! I will have a decent CLI interface if I’ve got to invoke a hex editor…

I’ve been prepping my destop for a reformat, including taking backups and prepairing software for reinstallation.

After presenting the choice of, A/ either I finish this or B/ I’m not going to work tomorrow until _after_ it is done; has finally cut the “!@#$%ing go to bed” shoutings to a more subdued amount. I can’t stand being told when to go to bed, not by someone that does not know my body the way I do, and has such disregard for the amount of shit I need to get done, plus:

If you’re going to help make my life hell, I’m not gonna be obligated to listen too a damn thing you say.

I’ve got almost 5gb of files; mostly installers, on the way to my file server. Basically everything from Abiword to zip.exe is laid out and ready for installation. So with luck, I can reformat the piece of shit… Setup a quick dual boot, mount the backups and copy them over to a FAT32 partition; install my drivers, install SP3, install my software, and setup the system. I’ve also taken the liberty of making a few change: more development tools and TeX Live 2007 for the type setting environment. I usually try to avoid compiling anything from source under Windows, like the plague. In my opinion, it really is that much of a pain in the ass… I do however like the toolchains around for my own use.

Under unix based systems, I don’t mind compiling from source as long as I’m given something *decent* to work with. Like something that actually builds on a standard system without mucking with it, rather then a piece of crap that is only easy to build on the developers Foo Linux machine lol.

I need to fetch my XP disks, mouse driver disk, and wifi driver disk. But all in all, it shouldn’t be to bad to carry this out. Just that it will probably take 6-8 hours and over a dozen reboots…. Oh man, how I love FreeBSD — a reboot typically means a new kernel to boot from. Much less then that, and I’ve never had to reboot my systems (with the exception of one sound driver that needs to be in loader.conf)

Tomorrow is likely to be another day of … Hmm, I can’t actually think of a word for it, that doesn’t stretch into multi-word profanities. But at least I *should* get off work at a decent hour. Today, I ended up leaving around ~1600Q or so. I can’t stand my life, but there isn’t a lot I can do to change it.

Since I’m not about to keel over and die, and resulting to quite drastic measures is further then I’m willing to go.

Wireless networking options

I’m contemplating *trying* to move my desktop PC to my room… Which means access to the ‘net will only by available via wireless. The computer doens’t have a wirfi card, just ethernet so that means shopping is involved.

It primarily runs Windows XP for gaming and has space reserved for testing GNU/Linux distros and BSD systems. Being a BSD-aware and manual reading shopper, I always crack open my operating systems manuals and look at what cards are supported by the drivers when I go looking for a product.

Since the only principal markets available to me off the web are Best Buy and Office Depot, those are where I looked online first.

The cards:

NETGEAR – 802.11g PCI Card Model: WG311

Pro’s:
Supported by ath drivers.

Same brand and chipset as my PCMCIA card (WG511T)

Con’s:

Old (or cheap) product, only supports WEP (which I don’t use)

Newer revisions may not be totally compatible with existing drivers (I suspect).

Belkin – Wireless-G USB 2.0 Network Adapter, Model: F5D7050

Pro’s:

Version 3 is supported by the rum driver and v2000 by the ral driver.

Con’s:

Reviews suggest bad gaming performance due to burst based transmissions

The rum driver is new to FreeBSD 7.0-Release (ported from OpenBSD)

GOD only knows what revision/version you might find at the store…

Hawking Technology – Wireless-G USB 2.0 Network Adapter,
Model: HWUG1 at best buy and at OfficeDepot

Pro’s:
Supported by the rum

Removable aerial and possibly good signal strength if you don’t have problems with it.

Con’s:

The rum driver is new to FreeBSD 7.0-Release (ported from OpenBSD)

May be hard to find (lesser known brand, at least from what I’ve seen of consumer (non enterprise) products).

Just look at Hawking Technologies website… (ugh)

Linksys Wireless-G 802.11g PCI Adapter, Model WMP54G at Office Depot and Best Buy

Pro’s:

Supported by the ral driver.

It’s cheap

It’s available while it is still on the market

It’s the same brand as my router (which is _not_ a plus in my book…)

Con’s:

More stores are carrying similar but newer models for Wireless-N and variants of the both (802.11g and 802.11g/n) proprietary speed boosting technology, which of course is unsupported.

It’s the same brand as my router (which I don’t care much for!)

MISC:

Driver support on OpenBSD and FreeBSD at release levels…

ath == OpenBSD 3.7, FreeBSD 5.2, NetBSD 2.0 (more recent modules don’t use a binary blob, at least the OpenBSD drivers that is (-;)

ral == OpenBSD 3.7, FreeBSD 6.0 and may require PCI 2.2 compatible mother boards.

rum == OpenBSD 4.0, FreeBSD 7.0

ural == OpenBSD 3.7, FreeBSD 6.0 and may have issues with communicating transmission speed (OBSD manual is more specific).

All of this is posted for my own reference and anyone else who may find use for it.

So Winucking funny, it’s pitiful !!!

I honestly don’t know if I should laugh or cry, it’s really that bad but I’m laughing my ass off right now lol.

Like last week I set up Microsofts Services For UNIX 3.5 on my XP machine, configured user/group maps from my Windows XP user account to my account on the OpenBSD server with the NFS shares. I followed the documentation that came with the software to get it set up.

If I try to access \vectrasrvnfs through Windows Explorer I either get an error message or I get the files, or I get BOTH. And trying to even right click to highlight any thing in Windows Explorer causes lock ups for several seconds. If I use the IP address rather then the alias ‘vectra’ that I setup in %SystemRoot%System32Driversetchosts it works slightly faster if I try to use the dir command in the command prompt which is stupid.

When I try to map the share to a network drive in Windows Explorer it dies with an error at \vectrasrvnfs, but I can ‘browse’ for it and then use it some times. It also ignores the maps I set up in the graphical SFU admin program so I can’t access files — and still buggers up when I tell it the login datam.

So finally pissed off after a week of this lag & lock crap, I open a command prompt with SFU’s shell and check the mount commands documentation which tells me to use the Windows Uniform Naming Convention (UNC) syntax for the file paths.

mount \vectrasrvnfs N:

And I get an error message about \vectrasrvnfs being an invalid command line argument to mount. So I for the hell of it I try the unix style host:share syntax to see if that works.

mount vectra:/srv/nfs N:

and BOOM it friging works !!!

I open windows explorer and go to N: in the nav bar and it works QUICKLY just like the NFS Shares mounted on my PC-BSD system do. Now my NFS shares are working through Windows Explorer properly, not like a piece of garbage as it was when doing through the GUI on Windows.

THE IRONY OF IT ALL !?

Microsoft Windows is noted by some people for giving easy, graphical ways to do things that ‘unix’ systems are supposed to lack quality documentation.

I used the ‘easy’, ‘graphical’ interfaces in Windows to do what takes 2 seconds in Unix which is ‘supposed’ to lack documentation and it works like shit or not at all in Windows.

I used the ‘hard’, ‘command line’ like way on Windows, only to find that the ‘supposed’ good documentation is wrong, and guess what — Doing it from the command line on Windows works ____better____ then the GUI once you figure it out.

Time to roll on the freaking floor laughing until my sides hurt !!!!

Reinstalling PC-BSD

I complted my backups during dinner so when I booted my laptop tonight, compared the MD5 checksums on the PC-BSD v1.5 CD#1 ISO file and burned the disk. I had K3B installed from PBI when I installed PC-BSD from a 2-Disk set awhile ago but I’ve never actually used K3B to do things lol. So I put a blank CD-R in my laptops acd0 and looked around on how to burn the ISO.

cdrecord -scanbus               # find out my 'dev'ice
Cdrecord-Clone 2.01 (i386-unknown-freebsd6.2) Copyright (C) 1995-2004 JΓΆrg Schilling
Using libscg version 'schily-0.8'.
scsibus2:
2,0,0 200) 'PHILIPS ' 'DVD+-RW SDVD8441' 'PA48' Removable CD-ROM
2,1,0 201) *
2,2,0 202) *
2,3,0 203) *
2,4,0 204) *
2,5,0 205) *
2,6,0 206) *
2,7,0 207) *

cdrecord -v -pad speed=1 dev=2,0,0 PCBSD1.5-x86-CD1.iso
# with very nice verbose output ;-)

I’ve never used my laptops DVD+-RW drive for burning disks before, normally I use the install of Nero that came with my Desktop but good ol’Dixie ain’t let me down, the CD-ROM came out great. I did an install with the decision to use the entire disk and a custom disk label. The dang gum installer still doesn’t have an option to set the time zone to UTC so I set it to Europe/London GMT 0000 which is close enough (my .zshrc sets TZ)

I noticed three problems with the custom disk label part of the installer. The first is, although PC-BSD finally fixed their default of 1024MB SWAP to instead use a more dynamic algorithim… For which it alloted 512MB of SWAP when my laptop has 512MB of PC2700 RAM. My previous install had that much RAM and when under the ‘worst loads of its life’ top some times reported ~300-400MB swap usage.

The installer woulnd’t let me create a second swap partition, so I upped the size to 1024MB. Normally I double check my values with a calculator since the installer seems to lack fdisks ability to handle K, M, and G suffixes but I found BC was gone. I didn’t have one handy so I started an XTerm only to find out that ‘bc’ was not on the install disk πŸ™ so I did it manually.

The other two problems are that I created /usr, /home, /var, and /tmp partitions. It converted the /home mount point to /usr/home and made /home a symlink, the only problem is I created /home before /usr in the installer. So when I rebooted I found a nice surprise that /usr/home was not mounting because /usr was not mounted yet :-(. Also although I made a /tmp partition the PC-BSD installer failed to disable tmpmfs in rc.conf, I had to do that manually. I know rc.conf.local is supposed to be a bit out dated on FreeBSD and the proper way on OpenBSD… But I always use /etc/rc.conf.local for changing rc.conf on PC-BSD, less trouble ;-).

Started PC-BSD, noted the boot menu now shows FreeBSD instead of PC-BSD like in the last release and the splash screen was gone which is fine by me. I usually would clear it when booting but was always too lazy to disable it 8=)

Setup the display for 1280×800 24-bit with ‘ati-3d-enable’ and switched to a vtty with control+alt+F2 and logged in as root. I had to change roots password, because my is to strong to ‘pass’ the PC-BSD installers concept of an acceptible multinational password lol. And to add my personal user, during install I only added ‘rstaff’ because I wanted to create my user ‘Terry’ with the same UID and GID settings as on my OpenBSD machine, tired of remapping stuff…

passwd                                  # fix roots pw
adduser # add my user

Then I realized that there was one fatal flaw in my plan, all the backups were on Vectra including the copy of my wpa_supplicant.conf file used for an internetconnection via wireless.

There is more ways then one to solve a problem πŸ˜‰

Since I don’t have a USB Flash Drive I booted my desktop into Windows and stuck in my spare SD Memory card in the hopes of copying the backup of /etc to it but Windows couldn’t access the bloody file shares, *Grrr* so I used PuTTY to SSH into Vectra and used cat, copy, and paste to create a new wpa_supplicant file.

Since my laptops card reader is not supported on FreeBSD 6.3 I swapped memory cards in my camera and attached the USB cable, I keep it set to ‘Mass Storage’ mode rather then PTP so I can transfer pictures to my laptop.

I plugged in the cable, turned on the camera, and in the time it took for me to type ls /dev | grep da the entire computer locked up, frozen solid on ‘ls /d’ so I had to shutdown with the magic on/off button πŸ™

So this time I turned off the camera and started my laptop again, turning on the camera during the kernel probe so it would stay in umass mode. Booted into single user mode and did a fsck -y then mounted the camera so I could get the file.

mount -t msdosfs /dev/da0s1 /mnt
cp /mnt/wpa_* /etc/
umount /mnt
# exit single user mode

Logged into KDE with my main user, ‘Terry’ and I decided to give PC-BSDs networking tool a try, set up my wireless card. It failed to detect my wireless access point so I specified the SSID manually and cat, copy, and pasted my passphrase from wpa_supplicant into the GUI. I then proceded with my master plan, mount my stored backups off Vectra via NFS and start restoring files. So I booted into single user mode again and set to work, I knew I’d need single user mode because with X running things would get fucked soon if I didn’t get my xorg.conf back!

Since I rarely write out a mission plan in that much detail when I am ‘playing’ with one of my computers. I’ve kept a log of my actions using vi to write /root/fixit.log and have ordered and commented the entries in a more logical order, I just did them in the order I thunk of them hehe.

fsck -y
mount -u -o rw /
mount -a
/etc/rc.d/netif start # start the network connection
# and mount my backup files on /mnt
mount_nfs -r 8192 -w 8192 xxx.xxx.xxx.xxx:/srv/nfs/Backups/today /mnt
bash # /bin/sh lacks a bit on tab-completion

cd /tmp
tar -xf /mnt/etc.tar
cd etc
cp ssh/ssh*_config /etc/ssh/
cp /etc/X11/xorg.conf /etc/X11/xorg.conf.pcbsd15.install
cp X11/xorg.conf /etc/X11/
cp rc.conf.local /etc/ && vi /etc/rc.conf.local # trim my rc.conf
cp pf.conf /etc/pf.conf.my-old
vi /etc/fstab # create fstab entries for the NFS shares
cd /
tar -xf /mnt/local-share-ri.tar # install ruby docs pc-bsd lacks
tar -xf /mnt/local-etc /usr/local/etc/sudoers # restore my sudo config
cd /usr/home/Terry

# add nfs-users and smb groups
pw groupadd -g 7778 -n nfs-users -M rstaff,Terry
pw groupadd -g 19132 -n smb -M rstaff,Terry
pw groupmod -n operator -m Terry # add myself to the operator group
su - Terry
mv Images Pictures # I prefer that name ;-)
mkdir code
# adjust the ownsership of my dirs
chown Terry:nfs-users {Documents,Music,Pictures,code,Videos}
tar -xf /mnt/my-home-backups.tar # various files, extracts as 'backups/'
# restore the stuff I want saved
mv backups/GNUstep ~/
mv backups/sh ~/
mv backups/misc ~/
mv backups/konversation ~/.kde/share/apps/
mv backups/knode ~/.kde/share/apps/
mv backups/.* ~/ # restore selected 'dot' files

# connect to my file server and create a new dir for nfs
ssh -p 22222 -i .ssh/mykey Terry@vectra
su - root
mkdir -m 1770 /srv/nfs/code # I'll extract files later
groupadd -g 7778 nfs-users
vi /etc/group # added my user to nfs-users
^D # exit vectra root shell
^D # exit vectra Terry's shell
cd /srv/nfs
chown -R Terry:nfs-users ./*
^D# back to working as root on dixie in single user mode
cd /tmp
tar -xf /mnt/root-home.tar
cd root # restore a few files I want there
cp *.ogg ~/
cp .login ~/
cp *-supfile ~/
reboot

on reboot I set out to work with molding KDE into shape and installing PC-BSD updates. With no lockups within the first half hour of operation.

After having been wanting to for ages I have finally fixed up my OpenBSD machines partitions.

I had an 80GB hard drive formated (wd1a) and moved /usr/local/ on to it and put my SMB shares on it for the free space.

Since wd0 is a 8GB disk split into a, b, h, d, g, and e partitions the biggest is wd0g mounted on /usr with ~6GB free but I had almost 10GB of files on /usr/local (wd1a). So I had to copy my backups and videos to the windows machine via Samba/Network Neighborehood before I could move all of my files in /usr/local/srv to a temporary place in /usr and then archived the rest of the directory.

cd /usr
mkdir storage
mv local/srv storage
tar -cf /var/tmp/local.tar local

I had to relabel the disk and then format the partitions, I created wd1a and wd1d to use as /usr/local and /srv with ~15GB more free space in case I need it.

umount -f local
disklabel -E wd1
newfs wd1a
newfs wd1d

During the disk label I changed to ‘disk geometry’ (g d), deleted the a partition (d a) and created the a and d partitions (c a and c d) keeping with the prompts on it and specifying 12G and 45G for the partition sizes.

Fixed my fstab and then mounted the partitions

vi /etc/fstab
# 8GB Primary Master, PATA drive
# device mount type opts dump fsck
/dev/wd0a / ffs rw 1 1
/dev/wd0h /home ffs rw,nodev,nosuid 1 2
/dev/wd0d /tmp ffs rw,nodev,nosuid 1 2
/dev/wd0g /usr ffs rw,nodev 1 2
/dev/wd0e /var ffs rw,nodev,nosuid 1 2
# 80GB Primary Slave, PATA drive
# device mount type opts dump fsck
/dev/wd1a /usr/local ffs rw,nodev 1 2
/dev/wd1d /srv ffs rw,nodev,nosuid 1 2

mount -o rw,nodev /dev/wd1a /usr/local
mount -o rw,nodev,nosuid /srv

I’m some what tempted to mark wd1d ‘noexec’ but I may wish to run scripts from there later if I ever move ~/code over. After that it was just a quick hop, skip, and jump to restore my files.

tar xpf /var/tmp/local.tar
mv storage/srv/smb /srv/
vi /etc/samba/smb.conf

I corrected all of my shares in smb.conf from command line mode:

:1,$s//usr/local/srv//srv/g

I could’ve used ex but I rather like paging up/down with ^U and ^D instead of using ‘addr1,addr2p’ in ex.

mount
/dev/wd0a on / type ffs (local)
/dev/wd0h on /home type ffs (local, nodev, nosuid)
/dev/wd0d on /tmp type ffs (local, nodev, nosuid)
/dev/wd0g on /usr type ffs (local, nodev)
/dev/wd0e on /var type ffs (local, nodev, nosuid)
/dev/wd1a on /usr/local type ffs (local, nodev)
/dev/wd1d on /srv type ffs (local, nodev, nosuid)
# df -h
Filesystem Size Used Avail Capacity Mounted on
/dev/wd0a 147M 30.4M 110M 22% /
/dev/wd0h 393M 35.6M 337M 10% /home
/dev/wd0d 98.3M 2.0K 93.4M 0% /tmp
/dev/wd0g 6.7G 398M 6.0G 6% /usr
/dev/wd0e 148M 84.1M 56.2M 60% /var
/dev/wd1a 11.8G 76.9M 11.1G 1% /usr/local
/dev/wd1d 44.3G 5.1G 37.0G 12% /srv

Windows wouldn’t see the file shares and sending the HUP signal to Samba to reread it’s conf file immediately didn’t help any. So I gave Vectra a reboot to double check my fstab entry (yes I am paranoid), I could’ve just killed the processes and reloaded them manually for the same effect.

# uptime
9:14PM up 19 days, 3:29, 1 user, load averages: 4.12, 4.16, 3.86
# reboot

I love OpenBSD πŸ™‚

EDIT:

To prevent some nasty time outs.

vi /etc/ssh/sshd_config
ClientAliveInterval 15
ClientAliveCountMax 45

vi ~/.ssh/config # or /etc/ssh/ssh_config for all clients
ServerAliveInterval 15

Egg on my face

Oh this is a shocker!

I noticed I had one of my quick bookmarks in konqueror that I never finished reading, some thing on command line arguments — a very poor name for a bookmark generally speaking.

So I opened it in another tab and parsed it at my usual rapid pace. Gradually I started lookinf around at other stuff on the site, intrigued by some of the other things I found, even things noted about the design of termcap/terminfo, fetchmail, gcc, etc and decisions involved with the problems the developers had to solve. About a half an hour and almost 3 chapters later and figuring it was probably some (good) book gifted to the WWW by a universities CS department I finally clicked the ‘home’ button and felt like popping myself in the head when I realized what I had been reading a mirror of:

The Art of Unix Programming

I remember I was reading it last year but I never had time to finish it. Hmm, I wonder where I left off? It is a very fine book but unfortunately not one I was able to inhale in my spare time :. I might be a strange person but when I find a good book, it usually makes a transition from eye to brain at a rate of 50-120 pages a day xD, time and energy permitting of course.

It’s a book I’d fully recommend for any one interested in problem solving or engineering’ish thinking.