Tag Archives: Mac OS X

Bash: compare two directories

In Unix based systems like Linux and Mac OS X there are a number of ways of comparing two directories. The simplest way is to use diff:

diff –brief -rb directory_1 directory_2

This command compares each file and reports if they differ. You can find the meanings of the options in man diff.

Diff is fine if you’re on a fast drive, if there aren’t many files or the files aren’t big. The command compares the contents of each file so it can take quite some time on a slow external drive.

If you just want to know which files are in one directory and not in the other directory it’s overkill. This little bit of Bash scripting does that however:

diff <(cd dir1 && find | sort) <(cd dir2 && find | sort)

It still uses diff, but compares the file listing of each directory instead of the files. It’s much faster and perfect for figuring out what files are out of place on my 2 relatively slow USB drives. (source)

Slowly learning Dvorak

At the recent Automattic meetup in Quebec Matt gave a passionate talk about how great the Dvorak keyboard layout was and handed out paper copies of The Dvorak Zine.

The meetup was hectic and the first chance I had to try it out was on the plane home. Just over 5 hours from Montreal to Heathrow, London. Here’s what I typed in about 2 hours:

Mad! Typing this on the flight back to London using the dvorak keyboard layout. It’s slow going but I have plenty of time to practice, it’s a long flight! My finger memory says QWERTY but they’re very slowly mapping to the new layout. Vowels come first followed by s, m, l, n and d.

It’s definitely a better layout but right now I am so slow! I’m glad that I have power on this flight. No need for the extra battery! I love how th are next to each other.

Gotta get me a layout I can stick to the keys of the macbook.
Watched the Hurt Locker while typing this.

I always type i instead of d.

Gonna watch Night at the museum 2 again, just so I can watch the ending, finally.

I’ve got three seats to myself. Maybe I should sleep? Seems that would be the most sensible thing to do, now wouldn’t it? Looks like we’re about half way across the Atlantic! The film is fast forwarding nice and fast!

Time for a break from Dvorak!

Wow! Layer Cake is a great film! A bit violent but good ending! Only 156 miles to go! Then at least an hour in Heathrow! Can’t believe I didn’t Sleep!

Yes, I didn’t sleep. That was a long day, and Layer Cake was on my laptop (freshly ripped from the DVD I bought before leaving). I can heartily recommend Air Canada. Best experience I’ve had in economy on a trans-Atlantic flight.

Anyway, changing the Mac OS X keyboard to the Dvorak layout is easy, as it is in Linux too. Trying to login using the Dvorak layout is a right pain though.

I didn’t try to rip out the keys of my Macbook but I did rearrange the keys on a wireless keyboard. It actually didn’t help, mainly because the keyboard itself isn’t that comfortable.

dvorak

The next step was to run through a few Dvorak keyboard training tutorials. They went well and I repeated the first tutorial several times, improving the times and accuracy each time. I’m not doing quite as well as Nick is doing though. I’m impressed.

I’ll persevere. My hands are retraining themselves. The Dvorak Zine is a great help, but if I tried using Dvorak for work I’d be 90% less productive right now. Matt, that ok then? ;)

Control Ubuntu and Mac OS X from one computer

I just installed Synergy on my Ubuntu and Mac OS X laptops and now I can control both from one keyboard and mouse. It works fairly well, although I do wonder:

  1. What are the special Mac keys mapped to on my beige PC keyboard?
  2. I’ll have to stretch if I move my Macbook away from my desk. (joking)

It’s easy enough to install, on Ubuntu the Linux version is already in the repositories, so the following will install a simple gui tool to configure and run a server.

aptitude install quicksynergy

That will install Synergy as well.
Run “quicksynergy” from a terminal, go to the “Use” tab and give it the IP address of your machine. Then enter the hostname of your second (or third or fourth..) computer in whichever direction you want. My Macbook is on the left.
screenshot-quicksynergy

Before clicking “Execute”, I downloaded the Mac OS X version of Synergy, untarred it and after reading the documentation, fired up the client with:

./synergyc -f 192.168.1.20

Moments later, the following message popped up on my Ubuntu terminal,

NOTE: CServer.cpp,278: client “donncha-o-caoimhs-macbook.local” has connected

Now I can move the mouse cursor off the left side of my Ubuntu screen and it starts moving on my Macbook!

I don’t think I’ll use it full time as I’d strain my back or neck typing on a keyboard in front of me and twisting my neck to see my Macbook but it’s a nice tool to have. Over WiFi moving the mouse cursor stuttered a small bit, so it’s unlikely you’ll want to do intricate pixel work with it.
I’ll have to try a day’s work with it to judge it properly.

VirtualC64 for Mac OS X

VirtualC64 is a new Commodore 64 emulator for Mac OS X. It’s a promising project, let down by the fact that it’s still in beta but by the looks of things development is moving at a steady pace.

When you first run the emulator it will ask you for C64 roms: basic, kernal, chargen and vc1541. Ironically, you can find all these roms inside Vice, another C64 emulator. Look in /Applications/VICE.app/Contents/Resources/ROM/. The 1541 ROM is DRIVES/dos1541.

Loading a game or demo is as easy as dragging the d64 or t64 image into VirtualC64. When you do you’ll see a dialog like this.

picture-6

“Flash file into memory” works great for single load programmes but multiload could be a problem. I tried Armalyte. Mounting the d64 as a disk didn’t work. I couldn’t type anything. Loading the first file on the disk by flashing it brought up the crack intro but failed to load. The neat integrated debugger (click “Inspect”) showed the emulator had died doing jsr $2020 and unfortunately at 2020 was another jsr … ($20 is the character code for a space if memory serves, and the machine code for jsr was $20, so memory was full of spaces!)

picture-3

Blue Max worked much better, as did a 3D Pool game I tried. the crack by Remember included the documentation and again using the debugger I watched as the programme checked for the various key presses. Geeky I know but it brought a smile of recognition to my lips. Here’s that debugger in all it’s glory. Anyone familiar with the C64 should recognise the code beginning at 1AA0. (I had to look up what D016 does. It’s the screen mode. I had completely forgotten. It’s only been 16 years.)

picture-10

One thing it has going for it over Vice, is a real fullscreen mode. The current version of Vice uses some dodgy resolution changing in Linux (that I rarely got to work properly without screwing up my desktop) and I couldn’t get to work in Mac OS X at all. Fire this baby up in fullscreen mode and you’ve got your very own C64 laptop! Cool or what eh?

As luck would have it VirtualC64 has blown a fuse just as I finish this post. If you have a usb joystick plugged in and activated in port 2 it does strange things. First the keyboard wouldn’t work, and flashing a file didn’t run it automatically. Then the keyboard sort of worked but the left arrow character appeared for most key presses. Odd stuff. Unplugging the joystick and restarting the emulator fixed that problem.
Even my Bits ‘n’ Bobs demo worked in it! (Bah, all my screenshots failed. They only show white. I wonder if the emulator does strange things to the Mac while emulating mixed video modes? I mixed character and video modes in the screens I tried to capture, ah well.)

VirtualC64 is a very promising C64 emulator, and it’s GPL too! I’ll certainly be keeping an interested eye on it, and I wish Dirk and the other project members the best of luck with it.

Google Chrome on Linux and Mac

Google Chrome, the open source browser that recently made headlines, was unfortunately only released for Windows. Linux and <a href="Mac users were left out in the cold.

It was possibly to get the browser working with Wine, but it wasn’t very stable by all accounts. Thanks to CodeWeavers, they have ported the Chromium browser to Linux and Mac OS X and packaged it ready for download on both systems!

First impressions of the Linux version? For some reason my whole screen goes black while a page is loading or when a new tab is opened. I see this in Vice (The C64 emulator) and any movie player other than mplayer so it’s an issue with my setup, not the browser. The fonts in the url bar suck as well, but I’m sure they can be fixed too. My curiousity is sated. CoveWeavers did a great job, but I’m going back to Firefox. (Via Tom)

So today I am pleased to announce that we have shipped freely available versions of Chromium for both the Mac and Linux. Not only does this give Mac and Linux users a chance to see what all the hype is about, it also lets the world see just how far Wine has come and how powerful it truly can be. In just 11 days, we were able to bring a modern Windows application across to Mac and Linux.

Mac OS X Leopard and Nokia N73 Bluetooth Problems

When I got my new Macbook a few weeks back I thought I could use the Bluetooth functions to browse and copy files from my Nokia N73. It worked just fine on my previous Macbook, an old 2 year old machine destroyed by a cup of tea, so I wasn’t expecting any problems.

Unfortunately it seems that Mac OS X Leopard and the latest firmware of the Nokia N73 just do not like each other. No matter what I did, I could not get the Macbook and N73 to pair. The configuration tool stopped every single time on the “getting more information” part of the wizard. I’m not the only one experiencing problems. There’s a long thread on the Apple website. Both Apple and Nokia have been informed and are aware of the problem but I suspect it’s something in Nokia’s latest N73 firmware.

I have a card reader, now to find the SD sleeve that came with my Sony Ericsson phone. Nokia didn’t include one with their phone.

PS. does anyone else find the keyboard of their Macbook isn’t as responsive as it should be? I have to really hit the y and Enter keys to make sure. It is very annoying!

Macbook Porn

After I destroyed my Apple Macbook I thought I’d never get to put stickers on a Macbook again. Luckily the machine was insured and the replacement Macbook came this morning.

Compared to the previous machine this one is a huge upgrade! The new Macbook has 2GB of RAM, a 2.4GHz Intel Core 2 Duo CPU, 160GB drive and comes with Mac OS X Leopard installed!

Now, where did I put that Ubuntu install disk ..

How do you backup to DVD?

One of my external drives failed yesterday and for an hour I thought I had lost a lot of family videos and other stuff. My photos are backed up on to another drive with backuppc, but there simply isn’t room to backup everything there. Luckily the drive came back after I unplugged it and let it cool down but I don’t trust it now. I think I need a RAID server with at least 1TB of space to be future proof for the next 2 or 3 years.

I would love an application that you could point at a directory or a list of files and directories and it would burn them onto multiple DVDs, filling each disk to it’s maximum. Backing up my photo archive has always been a bit painful, trying to find and remember which directories I had just burned, comparing file listings, etc.

Tar doesn’t cut it however. I want to be able to restore a single file or directory by looking at the DVD contents in a file manager.

I used to have a DOS app that did this. I can’t remember what it was called, but point it at a directory of stuff and it would prompt for a floppy disk, write to it, prompt again, write, and so on until finished. Simple.

Is there a Linux or Mac app that will do that? I think I’ll write a shell script to do it if nobody else knows of an alternative.

The blinking folder and question mark is bad, right?

Just over a year after buying my Macbook and it has quite possibly died. While using it, it stalled, keyboard wouldn’t respond, and I had to shut it down. When I started it up again I heard 3 distinct clicks which is never a good thing, and after a few minutes of staring at a grey screen a flashing folder appeared with a question mark in the middle.

It has happened to others and the prognosis isn’t good. A reinstall of Mac OS X is required, but those clicks I heard disturb me. I get the feeling I’ll be finding out how good Apple Support are. Does anyone know how to eject a DVD without the OS running? The Bourne Supremacy is in the drive and I haven’t even watched it yet!

I’m paranoid about backups, and what has been bugging me over the last few weeks is that all my email was on the Macbook, and I hadn’t got around to backing it up because the wireless connection was too slow. I’ll find an older Thunderbird directory on my Linux box and fire that up, but if you’ve sent me email over the last few weeks that needs a reply, send it again. I think I’ll allow Gmail to store my mail in future.

If for some reason the machine can’t be resurrected, it’s definitely the last Mac I’ll buy. What with the flickering screen too, I think I might be better off spending the extra pennies on better hardware from a PC manufacturer.

Update! I rang Apple, who put me on to their local reseller/fixer-upper, and they have the laptop. Hopefully I’ll hear back from them before the end of the week. They’ll try to fix the flickering screen too. That’s apparently caused by a missing piece of rubber on the mother board.

Update on Aug 24! The service center rang yesterday evening to say the machine is fixed so I picked it up this morning. All data is gone but I won’t put anything on there I can’t afford to lose. I hope the flickering screen problem is gone now as they replaced a “board, inverter” and “cable, inverter” too. OS X is 10.4.10, and Software Update picked up one iPhoto update. Now to reinstall Firefox and other apps ..