East of the Sun, West of the Moon



Filed under: Site,Software — Erwin @ 12:57 pm

Because my webserver is on an internal host that is firewalled in, it can’t make trackback requests directly. WP in its natural form is blissfully unaware of this concept, so I had to adjust the code a bit:

$ diff -bc functions.php.orig functions.php
*** functions.php.orig  Mon Oct 18 12:38:57 2004
--- functions.php       Mon Oct 18 12:47:05 2004
*** 551,556 ****
--- 551,566 ----
        $tb_url = $trackback_url;
        $url = urlencode(get_permalink($ID));
        $query_string = "title=$title&url=$url&blog_name=$blog_name&excerpt=$excerpt";
+         $proxy = 1;
+         if ($proxy) {
+           $http_request  = "POST $trackback_url HTTP/1.0\r\n";
+           $http_request .= 'Content-Type: application/x-www-form-urlencoded'."\r\n";
+           $http_request .= 'Content-Length: '.strlen($query_string)."\r\n";
+           $http_request .= "\r\n";
+           $http_request .= $query_string;
+           $fs = @fsockopen(<my-proxy-host>, 3128);
+         } else {
              $trackback_url = parse_url($trackback_url);
            $http_request  = 'POST ' . $trackback_url['path'] . $trackback_url['query'] . " HTTP/1.0\r\n";
            $http_request .= 'Host: '.$trackback_url['host']."\r\n";
*** 559,564 ****
--- 569,575 ----
            $http_request .= "\r\n";
            $http_request .= $query_string;
            $fs = @fsockopen($trackback_url['host'], 80);
+         }
        @fputs($fs, $http_request);
        $debug_file = 'trackback.log';

Yay, now I get to harass others with my blog. 😉

Either WP or one of the plugins doesn’t like backslashes in the text. It strips them out except if it’s doubled, but then when it presents the text to me for editing it doesn’t double them itself so editing something twice without doubling all the backslashes makes me lose it again. Oh well, can’t win ’em all.

Update 2:
Ok, doubling still didn’t do the trick properly because in the resulting output they got lost. I ended up using &#92; which was thankfully left alone by the WP and related code.

Can I have a weekend now?

Filed under: General,Software — Erwin @ 11:33 am

On Friday evening both M and I went to bed feeling slightly unwell, but not quite sure what could have caused it. Saturday morning we both woke up with massive headaches and an upset stomach. Of the kids, A had puked on his bed and N wasn’t feeling a 100% either, fun! Both recovered sufficiently to spend a day with their grandparents, giving us a quiet house. Of course not like we got to enjoy that, with our headaches, even after taking some painkillers (on nearly empty stomaches, yay). Bad enough that I didn’t feel like sitting down at the computer and distract myself with some catching up on news, or play some mindless games of Go. By Saturday evening when both kids were home again, we were finally starting to recover and towards midnight I was 90% ok, M not far behind.

Then Sunday morning, I wander down to the basement (where my office is) and find that the billing system at work crashed. Oops! A few hours and one recovery later, it crashes again, but this time due to lack of diskspace because I had left a few spare copies of rather large files sitting around to analyse later. Double oops! I move them out of the way and on we go, but it mostly ruins the good feeling of having recovered from Saturday’s illness.

Later that evening IgorMUD, where I’ve spent many years as wizard and some as arch(admin), crashes as well, but thankfully that is (no longer) my responsibility so after I alert the programmer of the gamedriver to the issue and he finds the cause and provides a source-patch, I fairly quickly fade out into the night.

This morning, I find the billing system at work had crashed again, again due to diskspace shortage, argh! Removing more crud and analysing the damage, I move on to drinking my coffee and wondering: Can I have a weekend now?

Powered by WordPress