Category: Apple

06/16/10

Permalink 11:24:24 pm, Categories: Apple, 35 words   English (US)

Safari fail

I just spent a few hours trying to debug my movie vote GWT application failing to render a grid in Safari but working in other browsers. It turned out to be a Safari bug. Sigh...

05/26/08

Permalink 08:01:56 pm, Categories: Linux, Apple, 1111 words   English (US)

Time machine + AFP + Ubuntu - Samba

This weekend I finally installed Leopard on my macs. I have an old Powerbook G4 15" and a Mac Mini. Both of them run it great (I have at least 1G RAM on each). At home I also have an Ubuntu server running on a laptop which I use for various Linux things. I've been sharing drives via Samba on it and hacked up my own backup scripts.

But with Leopard, there is this cool Time Machine thing I can use right? Well I wanted to use a network share via Samba with Time Machine. Turns out it is not so straightforward. OS X by default won't let you use the network drive. This post describes how to get around that. There is also a wealth of information here. Great, now I can select the network drive in Time Machine.

But now I was getting an error about creating the disk image. I watched a bit what it was actually trying to do on the Samba share and noticed that it was using the machine name in the filename being created, which is a 'sparsebundle' file. My machine name was something like 'Powerbook G4 15"' and I had a feeling the '"' or some other character in the filename was not playing well with Samba. So I changed my computer name (via Preferences -> Sharing) to some very simple name. Still no go :(.

After some searching I came across this post which seems to describe my problem. It generally suggests to create the disk image file manually and then copy it to the network share. But I wondered, why not try creating this directly on the network share? I should have the same problem Time Machine gave but perhaps I can get more information and debug further. So I tried it, but unfortunately the command given in the post was wrong. A few comments below describes the correct one (wtf don't they fix this?). Here is the command I ran:

hdiutil create -size 50g -fs HFS+J -type SPARSEBUNDLE -volname "Backup of powerbook" powerbook_000d93b43026.sparsebundle

And I got the unsexy error:

hdiutil: create failed - Operation not supported

Fooey. Ok, I didn't get much debug info there. It sounds like some operation is being tried on the Samba share, but what? Next I followed the rules and created this image on a local drive. That worked fine. Now the post states to copy this image over, but I instead tried to 'mv' it. This should try to replicate everything at the destination and perhaps give me more info. It did:

mv /tmp/powerbook_000d93b43026.sparsebundle .
mv: chown: ./powerbook_000d93b43026.sparsebundle/bands/62: Operation not supported
... lots more
mv: chown: ./powerbook_000d93b43026.sparsebundle: Operation not supported
mv: /bin/cp: terminated with 1 (non-zero) status: Cross-device link

Interesting! So it looks like the real culprit here is 'chown'. OS X is trying to chown these directories on the Samba drive, which of course is not supported. Looking at the files created by hdiutil, it looks like it is trying to chown the group 'wheel':

powerbook_000d93b43026.sparsebundle valankar$ ls -lRa|more
total 16
drwxr-xr-x@ 6 valankar wheel 204 May 24 10:27 .
drwxrwxrwt 10 root wheel 340 May 24 10:27 ..
-rw-r--r-- 1 valankar wheel 498 May 24 10:27 Info.bckup
-rw-r--r-- 1 valankar wheel 498 May 24 10:27 Info.plist
...

Whatever, knowing this is not helping me much. In fact, I just found another post where someone digged further. After copying it over (actually the 'mv' copied it just fine but bombed on the chowning), I enabled Time Machine and it generally worked. But it worked SLOW.

As an aside, I've generally had some slowness using Samba when it involves lots of intense disk access. Say I'm watching a video as well as recording something with EyeTV on the Samba share. It generally will clip the video pretty badly. No amount of Samba tuning on my part could improve this and I eventually gave up. But Time Machine was ridiculously slow, and it drove me to wonder, "WTF am I using Samba for anyway?" I mean seriously, I have no Windows boxes here. Why aren't I using Apple File Sharing? Surely Linux supports it right?

Thus began my journey into setting up netatalk (AFP) on Ubuntu. It was a short one and generally without hiccups. This page has some pretty good docs, however with Ubuntu there is one stickler. SSL support is not compiled into netatalk, and this is required for Leopard. The workaround is described here. Sheesh, why even include the package if it's essentially unusable? Well it works with Panther, albeit with a warning. But with Leopard you just get an error trying to connect.

Now how do I connect to my share? Well I have yet to figure out how to show my shares in Finder. Instead I have to go directly to Go -> Connect to server. In there I type the full path of the share, e.g.:

afp://system76/timemachine_powerbook

At this point I came across a problem. In my /etc/hosts file on the server I had something like:

127.0.1.1 system76 ...

And when I attempted to connect, it hung at trying to connect to 127.0.1.1. Evidently this IP is passed along over AFP. I fixed my /etc/hosts so my hostname was not pointing to a loopback (no idea why it was in the first place).

Voila, I have a network share now. Sadly, neither hdiutil nor Time Machine were able to create the disk image on the network drive, so I still needed to create the image locally and copy it over. But once I did it worked like a charm, and much faster than Samba. It's still pretty slow for the initial backup of about 20G (in fact I think it took like 12 hours), but after that it worked pretty well. I'm a bit worried how it will deal with large backups though, as it could be lots of traffic over the network.

Another thing I have to worry about is resizing the disk image. This post describes it somewhat, and it's likely I'll have to do that at some point.

I setup the same thing on my Mac Mini, so now I have 2 Time Machines going to the same share. Plus I have AFP setup and no more need for Samba. Good riddance!

One caveat. My syslogs are filling with:

May 26 09:02:33 system76 afpd[3651]: bad function 4F
May 26 09:03:05 system76 last message repeated 89 times
May 26 09:03:25 system76 last message repeated 163 times

Turns out this is some undocumented AFP call.

Update: And now I think I've lost faith in Time Machine network backups altogether. There is a great post describing the pitfalls of such a solution. Maybe it's time to move back to rsync snapshot backups.

06/24/07

Permalink 11:30:43 am, Categories: Apple, 239 words   English (US)

Drobo Snowblower

I picked up a cool external storage device called a Drobo. It's marketed as a 'storage robot', but there are no robotics involved. They use a proprietary RAID-like scheme that typically gives you more storage than the various RAID levels. The price is reasonable too: $499.

Are there any problems? Well the only issue I have is with the noise. That thread does not exaggerate at all; this thing sounds like a blowdryer/jet engine when the fan kicks into high, which is almost random. For what I'm using it for, in a home theatre setup, it's really unacceptable. So I took advice from one the posters on that thread and decided to open it up and replace the fan with something quieter. It turns out the fan in the unit is a Sunon PMD1208PTB3-A and is 3900 RPM, 49 CFM, and 42 dBA! That is ridiculously loud. I bought a Vantec SF8025L from Fry's which is rated at 2050 RPM, 27 CFM, and 21 dBA. The Drobo was rather cumbersome to take apart, but not too bad. I had to splice in the fan cables because it had a non-standard fan connector, but once it was in it worked pretty well. It's much more quieter now. Of course it's a lot less airflow, but I honestly don't care. It was simply unbearable in its previous state.

Now I hope my place doesn't catch on fire :). The drives are hot, but not exceedingly.

08/20/06

Permalink 10:51:53 pm, Categories: Apple, Music, 110 words   English (US)

iTunes extortion

I saw Snakes on a Plane last week. I'm not going to write a review of that movie. I mean, it's snakes on a mother-fucking plane. What more do you need?

My problem is with iTunes. iTunes is carrying the soundtrack. I kinda like the theme song, but guess what, Apple is forcing us to buy the whole album just for one song. I know why, it's because all the other songs suck. What happened to the 99 cent songs? Does that only apply when it's convenient? I've seen iTunes doing this alot lately, forcing me to purchase albums instead of individual songs. Lame! I am not paying $10 for 1 mediocre song.

Permalink 10:52:37 am, Categories: Ubuntu, Apple, 1791 words   English (US)

Ubuntu on my Powerbook

This weekend I decided to take the adventure of installing Ubuntu 6.06 (Dapper Drake) on my Powerbook G4. I wasn't sure what to expect as to hardware support, and learned alot along the way. I am writing this from Firefox in Linux on my Powerbook though, so it's been somewhat successful :).

I've been wanting to have a good Linux box to hack on. I did install Xubuntu on an old Thinkpad, but it's falling apart and the battery lasts a whopping 10 minutes. I've heard some good things about Ubuntu on PowerPC, so decided to give it a go.

I have OS X Panther on my Powerbook. I have never had the chance to upgrade to Tiger. I have a 70G drive and had plenty of free space, so my first task was to resize and repartition. Now I'm pretty familiar with doing this on the PC, but not on Macs. I have been using SuperDuper for backups to an external USB drive, so I was set for backups. I actually wouldn't mind it if my Panther partition got trashed, as it would give me an excuse to upgrade to Tiger. In the end nothing bad happened, so I was still luckily (or unluckily) stuck with Panther.

Back to resizing. Out of whim, I tried booting the Ubuntu CD to see if it had an easy resizing tool like it did for Intels. Nope, it just wanted to erase my whole disk. I read that it is possible to do resizing with free tools, but it was late and I didn't feel that brave. I decided to purchase and download iPartition, which seemed similar to Partition Magic. Of course, it couldn't resize the live running boot partition, so I needed to boot something else. The manual first recommends trying to boot off of a backup drive, and if that doesn't work to use the boot CD creator tool that comes with iPartition.

Obstacle #1: try to boot my backup drive via USB

I thought this would be a good test of by 'backup strategy.' I plugged in my external USB drive. After some digging around, I found out that you can have the Mac scan for bootable media at powerup by holding down the Option key while powering on. This brings up a nice GUI boot screen and showed my USB drive! I selected it, and after some crunching it eventually came up with a no smoking sign and didn't boot :(. Oh well I guess my backup isn't that cool. It does have files on it though, so I am backing up something, just not something that will boot. I tried some other hackery mentioned on the web, by booting into the Open Firmware by holding down the twister-inspired key combination of Command-Option-O-F while powering up, and changing the boot-device with setenv. I swear, Apple is trying to give me arthritis. Anyway, no luck with that, and I later realized that setenv actually writes the NVRAM, so I had to remember the old setting and undo this. Fuck booting from my 'backup.'

Next I created an iPartition boot CD with their CD creator tool. I booted it (again with the Option key held at boot to select CD), and successfully shrunk my OS X partition by 10G and left the free space. This operation was done so fast I thought it didn't do anything. I booted back into OS X. It booted ok (whew), and I verified in Disk Utility that the partition shrunk by 10G. So far so good.

Now on to installing Ubuntu. I booted the CD. I wanted to see if the Airport wireless worked, so went to System -> Administration -> Networking. It detected the Airport but failed to configure it, and I remember seeing boot messages about firmware errors. I did some research beforehand and it turns out the driver is not open, and it was up in the air whether it would work or not. I figured I could fool with it after installation. I grabbed a wireless card from my Thinkpad, and voila that worked like a charm in my Mac. At least I would have internet access while I debugged the Airport driver later.

I ran the installer, and specified for it to use my free space. The text that is shown before making the partition gave the impression it was going to wipe my HD, i.e. it was not obvious it would use my free space. I thought whatever, if it trashes it that's ok. It didn't (whew), and after a 40 minutes or so, I rebooted. I was given a LILO-like boot menu with my OS X still there. I tested OS X, and that still worked (whew). Next I rebooted into Linux! It was speedy and worked like a charm. My wireless was working, but with the PC card, not with the internal Airport.

Obstacle #2: getting Airport to work

I started searching the discussion boards for Airport support. Now Ubuntu forums are interesting. They are mostly filled with non-Linux users seeking help. That's cool and all, but it just makes my searching more difficult with crappy results. I finally found this guide which was generally what I did except for the part about installing 'Network Manager', whatever that was. I figure I should be able to use the Network setting app that is already part of Ubuntu. I found some other good docs, the latter being very helpful. Eventually I got it working whenever I brought up the interface in the Networing app, but it would take a very long time, and would never work at bootup. From those docs, I added the following to /etc/network/interfaces:

auto eth1
iface eth1 inet dhcp
  pre-up ifconfig eth1 up
  pre-up iwconfig eth1 rate 11M
  pre-up iwconfig eth1 ap any
  wireless-essid myssid

I rebooted and voila, Airport works! No more PC card needed. Everything, even sound, was working. But after using Ubuntu for some time on the Mac, I realized a big annoyance...

Obstacle #3: How the fuck do I right-click?

I realized early that Ubuntu is not very usable with a 1-button mousepad. After some searching I found out that F12 (or maybe it was F11, it's not working now) was mapped to right-click. WTF, there is no way in hell I'm using any F key for right-clicking. In OS X I can do it by ctrl-clicking, so I should be able to do it in Linux too. I came across this posting about installing mouseemu. I did so, and added to /etc/default/mouseemu:

MID_CLICK="-middle 125 272" # Command key + mouse click
RIGHT_CLICK="-right 29 272" # Control key + mouse click

Once I did that and restarted mouseemu (sudo /etc/init.d/mouseemu stop/start), I was able to right-click with ctrl-click. Yay! But then after realizing that I have to use Alt-Tab instead of Command-Tab to switch windows, I was annoyed further because the Alt key on the Mac is proven to increase the risk of arthritis and why the hell do I have to remember a different keystroke for Linux when Command-Tab works in OS X?

Obstacle #4: Swapping Alt with Command key

I found somewhere on the web that xmodmap can be used for this. I created a ~/.xmodmap file that contained:

keycode 115 = Alt_L

One thing very cool is Ubuntu will notice your .xmodmap and ask you to load it on next startup. There was some discussion on whether to use .xmodmaprc, or .Xmodmaprc, or .Xmodmap, or .muhahhayouWillneverFigureitOutrc. But I will tell you .xmodmap works :).

After booting back and forth between OS X and Linux, I realized that the boot manager was defaulting to Linux. I didn't want that. I wanted OS X by default. Such began my journey into yaboot, the LILO for Mac's.

Obstacle #5: boot OS X by default damnit

It was a short journey. I edited /etc/yaboot.conf and added after the macosx= line:

defaultos=macosx

This is described in 'man yaboot.conf'. I rebooted, but whaddaya know, it still booted into Linux by default. I was optimistically thinking this would be like GRUB, where I didn't have to run anything to update the boot sector. Turns out I need to run ybin, which copied my changes in. I didn't know what arguments to give, so being inspired by 'lilo', I just ran 'ybin.' That worked, and I was booting OS X by default. Yay.

Now I worked a bit more in Ubuntu and realized that I needed to copy some files off of my OS X partition (namely, my SSH config file).

Obstacle #6: Accessing my OS X partition from Linux

I had no idea if OS X's HFS+ partition was supported in Linux. I found this document which states that it is, and the fs type is hfsplus. However, 'man mount' only shows hfs, not hfsplus. I stuck with hfsplus anyway. I found this post about a user mounting his partitions. All I wanted to do was copy a file, and I'd be pretty pissed if Linux screwed up my OS X partition accidentally. I decided to mount it read-only. But what's my OS X partition? I easily found that from the macosx= line in /etc/yaboot.conf, which was /fev/hda3. dev has been replaced with fev to protect the innocent. For some reason either my webhosting provider or blogging software won't let me post dev. I ran the following commands:

mkdir /tmp/mnt
mount -o ro -t hfsplus /fev/fda3 /tmp/mnt
cp my file
umount /tmp/mnt

At this point there are only a few things left that annoy me. The mouse sensitivity seems quite different from OS X. I tried adjusting the acceleration settings, but it still just seems wierd. My fan seems to be constantly running, and my guess is Linux is not as nice on the CPU as OS X. Finally, cutting and pasting with a 1-button mouse in Linux is a bitch. Why do I have to shift-ctrl-anything to copy text in Terminal anyway? Why can't I just select and have it auto-copy? Maybe there is a way, but I haven't figured it out yet. Maybe it is time for me to get a real mouse and keyboard.

The fn, ctrl, alt, and command keys on the Mac cause me no end of grief. I constantly forget which incantation to use to switch workspaces, switching firefox tabs, closing windows, closing firefox tabs, etc. But that's more of a rant towards the Powerbook keyboard in general. Also forget about Flash and other plugins, they are nonexistent for PowerPC Linux.

In general, it was a fun adventure to figure out how to do things and cool to have Linux on my Powerbook. It runs beautifully and I'm sure I'll be hacking on it for some time.

05/21/06

Permalink 07:46:09 pm, Categories: Apple, Money, 36 words   English (US)

401k: you need to save 18%

Saw a very good Frontline about retirement planning. Probably the most interesting thing from the show is that you really need to put away 15-18% of salary in your 401k for 30 years to have enough for retirement.

:: Next Page >>

Viraj's Weblog

This is my personal blog. The views expressed on these pages are mine alone and not those of my employer.

| Next >

August 2010
Mon Tue Wed Thu Fri Sat Sun
<<  <   >  >>
            1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31          

Search

Categories


Misc

Syndicate this blog XML

What is RSS?

powered by
b2evolution