I always thought it was just the tech crowd complaining about Vista but that isn’t so. Apparently “average users” are unimpressed with Vista and/or the machines it comes on or they’re having such a difficult time they need to buy a book.

Exhibit A) College student is upset with her junk laptop. Vista won’t access certain university resources and the battery is always dying.

Exhibit B) Book store worker says she has gotten a half dozen or so people in the last couple of weeks looking for books on using Vista. For an OS touted as being easier to use that doesn’t sound promising. One customer was a trained IT professional.

Exhibit C) My own experience. Windows explorer and the save dialogs are a complete cluster fu*&. Browsing for files is a royal pain because the explorer window shows three different views of the same crap, it is just overwhelming and even with all the information you still feel lost. Also, why does the entire machine hang off of the desktop? Doesn’t make sense.

Or how about the borked send to compressed file thing? If you right click on a file and choose send to compressed file the OS will dutifully compress the file and then highlight the part of the file name you want to rename. How convenient! Only problem however is that the highlight doesn’t have keyboard focus, you have to use your mouse anyway. Maybe it’s because I choose to show extensions but either way, pretty lame.

People are sometimes amazed at how quickly I get some things done. Truth be told I’m lazy and hate having to do more than I need to. Sometimes it is great to have just enough programming background to be dangerous.

I’ve posted about for loops before and they are probably one of my most liked bash items. Here is another reason why.

I’m working on a web site and I need to edit a bunch of files, they all need the same edits done and there is no reason I should get interrupted from working on them all in series. Enter the for loop! With the following command I can edit each file in VIM and when I close the file the next file will open for me.

for I in `ls *.php`
do
vim $I
done

Nice and simple.

A while back I wrote about how I lost my file server. On my file server were a number of video files that I was editing in iMovie 08. While I had managed to transfer the files from tape again, my project file still showed the files as missing. Recently I finally decided to get back to fixing the project and here is how I did it.

I headed over to Apple’s discussions area and searched a bit. After a while I found a thread that discussed my exact issue and it mentioned editing the project’s project file. Well, that was for an older version of iMovie. iMovie 08’s project file is a binary file rather than a straight text file making it much more difficult to edit.

So, rather than edit the file I thought I’d take a look at the contents of the file and make sure my files were in all the same spots iMovie was expecting them to be in. Using terminal, I browsed to my iMovie project file location of ~ruedu/Movies/iMovie Projects/Big Production. In this directory is a file called Project. On this file I used a command called strings. Strings will search for and display any strings that are present in a binary file. Using strings, this is what I saw.


X/Volumes/RAID/iMovie Events.localized/Video/clip-2007-11-03 14
;08;26.dv
X/Volumes/RAID/iMovie Events.localized/Video/clip-2007-11-03 14
;10;25.dv
X/Volumes/RAID/iMovie Events.localized/Video/clip-2007-11-03 14
;1

I then compared this to what was really present on my RAID volume. Sure enough, the file names didn’t match. It was


X/Volumes/RAID/iMovie Events.localized/Import/clip-2007-11-03 14
;08;26.dv
X/Volumes/RAID/iMovie Events.localized/Import/clip-2007-11-03 14
;10;25.dv
X/Volumes/RAID/iMovie Events.localized/Import/clip-2007-11-03 14
;1

I renamed Import to Video and restarted iMovie. My project was now correct!

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.

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