I have just imported all my old blogs from http://notvincenz.blogspot.com, randomly sampling one entry, I noticed that some of the blogs need to be reeditted a bit. If you happen to notice any broken blogs, please ping me so I can fix it.
Thanks!
Blogging about technology, functional programming, linux and life in general.
I thought I would share an old piece of code that I’ve had lying around for a while. Basically, it calculates Fibonacci numbers in the type system:
{-# LANGUAGE EmptyDataDecls, MultiParamTypeClasses,
FunctionalDependencies, FlexibleInstances, UndecidableInstances #-}
module Fibonacci where
data Nat
data S a = S a
class Numeral a where
value :: a -> Integer
prev :: S a -> a
prev = undefined
instance Numeral Nat where
value _ = 0
instance (Numeral a) => Numeral (S a) where
value x = 1 + (value . prev $ x)
class Add a b c | a b -> c where
add :: a -> b -> c
instance Add Nat b b where
add = undefined
instance Add a b c => Add (S a) b (S c) where
add = undefined
class Fib a b | a -> b where
fib :: a -> b
instance Fib Nat Nat where
fib = undefined
instance Fib (S Nat) (S Nat) where
fib = undefined
instance (Fib (S a) b, Fib a c, Add b c d) => Fib (S (S a)) d where
fib x = undefined
main = print . value . fib . S . S . S . S . S
. S . S . S . S $ (undefined :: Nat)
It has been a while since I last blogged, mostly due to the fact that I’ve been busy settling into my new place, travelling to IKEA, breaking IKEA mobility vans, buying furniture, etc. However, I’ve started on a new little project, and I thought that I’d document as I go along.
The project I’m working on is a little home network. You could say that a home network is rather easy, and it is, but I’ve decided to make my life more complicated. I want to learn more about routers, DNS, firewalls, traffic-shaping, etc, so I thought that this was the perfect project for that. Additionally, I might soon get another computer with some colleagues at a colo, so that will give me enough reliability (along with my linode box) to set up a set of nameservers for my own domain.
Currently I would like to:
Let’s start by defining the hardware I have:
Now, originally, we had the WRT54G wireless router in our office, on the first floor. Sadly, due to the incredible swiss building style, we’re not able to get WIFI in the living room, which is exactly 1 floor up. We’re investigating whether we can use the ISDN-plugs that seem to be available in each room to route ethernet upstairs. If that’s possible, then the links router will go upstairs for WIFI in the living room, and I’ll use the ALIX engine with the WLAN card to supply our downstairs with WIFI. Let’s hope it’ll work, otherwise we might have to get another WIFI bridge, which wouldn’t be very neat.
Currently, the plan is as follows:
I’ve been contemplating quite a bit which OS to install on the Alix boxen. I’ve always worked with Ubuntu (well not quite always, way way long ago I had Mandrake, and prior to that Slackware). There are mini-distros available, but given the amount of space I have on the CFs and since I want this to be a learning exercise, I’ve decided to stay away from them. This leaves me with the following choices:
For the PXE install, I followed the advice on this page. Sadly, after a lot of struggling, I would get the device to start dhcp, it would actually start copying files, but it would not boot. I then moved to trying to install plain old debian, however this failed as well, it would boot properly, but then it would simply hang. Perhaps it is the serial settings of minicom that were screwing up.
Therefore, I’ve moved on to try Voyage Linux, which seems to be a slimmed down Debian specifically suited for this purpose, but not limited to being just the slimmed down version. Installing it was a breeze, I just followed the instructions given in the README, and everything worked perfectly.
The first things I did, was install vim and screen. I also set up proper .screenrc and .vimrc.
Looking further into how things are mounted, I noticed the following:”
This shows two different ways of not using the CF when not required, one which is purely transient and one which is non-transient but saves on CF writes. Currently, I think the following setups might be good:
This article has remained as draft for far too long, so I will publish it and create a second article to continue.