Archive for the ‘*nix’ Category

a.out

Wednesday, May 1st, 2013

From the paper “First edition Unix: Its creation and restoration

because the PDP-11/20 provided no memory protection against kernel corruption by the running process, it was considered a courtesy for a programmer to yell ‘‘a.out?’’—the name of the Unix assembler’s default output file—before running a new executable for the first time

More Acme & tools of Plan9 from User Space

Wednesday, January 9th, 2013

Mind blown today by the Plan9 tools as I got a chance to practice working in acme more today.
Browsing installed fonts exposed by fontsrv(1) as a file system using 9p(1) (a taste of treating everything as a file), using adict(1) which is a dictionary browser & win(1) which connects a shell with a pane in acme so anything you type into that pane is sent to shell & any output from the shell is sent back to the pane. This allows you to do such things as build notes as you work through a problem at the same time, without having to have a collection step as a part of your work flow.
I love the simplicity & elegance of this environment, the points raised above is essentially what is covered in the tour of Acme Editor by Ross Cox in the 2nd third part.

I’ve been trying different fonts for my terminal, currently between Inconsolata & Adobe Source Code Pro
Screenshot below is taken from 2 instances of Acme, one the left running with Inconsolata 19pt antialiased font & one the right Adobe Source Code Pro 17pt antialiased.

Inconsolata vs Adobe Source Code Pro

Running IPv6 on 4.4BSD – Summer 2012 Retrochallenge entry

Monday, July 2nd, 2012

I’m entering the summer Retrochallenge which runs throughout July, the plan is to get an emulated host running with 4.4BSD-lite connected via IPv6 using the NRL patches & if possible serving a basic webpage over HTTP or fail at it & either way document the journey in this post.
It will be a good opportunity to visit the early implementation of IPv6 & learn about the origin of this stack, IPv6 is sexy right? or is that DNS??
I was unaware of the existence of these patches & assumed KAME was the original implementation until I was pointed to the USENIX paper by fellow tweep Dan McDonald.
Looking forward to doing some digging for information & patches :)
To fit the challenge rules, the host the emulation will run on will be a Cobalt Qube2 with NetBSD/Cobalt.

3/7/12
Before I started to attempt building things I did some research on what was required & if the patches and any documentation was still around.
Sun Microsystems IPng Implmentations page is still available on archive.org though the NRL IPv6+IPsec is long gone, I was able to obtain the patch sets from the RIPE FTP server
The installing & operating 4.4BSD UNIX section of UNIX System Manager’s Manual (SMM) lists the supported platforms by 4.4BSD, I hadn’t realised that VAX was not a officially supported platform in this release by CSRG, the 3 official supported platforms which binaries are shipped for being the HP, DECstation & SPARC platforms, this means that simh is off the list & it’s a toss up between tme & GXemul, I’ve not played with GXemul before but tried the Sun3 emulation on tme a few years back in an attempt to get SunOS 4.x but failed after not getting the disk setup right.
I found a copy of the 4.4BSD-Lite CD ISO files on Poul-Henning Kamps website.
Next step is to get a virtual machine up & running with 4.4BSD-Lite, I’m probably going to start with the DECstation (MIPS) emulation on GXemul & move onto SPARC on tme if things don’t work out. The README with patches states the patches were built on SPARC but I’m hoping this isn’t an issue (endianness?).

21/7/12
My CSRG archives cd set is here, this week will be a cram as I play catch up.
Front cover for CSRG Archives cd set

Back cover for CSRG Archives CD set

A patch to make Chillispot 1.1.0 buildable on *BSD

Wednesday, October 11th, 2006

It seems the unannounced release of Chillispot 1.1.0 has a few typos in the source code aswell as use of the clearenv() function which is not available in *BSD, I’ve made a patch which sorts these problems out, test it out & send any feedback to the Chillispot mailing list

Running Chillispot on OpenBSD, NetBSD & Mac OS X

Wednesday, July 5th, 2006

*** 08/07/06 – Update, the patch just allows Chillispot to build successfully, tun.c needs some more patching before chillispot will work. Sorry :( ***

I have made a patch which will enable Chillispot compile & run on OpenBSD, NetBSD & Mac OS X.

The patch has been tested working on the following versions of O/S’s
OpenBSD 3.9
NetBSD 3.0-STABLE & -CURRENT
Mac OS X 10.4.7
though it should work on previous versions aswell.

To build Chillipot 1.0 first download & extract Chillispot.
Then copy the patch into the Chillispot directory & issue:
patch -p1 < chillispot -1.0.patch

You should get the following result:
patching file src/chilli.c
patching file src/dhcp.c
patching file src/redir.c
patching file src/syserr.c
patching file src/tun.c

For NetBSD & OpenBSD:
Now run ./configure with the relevant switches e.g.
./configure --sysconfdir=/etc --localstatedir=/var
then for OpenBSD: run make install chilli_LDFLAGS=""

For Mac OS X:
Run make install chilli_LDFLAGS="-lcrypto -lresolv"
If compiling fails with the following error:
redir.c: In function 'redir_accept':
redir.c:1400: error: nested functions are not supported on MacOSX
redir.c:1406: error: nested functions are not supported on MacOSX
make[2]: *** [redir.o] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

then you’re using GCC 4.0.1, use gcc_select to switch to GCC 3.3 by running gcc_select 3.3 then rerunning make. When you’re done you can switch back to GCC 4 by running gcc_select 4.0 surprise surprise!!! :)

Getting MRTG running

Sunday, July 3rd, 2005

I came across this 4 part guide by Michael Lucas on SNMP & MRTG, the series starts by covering the concept of SNMP & installing ucd-snmp (now net-snmp) through to configuring & customising it on the 2nd article. The 3rd & 4th articles cover installation, configuration & customisation of MRTG.

Part 1: Walk the SNMP Walk
Part 2: Talk the SNMP Talk
Part 3: Longterm monitoring with SNMP
Part 4: Customising MRTG

MSN Video / Webcam support

Thursday, May 26th, 2005

the cvs checkout of amsn (0.95 Beta) comes with video support enabling you to use your webcam on the MSN IM network :)
I had problems tryinig to get the last 2 nightly builds to run on OS X 10.4
After a bit of googling around I came across a packaged version of a nightly build from a couple of days ago for OS X here

Enjoy! :)

http://usuarios.lycos.es/sonicromsx/amsn.dmg

My 1st Patch!

Monday, November 22nd, 2004

Woohoo!
I’ve just created my 1st patch, to add support for Slackware to the iSCSI Enterprise Target software

Read this guide if youre interested in rolling out your patches

--- Makefile.orig 2004-11-22 10:30:57.000000000 +0000
+++ Makefile 2004-11-22 10:35:16.000000000 +0000
@@ -28,6 +28,8 @@
install -v -m 755 scripts/initd.debian /etc/init.d/iscsi-target;
elif [ -f /etc/redhat-release ]; then
install -v -m 755 scripts/initd.redhat /etc/init.d/iscsi-target;
+ elif [ -f /etc/slackware-version ]; then
+ install -v -m 755 scripts/initd /etc/rc.d/iscsi-target;
else
install -v -m 755 scripts/initd /etc/init.d/iscsi-target;

iSCSI On a budget!

Monday, November 22nd, 2004

Following the Quick Guide to iSCSI on Linux I managed to setup a iSCSI Target host on Slackware 10 running on a virtual machine on VMware then connected to it from the Windows 2000 box which was the VMware host! :)

I used the iSCSI Enterprise Target rather then the Ardis Target which the guide covers but as the Enterprise Target is a fork of the Ardis Target there is no variation in steps carried out.

The Windows Initiator can be dowloaded from here

WMI Window Manager

Tuesday, October 26th, 2004

After a serious plugging by some of the peepz @ BSD Nexus (WIntellect!!) I decide to give the new window manager called WMI a try on my laptop running OpenBSD.
WMI is coming from the same angle as flux & black box in that its a totally stripped down window manager with heavy focus on keyboard shortcuts.
For OpenBSD the site links straight to the OpenBSD ports cvsweb page, where you can download the necessary files to build WMI, the build process went totally smoothely & a package was created in /usr/ports/packages/i386/all/ but as there is a error in one of the Make files, the package doesnt complete the install & outputs a error (will investigate this & keep you updated).

I wasnt particularly impressed with the default theme that WMI comes with (called industrial) but there are 2 aditional themes currently available on the WMI site which you can install, which I did (im currently running the DragonflyBSD theme) & judging from the contents of a theme if you dont like the themes available it wouldnt be very difficult to make your own one, a quick edit of my theme file to add some wallpaper & Its all systems go. :)

Automated Uploads with FTP using cron

Sunday, July 25th, 2004

Today I’ve mostly been messing with IRC bots & toys.
setup a bot (eggdrop) & irc stat generator (pisg) on my server here at home. Unfortunately the channels website is hosted elsewhere, using crontab I created a cron job to run pisg at a regular interval, then planned on using ftp in another job to upload the generated stats page. Unfortunately there no way of telling the ftp command to upload files.
To get around this I resorted to setting a cron job on a script which ran ftp & included the necessary ftp commands to upload the file piped to the ftp command.
Heres the script I used (thnx Dan!):

#!/bin/sh
ftp -i -n ftp.hostname.net <<EOF
user myusern mypasswd
cd /whereu/want2upload/
lcd /wherethe/fileis/locatedlocally/
put index.html
quit
EOF

the crontab entry looks like this
0 * * * * /pathto/sh /pathtothe/script >/dev/null 2>&1