Mostly about my amusement

Category: Geek (page 28 of 36)

Vista and 4 GB of RAM

I’m running Vista 64 on my XPS 700 720 and I just upgraded from 2 GB RAM to 4 GB of 800 MHz dual channel DDR2 ram.  My system was running slowly (it’s a Microsoft Operating System).

The RAM even came with heat sinks.   After the upgrade my system does perform nicely and I have much less disk thrashing.  But Vista is a pig.  Even running idle and having only Firefox or Internet Explorer, the system is using more than 1 GB of RAM.  That’s just nuts.

This is one reason why people should stick with XP.  With every iteration of Windows you get an even more hungry monster for very little benefit.  I’m glad I moved to Vista but that’s because I have a character defect.  I like working with broken and difficult systems.

I went with the 64 bit version because I was sure I’d run application that could use the RAM.  With a 32 bit Microsoft OS you get a actual limit of somewhere between 2 and 3 GB’s.  It’s an addressing issue and the fix is to go 64 bit.

Ubuntu 7.10 on Virtual PC 2007

Installing Ubuntu on more time

Today it’s President’s Day, it’s raining, and the kids are off this week.  So naturally I am goofing around with my PC. I’ll head to the basement soon to play with the kids but first I want to setup something on my workstation.

My main workstation is a Dell 700 720 with a Core 2 Duo and a pair of nvidia GeForce 7900’s.

It’s a great machine and I am currently playing Call of Duty 4, Crysis, and a couple of others.  But I really enjoy working in Ubuntu. I just don’t want to give up the games.

I installed Virtual PC 2007 on my workstation and enabled hardware-assisted Virtualization.  I captured an Ubuntu 7.10 iso on my disk and began running the installation. I created a disk for the virtual PC and began the installation.

I knew that once the live CD booted up I would have problems with the X11 driver.  So I ctrl-alt-F1 and ran “sudo vi /etc/X11/xorg.conf”. I replaced the “Depth 24” with “Depth 16”, saved the file, did alt-F7 to switch back to the X11 screen and then alt-backspace to restart the X11 server.

The mouse still did not work.  Google is my friend and I learned that when I boot the CD press F6 and append the following to the kernel boot parameters ” i8042.noloop”.  The article suggested running the Virtual PC in safe graphics mode but that went very low resolution on me.

Wash, rinse, repeat the “Depth 16” portion.  I’m now installing on my Virtual PC 2007 Ubuntu with a color depth of 16 and a working mouse.  My system has only 2 GB of RAM but since I upgraded to the XPS 720 motherboard I can go nuts with the 800 Mhz stuff.

Vista 64 with 8 GBs of RAM, that sounds like a good upgrade.

After the install I modified the /boot/grub/menu.lst to add to the kopt line i8042.noloop as well as to the end of the kernel line.  That’s probably not the place to put it but it works for now and I’m going to continue working on it. I’ve just got the networking going and I’m putting on 187 updates since the iso image was created.

Bad mail queuing in Postfix

Yesterday around 12:36 AM my main server mowgli went into a temporay coma (a disk volume fell down and did not get back up) and was not receiving mail.

No problem, thanks to the magic of DNS MX records, mail goes to my backup server dixie. Good thing I was clever and had dixie forward all mail to Optimum Online’s mail relay… when the mail relay got the dembowski.net mail it tried to deliver it to mowgli (who was down) and then back to dixie. The mail dixie got was sent into a loop with my ISP’s mail relay.

Each hop is added to the messages SMTP header and when an MTA sees that it is looping with itself then it typically sends the sender a non-delivery message and discards the original mail.

I lost about 20 hours of mail messages for my domain. Once mowgli was fixed I made a change to mowgli’s Postfix configuration. In the main.cf file I changed this line from

smtpd_recipient_restrictions = permit_sasl_authenticated, permit_mynetworks, reject_unauth_destination, reject_rbl_client zen.spamhaus.org

to now include a whitelist

smtpd_recipient_restrictions = permit_sasl_authenticated, permit_mynetworks, reject_unauth_destination, check_client_access hash:/etc/postfix/whitelist, reject_rbl_client zen.spamhaus.org

The /etc/postfix/whitelist file just contains one line for dixie’s IP address

24.46.186.255 OK

I ran postmap hash:/etc/postfix/whitelist and tested. From dixie I was able to telnet to mowgli on TCP port 25 and send mail by typing in the SMTP commands directly. Before this I would get an error message like

554 Service unavailable; Client host [24.46.186.255] blocked using zen.spamhaus.org; http://www.spamhaus.org/query/bl?ip=24.46.186.255

Now my main server accepts mail just from that IP address on the whitelist before the Spamhaus check occurs. The reject_rbl_client check is still working (open mail relays are BAD) it’s just my one IP address that gets a pass.

The configuration on my backup server dixie was simple. I added to main.cf one line

transport_maps = hash:/etc/postfix/transport

The file /etc/postfix/transport contained

dembowski.net smtp:[mowgli.dembowski.net]

I ran postmap hash:/etc/postfix/transport and restarted postfix. Now when dixie needs to deliver mail to dembowski.net it sends it directly to mowgli. If mowgli is unreachable it will just queue up the mail until mowgli becomes available. Every other domain gets forwarded to my ISP’s mail relay and all is good.

Amateur balloon hits 30km with pics

Reddit’s web site is a pure time waster by design. This morning I saw this link. It leads to a web site that shows how a hobbyist built a kit and put it on a high altitude balloon. According to his sensors he hit about 30km and has pictures to back that up. Amazing!

This kit (space capsule?) let him take spectacular digital photos that he posted. The kit contained GPS, sensors, digital camera, etc. My favorite part is where the hobbyist Alexei Karpenko states

Also, I have verified that the Earth is indeed round and that space is black.

I can’t see many people running out an getting into this hobby but it sure reminds me of when amateur rocketry using Estes kits was popular when I was a kid.

Head over to that site, the web page details the time line, what was in the kit, and the data and pictures collected.

Update: I guess the site got hit with the Digg effect!  The new URL is not redirecting properly, use this link to get to the Flight 2 web page http://natrium42.elyxa.com/halo/flight2/? .

A brown out or “why DR planning is your friend”

My server is in the basement of my home. In Long Island. Where we have brown outs like the one we had today.

The clocks came back and had to be reset but my Linux server apparently did not, or maybe it’s the cable modem. Hard to tell exactly as I am not at home. Fortunately I backup my server every night to a VPS hosted by TekTonic. It’s $15 a month and and serves as a backup DNS server for my domains. It’s not the fastest but it’s good enough for my traffic.

So once again I updated my DNS record for blog.dembowski.net, ran the restore script on the VPS, updated my wp-config.php and poof I’m running.

The best part was that I did this using the ssh client on my Blackberry Pearl! It works but using vi on that small screen is not something I would recommend. I know where all the pieces are but if I we hunting and pecking I would not be able to get the blog up and running.

Once I figure out what is going on with my basement server I’ll do the process in reverse.

Fun with WordPress tags

Going from UTW to WordPress 2.3’s built in tag system was mostly painless. But there are somethings I miss about UTW. Two of those things are being able to display “Tags: None” and having my tags show up in my RSS feeds. Here is how I was able to put both back into my blog.

Adding “Tags: None” to my theme

I’m not a PHP programmer. I had thought I could just do $my_tags=the_tags(); and put in an if..then loop to check if it’s empty. That did not work; referencing the_tags() would cause the output to go to the $content and get displayed.

PHP has a function called ob_start(). From the manual page:

This function will turn output buffering on. While output buffering is active no output is sent from the script (other than headers), instead the output is stored in an internal buffer.

That’s good! Looking around some more I saw that using ob_get_clean() can put that buffer into my variable. That’s what I wanted so I could just capture and test the output. Here is the code I put into my theme template.

<?php if (function_exists(‘the_tags’)) {
ob_start();
the_tags();
$my_tags = ob_get_clean();
if ( $my_tags != “” ) {
echo $my_tags;
} else {
echo “Tags: None”;
}
} ?>

This lets me check the output from the tags and if it is empty then I can display “Tags: None” when I want.

Update: There is an easier way without using ob_start(), using get_the_tags().

<?php if (function_exists(‘the_tags’)) {
$my_tags = get_the_tags();
if ( $my_tags != “” ) {
the_tags();
} else {
echo “Tags: None”;
}
} ?>

I thought about this because a) it’s easier, and b) I think that wp-cache might do this and then my theme might cause issues.

Adding tags to my feeds

Making feed include tags was a simple matter as well. I had read on Angsuman’s blog about a plugin that lets you append copyright notices to your feeds. I downloaded it and took a look at the plugin. Simplest code in the world, I just modified Angsuman’s plugin. Here is what it looks like.

<?php
/*
Plugin Name: Add Tags to Feeds
Plugin URI:
Description: This adds WP 2.3 tags to your feeds.
Author: Jan Dembowski
Author URI:
Version: 1.0
*/

function addTagsToFeed($content) {
global $my_tags;
ob_start();
the_tags();
$my_tags = ob_get_clean();
if(is_feed()) {
return $content.”<p class=”tags”>”.$my_tags.”</p>”;
} else {
return $content;
}
}
add_filter(‘the_content’, ‘addTagsToFeed’);
?>

Nothing to it. My feed validates and now the tags are in the feeds too. Seeing how existing code uses add_filter is probably the best way to learn by example.