fluffigt.com *poof* said fluff….

18Oct/110

Dennis Ritchie, tack för allt!

Den 12:e oktober gick Dennis Ritchie bort efter en längre tids sjukdom. Han lever dock vidare genom C och UNIX på samma sätt som han gjort dom senaste 40 åren. Tack för allt!

Se även mitt inlägg på .SE-bloggen

16Sep/100

6 Ways To Kill Your Servers – Learning How To Scale The Hard Way

Good article over at HighScalability.com about what happens when a coder, even an experienced one, has to scale out a web site under time pressure.

The most important lessons in my opinion are caching, tweaking configuration and stress testing.

2Sep/100

How to be a better sysadmin

Matt Simmons over at Standalone Sysadmin wrote about xenophobia and elitism among sysadmins and I couldn't have written it better myself:

The way that I’ve found that seems to work best for me in understanding other people, and having them understand me, is to put myself in their place, and consider the situation from their perspective. Doing this requires humility, because it supposes that my way may not be the best or only way. This is difficult, because I have an ego and admitting I may not be right requires swallowing my pride. But I do it, because to work together for mutual improvement, it’s necessary to maintain an open mind.

Not everyone makes this effort, however. There is, and probably always will be, a minority of people who are xenophobic. That is, they are afraid of things and ideas that are different from theirs. As I was explaining to someone on twitter earlier, this xenophobia manifests itself in a complete antipathy toward methods and opinions which differ from their own. You’ve seen it. We’ve all seen it. You see it whenever someone decides an idea is wrong because it belongs to someone else, and if you challenge that stance, the person attacks you.

Can't honestly say that I'm always the understanding and considering sysadmin myself, but I try...

Tagged as: , No Comments
6Nov/080

Man trodde ju dom skulle lära sig av varandra…

Nu har D-Link också gjort det... Vad kan man säga mer än att historien upprepar sig. För nästan precis fem år sen sålde Belkin en router som gjorde om slumpmässiga dns-uppslag (eller om den "bara" kapade vissa HTTP-sessioner) för att göra reklam för en ny funktion i deras router. Nu har tydligen D-Link fått för sig att göra samma sak. Man upphör aldrig att förvånas!

11Sep/080

daemontools and ucspi-tcp on Hardy Heron

I was about to install daemontools and ucspi-tcp on Hardy Heron (Ubuntu 8.04) when I found that the packages build-daemontools et al was not in the archive anymore! Instead of digging about what happened I found out that Intrepid Ibex[1] has some packages.

So what I did was download the packages daemontools, daemontools-run and ucspi-tcp, and then install them. A bit of a problem with that too, but the following steps did the trick for me.

# touch /etc/inittab
# dpkg -i daemontools
# dpkg -i daemontools-run
# dpkg -i ucspi-tcp
# echo "start on runlevel-1
start on runlevel-2
start on runlevel-3
start on runlevel-4
start on runlevel-5
start on runlevel-6

stop on shutdown

respawn

exec /usr/bin/svscanboot" > /etc/event.d/svscan
# initctl start svscan

And that's it! Have fun folks!

[1] http://packages.ubuntu.com/search?keywords=daemontools&searc...

23Aug/080

Private methods in PHP programming – response

Felix over at Debuggable wrote an interesting article about private methods. He thinks it's not a very good thing to use, but, kudos to him, doesn't rule out the possibility. He argues that he doesn't have any formal education in programming and development, but I don't think that matters much at all since he seems to have quite a bit of programming experience.

But what I think is that, of course, you alwas can write private-method-free code, but sometimes it's not very good. When you need to duplicate code time after another, you might begin to see the need for another method (refactoring) or for that matter class. What that method does or returns maybe, just maybe, isn't that good for the rest of the world (read application) to access directly rather than through your other, more high level methods.

CakePHP itself is has lots of private methods. Could we do without them all? Of course we could. Would it make the code easier to read? Maybe. Would it make the code easier to maintain? I think not.

With that said, you always need to make an active decission whether you choose to make a method public, private or protected. Chances are, if you only write public because you are used to it, you might be making a mistake that could compromise stability or security of your application if another developer makes use of that method...

22Aug/080

Power consumption on office switches

Russel Coker wrote about switches and cables, and thinks putting a "dumb switch" on every desk is a good solution for office networking. He's got a couple of valid points, for example that it's possible to use less cables from the patch room, no (or less) dependency on network gurus and so on.

What he doesn't talk about is that

  • Power consumption goes up. Each office switch typically uses between 5W and 10W depending on how good the AC/DC-adaptor is. (example of WRT54 power consumption)
  • You get many more SPOF. Okay, most switches actually works quite good, but office support will have to answer a great many calls of "Internet is down" etc.
  • Configuration of a "real" switch isn't that complicated, draws less power and usually gives _many_ more possibilities than the dumb table-top switch (ie VLAN, bridging, QoS, ...)
18Jul/080

xen 3.02 on Debian Etch / AMD64

A quick walk-through of installation of Xen 3.02 on Debian Etch (AMD64):

KERNELS="linux-2.6-xen0 linux-2.6-xenU" make -j7 world
make install
make linux-2.6-xen0-config CONFIGMODE=menuconfig
make -j7 linux-2.6-xen0-build
make linux-2.6-xen0-install
make linux-2.6-xenU-config CONFIGMODE=menuconfig
make -j7 linux-2.6-xenU-build
make linux-2.6-xenU-install

vim /boot/grub/menu.lst

title Xen 3.0.2 / Debian GNU/Linux, kernel 2.6.16
root (hd0,0)
kernel /xen.gz dom0_mem=131072
module /vmlinuz-2.6-xen0 root=/dev/sda2 ro console=tty0
savedefault

Install xen-tools, xen-shell etc

update-rc.d xend defaults 20 21
update-rc.d xendomains defaults 21 20

4Apr/080

No 404 page when using a static front page

I was setting up a wordpress blog (latest version, 2.5) a couple of days ago, and added the great plugin Google XML Sitemaps. I wanted a static frontpage with a couple of blog posts below it, so I modified the Kubrick theme a bit (added another template to use for that page, no biggie).

When taking a look at Google Sitemaps (somewhere under Google Webmaster Tools) I found that WordPress didn't respond to non-existing pages with a 404 not found, but all my pages after each other, rather like the posts on a dynamic front page.

Again I thought - no biggie! I modified the 404.php template to begin with the following:

<?php
ob_start();
header("HTTP/1.1 404 Not Found");
header("Status: 404 Not Found");
...

Still, no luck. Then I saw that WordPress didn't even read the 404.php page! I tried turning off the static front page and voilà, 404 works okay again.

I've searched a bit for this in the WordPress forums, but I'll report a bug ticket for them. Hopefully it will work in the next release 🙂

Newsflash:

It only works this way if you haven't chosen a "Posts page". Maybe it's just an undocumented feature?

1Apr/084

Symfony development with XAMPP on Windows

This is how I set up my windows laptop for development with Apache/MySQL/PHP/Symfony (XAMPP with Symfony).

  1. Download XAMPP Installer package.
  2. Install XAMPP - this is really just a case of next -> next -> okay.
  3. Since I'm not only using my laptop for development I chose not to start any services except for XAMPP when windows starts.
  4. Start (from XAMPP Control Panel) Apache and MySQL (and whatever other services you need).
  5. Add PHP to your PATH.
    1. Right-click "This Computer", choose properties.
    2. Advanced tab -> Systam variables (not sure, my system is in Swedish 😉 )
    3. Add C:\xampp\php;C:\xampp\mysql\bin (if installed in default location) to the PATH variable.
  6. Upgrade Pear - pear upgrade pear
  7. Find Symfony - pear channel-discover pear.symfony-project.com
  8. Install Symfony - pear install symfony/symfony
  9. Done! Start playing around...