Archive for the 'Geeks Paradise' Category

Sharing iCal Calendars

Wednesday, August 25th, 2010

From the day our household obtained more than one Macintosh computer, the problem of sharing calendars between multiple macs and multiple users of the macs have plagued me. How do I make my calendar visible to my wife? How can I see her calendar? iCal has always had the ability to publish calendars on the net, and so that’s what we’ve done. At first we published to my work’s WebDAV server. Then when that went away we found the site, www.icalx.com. Users can publish and exchange calendars via the site. We used that for several years. However, I was uncomfortable with the idea of storing my schedule on a public server on the internet. I wanted to setup my own calendar server.

A bit of googling led me to this site: Sebastian Mogilowskis Blog with step by step instructions on how to set it up.

The above link allows one to setup a single directory where all calendars will be stored. I wanted each user to have their own directory, and also have a public and private calendar areas. The solution is simple.

In the apache configuration add the following directive to the VirtualHost section for the calendar web server

<directory /path/to/calendar/dir/*>
AllowOverride AuthConfig Limit
</directory>

Then instead of inserting the “Auth*” directives in the <location> block of the web server config file for the calendar server, you can put it in the .htaccess file found in each user’s calendar directory. For example my calendar directory is: /path/to/calendar/dir/edsel
I would place a .htaccess file in there with the following contents:

AuthName "Calendar"
AuthType Basic
AuthUserFile "/path/to/htpasswd/file"
<limit GET PUT>
require valid-user
</limit>

This makes the calendars stored in /path/to/calendar/dir/edsel available to all users in my htpasswd file, effectively making it publicly available to authorized users of my system.
Then I create a /path/to/calendar/dir/edsel/private with the following .htaccess file:

AuthName "Calendar"
AuthType Basic
AuthUserFile "/path/to/htpasswd/file"
<limit GET PUT>
require user edsel
</limit>

That makes the private directory only accessible to the user ‘edsel’ which is me.

Other users can have a similar directory structure and .htaccess configuration. By ensuring that the .htaccess file in the private directory only lists the owner of that directory, we ensure that its contents remain private.

Now I can host my own calendar sharing site.

This solution is fine and dandy until you begin to have the need to modify other users’ calendars. For example, my wife may want to add our date on Wednesday night to my calendar. With this setup it isn’t possible, since iCal only gives you read-only access to calendars you subscribe to over the network.

Maybe I’ll try Apple’s calendar server soon to see if it has that additional capability… Stay tuned.

-- Posted in Geeks Paradise

iscsi and LDOMs

Wednesday, August 18th, 2010

This post should be filed in the “don’t do this at home” category.

So I have a server running Solaris 10 x86 release 10/09. I decided to play with the iSCSI implementation on this Solaris release. Note that this is the native Solaris 10 iSCSI target implementation, not the OpenSolaris COMSTAR iSCSI implementation.

First off, this implementation of iSCSI target runs in userland (as opposed to the in-kernel implementation of COMSTAR).

I also have a T series machines with LDOMs. Wouldn’t it be great if I can setup LDOMs on the T series system to boot from my iSCSI server? It would be a poor man’s SAN boot.

So I did all the necessary setup required. I created the iSCSI target volumes backed by ZFS volumes on the storage server and enabled the iscsi initiator on the T series primary domain so that the iSCSI targets are accessible. I can now access the iSCSI targets as local disks on the primary domain of the T series machine.

I created the guest LDOM on the T series machine, then proceeded to create the necessary vds-devs and vdisks on the T series so that the iSCSI targets will be visible to the guest LDOM. All is well.

The guest LDOM sees its disks. Solaris install went perfectly well on the guest LDOM, and the system ran fine for a while. Yes there were performance issues related to the iSCSI target disks since I was running only on a Gigabit network with no Jumbo frames support and I’m using the standard Solaris 10 iSCSI implementation (which is plagued with performance issues). But in general the guest LDOM ran OK.

Then something happened on the iSCSI server which needed it to be rebooted. I rebooted the iSCSI server without shutting down the guest LDOM that uses the iSCSI target as a boot disk. This proved to be a very bad idea. This resulted in the boot disk (iSCSI volume) getting corrupted that the guest LDOM crashed, and it won’t boot anymore complaining with the following error:


Boot device: disk File and args:
Warning: Fcode sequence resulted in a net stack depth change of 1

The file just loaded does not appear to be executable.

The only way to recover was to re-install the guest LDOM (or restore from backup).

So kids, don’t do this at home. Don’t reboot the iSCSI server without first shutting down the LDOMs that use the iSCSI volumes, or you could risk data corruption.

-- Posted in Geeks Paradise

Apple’s Mail.app Bugs

Thursday, July 15th, 2010

I’m getting increasingly frustrated with Apple’s Mail.app on OSX. It’s a great mail program but it does have some very annoying bugs. This blog entry will be used as a catalog of the bugs I find with Mail.app.

1. Loses IMAP server connectivity - occasionally a small triangle with an exclamation mark will appear beside some mail boxes. Clicking it will popup a message indicating “the connection to port 993 of the mail server timed out”. Manually connecting to that port on that server from a terminal using telnet works fine, but Mail.app cannot reconnect. The only way to resolve it is to restart Mail.app

2. Cannot delete files sent as attachments - Once you send a file as an attachment, it cannot be deleted without quitting Mail. If the file is on a remote volume mounted from a server, you will not be able to eject the volume until you quit Mail. This can cause problems with the Finder in particular if you are a mobile user and you disconnect from the network where that share is mounted from. Finder can freeze and take long to respond. Work around is quit mail before deleting the file and before ejecting a network volume.

3. Mail.app occasionally loses “sent” emails - I haven’t been able to determine what causes this, or where that lost e-mail goes. The e-mail gets sent, the recipient receives it (I’ve verified this), but the message isn’t in my “outbox” or “On my Mac -> Sent” folder or in the Sent folder on my IMAP server. Yes, I’ve configured Mail.app to store “Sent” messages on the server. This usually works, but in rare occasions, some sent mail does not get stored in the Sent folder.

-- Posted in Geeks Paradise

LDOMS and virtual disks

Wednesday, June 24th, 2009

Have you ever had an LDOM that failed to boot due to some erroneous configuration files in the root file system? Ever wish you could modify the root filesystem of that LDOM without having to boot the LDOM?

Well, you could take the virtual disk and re-assign it to another LDOM, and restarting the LDOM you just re-assigned it to, then access it from there.

For example:

ldm rm-vdisk bootdisk broken_ldom
ldm add-vdisk broken_bootdisk broken_ldom_bootdisk@primary-vds0 working_ldom
ldm stop working_ldom
ldm start working_ldom

Once working_ldom boots, you can run “devfsadm” to create the device links for the new disk. At which point you can mount it and fix whatever you want to fix.

But what if you didn’t have an LDOM that you could restart at this point? What if you didn’t have the resources to create a new temporary LDOM for this purpose?

There is another way but it has limitations. You will only be able to access the first partition on that virtual disk.

If the virtual disk is a zfs volume you can mount it directly as follows:
mount -o rw /dev/zvol/dsk/zpoolname/volname /mountpoint

If the virtual disk is a file, then you can use lofiadm to create a device for it:
lofiadm -a /path/to/vdisk/file
mount -o rw /dev/lofi/1 /mountpoint

I’ve only tested this on volumes that have UFS file systems on it. It may work with other file systems (even ZFS), I just haven’t tried it.

Now if anyone can figure out how to create device files for the other partitions within the volume (by mapping that device file to an offset within the file), then managing every slice in a virtual disk file or volume would be possible and greatly simplified.

-- Posted in Geeks Paradise

Apple Macbook Air Parody

Wednesday, February 6th, 2008

I thought this was pretty cool.


-- Posted in Geeks Paradise