“Kristens resa”, anno 2009, i form av en makaron

15 February 2009, 18:56 — Christianity, Insane

John Bunyan skrev sitt allegoriska mästerverk “Kristens resa” 1678-1684 (Pilgrim’s Progress) om en kristens färd genom prövningar och äventyr under sitt jordeliv.

Nu finns det ett uppdaterat verk, skrivet anno 2009, där Kristens prövningar uttrycks… i form av en makaron.

Lament for Delphi

15 February 2009, 18:23 — Poetry, Software Development

It was with a pang of sorrow
That I realized today
We may have to say goodbye

We were brothers in arms for so long
You helped me do things
I could never have done on my own.
We built applications, you and I
Hacked together utilities and tools
And the sun was shining.

You never once complained.
Never once faltered.
You had your oddities and quirks
Unappreciated and ridiculed
But you were mine!
And underneath that bland exterior of yours
Was raw power…
The skies were limitless.

I held on to you for as long as I could.
But now you’re slipping through my fingers
And a new group of people will benefit now.

Farewell, my brother,
Remember how I loved you.
Remember the victories we won.

I will never forget.

Scripts to alter DNS settings

15 February 2009, 9:59 — Uncategorized

My NetGear router has been acting more and more weird the last months. I don’t really know why, but sometimes the DNS resolver inside just locks up and misbehaves something wicked. It would be a lot easier if it could just forward the DNS settings through DHCP, but it doesn’t do that, it just always sets itself as the dns resolver. Maybe it started appearing when I installed Vista, dunno.

So I made some scripts to change this. Just sharing it with the world in case someone else has a problem.

SetTeliaDNS.cmd:

@echo off

set IF="Wireless Network Connection"

netsh interface ipv4 set dns %IF% static none
netsh interface ipv4 add dns %IF% 195.67.199.24
netsh interface ipv4 add dns %IF% 195.67.199.25

netsh interface ipv4 show config %IF%

SetDchpDNS.cmd:

@echo off

set IF="Wireless Network Connection"

netsh interface ipv4 set dns %IF% dhcp
netsh interface ipv4 show config %IF%

Using the first, I switch my wireless network over to predefined DNS through my ISP, Telia. Using the second, I switch back to whatever I got through DHCP – when I use another wireless network, for instance.

And then, just a quick link to these two in the TrueLaunchBar menus, and… good to go.

Code folding in Netbeans PHP

6 February 2009, 10:26 — Software Development

I recently found out a tip that C#-style #region and #endregion-style declarations work in NetBeans for PHP too, although with a slightly different syntax.

The trick was making it work in HTML, since I use it mostly for defining different sections of my .phtml templates, which can get pretty long:

<? // <editor-fold defaultstate="collapsed" desc="JavaScript code"> ?>
...
<? // </editor-fold> ?>

Realized you had to escape to PHP for it to work. A little extra syntax, but look at my beautiful, beautiful HTML code: