Mostly about my amusement

Category: Geek (page 27 of 36)

To Digital SLR or not

I’m not a camera person.  I have a really good memory for events and like to talk to people. I can’t show people what I saw but the telling is very entertaining.

This really means I take lousy pictures, mostly because my hands shake. Using a small camera like our Canon SD400 always get a poor photo.

One of my brothers is a genuine camera enthusiast.  His current camera is a Nikon D80 and he looks longingly at the D300.  If he won the lottery he’d go nuts and get a D3 with a whole compliment of new lens, new flash, tripod, etc.  You can see Stefan’s work at his Flickr page, he really enjoys working with his camera.

Doing his civilian duty to boost the economy, Stefan has been successful at getting co-workers to purchase DSLRs.   One of our co-workers recently got a Nikon D60 and let me play with it.

It’s a remarkably comfortable camera.  The package came with two VR lens and just for goofs, I took some test pictures by zooming the 200mm lens out, standing in my most awkward pose and shot a photo of a sign.

The picture was very stable, no blurriness at all that I could complain about.  Playing with the aperture size, ISO, etc, got me different yet cool results.  I played with the 15-55mm lens as well; the D60 is targeted at people like me who are thinking of getting into semi-serious digital photography.  Since I’m not clever enough to just rest the camera, the VR lens are great.

The owner of the camera had shot over 900 picts in only a couple of days; I could easily see my self tormenting the family taking lots of pictures like that.

I had no idea what I was doing but it was pretty entertaining to me.  So now I am thinking about pricing out that D60 package.  We’re planning a couple of trips with the kids and being able to post decent shots would be a bonus.

Upgraded to Ubuntu 8.04 LTS

My Ubuntu T40 laptop is “only MOSTLY dead”.  The built in LCD display is too dark to read and I replaced it with a HP laptop running Vista Home Premium.

I feel slightly guilty about running Vista on it but it runs really well so ptthhhhppp.  I put the T40 onto it’s docking station and hooked it up in the basement with the other equipment.

The upgrade was easy as usual.  Just sudo su – and update-manager -d.  It took a while to download the files but a reboot later and I’m running.

This new Ubuntu feels faster.  It’s hard to really quantify that with old hardware, but it does.  So far the only issue I have is that the spell checker in Firefox 3 beta 5 is broken sometimes (I had to use the one built into WordPress for this post).

It’s like a refined version of 7.10.

.htaccess fix for machine translation

The current version of ATPP is 5.1 and it works really well. But occasionally I get speed bumps from Babelfish and Google translation engines so I end up turning it off for a while.

Without the plugin, when someone goes to the translated version of a posting, they get redirected to the home page.

For example the German pages for Andre’s trip to Disneyland is

http://blog.dembowski.net/2008/01/30/andres-trip-to-disneyland/de/

When I turn off the plugin users get sent to

http://blog.dembowski.net/

Here is where .htaccess comes to the rescue. By adding lines at the top of my .htaccess file I can send the request for a translated post to the English version:

RewriteRule ^de/ http://blog.dembowski.net/ [R=302,L]
RewriteRule ^zh/ http://blog.dembowski.net/ [R=302,L]
RewriteRule ^ko/ http://blog.dembowski.net/ [R=302,L]
RewriteRule ^ja/ http://blog.dembowski.net/ [R=302,L]
RewriteRule ^pt/ http://blog.dembowski.net/ [R=302,L]
RewriteRule ^it/ http://blog.dembowski.net/ [R=302,L]
RewriteRule ^es/ http://blog.dembowski.net/ [R=302,L]
RewriteRule ^(.*)/de/ http://blog.dembowski.net/$1/ [R=302,L]
RewriteRule ^(.*)/zh/ http://blog.dembowski.net/$1/ [R=302,L]
RewriteRule ^(.*)/ko/ http://blog.dembowski.net/$1/ [R=302,L]
RewriteRule ^(.*)/ja/ http://blog.dembowski.net/$1/ [R=302,L]
RewriteRule ^(.*)/pt/ http://blog.dembowski.net/$1/ [R=302,L]
RewriteRule ^(.*)/it/ http://blog.dembowski.net/$1/ [R=302,L]
RewriteRule ^(.*)/es/ http://blog.dembowski.net/$1/ [R=302,L]

The request from /some/url/here/de/ results in the Apache server sending back a 302 temporarily moved to the same URL minus the two letter language code.

If I have to turn off the ATPP plugin for an extended time, I can do so knowing that search engine visitors will still find the original post.

Update: added portion for languages off of the root i.e. http://blog.dembowski.net/es/ becomes http://blog.dembowski.net/

Opensuse and apache vhosts

OpenSUSE Logo from OpenSUSE.usThis happens often. I do something on my servers and six months later I try to rebuild from scratch what I did and wish I wrote it down. This is one of those blog posts.

I reviewed my Apache error logs and noticed that WordPress was tossing fatal PHP errors. I was pretty sure it was a particular plugin but I had made so many changes to Apache and PHP5 and I thought it would be easier to remove and re-install Apache and PHP5. So I switched my blog to my backup VPS, updated DNS and took apart my server.

That turned out to be a little painful and more work looking up how to set it up.

Removing the packages was simple. I just ran rpm -qa | egrep “php5|apache” to get the list of packages and created a small shell script to removed them. But I had forgotten how I had setup the virtual servers for more than one website. I wanted to avoid using the old config because I was sure I had made mistakes.

I had setup the main server dixie.dembowski.net and that worked. My MRTG and Cricket scripts were displaying correctly. Getting additional virtual hosts turned out to be easy.

In /etc/apache2/vhosts.d directory is a file called vhost.template. I copied that file and called it blog.dembowski.net.conf. I edited that copy and change all the dummy-host.example.com to the fully qualified name of my server. In vi thats just :0,%s/dummy-hosts.example.com/blog.dembowski.net/g and all the dummy names were changed.

I removed the cgi portion and added some additional Directory, AllowOverride, and Options statements. I set -Indexes and made other changes so that the rewrite rules for WordPress will work.

I saved that file in /etc/apache2/vhosts.d and that permited that my blog virtual server to work. But that caused my existing server dixie.dembowski.net to stop working. That was simple to fix. I created a file in /etc/apache2/vhosts.d called _dixie.dembowski.net.conf. The underscore character ensures that this file will be read first; the first virtual server becomes the default.

This file was very short and contained only these lines:

NameVirtualHost *:80
<virtualHost *:80>
ServerName dixie.dembowski.net
DocumentRoot /srv/www/htdocs
</virtualHost>

This let the web server at /srv/www/htdocs work as if had before I made the virtuals.

I restart Apache and all is well. I did the same thing for my one SSL host in Apache. Unlike clear text http, the SSL based https can’t do multiple SSL sites on one IP address/TCP port. I could run one on 443 and another on a different port, but I don’t bother as I only need one SSL based site.

As long as a DNS entry exists to point that name to your IP address, you can have multiple web sites served from one IP address.

Blog re-theming

How my blog used to lookI’ve been using a modified version of the FastTrack theme by Sadish for a couple of years now. It’s a good theme but it’s designed for a 800×600 resolution screen. Most of the visitors to this website use 1024×768 and on my screen it looked narrow. I felt like I was wasting screen real estate.

So after trying out lots of different WordPress themes, I settled on one called “The Journalist” by Lucian E. Marin.

This new theme has two columns with the main column wide for text. It’s easy to read and I did not change much except add some plugins and a banner at the top.

Adding the image at the top was easy. I took a version of a rotating script that I put together for Stefan’s blog and made it a separate file and where ever I wanted to put the image I just inserted this line into the php file:

<?php include(TEMPLATEPATH . '/rotate.php'); ?>

A copy of the php script can be found here. This one line was inserted into these files 404.php, archive.php, index.php, and single.php. I also create come page templates by copying the index.php and removing the post code inside and replacing it with code for the sitemap, archives page, etc.

In the journalist/images directory I made a new directory called random and placed some 700×175 jpegs there. When the rotate.php is called, it creates a list of images and populates it into a javascript. It’s convoluted but guarantees a random image with every page load.

The images were lifted from Stefan’s Flickr account with permission. If you like one check with him before you use it. I used the Gimp and set the rectangle select tool to a fixed aspect ratio of 700×175. Loading up the highest resolution image available, I was able to cut what I wanted, crop it, and resize it.

In the past I’ve made all my changes to the sidebar in sidebar.php. Widgets are lots easier, so rather than keep beating at the sidebar.php, I just use widgets now and it’s all good.

With this theme I’m using XHTML Transitional 1.0 instead of Strict. It’s easier to work with and more forgiving. I still switch to HTML in the blog editor to fix the image layout by hand and upload the images seperately. With WordPress 2.5.1 TinyMCE adds CSS classes to the img tag so I may just add those tags to my style.css and leave it at that.

(Was the) Shortest software eval ever

Browser Says NoOver at downloadsquad.com they talked about the HydraBrowser and how it may go too far with features.

It looks like Internet Explorer with enough add ons to make it “special”. It was special alright; after I ran it it wanted a user ID and password. I canceled that (I just wanted to see the web) and entered a cnn.com as the URL.

Nothing. No error message, nada.

Control Panel -> Uninstall Software -> Hydra Setup (publisher is listed as Microsoft?) and good bye. Back to Firefox for me. Install to uninstall in less that 10 minutes. I’m sure if it were some other software I’d spend some time with it, but it’s a web browser. How hard should it be?

Update: After the author left some good feedback below, I installed v1.07 on my laptop. It’s not bad and I’m listening to radio via Hydra as I update this. The browser goes for the Office 2007 look and the layout is not bad.

My laptop and PC both have a 16:10 aspect ratio and that permits Hydra to display the web page well and still leave room for the content. The RSS reader looks familiar; I’m a huge Google Reader fan so I probably wont be using that feature. The integration is interesting but the overall experience feels like the product is still developing.

That’s not a bad thing at all. My complaint originally was that without setting up an Admin user, you could not even use the browser. The author’s v1.07 which I’ve just installed, plainly says if you don’t create an account you can still use the guest access. That’s good responsiveness to a “feature request” which was not even in his forum.

I’ll continue to kick the tires some more. I doubt I’ll leave Firefox 2.x anytime soon (Firefox 3 beta 5 annoys me; don’t know why but it does) but I’m glad to see someone is working on another alternative outside of Opera and Firefox.

Internet! You kids get off the lawn!

I have a few blog entries about Gundam episodes and Gunpla and I often put up graphics either of the model I’m assembling or image from the anime I am watching.

This is the Internet and I don’t mind people copying the images onto their website. I mean, why would I? Some of the images aren’t mine, like the Ubuntu logo. if I get an e-mail from Sunrise about a Gundam 00 image, I’d be shocked and flattered.

But I do not like hotlinking and had been blacklisting new URLs on a regular basis. Hotlinking is when some individual on the Internet decides he likes something on my website, so he loads it directly from my server onto his page.

Myspace users do that a lot.

So rather than continue looking at my logs and zapping offenders one at a time, I finally put in the following into my .htaccess file:

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://blog.dembowski.net/ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.dembowski.net/ [NC]
RewriteCond %{HTTP_REFERER} !^http://.*.google..*/ [NC]
RewriteCond %{HTTP_REFERER} !^http://.*.yahoo..*/ [NC]
RewriteCond %{HTTP_REFERER} !^http://.*.msn..*/ [NC]
RewriteRule .*.(gif|jpg|jpeg|png)$ - [F,NC]

This lets search engines that I like get copies of the images (I run a web server on the Internet, I want people to find me). The second line lets the web server load images if there is no referer.

If you try to load an images onto your website from my web server, and you are not on the approved list, then the image will not load. I thought about putting in a “Don’t hotlink you loser” image but why bother? I just want hotlink to my website to stop.

All is good with WordPress 2.5

WordPress button from WordPress.orgSo far so good. Once I stopped using version 2.3.3 and switched to 2.5 I got the hang of the new admin interface.

The old Admin-SSL plugin stopped working because the cookie code was from the old wp-includes/pluggable.php. The cookies are different so the old plugin failed.

There is a replacement but it does not set the cookies for use with SSL pages only, which was a huge part of the old plugin. I’m going to see if I can get the old one working with the new auth cookie code. My PHP is horrible so I’m not feeling too optimistic.

Mostly WordPress 2.5 worked right out of the box for me. Since I’m using the translation plugin, I get lots of Mysql database timeouts. With 2.3.x I implemented this fix and the translation pages have no issues with database timeouts. The fix has been updated for 2.5 so my database is not complaining anymore.

Thanks to 2.5 I was able to get rid of 2 fix plugins, Optimal Titles and Full Feed. Both are no longer needed. I did modify Bad Behavior slightly and added the Remove Max Width plugin but that’s mostly it.

An odd Easter Sunday

Today is not exactly how I intended to enjoy Easter Sunday. I’m baby sitting my main server in my basement right now. This morning at 6 AM I noticed my server in the basement was not passing traffic since 2 AM. So I rebooted the server and it came back.

I like to attend the 8 AM mass at St. Mathews because I don’t like crowds. Today we got the kids dressed up and went to church. Afterwards we went to Friendlies for breakfast. 9 AM Sunday is a great time to go; no crowds at all.

At 9:45 AM I received an e-mail on my Blackberry that my server was down again. I use the free service from Service Uptime. Yes I snmp monitor my cable modem, server CPU, server throughput, etc. and no I’m not an Uber Geek. We got home, we snapped some pictures (we were all dressed up after all) and I got to work rebooting my server.

Hard rebooting a Linux server is odd. I generally only run tested packages on my servers and I’ve had Linux boxes go for months until I had to reboot it for some kernel patch. So when this one started acting up I’m getting worried. One of my disks sounds like the fan from an old car so that might be a hint.

I pulled out a 300 GB from the Netgear SC-101 since I was not using it. I have a ton of data on the old drive so right now I have both drives mounted and am copying data from the lawn mower and onto the new 300 GB drive.

Going from one ATA bus to the other is about 8 MB/sec so it’s taking a long time. Copying data from your disk is like cleaning up your basement. If you have not looked at it for more than 6 months then you can probably lose it. Once I get what I want of the old drive, I’ll place it on the shelf and close up the server.

If it keeps happening then I’ll just get a Dell refurb PC.  In the meanwhile the kids are having a blast playing in the basement while their Dad waits for his server to finish.