Foxpro: Not a database file.

After a crash, Foxpro complained that a dbf was not a database file. Turns out this was due to an incorrect record count in the .dbf header. Bytes 04-07 in the header contain the record count and it seems that if this does not match the expected file size Foxpro complains. Calculate the correct record count and use a hex editor to alter the header.

Bytes 08-09 in the header are a pointer to the first record (Header size)
Bytes 10-11 contain the size of one record.

The record count can be calculated from this, although I was able to use LibreOffice base to open the .dbf. This does not complain if the file size does not match the record count.

Squid on pfSense 2.3

After upgrading to pfSense 2.3 it was evident that squid just wasn’t working.

It’s now working fine after….

Stopping the service. Clearing the squid folder under /var/squid.

And then…

Setting authentication to local – which didn’t work when the correct username and passwords were entered.
And then setting auth back to none – Bingo, we can get through squid.

Using vHosts on pfSense

My way of using vHhosts on pfSense involves Squid reverse proxy, DNS and vHosts.

Make sure you’ve got the Squid3 and vHosts packages installed.

Admin Access

First, the pfSense web gui should be on a port other than 80 or 443. This should be done as a matter of course anyway (use https on port 8443 maybe).


We need to play around with the Squid Reverse Proxy settings.

Make sure Enable HTTP Reverse Proxy is ticked, and the Reverse HTTP Port is set to 80. Do the same for HTTPS on port 443 if you need to.

Squid Peers

Peer server

Now move over to the Web Servers tab, and add a new web server (A Peer). We are going to add a reference to the pfSense box – where the vHosts server is running. We are telling squid that there is a peer server names pfSense running on localhost ( and listening at port 10081.



Choose the Mappings tab and add a new mapping. We are telling squid, that when it receives a request for a particular URI, to forward that request on to another server. Choose whatever you want for the Group Name and Group Description. From the Peers list, chose the peer server we defined above. In the lower URI’s section, enter the address of the web pages you want to host (eg., this will correspond with each vHost we define later.


So now we create a vHost for each site we will be hosting. Add a new vHosts with the Host name being a URI we entered earlier. The IP Address will be Port will be 10081 as we defined earlier in the Squid Peers section. Set Enabled to true and enter a description if you want.


Whichever DNS system you are using, you will need to add an entry for the URI’s for each vHost to hit your pfSense host box.


To make sure everything is updated, restart your Squid and vHost services. Point your browser to on of the sites you’ve defined and things should work…. they did for me.

Checking and securing is down to you..

Setting up IPX and NCPFS on Ubuntu 14.04

It seems that packages are not published yet for 14.04, so if you need to string together a Novell 3.12 server and Linux for some reason, this may help.

The packages from the Maverick release work perfectly.

So visit and download the following files.

  • ipx_2.2.6-8_amd64.deb
  • libncp_2.2.6-8_amd64.deb
  • libpam-ncp_2.2.6-8_amd64.deb
  • ncpfs_2.2.6-8_amd64.deb

The best way to do this (if you’re unsure) is to use wget from a console, just copy the download links from the page and paste so you end up with


Then install the packages as root.

sudo dpkg -i ipx_2.2.6-8_amd64.deb
sudo dpkg -i libncp_2.2.6-8_amd64.deb
sudo dpkg -i libpam-ncp_2.2.6-8_amd64.deb
sudo dpkg -i ncpfs_2.2.6-8_amd64.deb

Now if you’re attached to a Novell server typing the command slist as root should show it.

There are plenty of tutorials on how to mount a Netware drive, or use pserver to use your linux box as a Netware printer server.

This post was mainly a record for myself.

Watchguard Firewall X750e running pfsense

After many trusted years of service, my original pfsense firewall died (Watchguard X700).   So it was off to ebay to buy a newer model the X750e – faster processor, more RAM.  £40 later on ebay I have myself a large red box!

For those who don’t know pfsense is a damn good open source firewall.   It’s based upon FreeBSD and the firewall software runs particularly well, with a little tweaking, on old Watchguard boxes.  These boxes have a 1.3Ghz celeron processor, 6 x 1Gb NICS, 512Mb RAM.  More than ample for running a firewall.  Get two and you can set one up for automatic-failover!

So if you want a firewall that is industrial grade and want to protect your home a little better than a typical ADSL type firewall, or just want to learn more about one of these babies, then head over to ebay and grab one for a bargain.

To get one working here are the high level steps that I’ve found to work

  1. Flash the BIOS with the original CF card so that you can use large CF cards on the box.
  2. Flash a 4Gb CF card with the latest version of pfsense
  3. Sort out the DMA issue caused by the latest version of pfsense
  4. Install WGXepc so you can control the speed of the howling banshees (aka cooling fans)
  5. Install LCDProc
  6. Configure your firewall for your personal tastes

Good starting point:

And back to Firefox

So I’ve been using Chrome for a number of years now, and thought it time to try the developer spin of Firefox. So glad I did. It’s smooth, fast and probably less invasive than Chrome. The developer tools are amazing too. My browser of choice. 

Crash report – 22nd Jan 2015

Anonymous UUID: 7CA7ED79-BC1E-4D32-0AD1-248475CD9C97

Thu Jan 22 20:42:23 2015

*** Panic Report ***
panic(cpu 0 caller 0xffffff7f97a0cf63): “GPU Panic: [<None>] 3 3 7f 0 0 0 0 3 : NVRM[0/1:0:0]: Read Error 0x00000100: CFG 0xffffffff 0xffffffff 0xffffffff, BAR0 0xd2000000 0xffffff8130823000 0x0a5480a2, D0, P2/4\n”@/SourceCache/AppleGraphicsControl/AppleGraphicsControl-3.7.21/src/AppleMuxControl/kext/GPUPanic.cpp:127
Backtrace (CPU 0), Frame : Return Address
0xffffff811dfcb680 : 0xffffff8014d3a811
0xffffff811dfcb700 : 0xffffff7f97a0cf63
0xffffff811dfcb7e0 : 0xffffff7f95a11b9f
0xffffff811dfcb8a0 : 0xffffff7f95adb18e
0xffffff811dfcb8e0 : 0xffffff7f95adb1fe
0xffffff811dfcb950 : 0xffffff7f95d5a056
0xffffff811dfcba80 : 0xffffff7f95afe82d
0xffffff811dfcbaa0 : 0xffffff7f95a185f1
0xffffff811dfcbb50 : 0xffffff7f95a160fc
0xffffff811dfcbd50 : 0xffffff7f95a1719c
0xffffff811dfcbe30 : 0xffffff7f959c3f5e
0xffffff811dfcbe90 : 0xffffff7f979dddf6
0xffffff811dfcbee0 : 0xffffff7f979dcab0
0xffffff811dfcbf00 : 0xffffff8014d6be13
0xffffff811dfcbfb0 : 0xffffff8014e192c7
Kernel Extensions in backtrace:[796AE430-39FB-3255-8161-D52AFA28EE2B]@0xffffff7f959c1000->0xffffff7f95c2afff

BSD process name corresponding to current thread: kernel_task

Mac OS version:

Kernel version:
Darwin Kernel Version 14.0.0: Fri Sep 19 00:26:44 PDT 2014; root:xnu-2782.1.97~2/RELEASE_X86_64
Kernel UUID: 89E10306-BC78-3A3B-955C-7C4922577E61
Kernel slide: 0x0000000014a00000
Kernel text base: 0xffffff8014c00000
__HIB text base: 0xffffff8014b00000
System model name: MacBookPro6,2 (Mac-F22586C8)

System uptime in nanoseconds: 97828327738265
last loaded kext at 13685104947179: 240.2 (addr 0xffffff7f97b78000, size 12288)
last unloaded kext at 13784736921471: 4.2.2b5 (addr 0xffffff7f97b72000, size 16384)
loaded kexts:
at.obdev.nke.LittleSnitch 4234 11.0 8.0.0 3.0.0 1.70 1.9.5d0 100.14.37 4.3.1f2 3.0 4.3.1f2 1 124 267.0 267.0 10.0.0 1.7.3 1.0.0 10.0.0 2.0.4d1 1.0.1 7.0.0 1 1 1.0.0 3.7.21 10.0.0 3.6.1 1.2.10 3.0.4d1 240.2 240.2 3.5.0 327.5 1.0.0d1 1.0.0d1 35 3.7.0 404 2.6.5 800.20.24 705.4.1 5.5.2 3.0.7 10.1.2b3 705.4.14 161.0.0 3.1 2.0 1.8 2.1 3.1 1.7 218.0.0 161 3 8 218.0.0 1.0 3.7.21 4.3.1f2 1.0 11 267.0 1.15 200.6 1.2.0 705.4.0 1.0.12d1 2.2.6 267.0 267.0 97 4.3.1f2 1.0.0 5.8.0d49 3.7.21 1.1.0 10.0.0 1.0.13d1 10.0.0 2.4.1 2.4.1 3.1.9 245.2 3.7.0 3.7.0 705.4.0 471 705.4.0 705.4.9 3.7.0 1.7 1.7.1 1.7.1 2.6.1 3.7.0 4.5.6 700.52 2.7.0 1.0.3b3 1.0.1b8 3.2 705.4.14 2.0 2.0 2.0.0 1.1 300.0 1.0.0d1 2 1.0.5 1.0 389.1 2.0 31 28.30 3.1 2.9 1.4 1 1 1.0
Model: MacBookPro6,2, BootROM MBP61.0057.B0F, 2 processors, Intel Core i7, 2.66 GHz, 8 GB, SMC 1.58f17
Graphics: Intel HD Graphics, Intel HD Graphics, Built-In, 288 MB
Graphics: NVIDIA GeForce GT 330M, NVIDIA GeForce GT 330M, PCIe, 512 MB
Memory Module: BANK 0/DIMM0, 4 GB, DDR3, 1067 MHz, 0x859B, 0x435434473353313036374D2E4D3136464D44
Memory Module: BANK 1/DIMM0, 4 GB, DDR3, 1067 MHz, 0x859B, 0x435434473353313036374D2E4D3136464D44
AirPort: spairport_wireless_card_type_airport_extreme (0x14E4, 0x93), Broadcom BCM43xx 1.0 (
Bluetooth: Version 4.3.1f2 15015, 3 services, 27 devices, 1 incoming serial ports
Network Service: Wi-Fi, AirPort, en1
Serial ATA Device: Hitachi HTS545050B9SA02, 500.11 GB
Serial ATA Device: MATSHITADVD-R UJ-898
USB Device: Hub
USB Device: IR Receiver
USB Device: Built-in iSight
USB Device: Hub
USB Device: Apple Internal Keyboard / Trackpad
USB Device: Internal Memory Card Reader
USB Device: BRCM2070 Hub
USB Device: Bluetooth USB Host Controller
Thunderbolt Bus:

Hooking up Apache WebDAV to Zentyal Active Directory.

Nothing too tricky here, but this may save someone a little bit of head scratching. Active directory expects the BindDN to be in a slightly different format than OpenLDAP and it’s also on port 389.

You’ll be creating and editing an additional config file for your virtual host; I created mine as. /etc/apache2/sites-available/

This configuration grants access to users belonging to the webdav group, so you’ll need to make sure the group is in your active directory and users are assigned to it. It also authorises against the sAMAccountName – which is the user login name, but this can easily be altered to an email address etc.

Alias /webdav /srv/www/
<Location /webdav>
 Dav on
 AuthName "Development webdav"
 AuthType Basic
 AuthBasicProvider ldap
 AuthLDAPUrl ldap://localhost:389/cn=Users,dc=sitename,dc=co,dc=uk?sAMAccountName?sub?(objectClass=*)
 AuthLDAPBindPassword your-admin-password-for-LDAP-access
 Require ldap-group CN=webdav,CN=Groups,dc=sitename,dc=co,dc=uk
 php_flag engine off

Reload you Apache config with sudo service apache2 reload or something which works for you, and then test access with the excellent cadaver client. If you’re accessing from Windows 7 you’ll need to set up for Basic Auth. There’s a detailed walk-through here.