November 12th, 2008
If your bind restart fails with the following symptoms:
dax:/etc/bind# /etc/init.d/bind9 restart
Stopping domain name service…: bindrndc: connect failed: 127.0.0.1#953: connection refused
failed!
Starting domain name service…: bind failed!
Check in /var/log/daemon.log - I suspect you’ll have something along those lines:
Nov 12 13:08:22 dax named[25989]: loading configuration from ‘/etc/bind/named.conf’
Nov 12 13:08:22 dax named[25989]: listening on IPv4 interface lo, 127.0.0.1#53
Nov 12 13:08:22 dax named[25989]: listening on IPv4 interface eth0, 88.191.12.184#53
Nov 12 13:08:22 dax named[25989]: none:0: open: /etc/bind/rndc.key: permission denied
Nov 12 13:08:22 dax named[25989]: couldn’t add command channel 127.0.0.1#953: permission denied
Nov 12 13:08:22 dax named[25989]: none:0: open: /etc/bind/rndc.key: permission denied
Nov 12 13:08:22 dax named[25989]: couldn’t add command channel ::1#953: permission denied
That’s a known Debian bug (bug #500277), the fix is the folllowing:
rm -f /etc/bind/rndc.key
touch /etc/bind/rndc.key
chown bind.bind /etc/bind/rndc.key
chmod 640 /etc/bind/rndc.key
killall named
/etc/init.d/bind9 restart
Posted in Uncategorized | No Comments »
July 8th, 2008
Posted in Uncategorized | No Comments »
May 7th, 2008
PostgreSQL has a wonderful feature which is called User-Defined types. It allows anyone to create a new datatype, along with the relevant operators, which are then managed almost natively by Postgres.
I decided to use this feature to manage chessboard positions in a more efficient manner than the usual ASCII storage which looks like “rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR”
I named this new type EPD, for “Extended Position Description”. I know that all the relevant data is not present (I shall typically store information like the active color, the casting availability, and a few other fields), but it didn’t sound like a bad choice for a name.
It allows to do some cool things like:
– Create a table with the epd type
chess=# CREATE TEMPORARY TABLE test_epd(my_epd epd);
CREATE TABLE
– Insert a string - it gets automatically converted to a native format and only takes 32 bytes
chess=# INSERT INTO test_epd VALUES (’rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR’);
INSERT 0 1
– And converted back into a string
chess=# SELECT * FROM test_epd;
my_epd
———————————————
rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR
(1 row)
– What’s on A2 ?
chess=# SELECT epd_piece_at(my_epd, ‘a2′) FROM test_epd;
epd_piece_at
————–
n
(1 row)
chess=#
The code is available here. The installation process is:
- Compile: make
- Install the .so: make install
- Configure postgresql: cat epd.sql | psql
Posted in Database, chess | No Comments »
March 17th, 2008
Startup the guest Debian.
In VMWare, click on VM / Install VMWare Tools…
/dev/hdc must be unused !
Click on “Install”
VMWare will mount a virtual CD on your system. Copy VMwareTools-.tar.gz to your home directory
cd ~ && tar xzvf VMwareTools*
cd vmware-tools*
apt-get install gcc linux-headers-2.6-686
ln -s /usr/src/linux-headers-2.6.18-6-686 /usr/src/linux
cd /usr/src/linux
apt-get source kernel-image-2.6-686./vmware_install.pl
Answer [ENTER] to all questions - should work
Posted in Uncategorized | No Comments »
March 4th, 2008
Posted in Uncategorized | No Comments »
February 23rd, 2008
Posted in Uncategorized | No Comments »
January 28th, 2008
Posted in Uncategorized | No Comments »
January 19th, 2008
Posted in Uncategorized | No Comments »
December 21st, 2007
Posted in Uncategorized | No Comments »
September 6th, 2007
Posted in Uncategorized | No Comments »