Mostly about my amusement

Category: Geek (page 16 of 36)

Now using Hybrid and a child theme

I’ve been interested in switching to a theme framework and after looking at both Hybrid and Thematic, I’ve begun plugging into Hybrid with the child theme WP Full Site.

It’s a fun little exercise and Hybrid has lots of places to make changes just using a child theme. The WP Full Site function.php file has already gotten some additions by me and I’ve switched from using the_content() to using it for just the first two posts. The rest uses the_excerpt(); I couldn’t work out how to use the Query Posts widget so I broke down and copied hybrid/home.php to wp-full-site/home.php. The file in the child theme directory gets precedence over the parent template version.

This is hands down the wrong way to go about this and defeats much of the point of using a child theme. But until I work out the widget logic, this will have to do. And besides I get to brush up on my PHP skills some more.

Update: Nuts, while playing with my install I lost this post. This is actually copied from my RSS feed on Google Reader.  Backup, backup, backup…

And the winner is Xmarks

Earlier I had dropped Xmarks and installed Mozilla Weave. After a few weeks I’m back to Xmarks.  Syncing the browser history is a very useful feature, but some really weird things have been going on with my Weave sync data lately.

My problems began when I installed Weave on my Ubuntu 9.10 work station. I could not get the bookmarks to install on that browser for anything. No errors in the log, just no sync either. I have just plugged in another old PC in the basement and installed Weave. The same thing happened and I was not getting any data synced.

Also being able to roll back to an earlier set of data on Xmarks is a huge benefit. I screw up sometimes and Xmarks has a great safety net.

I know that I can install Weave and Xmarks at the same time. That way I can use Xmarks for password and bookmarks and Weave for browser history.  But I’m not going to do that because I want to limit the amount of add-ons that I’m using.

Now if only Xmarks would just sync web browsing history then I would not keep looking at Weave…

StartSSL and Nginx

I converted this blog from Apache2 to Nginx but forgot a step for SSL. With Apache2 to correctly install the SSL cert, you need to include in your config ca.pem and sub.class1.server.ca.pem. See here for more information.

I didn’t realize I had a problem until I pointed my iPhone at my SSL enabled web site.

With Nginx you’ve got

 ssl  on;
 ssl_certificate  /etc/nginx/ssl/blog.crt;
 ssl_certificate_key  /etc/nginx/ssl/blog.key;

Nginx doesn’t do SSL certificate chaining like Apache2 does. In order to get the ca.pem and sub.class1.server.ca.pem onto your install just append the two files to your certificate file.

curl http://www.startssl.com/certs/sub.class1.server.ca.pem >>blog.crt
curl http://www.startssl.com/certs/ca.pem >>blog.crt

I restarted my Nginx server and had no problems since. I continue to be impressed with StartSSL and at some point I will want to purchase a wild card cert for my domain.

So far so good with Nginx

This blog is running on a VPS provided by Slicehost. It’s the 512MB package and I have no complaints. The network connectivity is pretty good too.

512MB is not what it used to be. When I run out of ram, mysql and Apache2 both go insane. My VPS becomes unusable and I end up hitting the remote hard reboot button. There is even a Slicehost iPhone app for that (which I have installed).

I can upgrade to 1GB of RAM but I’d prefer to create a smaller memory footprint. I am constantly floating between 1MB and 90MB free and adding a whole 512MB seems like overkill. Switching to Nginx is my attempt to take care of that. And besides, they have a really cool logo.

Installing it was a breeze. Go over to Donncha O Caoimh’s blog and read up on how to get WordPress, Nginx, and WP Super Cache working. I used his notes but made some changes to my installation. The only thing I did was disable the /etc/nginx/sites-available/default and created virtual server specific files. Also I don’t use WP Super Cache, I just don’t have the traffic. I started with a copy of the default file and added a few lines.

For example, blog.dembowski.net’s file looks like this:

server {
        listen   80;
        server_name  blog.dembowski.net;

        access_log  /var/log/nginx/blog.dembowski.net-access.log;

        # Hot-linking bad, expect when I let it.
        location ~* (.jpg|.png)$ {
                root   /srv/www/vhosts/$server_name;
                valid_referers server_names blocked none
                        *.dembowski.net
                        *.google.com
                        *.feedburner.com
                        *.pingdom.com;

                if ($invalid_referer) {
                        return 403;
                }
        }

        location / {
                root   /srv/www/vhosts/$server_name;
                index  index.php index.html index.htm;

        # if the requested file exists, return it immediately
               if (-f $request_filename) {
                       break;
               }
        # all other requests go to WordPress
               if (!-e $request_filename) {
                       rewrite . /index.php last;
               }

        }

        # redirect server error pages to the static page /50x.html
        #
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
                root   /var/www/nginx-default;
        }

        # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
        #
        location ~ .php$ {
                fastcgi_pass   127.0.0.1:9000;
                fastcgi_index  index.php;
                fastcgi_param  SCRIPT_FILENAME  /srv/www/vhosts/$server_name$fastcgi_script_name;
                include fastcgi_params;
        }

        # deny access to .htaccess files, if Apache's document root
        # concurs with nginx's one
        #
        location ~ /.ht {
                deny  all;
        }
}

I am lazy efficient enough that all I need to do is replace the server_name and access_log lines for each virtual web host. I tried to use $server_name in the access_log line too, but it didn’t take. That created a file name called $server_name-access.log.

Each of my virtual hosts were already setup in Apache2 this way. All I had to do was get php5-cgi working, shutdown Apache2 and bring up Nginx. I made it permament by running these commands as root:

# update-rc -f apache2 remove
# update-rc -f nginx defaults

This hasn’t really made a big difference in my memory footprint but my blog is more responsive. See this Pingdom report for performance numbers. I may yet upgrade to the next size slice.

Recycling an old printer

Stefan had replaced his old Epson Stylus Photo R300 printer a long time ago and dropped it off at my house.  It’s a USB Epson inkjet printer that has been replaced a couple of times over. I don’t even know what the current model is, but this one was free so who cares?

Naturally, I hooked this up to my Linux server in the basement. I could not get CUPS to agree with me so I’m printing via Samba.

I went to Costco and picked up replacement inks and glossy photo paper.  The Epson inks were $60! The paper was the Kirkland knock off so I’m assuming the price was good. I connected my laptop to the print queue and shot off a test page using plain paper.  That came out okay, so I loaded up the glossy paper and printed a couple of photos.

The photos looked like crap. There was banding all over the place and it looked like the ink had not decided to adhere to the glossy surface. If I looked closely, I am sure that the ink was about to slide off the page. So a few more test prints later and I set the default as premium glossy paper, Photos only, and enhanced photo processing.

The next photos looked stunning. The colors jumped right off of the page and the detail in the photos was just plain amazing.  For my color test, I printed this photo of some fish statues. I had forgotten that some of the fish were actually not blue. I’m printing more and I have lots of paper and ink. The only downside is that the printer often has problems grabbing the glossy paper. It requires a lot of “take out the paper, insert the paper the exact same way”. But the output is really good and as I said, I got the printer for free.

What? No, I did not read any of the printer instructions or documentation. Why would you ask?

On Monday I’ll update the photos in my cubicle with these new printouts. I can look at them and admire the photos I took.

Wow, Skype looks different

I was catching up with a friend and she asked me if I still used Skype. When she and I worked at the same company, instant messaging and Skype were very popular.

I have not used Skype or IM for many months.  With Skype I was getting weird spammy contact requests so I left it off. For IM I just stopped using it. This morning as a “why not?” I installed Skype on my PC. The interface looks more busy but aside from that it’s still Skype.

I was going to post a picture of the Skype GUI but somehow I don’t think my contacts would really appreciate that.

Facebook and keeping a blog journal have ruined the whole instantly contact your friends experience for me.  I have a working phone and e-mail address; it’s much more personal that way.  Even when someone I know joins Facebook, I’m usually on the phone with them the next day.

Instant anything just does not have much appeal for me anymore. Or maybe I’m getting old. I work with lots of mundane technology for a living, so the gee whiz factor rubbed off me a long time ago.

The iPad is announced! I just don’t don’t get it

With some fanfare the iPad was announced today. And if I am reading it right, it’s like an iPhone but big and fat.

I don’t get it.

It’s an iPhone without the phone. It does not multitask.  So while you are using it as a ebook reader, you can’t keep any instant messenger sessions in the background.  You can probably play music, but no streaming music via the wifi.  You can probably still cut and paste, but no switching ssh sessions ’cause that will make the ssh app to exit.

What’s the appeal again? Seriously, who will step up with a really useful little tablet? I’m hoping ASUS or MSI will deliver something that I actually want. I already have an iPhone.

MSN Toolbar and Firefox

My current PC is a HP i7 workstation and I’ve tried to keep the software it came with in place. For example, it comes with a 15 month subscription to Norton Internet Security. Even though I have a valid license for Norton 360, I can now save that license for another PC.

The HP PC also came with the MSN toolbar and today it prompted me to install an update. Keeping your software versions up to date is important especially with Microsoft. So I ran the update.

It installed the MSN Toolbar into Internet Explorer and Firefox. I can safely say “I DO NOT WANT” so I figured I would uninstall it in Firefox.  No luck there, you can disable it but not uninstall it. To do so you need to remove the toolbar from your PC via the control panel, which I am about to do shortly.

I’m not a fan of toolbars and any extraneous gadgetry I want to see I install via my desktop. The browser is for browsing websites and so far I have not seen a single toolbar that adds any value for me.

Moving WordPress again

I have been running my blog on the URL wp.dembowski.net for years. If you are familiar with WordPress then that’s an OK URL to use but most people are more comfortable with a generic name.

I did not want to use www.dembowski.net (already used for a place holder) and did not want to put move to a folder off of the web server. So I picked blog.dembowski.net and moved my WordPress install this morning.

It went very well.

I created a new virtual server for blog.dembowski.net on my server and enabled it in Apache 2 (a2ensite blog.dembowski.net) and copied all of my files from the old wp directory to the new blog directory.

I used my nightly backup script and produced a text file of my mysql database. I then ran this command on that text file:

$ cat wp-database.sql | sed -e 's/wp.dembowski.net/blog.dembowski.net/g' > new-database.sql
$ cat new-database.sql | mysql -D blogdbname -u blog-user -p

I did it that way on purpose so that I could always restore the old wp.dembowski.net setting if I messed this up. By hunting through and changing every instance of wp.dembowski.net to blog.dembowski.net in the database backup file, I guaranteed that even obscure plugin settings would get updated as well.

In my old directory I moved everything out and left a two line .htaccess file like so

RewriteEngine on
RewriteRule (.*) http://blog.dembowski.net/$1 [R=301,L]

That way any hits to http://wp.dembowski.net/some/thing/here/ will get 301 Permanently Moved to the same URL but on http://blog.dembowski.net/.

After a little testing everything is confirmed to be working. I am in the process of updating my stats settings in Clicky and Google Analytics but so far so good.