I recently found myself renaming a website and needed to change some common text in a bunch of php and template files. Here is the code I used to get the job done.

for I in `find . -name "*.php"`; do sed -i "s/old name/new name/g" $I; done
for I in `find . -name "*.tpl"`; do sed -i "s/old name/new name/g" $I; done

Sure a truly savvy person could have done this in one line but that’s just not as fun.

In getting ready for the coming TV season I wanted to get my recording capabilities up to snuff. I’ve grown tired of trying to get MythTV working and decided to bite the bullet and buy a solution. I decided on a HD Homerun with some EyeTV software for mac.

The great thing about the HD Homerun is that I’m not tied to the Mac for watching or recording TV, I can use just about anything I want including MythTV (despite giving up on it for now), Windows Media Center and even just VLC. I post some more about it as soon as it gets here.

A few times a day I head over to craigslist.org and look in the computer, electronics and game & toys section for things people have under priced so I can sell it for more somewhere else. I’ve had really good luck doing this on a number of occasions and even though it is never a huge money maker it feels good to buy low and sell high.

Well last week I came a cross a deal too good to be true but bit anyway, a Power Mac G4 MDD that wouldn’t boot for $60. This particular model sports dual 1Ghz G4 processors, a SuperDrive and an 80GB hard drive. The machine has room for three more hard drives and one other 5.25 slot. With the onboard gigabit ethernet this machine is actually a pretty good performer.

After picking up the machine I got to work figuring out why it wouldn’t boot. The machine would actually turn on and tone but not the usual Mac start up tone. It would tone once and then flash the power button. I looked up the issue on the web and found that the single tone meant no RAM was present. This was odd since all four memory slots were filled with 256MB sticks of DDR PC2100 RAM. According to some docs on the web this was the correct type of RAM for the 1Ghz MDD model. On a hunch, I decided to try PC2700 RAM and viola, the machine booted into OS X (10.2) and has been running just fine since. It even runs Leopard quite well despite being about six years old.

Back when I bought my Mac it was a bit more of an experiment than anything. At the time I didn’t figure on needing to print so I didn’t arrange anyway for the Mac to access our printer. At the same time I really didn’t have a good setup for my laptop to access the printer either. The printer sat in my wife’s office and if we wanted to print, we had to bring the laptop to the printer, hook up the USB cable and then print.

Well, the Mac is now what I consider my primary computer and since it is a stationary box it makes a lot more sense to have the printer hooked up to the Mac and then share it. So now my current setup has the printer connected directly to the Mac and then shared to my XP laptop.

This is where the fun began. While Mac people like to talk about how easy OS X is and how easy it is to share your files or share your printers with other computers the brutal truth is OS X much prefers to share with other OS X machines, particularly in Leopard. This is evident in Apples choice to enable file sharing using Apple’s AFP by default rather than smb/cifs. In other words, enabling file sharing without visiting an options dialog will leave you scratching your head. Same thing applies to printing, though it is barely Apple’s fault here. The difference lies in the printing systems used in the OS X/Linux world and Windows.

OS X, like most Linux systems today, uses CUPS or Common Unix Printing System to provide print services for OS X. Windows does not and so it does not understand the drivers that CUPS uses for printing. So when I shared out my Photosmart 8150 and added it to my XP laptop my laptop requested the drivers for my printer. After providing the drivers and attempting to print a test page I was greeted with a whole lot of nothing. Why? Well it turns out that the Windows drivers will not talk to the OS X drivers properly and nothing happens.

Thankfully CUPS on OS X can be configured manually just like it can be under Linux by using the web interface. Here’s how.

Start by enabling printer sharing on OS X. Even though Windows can’t print to this printer you must enable printer sharing so that OS X opens up and starts the necessary ports and services.

Next, you must have your root account enabled. The easiest way to do this if you haven’t already is to open terminal and type ‘sudo su -‘ (no quotes) and press enter. Enter your password and press enter. Now set root’s password by typing ‘passwd’ and pressing enter. Follow the on screen prompts. If you don’t have a password set you can also use Directory Utility to enable the root account and then set a password. I don’t have experience using this method so YMMV.

Next, open up your favorite web browser and head to http://localhost:631 and click on the add printer button. Type in a name for your printer. For my setup I used Photosmart_for_Windows. Notice the underscores in place of spaces. Click continue

On the next screen you will select the device you wish to print to. In my case, I chose HP Photosmart series 8100 USB. Click continue.

On the next screen you might be asked to select which specific model you are using. You can simply click the Add Printer button without choosing anything.

On the next screen you will be asked what Make the printer is. Here, be sure to click raw and then click the Add Printer button again.

Next you’ll be asked about the Model and this time your only option will be Raw Queue. Click this option and click Add Printer. You will be asked for a username and password. Here you provide your root username and password. In my case it is root and ******.

You are now done with the OS X portion of the setup.

On the Windows computer go to Printers and Faxes in the control panel and click the Add a printer link on the left or Add Printer from the file menu.

Choose ‘A network printer…’ and click next

Click the third radio button for ‘Connect to a printer on the Internet….’ and enter in the following

http://<mac hostname>:631/printers/<printer name>

In my setup it is

http://macmini:631/printers/Photosmart_for_Windows

Click next

Window will pause for a while and then finally ask you for the printer drivers. Either choose the appropriate drivers from the list or use have disk and browse for them. Finish the add printer routine and do a test print.

Another nice new feature of Leopard is Spaces. For anyone who has used Linux at all you’ll recognize that Spaces is nothing more than virtual desktops. The problem with Spaces is that it isn’t enough like virtual desktops to really make me feel at home with it. A preferences panel add on called Warp fixes this.

http://www.ksuther.com/warp/

Using Warp I can now drag a window from once space to the next or go to the next space by pushing my mouse against an edge.

OS X is a funny system. So many things are very simple and yet there are some things that are more difficult than they need to be. Take for example mapping or mounting network shares. In Tiger (10.4) you could mount a share and it would show up in the sidebar. With Leopard (10.5) this isn’t so, you have to manually add it. This addition to the sidebar will stick until you reboot the system. This is a bit annoying. I like having direct access to the root of my share.

Fortunately OS X ships with automator and either I didn’t notice this in the previous version or it really is new but you can now call shell and apple scripts directly. I was already using automator to mount all of the shares I want mounted on login but I needed a way to get them into the sidebar. Click through to see my solution.
Continue reading

There is a bit of buzz on the internet right now about Apple’s announcement of OS X Snow Leopard which is to replace Leopard sometime next year. Word on the street is that it won’t be luring people in with hundreds of new features but Apple is instead concentrating on stability of the OS. This is amazing to me for a couple of reasons. One, Apple seems to be admitting that it is out of ideas! Two, when is the last time you’ve heard of a big software company just going back and streamlining their OS? This is fantastic because as I wrote before, I’m liking Leopard more now than I did when it was initially released but compared to Tiger it’s just not as polished. Boot times for instance could be improved as Leopard takes nearly 50% to twice as long to boot compared to Tiger.

Along with the Snow Leopard client comes Snow Leopard Server and here is my prediction. Apple hasn’t told us everything (as usual) and based on the direction Apple is taking the iPhone, I believe Snow Leopard is going to be Apples biggest attack on the business/enterprise market yet. They have already admitted that ZFS will be included in Snow Leopard and they are talking about better Exchange support. Virtualization is a huge topic lately and I won’t be the least bit surprised to hear Apple announce virtualization support in Snow Leopard Server and maybe even in the client version. My guess is for the support of any OS including OS X itself..

What are your thoughts? Leave them in the comments area!

Well by now it’s no secret to any of my friends that I’ve become a bit of an Apple fan but I’m not so much a fan that I can’t criticize what they do. I’m not that rabid yet.

So it was with trepidation that I gave Leopard a try, twice no less, before finally making the switch to it permanently. I wanted to be sure the kinks were worked out and that it would work as well as Tiger did. I had read about and had my own issues with Leopard on my mini including poor animations, apps failing to start and just a general clumsiness to it that just was not what OS X should be like. While I’m not convinced it is quite there yet, the latest update has brought it a long ways in my mind.

The latest update, 10.5.3, seems to fix a lot of the big issues I was running into with Leopard. The biggest issue was actually with some iLife apps like iMovie. Either through luck or an actual fix iMovie now runs on Leopard. In previous versions I couldn’t get iMovie to open fully and when it did working with video was problematic and importing video was terrible. While I have yet to import video since installing 10.5.3 I’m fairly confident it’ll work much better than it has in the past based on how well it runs otherwise.

By now you have probably heard about the digital tv switchover deadline in February of 2009. In case you haven’t, head on over to http://www.dtv.gov/ to get the long story. The short story is that analog TV signals will be turned off as of February 17, 2009. If you get your TV using an antenna, then there is something you need to do to get ready. You can either buy a new TV with an ATSC tuner in it already or you can purchase a government subsidized digital to analog converter box. To get your $40 coupon head over to https://www.dtv2009.gov/.

Last friday I received my coupon in the mail. The coupon comes in the form of a prepaid credit card and you can use it at any store that sells approved converter boxes. I took mine over to Best Buy and picked up their Insignia branded converter box. This box is fairly basic providing one digital input, one RF output and a composite video output but the box is proving to be quite up to the task. The composite output allows you to get stereo sound (surround sound in fact) from the device and an improved picture over the RF connection. It also offers just the current program and the next program on it’s very simple program guide.

Now you might be thinking there is nothing wrong with the current system and that just couldn’t be further from the truth. Even though your old analog TV isn’t digital, the picture will be virtually perfect and in some cases better than you’d get if you had dish or cable. Audio too will be improved and if you have a surround sound system then any show that uses surround sound will be available to you in surround sound as well.

While the analog to digital switch over is a bit of a hassle the quality improvement is very much worth it. If you have any old TVs that are still in good shape and you don’t want to buy a new one then I strongly recommend going the converter route.