Mostly about my amusement

Year: 2007 (page 5 of 18)

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.

Upgraded the laptop to Gutsy Gibbon

Cool Ubuntu logo from www.linuxextremist.comLast night ran the command ‘sudo update-manager -c’ and after a few prompts left the laptop running the distribution upgrade to Ubuntu 7.10 Gutsy Gibbon. This morning I rebooted it at the prompt and poof I’m upgraded.

I usually don’t think that Linux has a real chance on the desktop; it’s just not the consumers choice. But seamless upgrades and making it so easy to use keeps me wondering. No way a Microsoft upgrade is this easy.

Half-Life 2: Episode Two

Half-Life 2: Episode 2 G-Man

I’ve bought Half-Life games since they first came out so naturally I had to buy Episode 2.

I’m about half way through in only a couple of hours. The play is okay and unlike Microsoft games (Halo 2 is still dead on Vista; what a waste) it works very well with my Vista 64 system.

When Half-Life 2 came out it in 2004 it was fantastic. Now 3 years later the graphics are getting a little dated. The problem is that other platforms kept up. Gears of War is visually stunning. Seeing the sharp polygons of the end of Gordon Freeman’s shot gun is distracting and not in a good way. I’ll play with the settings to see if I can get the images to look more realistic.

In the meanwhile the play is good. I’m glad that Valve still puts that ahead of the wiz bang effects.

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.

Ubuntu on a USB stick with XPS 720

Fixing the MBR on Vista 64 bit or how to remove GRUB from Vista. Keep this link handy, it saved me a lot of time.

Well running Ubuntu 7.10 beta did not work as well as I planned.

The 2 GB USB memory stick I had laying around was too small. This caused the installer to just stop and die around 70% or so. I printed out the coupons of the day and took them with me to BestBuy. I purchased a PNY 8 GB OPTIMA Pro Attache USB stick. It’s as no-frills as you can get and does not come with any software.

This time the installer ran, copied all the files, etc. It also installed GRUB into the MBR of my first hard drive.

Remember I thought that Vista would not play well with other operating systems? Oh, yeah that. My system could not boot off of the hard disk anymore.

This is how you can uninstall GRUB from a Vista partition:

I went to http://www.cpuguard.net/nedlasting/mbrfix.htm and read the whole page. I then downloaded and extracted MBRFIX.ZIP onto another USB stick. This stick was FAT32 formated and I put the contents into the directory called SAVED.

I booted off of my Vista 64 install DVD, ran the command prompt located the directory on that USB stick and ran

MbrFix64.exe /drive 0 fixmbr /vista

And all was right in the world. XP comes with FIXMBR but I could not find Microsoft’s equivalent for Vista 64.

After I booted up Vista a few times, I went back to the Ubuntu install CD. I mounted the 8 GB USB memory stick (it mounted it on /media/disk from /dev/sdc1) and ran

grub-install –recheck –root-directory=/media/disk –no-floppy /dev/sdc

On my system this put the root as (hd2,0) which just plain won’t work. While I was still on the live system I ran from a terminal window

sudo vi /media/disk/boot/grub/menu.lst

and located the entries I needed. All (hd2,0) had to be switched to (hd0,0) because in my BIOS when I select “Boot from USB device” that USB device gets treated like the first hard disk. I also removed the Vista section just because it makes sense.

I’m running that installation right now and doing a software update. On the 8 GB stick I have 4.4 GB free. Once I have it up to date the fun can really begin. Wonder if Compiz will like my setup?

Installing Ubuntu on a Dell XPS 720

Update 6/3/2009: Follow the instructions here at PenDriveLinux.com for Ubuntu 9.04, it works with the Dell XPS 720 very well. The only odd thing is that I have to re-enable the NVidia drivers between reboots. When you do enable it, don’t reboot. Just log out and let the auto login go and you can use the full Compiz effects.

Ubuntu 7.10 beta being installed

I run Vista 64 bit on my XPS 700 720. Looking at how it boots up, I am not sure that Microsoft will work with another operating system. And I do use this computer for work-ish *cough* games *cough* reasons.

I’ve just downloaded the 64 bit iso image for Ubuntu 7.10 beta and burnt it to CD. I’m installing the software but not on my hard drives, I’m installing it onto a 2 GB USB memory stick I have lying around.

This should let me install what I want to play with without me having to take the plunge exactly on this computer. I just have to remember to hit F12 when I boot up so the BIOS presents me with a boot menu.

As the install image booted up it played with my monitor settings and set it for 1680×1050. That’s not bad; last time it insisted on 1024×768. The sound card was not installed for the live session but that’s probably fine for now.

It’s installing right now as I enter this; I’m using Firefox in the live session. It’s going slow and I’m tailing /var/log/messages in another window to see if the drive suddenly dies.

Once I have it working off the USB drive entirely then I’ll mess with the drivers to see if I can get sound and Compiz working at 1920×1200 with full acceleration.

You need to be this tall to use a computer

Actually that should be “you need to understand how an application works before you can use it”. I think that Jammie Thomas would be better off today if she understood what could happen in the real world with using an application.

When I get Opensuse (this weekend I’ll get OpenSUSE 10.3) I’ll leave it running for a while to benefit others. Once I’ve done that long enough I’ll take it down. Contributing to the Opensuse torrent is a deliberate action on my part, it’s not automatic and does not share files on my hard drive. I’m not sure that I can use µTorrent to just share folders; never wanted to so I just don’t know.

Kazaa is a P2P file sharing app. IMHO It’s different from Bit Torrent because in Bit Torrent you need to leave the download running in order to share it. Apparently with Kazaa it’s trivial to share out your whole music library and this has gotten Kazaa into deep poo with the music industry.

This lady was sued by the RIAA and rather than settling for the extortion she went to trial. The RIAA behaves like a shake down organization and claims that if you rip the CD’s you paid for to your iPod then you are a thief. I did it with my CDs (can you get Basia on iTunes?), apparently so did the POTUS when he had the Beatles on his ipod. Soon I am sure they will insist on a pay-per-play model.

Oddly enough she lost. Her defense was basically “I don’t know how this happened, but it was not me. Maybe gremlins did it”. If she had used a different Kazaa account name than the one she uses for other services, then maybe. But her lawyer tried the dumbest defense possible by just claiming ignorance of the file sharing of those 24 music tracks.

I don’t like the RIAA. I think they should be shut down and let consumers alone instead of trying to scare them with “the sky will fall on you if you don’t contact our settlement extortion centers” tactics. I think that they are hurting their industry more than they are protecting it. But if you are caught doing something that is illegal, whether it should be illegal or not is moot, then you just might want to be able to demonstrate that it was not you instead of just saying it.