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!!!

I love this thing….

Laptop is under abusively heavy load compared to what my much more powerful windows machine does, but it’s still in a very usable state. If this system ran Windows XP instead of FreeBSD, it would be slow’n to a crawl lol.

currently running: 155~165 processes, 6 shell sessions, 1 x session, temperature is at 64.0 Celsius

  • X.Org is up and I logged in from GDM.
  • Blackbox is running with bbkeys, dcopserver, gkrellm2, and two rounds of fbpanel in support.
  • Psi, Pidgin, and XChat are running, with a total of 7 networks going between them (1 of which is freenode, with 3 channels open)
  • rxvt-unicode + gnu screen is open with 4 windows
  • linux-flock is running with 5 tabs and the mplayerplug-in streaming music
  • The www/firefox3 port is compiling
  • My vimbuild script is fetching/building a newer version of vim from cvs
  • I am csup’ing my systems copy of the FreeBSD source tree
  • And doing the write/compile/test rinse & repeat in vim 😉

This kind of workload, is fairly typical for me when running FreeBSD. On the windows machine, I don’t even bother – doesn’t take well to it :.

Strange behavior with this bit of C++

It has been a long time since I’ve had time to do anything in C++. So I figured it would be a useful way to limber up my memory, by implementing a little bit of my favorite Python classes/modules in C++. The only crazy thing, is the result this code has yielded.

// minimal program, using the code involved
#include
#include

extern "C" {
#include <sys/param.h>
#include <unistd.h>
}

namespace os {
bool link(const std::string& src, const std::string& dst);
}

bool
os::link(const std::string& src, const std::string& dst) {
if (link(src.c_str(), dst.c_str()) != 0) {
std::perror(NULL);
return false;
}
return true;
}

int
main() {
std::cout << "link()t" << std::endl;
os::link(std::string("./test"), std::string("/tmp/test"));
return 0;
}

compilation: /usr/bin/g++ -Wall -ggdb3 os.cpp test.cpp -o test

I compiled on FreeBSD 7 with the systems GCC 4.3.1 and get a segfault, then tried the code on my OpenBSD 4.4 machine. The OpenBSD 4.4 release has shipped with a patched GCC 3.5.3 (propolice) – on OpenBSD it ran perfectly! Trying to feed it through the debuger on FreeBSD wasn’t pretty either:

  • FreeBSD 7, system GCC 4.3.1 -> test program dies with a Segmentation Fault.
  • FreeBSD 7, system GDB 6.1.1 -> Endless stepping when used with a break point, or SIG SEGV in libc’s malloc() when run.
  • OpenBSD 4.4, system GCC 3.5.3 -> prints proper message from std::perror() as expected, when the program is executed.

If I change os::link to os::link_x and recompile on FreeBSD, it works the same as it does on OpenBSD, when unmodified that is. In a few tests on FreeBSD, When I run the program under GCC, it tells me

Program received signal SIGSEGV, Segmentation fault.
0x281fabc3 in malloc () from /lib/libc.so.7

if I set a break point in test.cpp on the os::link() call, and step through it into os::link() in os.cpp. If I keep stepping after the link(), I get returned to the os::link() call in main and can step through it all again. Like an endless loop of stepping into/out of the os::link() function call in test.cpp’s main(), and the if-conditional in os.cpp’s os::link(), geeze.

At least looking at the results I’ve had tonight, I know I’m not freaking nuts… lol. I still shouldn’t write code when I’m half asleep, but hey… It’s the only time I get :, Oh well… unless my family is late as usual, I need to be up in a few hour.

*head hits laptop, snores loudly until morning*

The problem with typing to quickly

Check if the program ‘named’ is running and listening. I don’t know off the top of my head if /etc/rc.d/named supports the status command or not (rc), but finding out if it is running the hardway is still easy.

I’m not familiar with any of the dns/ apps in ports, so I can’t say what name they would run under; but I’m sure someone here would point it out.

$ ps xa | grep named
... is named running?
$ cat /var/run/named/pid
... does the pid file exist?
$ netstat -n -p tcp | grep 53 -- s/tcp/udp/
... is anything listening on the usual port?

-> Assuming that the standard issue name server was used, you may want to check named.conf first, in case the settings were changed. On FreeBSD I believe this is etc/namedb/named.conf.

I really should check my posts for typo’s more completely, before I make an ass of myself so easily…. at least J65nko spotted it. Most times I try and check what I write, but after work, it’s not exactly a high priority – compared with finishing the sentence before I get AFK’d for the umpteenth time lol.

Believe it or not, I’ve just spent the last several hours spelunking around FreeBSD, and end it with a smile lol.

I got tired of a program I was writing (and a minor headache), so… I turned my attention to something that’s been on my todo list for ages. Tracking more and more of how the system handles it’s startup procedures. It would certainly be a bit more helpful to my understandings, if I had ever had time to learn x86 assembly. Maybe someday, I’ll get to that part of my todo list, lol but by then AMD64 will probably be old as a Pentium :

Well after 0500 now, time to get some sleep…. Flibin’ work early tomorrow, and another day of… annoyance.

Terry@dixie$ uptime && shutdown -p +2 'head hits keyboard, begins to snore loudly'
9:23AM up 6:15, 2 users, load averages: 0.07, 0.09, 0.06
Shutdown at Fri Oct 31 09:25:48 2008.
shutdown: [pid 3624]
Terry@dixie$
*** System shutdown message from Terry@dixie.launchmodem.com ***
System going down in 2 minutes

head hits keyboard, begins to snore loudly


For one reason or another, I seem to end up browsing /usr/src/ whenever I encounter curious program behaviors, I wonder…

Does this mean, that I would be bored stiff without access to the system sources; or do I just spend *to much* time in front of a code editor lol.

HOWTO boot FreeBSD, Linux, and Windows XP with GAG, GRUB, LILO, and BootEasy

Abstract

This posting endeavours to allow users to successfully boot the following Operating systems: Windows XP, most GNU/Linux distro, and FreeBSD/PC-BSD; using the following boot loaders: GAG, GRUB, LILO, PC-BSD (aka BootEasy). The target audience are PC-BSD users coming from Linux.

There will be several references provided at the end of the posting.

Using the Graphical Boot Manager, GAG

Simply boot off the install media and follow the on screen instructions.

Note well that must install a boot loader such as LILO or GRUB in a Linux / partition in order to boot Linux from GAG, like most other abstract boot loaders.

Using GNU GRUB

In order to boot PC-BSD from GRUB, you must tell GRUB which drive, slice, and
partition to load from; usign GRUBs own notation
syntax
.

The systems kernel is stored on disk as /boot/kernel/kernel and it’s Loadable Kernel Module (LKM) drivers are stored in the same directory; with a .ko suffix. Although it is possible to load the kernel directly, it is better to load stage three instead, which gives you an easier interface to loading the desired kernel.

You will have to edit the GRUBs configuration file. The name and location of GRUBs configuration varies based on your Operating System. Under Debian (and thus Ubuntu), OpenSUSE, and FreeBSD based systems, you will find it as /boot/grub/menu.lst. On Fedora/Red Hat Linux and Gentoo based systems you will find it in /boot/grub/grub.conf. Many distros may provide a symbolic link to /etc/grub.conf, please refer to your operating systems documentation if you can not find the file.

Open it as root and edit it accordingly with the settings for your system. This example is is meant for triple booting Windows XP, GNU/Linux, and PC-BSD, where they are installed in that order, into primary partitions.

title WindowsXP
root (hd0,0)
makeactive
chainloader --force +1
boot

title Foo Linux
root (hd0,1)
kernel /boot/vmlinuz

title PC-BSD
root (hd0,2,a)
kernel /boot/loader

By default, if the slice number is omitted, GRUB searches the first slice which has a partition. I have however specified the slice number in this example.

If your distro has already configured Windows and Linux in menu.lst/grub.conf,
you should probably leave it as is; appending the PC-BSD entry to the
configuration. The location and file name of the linux kernel can vary a bit,
/boot/vmlinuz, /vmlinuz, and /boot/vmlinuz-x.y.z should be common, but my grasp
of Linux kernels dates to Linux 2.2, not modern 2.6 — as always check your
operating systems documentation when necessary! initrd users please see the grub
manuls notes on
linux
.

Using LILO

For those whom still prefer the LInux LOader, you can still use it for booting PC-BSD: edit /etc/lilo.conf accordingly:

# cp /etc/lilo.conf /root/lilo.conf.old
# vi /etc/lilo.conf
# /sbin/lilo

I will leave the top matter in lilo.conf as an exercise to the reader (if you use LILO, you should know this); so working off the GRUB example, the /etc/lilo.conf file should look like:

other=/dev/hda1
label=WinXP
table=/dev/hda

image=/boot/vmlinuz
label=FooLinux
root=/dev/hda2
table=/dev/hda

other=/dev/hda2
label=PCBSD
root=/dev/hda3
table=/dev/hda

NB that initrd users will want to add a initrd=/path/to/your/initrd/img rule to
the FooLinux image specs.

Users with multiple hard drives, please refer to the FreeBSD
FAQ
for details.

Using the PC-BSD Boot Loader

The header is actually miss leading, as this is really just the boot loader used by FreeBSD, a.k.a. Boot Easy or /boot/boot0. Hence forth called BootEasy.

To boot your operating systems with BootEasy, once is installed – just reboot the PC. Following the previous examples, you would see a prompt like this:

F1: DOS
F2: Linux
F3: FreeBSD

Press F1 on the keyboard to load Windows XP, F2 to chainload FooLinux, or F3 to load PC-BSD.

Note well that you must have a suitable boot loader installed into the linux / partition in order to boot linux from BootEasy.

The FreeBSD FAQ specifically recommends to install
LILO into the Linux /
, although GRUB should work fine when installed into Linuxes /

References

Post script:

If you have a problem with my spelling, grammar, or punctuation: you can pay my family to go on a shopping spree and leave me free to type slower then I can physically move my fingers across the keys.

Disclaimer

The information provided here is done for your convenience at the authors expanse, it however is without any form of warranty or guarantee of fittness — use at yur own risk, I’m not responsible.

My poor baby…

Installed Netbeans on my laptop to give it a test drive, and between top and the massive change in performance in flock, I can’t help but think that my system is in pain as it fights with flock for system resources :

last pid:  2235;  load averages:  2.04,  1.50,  1.00    up 0+01:08:22  03:52:09
86 processes: 4 running, 81 sleeping, 1 stopped
CPU: 83.8% user, 0.0% nice, 16.2% system, 0.0% interrupt, 0.0% idle
Mem: 298M Active, 18M Inact, 96M Wired, 12M Cache, 53M Buf, 1888K Free
Swap: 860M Total, 100M Used, 760M Free, 11% Inuse

PID USERNAME THR PRI NICE SIZE RES STATE TIME WCPU COMMAND
2195 Terry 30 44 0 387M 137M ucond 0:00 77.25% java
1498 Terry 1 99 0 715M 139M RUN 25:43 13.87% flock-bin
1358 root 1 44 0 119M 63776K select 1:56 0.00% Xorg
1403 Terry 1 45 0 18616K 4796K select 0:51 0.00% gkrellm
1504 Terry 1 0 0 715M 139M linuxf 0:19 0.00% flock-bin
1500 Terry 1 0 0 715M 139M linuxf 0:04 0.00% flock-bin
1499 Terry 1 44 0 715M 139M select 0:03 0.00% flock-bin
1477 Terry 1 44 0 30940K 6832K select 0:03 0.00% Terminal
1887 Terry 1 44 0 34752K 8020K select 0:02 0.00% xchat
1174 root 1 44 0 3264K 564K select 0:02 0.00% moused
1404 Terry 1 44 0 45900K 2944K select 0:01 0.00% pidgin
1402 Terry 1 44 0 14280K 2256K select 0:00 0.00% fbpanel
1509 Terry 1 0 0 715M 139M linuxf 0:00 0.00% flock-bin
1405 Terry 1 44 0 9080K 1340K select 0:00 0.00% blackbox
1515 Terry 1 0 0 715M 139M linuxf 0:00 0.00% flock-bin
1481 Terry 1 20 0 4640K 0K pause 0:00 0.00%
1399 Terry 1 44 0 8172K 724K select 0:00 0.00% bbkeys

The fact that I’ve got flash7 running in one tab and only a small set of 5 tabs open in flock, ain’t that bad I guess. It seems that my system has almost adapted to this load, because the stats in top have gotten even worse but FreeBSD has gotten almost as responsive as normal when running these programs.

I love my darlin’ Dixie 😉

Abort, Retry, Ignore — not !!!

Windows XP is about 5% and still going strong on the game machine. Really, if I didn’t need RvS and SWAT 4, I wouldn’t even have XP on that machine lol…. My only dependency on Micro$oft is an OS that supports games –> I generally dislike console games.

0/ My current plan of action is to conduct the reformat/reinstall of XP.

1/ Verify that the S.O.B. boots… Install core drivers (GPU, Wifi)

2/ Strip her naked — remove the “pre-installed” software and trial-ware, e.t.c.

3/ Boot into Knoppix Linux (LiveCD) and sort the partitions according to plan

4/ Install FreeBSD 7.0-Release and boot into it

5/ NFS mount the setup data from the file server (Vectra) and copy it to a shared FAT32 partition on SAL1600 (games machine).

6/ Boot into Windows XP MCE and install SP3

7/ Reboot and configure core system elements (e.g. get her on the network, behind a firewall, and setup the environment)

8/ Install software in the predefined order into the predefined locations, making adjustments as needed.

10/ Restore data from backups

11/ Customize her to the hilt: full command line environment; development tools, dual-monitors, desktop layout, etc.

XP is almost up to 40% already,so hopefully I can get started on the real work soon. Reinstall is easy, getting a working PC is a diff’rent story. So far everything is going smooth, and is probably planned out as good as a NASA mission ;-). Hehe, I’ve even got many of the firewall settings already prepaired. Hmm, I guess it is just fun to rip stuff apart and put it back together a better way at times.

I hope to have SAL1600 back online before morning, and with luck time to post a advance notice of training ops on TG#1… I’d like to reserve the server for a change if I can lol.

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.