PHP and stuff

Lately I have been working so hard that I haven’t even had any desire to do any fun computering at home. Today that changed a bit.

I decided this morning that it was high time I upgraded my all time favorite rss feed reader, tiny tiny rss. Well, wouldn’t you know it, after I did the install I found it required a version of php higher than I had available on my server. Time to upgrade.

I run Centos 5 on my main server and, by default, that carries a php 5.1.x. I needed 5.2 or greater. As it happens, php 5.3 is available in the repos, so I did the upgrade. For the uninitiated, that entails doing a “yum list installed | grep php”, which gives you a list of what you *have* installed. Next you remove php by doing “yum remove <and name all the packages in the prior list here>”. This, followed by “yum install <list of files for php 5.3>”. For example, I had php-common.i386 and php.i386 installed, so I did a “yum remove php-common php” and then “yum install php53-common php53” to get all my php 5.3 packages on there. This was followed by a quick “service httpd restart” to make sure my webserver was using the new version.

Murphy’s law states that “something will go wrong if it can”. Well, *MY* law states that “something will go wrong”, and it did. As it turns out, I had built a whole bunch of php applications maybe 7 years ago that my wife uses almost daily. In the olden days of php, you could declare a php script at the top by doing a “<?”. NOW, you need to declare it by doing “<?php”. Consequently, nothing I had written worked. It only took me a minute or two to identify why the problem was occurring, but fixing it was another story.

So, how do you find all the files you have to fix? Well, I used the “grep” command. More specifically, egrep. I went to my html root directory and searched by doing “egrep -r “<\?” * | egrep -vi “<\?php” | egrep -vi “<\?xml” | grep -v inary”. What does all that do? The first stanza looks recursively through the directory structure at every file and outputs the ones that have any “<?”‘s in them. The second takes that output but does NOT pass through any that are “<?php”. Why, because they would already be ok! The third takes the results and doesn’t pass through any that contain “<?xml”. The last one doesn’t pass through results from binary files. The end result is I had a list of directory / file / line information of all the files I had to change / update. A few minutes later, after using vim, the best text editor around, I was back up and running!

Asus Transformer TF300T

Asus Transformer TF300T

Asus Transformer TF300T


You have heard me before explain why I love my iPad. At first I bought a Xoom tablet, which I thought was crap. When I picked up my iPad that was awesome. It did everything I needed and then some. As it happens, though, I have been thinking more and more about getting into Android again, until a few days ago when I finally pulled the trigger.

Until quite recently, Android was simply not ready or suitable for tablet use. You can argue with me about that all day long if you like, but you would still be wrong. 🙂 Recently, however, Ice Cream Sandwich was released (Android 4.0) and that, combined with the current state of technology, makes all the difference.

Anyhow, I decided that giving Android another try, especially in light of Apple’s recent bout of litigiousness, was in order. I decided on the ASUS tablet (32 GB), because it has really nice hardware, looks and feels good, and just seemed to have the most bang for the buck. I also bought the keyboard dock because having a keyboard for your tablet is wildly useful, not to mention it adds USB, SDCard and lots of extra battery life!

The only application I added that I had to pay for was Better Terminal Emulator Pro. This is, simply, the best ssh client available for Android, period. It also has the unique ability to actually be able to use *all* the keyboard keys available on the Transformer’s keyboard dock. Absolutely indispensable, and it was only $4.

Things I don’t like:
The iPad has a better mail application. Apparently, I am in the minority when I want to read my oldest email first and then progress to the newest. I find it really perverse to do it the other way around, and it annoys me to no end that I can only get 30 or so emails at a time without weird jumpy scrolling effects. The iPad didn’t have this problem. I will say, though, that I haven’t had a lot of time to try alternative email clients. I also liked the iPad’s version of the Tivo client better. The version for android is made only for mobile phones and doesn’t take advantage of a Tablet’s screen size, etc. I bet they will have this fixed at some point though, and it does the job for now. Lastly is the form factor. The iPad has a 4×3 form factor, which I find quite aesthetically pleasing, while the Android has a 16×9, which takes some more getting used to. I realize that multimedia is really geared more toward the 16×9 sizes these days, but documents are not and I grew up reading magazines and books and writing on papers, all in the 4×3 format, and it still feels a bit odd with the elongated tablet size. The absolute worst thing with this tablet is the proprietary charger connector. This pisses me off and is absolutely unnecessary and makes it difficult to obtain 3rd party charger / cable replacements. That is not to say they are unavailable, but I could not find a spare in a big box store and had to order through Amazon.

Things I do like:
This little gizmo is quite fast! Video playback is responsive and brilliant. ICS has a good feel to it as an OS and is much more useful than previous releases, not to mention, this machine is rock solid stable, which is something my Xoom really lacked. I have never had an app crash on me using this tablet yet, something I used to think I would have to own an iPad to enjoy. Even with the keyboard dock connected, it is pleasant to hold and use, aside from the strange feel of a 16×9 form factor. It is not too light or heavy. It feels ridged / solid. It has a very nice feeling textured case, which does not appear particularly scratch prone (in opposition to the iPad) and has a pleasing (very)dark blue color (I understand this particular tablet to soon be available in white as well). The screen, itself, is clear and crisp and easy to read, even in direct sunlight. As a touch screen, it is remarkably sensitive.There are times I swear I just have to think about touching it and it responds. Although the touch screen does attract fingerprints, they are easy to wipe clean and the tablet actually came with a soft cloth just for that purpose. Lastly, this comes equipped with a GPS, which makes it a great big nifty navigation unit too!

With the addition of the keyboard dock (did I mention 14 hours battery life?), this tablet actually makes a suitable laptop / netbook replacement. I can honestly say that I can carry *only* this device with me and be assured that I can still accomplish any work I need to do, especially with the addition of the previously mentioned Terminal Emulator Pro software purchase. All in all, this is a great device which makes portable computing truly doable and lots of fun. Great purchase!

Happy Father’s Day!

My Dad

My Dad


I was, I think, 7 years old when this strange furry creature married my mother. I remember being really excited at the time, because my mom was so happy, and I remember being kind of scared about what would happen to me.

I had never had a dad up to that point, so you can imagine that the transition was quite difficult for me, and, in turn, I made it hard on him. What he did, however, was miraculous and a true testament to his character.

My dad took me as his own. I NEVER remember hearing the words “step son” from his mouth. He always introduced me as his own. I was included, whether I wanted to be or not 🙂 It was certainly a learning experience for me. He taught by example.

He taught me to be responsible.
He taught me to have integrity.
He taught me to be honest.
He taught me to have fortitude.
He taught me how to love my wife and daughter.
He taught me to respect other people and myself.
He taught me how to be a man.

I respect my dad more than any other man alive. I could never tell him “thank you” enough, but I hope this gets me a little closer. If you ever meet a certain Roy Fessenden, you can thank him for me too. I love you dad! Happy Father’s Day!

Helping Kids

I grew up in a town of 2000 people in Upstate NY called Laurens. There are currently approximately 350 students enrolled K-12 in my old school and they are desperately trying to win a chance to sing with Foreigner (yes the rock band)! PLEASE help me help them by visiting this link http://wsrkfm.com/cast-your-vote-in-our-sing-with-foreigner-contest/ and casting your vote for the kids at Laurens Central School!

Mint 13 Fix for Broken DNS.

I really love Mint, just let me get that out of that way first. That being said, there are usually a couple things I catch, per release, that filter down from Ubuntu, that I wish were taken care of before Mint hits my desktop.

This time it is DNS.

I installed Mint 13 and was cruising around my home network and noticed that my dns searches weren’t appending my local domain. I had to use the FQDN to get to *anything* on my home network. Well, this frustrated me a bit because I worked hard to set up my own home network, I have resources on it including DNS, and I would like to actually use it. So, I went on the hunt for WHY I had to use a fully qualified domain name on my network…

For some strange reason, someone, somewhere thought it would be a great idea to mess with the way we handle DNS. In fact, the way Linux/Unix/unix has traditionally handled DNS for ever. That being if you put stuff ™ in the friggin /etc/resolv.conf file, your DNS just magically works. Well, not any more.

I have done 3 Mint 13 / Cinnamon installs now (assuming that Mate is the same here) and, in fact, THERE IS NO RESOLV.CONF file! What has happened is this, as far as I can tell. Someone in the Ubuntu camp (I assume) decided that it would be a great idea to start using dnsmasq through the NetworkManager to take care of DNS because they wanted to skirt some VPN issues with single homing. In layman’s terms, when you use a VPN, you are *ONLY* supposed to be able to connect to that network to be secure. Using dnsmasq, you could conceivably be on your VPN and route local traffic around too (multi homing). IPSEC guys frost themselves over stuff like this, BTW.

So, I set about to correct this injustice. Here is a simple script you can run which will turn off the dnsmasq garbage, put your resolv.conf files back in place where they belong and start those services back up so stuff works like we have been doing it for 20+ years.

#!/bin/bash

clear

# Test for UID=0
if [ "$(echo $UID)" != "0" ]
then
echo “You must be superuser to run this program. Try ‘sudo ./fixmint13.sh’”
exit
fi

sed -i -e 's/dns=dnsmasq/#dns=dnsmasq/g' /etc/NetworkManager/NetworkManager.conf

ln -s /run/resolvconf/resolv.conf /etc/resolv.conf
resolvconf --create-runtime-directories
resolvconf --enable-updates

reboot

An open letter to NY state police.

This week I am in NY visiting helping out my mother after her knee surgery. This morning around 7am I ran to the post office for her and stopped at the gas station to pick up a pack of smokes. On the way home, about 2 houses down from my parents place I see this guy aggressively yanking on the leash of his dog he’s walking down the sidewalk. I keep an eye on him as I drive past and then I see him throw his dog down to the ground and start kicking it (think superbowl field goals here) and then he doubles up his fist and just starts pummeling the dog. I slam my breaks on and jump out of the car and yell at the guy to stop and he tells me to mind my own “effing” business. I tell him he needs to simmer down and he says he can’t get the dog to walk (no kidding, if he beats the thing like that). I tell him he needs to understand that dogs have the mentality of small children and ask him if he would beat a child like that. Again, I get the mind my own business stuff. I tell him I will call the cops and he says “do what you want”. So, I pull up 2 houses and park in my parents driveway and watch this guy go to his house. Turns out he’s my parents’ new neighbor on the street, almost directly across from them.

So, I call the cops. They have me call the dog warden. I call the dog warden. She has me call the State Police. They said they would send someone by but “couldn’t really do anything about it.” I asked them if this guy has this much of an anger issue, what happens when he gets mad at his wife/girlfriend/kids/etc.? They said they could send someone out to talk to him. That was over 4 hours ago now. Sheesh!

I am certain if this had happened outside Philly, where I live now, there would have been some kind of reaction from the authorities. Here in nowhere NY I guess it is completely legal and acceptable to be cruel to animals. It really makes me sick. Honestly, in hind sight, I should have just run the prick over and taken the dog.

CentOS 6.2 WOW!

CentOS 6.2


This week I am helping out my Mother, who has just had knee replacement surgery, so, oddly enough, I actually have a small bit of time to actually post something here again!

Right before I left, I decided I wanted to press an old Dell laptop into service for giggles. It is a Dell Latitude D810, which has a 2.mumble Ghz processor, 60 or 80Gb hdd and 1.5 Gb of ram (I confess I did upgrade that a bit from 1Gb). The really great thing about this particular laptop is it has a 1900×1200 resolution on it’s 15.4 inch screen. This makes for a great work laptop because it has so much screen realestate.

Well, what to run on this machine? It originally came with Windows XP, but, as you can imagine, I just cannot see fit to run Windows on my laptops, so which Linux? I decided on trying CentOS. Specifically CentOS 6.2 i386, which is current as of this writing. As it turns out, that was a really great choice!

The CentOS install was exactly what I had come to expect from it, short and sweet. The only issue of note is an error you get about half way through that says “insufficient memory to start Kdump” or some such thing. This is really nothing to worry about and can be safely ignored. Other than that, after a reboot from the installer, the system was ready to rock-n-roll. As in completely! Everything was working. I had sound, wireless, X, you name it! No muss, no fuss. To me this was wonderful as the last time I put CentOS on a laptop, I had to mess around a little bit to get wireless going. This time I ended up in luck because apparently my Intel Corporation PRO/Wireless 2915ABG is completely supported out of the box. Woot!

Anyhow, I ended up following my own recommendations I blogged about earlier here to get all my required softwares going like I prefer. The only noteable there is that, apparently, the EPEL repo (that’s Extra Packages for Enterprise Linux for those in the know) has changed the URL to:
http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-6.noarch.rpm
or
http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-6.noarch.rpm
respectively.

Also of note, I seemed to have a bit of trouble getting dropbox on here. The solution was to NOT use the dropbox package available in the repos, but to go directly to dropbox and download the package available for Fedora, which worked just fine.

Once all that was done, this old laptop worked WONDERFULLY, and, in fact, I am typing and working on it now.

Often I hear people say things like “get more use out of your old computer with Linux”, and, while this is certainly true, I tend to discourage that because running a modern operating system like Linux on older hardware can many times give the wrong impression. Things run slow and laggy and often that is interpreted as being Linux’s fault, when, in fact, you are just trying to shoehorn it on to your old 486. You REALLY get a superior Linux experience when running it on modern hardware and it becomes VERY easy to contrast it then to other modern operating systems. At any rate, I wanted to say that this is NOT the case here. Linux on this older hardware runs so phenomenally well that I am seriously inclined to recommend purchasing this particular laptop used for persons looking for an inexpensive but capable mobile computing environment. I see them listed on ebay and amazon for very close to $200, which is, in my opinion, quite a bargain compared to the performance I experience from my much newer and more expensive netbook.

In conclusion, I would have to say, don’t discount older hardware, and certainly don’t discount CentOS as a viable, capable and speedy desktop (yes I did say desktop) Linux distribution!

PPC Linux

Sometimes I get lucky and something cool happens to fall in my lap. This happened last week when I ran across a G5 tower dual 1Ghz /8Gb ram that was getting tossed. I decided ti rescue it as I hate to see useful hardware go to waste. As the version of OS X that runs on such beasts is getting long in the tooth AND I happen to be a Linux enthusiast, I decided quickly that this would be a great box to look at the recent offerings of PPC Linux. Here are my thoughts:

debian

debian


Debian:
This happened completely by accident, but Debian was the first distro I tried. You see, the Mint PPC installer will install Debian PPC by default if you don’t specify to install Mint, which I completely forgot to do on my first try. Debian is, well, Debian. I wish I had the foresight to actually get a screenshot, but the installed version on PPC is what I expect it looks like anywhere else as well. Debian is fantastically consistent about that. That being said, Debian and I differ in opinion on what software I generally want to have available under Linux. The Debian folks are very staunch on the “free software only” thing and *I* am one of the guys who thinks I should have the “freedom” to actually enjoy proprietary and non-free software if I want to. As I really wasn’t looking to do a Debian install anyhow, I played for a few minutes and then moved along.

mintppc11

mintppc11


Mint PPC 11:
Now *this* is what I really wanted to try. As a long time admirer and user of Linux Mint, I was thrilled to try it out on the PPC too. Unfortunately I was slightly disappointed. You see, Mint PPC is not an “official” port, per se, so it’s not quite the same. First thing I noticed is it is obviously built straight off Debian, and uses their software “choices”, which I have previously described. Secondly, the default desktop is an LXDE with nautilus. Ok, but a little clunky feeling to me. It wasn’t long before I was wanting to check out what else was out there, and so I did.

YellowDog 6.2

YellowDog 6.2


YellowDog 6.2:
Years ago, when Dann and I first started the Lehigh Valley Linux User Group, YellowDog Linux was quite a contender. Shortly thereafter, they made their presence really big in Japan and I sort of didn’t hear much from them anymore. Well, it appears they are still going strong and offering what turns out to be a really nice and robust PPC Linux distribution. Honestly, in retrospect, this is the one I would settle on as my second choice. There is plenty of support and plenty of packages available and it runs rock solid stable. If you are at all familiar with RedHat, CentOS or Scientific Linux this would be an no-brainer for you to use. The *only* thing I didn’t really like about it was the default DE was Enlightenment. It worked fine and was completely functional, just not to my tastes. I am sure I could change it to suit my needs better, but there were more PPC Distros to try!

Fedeora 16 PPC

Fedeora 16 PPC


Fedora 16 PPC:
Now THIS one I was SURE would be the one for me as soon as I got it running. The install went really smooth, especially for a Fedora install, which has a really bad historical habit of being broken in one way or another. Once I had the desktop up I was greeted by a standard Gnome3 DE, which is completely familiar to work with for me, even though it was minus the desktop icon support available in Mint. No matter, I was excited to use it and it was FAST and really responsive. Unfortunately, as is the habit of my ventures into Fedora land, it was hopelessly broken, and there is not a lot of package support. Here are a few for-instances: EPEL repo will not install. Flite makes the core dump. Worst was nautilus refuses to prompt for user/password on any shares (ssh, smb, webdav, etc.). It just says you must enter the password and then doesn’t afford you any way to do so. Nice try guys.

Ubuntu PPC 11.10

Ubuntu PPC 11.10


Ubuntu 11.10 PPC:
Saving the best for last, I *finally* hit on one that’s a keeper, otherwise I was going straight back to YDL. Ubuntu, as it turns out, ends up being a very polished product for PPC. Sure there are some issues, such as Unity completely rots on this machine, but they are easily overcome and then you have a nice solid worker with good package support. In my case, like I mentioned, I had an issue with Unity. It seems that the Unity 3D doesn’t like this mac. I am not sure why as Gnome-Shell works great with the 3D stuff. Unity 2D was fine, but not only do I prefer Gnome-shell over Unity, but I was working on a 4×3 screen, which nobody should ever use Unity with. Once I switched to Gnome-shell, I was set. I installed my standard set of packages I use. All of them installed without crabbing about anything and everything worked, even user/pass in nautilus 🙂

If you have an old PPC machine you want to keep in service or press into service, Linux PPC is surely the way to go. You just cannot go wrong with either YellowDog or Ubuntu on these machines. No sense in wasting or chucking good computer equipment right! Stuff Linux on there and make it useful once again!

The Original Screensaver

Worms

Worms


I know, I know. I have been really busy lately and have not posted anything. You wouldn’t even believe how much so.

Last night, right before I passed out from another long week I was reading my email (in mutt, the best email client btw) and I decided I was going to take a little nap. Well, as a hold over from the old days when you had to worry about screen burn-in, I wanted to start a screensaver, but something different.

As a cli addict, in the old days I remember using a couple terminal savers, worms and rain. I decided to start up worms for nostalgia sake. Well, it wasn’t installed. AHH THE HORROR! As it turns out, most distributions do not automatically include these anymore and they are normally in a package called “bsdgames”. Once that was installed I was ready to go. Simply running a maximized terminal session with worms -d 60 (a switch to delay the worms a bit), was enough to make things right once more.

I bet that many new Linux/unix users have missed out on the wonders of such simple things and decided that today I would make a little post to try and encourage you to try them out. Please do so! (and remember rain too.)

The bsdgames have a lot of those kinds of little gems and you just cannot go wrong playing around with them. There are greats in there like hack and tetris and snake and on and on. You might be surprised how entertained you can be while enjoying some of the old-school stuff that gives you some great unix creds 🙂

HTML5 Developer’s Cookbook

HTML5 Developer's Cookbook

HTML5 Developer's Cookbook


Ahh yes, another book review. I have to say that most books I review end with me telling you that it’s a good book, but this is NOT the case this time. This is not a good book, it’s a fantastic book!

I consider myself pretty versed in HTML 4 Transitional code, but HTML 5 is a whole different monster. I looked at it a while back but it wasn’t very mature at the time. Things have changed a bit now. There are more browsers that support it now and the support is much better. More and more websites are offering great HTML 5 content and there is some really amazing stuff I have seen it do. I just had to get my feet wet a little more.

This book, the HTML5 Developer’s Cookbook, is a great way to get into this new form of web programming. I really dig the whole “cookbook” concept, which has some well annotated and defined “recipes” for accomplishing different tasks. You get great directions on everything from HTML 5 basic layout, to HTML 5 forms and much much more. This book starts with some forward information on what HTML 5 is and what it is not, a little history and background. It follows with, basically, 2 sections. Practically half the book is devoted to straight HTML 5 layout, tags, element changes, forms, css and media embedding, and the second, more advanced half of the book covers a wide variety of very useful API’s. Things like drag and drop support and SQL support all the way up through really advanced things like media capture and geo-location.

It took me a long time to get through this book, mostly because i really wanted to try a bunch of this stuff myself and there are a lot of code examples (those recipes again). What I *WISH* I had done is to read the back few pages first. You see, a great advantage to this particular book is it comes with a free 45 day access to Safari Books Online copy of the book and it is infinitely easier and quicker to cut/paste code from the book than for me to type it all 🙂 My only gripe would be that you only get 45 days with it. That should be sufficient enough, though, for you to build a personal code repertoire that you can revisit for long after.

As always, it seems, with the selections I get from Pearson, this would be a great buy, fantastic resource to have and is a very good read. Go get your today. You’ll be glad you did!