betabug... Sascha Welter

home english | home deutsch | Site Map | Sascha | Kontakt | Pro | Weblog | Wiki

Entries : Category [ mac ]
Macintosh computers are some of the betabugs preferred tools. Sometimes something comes out of it, this category is a container for such knowledge.
[digital]  [language]  [life]  [security]  [media]  [zope]  [tourism]  [limnos]  [mac]  [athens]  [travel]  [montage]  [food]  [fire]  [zwiki]  [schnipsel]  [music]  [culture]  [shellfun]  [photography]  [hiking]  [pyramid]  [politics]  [bicycle]  [naxos]  [swim] 

20 April 2009

Rotten Trash in FileVault

Stubbon Folder / File resists deletion

For the last couple of weeks I had something in my trash that wouldn't delete. Whenever I emptied the trash, I got an error and had to skip the file in question. I checked Apple's knowledge base Article on the topic, but the suggestions in there didn't work for this case. Me using FileVault made the problem a bit more complicated... in the end logging in as root and mounting my home disk image from there solved the problem... for details see after the break.

Prehistory: At some point some items on my desktop started to behave erratically. The icons would disappear until I selected them. Move things around, the "haunted" items would revert to their position. Somehow I managed to copy the important stuff (using the Terminal) then move misbehaving items to the trash. Where most of them could be deleted, but one of them stubbornly resisted. In fact it was the empty hull of an application program, so in fact a folder with the suffix ".app". Trying to access the file from the Terminal resulted in "IO Errors".

Normally I'd now run fsck in single user mode (yeah, I'm that kind of Mac user), but since my home directory is in a "FileVault" (Apple's technology for an encrypted home directory - and yeah, I'm that kind of Mac user too), that wasn't so easy.

What I did then was to log in as root exclusively, mount the FileVault disk image of my home directory (which can be found in /Users/.username/username.sparseimage), then run a check/repair with "Disk Utility" on it. Mounting the disk image took a very long time on the "verify" step. Fine with me. "Disk Utility" didn't find anything to repair though... there went my theory. But given that I had a root shell at my hands, I went for a look in the .Trash folder in there. To my surprise, not only did I see the stubborn thing, there were also the other items that I thought I had managed to delete long ago. To my further surprise I succeeded in deleting everything with rm. Logging back in to my normal user (and a restart after a software update later), the things are still gone.

New theories: Either having the volume mounted, but not as a user home directory allowed the deletion of the files without some special function looking at .Trash intervening... or else the long "verify" step in the mounting process had actually fixed some file level errors. Spooky stuff.

Posted by betabug at 12:51 | Comments (0) | Trackbacks (0)
28 July 2009

How to enable identd / auth on Mac OS X 10.4

Fast and simple... no installs needed

IRC on the shell is fun... but some IRC servers require to get an auth response from your machine. Since I'm on a 3G connection right now and I wanted to IRC on Mac OS X... which doesn't run identd by default, I had a non-fun problem.

Now there are people saying that you need to install some software on Mac OS X to get identd (the "auth" service) running. At least for 10.4 this is not true, everything is still there in the system. Of course Apple is progressively trying to cripple the Unix base of the system, e.g. by replacing simple config files with weird xml setups. But still it's possible to get things going with built in tools.

So what did I do (apart from searching the f* web)?

Step 1: Enable the auth service in /etc/inetd.conf

Yes, indeed, the very good old inetd.conf, not xinetd, not launchd, not xml something. There is just one line that needs to be uncommented. Change this line:

# auth    stream  tcp     wait    root    /usr/libexec/identd     identd -w -t120

to this line:

auth    stream  tcp     wait    root    /usr/libexec/identd     identd -w -t120

Step 2: Start inetd

Yes, indeed again, inetd is still there. It's probably working through 3 layers or more of Apple bogon fields (aka inetd over xinetd over launchd), but it works. Run this little command as root:

# /System/Library/StartupItems/IPServices/IPServices start

As mentioned, this works for me in 10.4 (Tiger), where I needed it to connect to IRC. Dunno if this still works for 10.5 (Leopard), but I guess it might as well work - give it a try and leave a comment.

Also this doesn't auto-start when you start up the machine. You'll either have to repeat step 2 after each restart ... or find out how to auto-start things on boot. Have fun!

Posted by betabug at 10:43 | Comments (2) | Trackbacks (0)
02 October 2009

Status of

Thank you PHP...

Some people seem to search the web in order to find out what happened to the site The current status is that the site was taken down because of multiple security incidents that had resulted in phishers abusing the server to host fake sites (e.g. fake paypal forms). The problem behind that is, that the software used (PHPBB) is a total piece of crap, "programmed" by people who are totally, utterly clueless [1]. I can and do blame PHP for this, I doubt that any other web programming system has such a record of bad quality code output.

The webmaster and one of the server admins are currently trying to switch the site to a different software... trying, because importing the content seems not to be too easy. Myself I'm not currently helping, I'm too busy. The other two guys are busy too (hey, everybody has a job and a life), so work progresses only as fast as it can.

Current status: Please wait for the site to come up again, sorry!

[1]man, they haven't even discovered diff and patch yet, instructions for "bugfixes" are given by description "then you open the other file and find the line after ..." ... totally clueless!

Posted by betabug at 09:58 | Comments (1) | Trackbacks (0)
26 November 2009

Apple's Fooled Everybody With Address Book Server 10.6 Description

Read it, baby, read it real good!

So we upgraded to Mac OS X Server Snow Leopard 10.6 (can system software names get any longer?)... all nice and dandy. Starting up "Address Book Server", wonderful. Setting up Address Book on a Snow Leopard 10.6 machine to connect to Address Book Server to share an address book, then a second one to get the shared address book. But wait, something doesn't work... the 2nd Mac never sees the first's address book. What gives?

Re-read the description:

With the new Address Book Server in Snow Leopard Server, it’s incredibly easy to access and synchronize contacts across multiple computers and the devices you own.

Everybody on the Intarweb-thingy read this to the logical conclusion that you can set up an address book for your office group of people and people can share the addresses in that. But as has been pointed out in a couple of discussion threads that will probably soon disappear from Apple's support forums, the fine point is in the words you own. If you set up an address book with account "Adam", then only account "Adam" can share this address book, for example on two different Macs Adam owns. What people would have expected in a workgroup environment is that Adam can publish an address book for his team to share.

What you can do is make an account on the server only for use with the Address Book Server, then give that username/password to everybody for access of the shared address book. Crude. The other option is to set up a gateway to a LDAP "Global Address List" and go back to the big setup of LDAP.

Posted by betabug at 10:39 | Comments (5) | Trackbacks (0)
16 February 2011

New Laptop... Not, but Almost

Got a new drive, it's driving me on

Monday evening I picked up a new hard drive for my Macbook. Originally I think it had an 80gig drive, which I upgraded to 250gig, and now I got a 500gig drive. I'm not much into media, small music collection, I've almost gave up watching movies. The reason I needed this upgrade is simply that with raw scan files going up to more than 500MB for one picture (from a 6x9cm color negative), the disk was filling up. Yesterday evening I installed the drive into the laptop and placed the old one into yet another external housing.

The drive I got is a Seagate Momentus XT "hybrid drive". Which means that there is a 4GB solid state disk in a chip on the drive, which is used as a read cache. This is supposed to make for example starting applications which you use regularly snappier. It's also spinning faster than my old drive (at 7200rpm). I can't really make a statement about the performance, as I also upgraded from 10.4 to 10.6. Too many factors changed, so no scientific data.

The computer feels snappy though, which is what I had wanted. I was afraid that the "heavier" OS would feel slow on this not-so-young Macbook. Sure, 10.6 is "64bit", but it's also much more bloated. I hoped to counter-balance some of that with the cached drive. First thing I had to do with the new system was to turn off "show icon previews" in the Finder - which should be labelled "generate icon previews, slowly and using a lot of CPU" - especially for 100+MB image files.

I was impressed and happy how well the migration went. Apple's "Migration Assistant" really has come a long way. Even my Zope instances were running right after the install. VPN and bluetooth needed only minor re-setting. Neither Photoshop nor FileVault gave me trouble (FileVault required that "Migration Assistant" ran before any users were set up). Casualties so far include only a couple of screen savers. I had expected a lot of time to set things up in working order again, but so far everything comes along cool.

Posted by betabug at 18:01 | Comments (0) | Trackbacks (0)
04 April 2011

Tethering the Nokia e71 to OS X 10.6

Better with the cable

Over the weekend I tried out tethering the e71 to the Macbook again. Well, it's not the first time I'm doing this. I've been tethering and getting my fix of the 'net through the phone for years. The difference is that so far I was on 10.4 (Tiger). On 10.4 I used to tether through bluetooth. It worked, but it sucked up a lot of battery on the phone. The reason that I used bluetooth was that hooking up the phone with the cable did not work for me on 10.4. Along came 10.6 (I skipped 10.5 and was pretty late to go to 10.6 on my Macbook).

So I gave the cable another try and it works now. When hooking up the phone it asks me with what mode to connect. I set it to "PC Suite". On the first time, the Mac informed me of 2 new network connections. I set them up similar to how I did with bluetooth... and off I went. Another advantage: The cable connection is less likely to get disrupted. Speed also appears to be better, but no scientific data there.

Posted by betabug at 09:51 | Comments (0) | Trackbacks (0)
09 April 2011

Postfix: Upgrading to Snow Leopard, User+Group Changed

I'm a bit late to upgrade, so everybody else probably already knows

My MacBook has a local postfix setup with a smarthost that I use to send out mails written in mutt. When upgrading from Tiger 10.4 to Snow Leopard / Mac OS X 10.6 (a long time after that came out, skipped 10.5 entirely), the setup failed with the error message:

postfix/sendmail[13601]: fatal: file /etc/postfix/
parameter mail_owner: user postfix has same user ID as _postfix

So I went and edited to fix mail_owner to be _postfix. After that I got:

postfix: fatal: file /etc/postfix/ parameter setgid_group:
group postdrop has same group ID as _postdrop

So I had to change also for setgid_group the group postdrop to be _postdrop.

With those changes, my smarthost setup worked again without problems.

Posted by betabug at 10:41 | Comments (2) | Trackbacks (0)
12 April 2011

I'm a Freelancer now/soon

Python, Zope, Pyramid, whatever comes along

After 6 years at the Graphics Garage, my big projects there seems to be done. I've written three big systems there: Two of them to administrate every bit of the company, including organizing all the communication with the clients into an Extranet solution. It's time to move on... I'll start working on my own as a freelancer now.

I have on and off worked with Python and Zope since 2002. I've also worked with other web based systems of all kinds (and some not-web-based ones), so I guess I'll stay in the web based programming area for now. I've worked on big and small projects, in teams and alone. Some of my stuff is open source and can be admired from my pro page (with links to my resume too), some is proprietary client stuff and will stay hidden in their code vaults forever.

With all that Zope experience, I'm obviously there for any ol' Zope site in need of an overhaul or extension. For the "new" stuff that's not Zope, right now I've started a little fun project with Pyramid and I've got some Django and Ruby scheduled too. Whatever comes along though, if the tool does the job, it's fine for me.

For starters I continue supporting the projects of the Garage of course, putting my projects there into "maintenance mode". I also have the first project coming along from a customer in Switzerland. I've got some leads from France, so I might be having fun soon as an "international enterprise".

I don't want to hurry it in the beginning (starting too many things at once is as bad as starting nothing), but I've still got some capacity free. So, service announcement: If you need some good programming done, drop me a line!

Posted by betabug at 10:09 | Comments (1) | Trackbacks (0)
23 November 2011

Bragging on AppleScript

Looking at some stuff I did waaaay back

Yesterday while "surfing here and there" (as my friend Panos likes to put it), I came across a post that had a snippet of AppleScript, which triggered fond memories. You see, a looong time ago I did a lot of AppleScript. Those were the days when I was using Claris Emailer and writing various Emailerscripts to extend it. We are talking about 1997 here. Now AppleScript doesn't have such an affection to text wrangling like perl (which I started using a bit later). It especially lacked afast way to search and replace in strings. So one winter evening I was sitting in my home office, turning this problem around in my head.

At some point I had an idea, a flash, a serious spell of "thinking outside the box". I came up with a fast way to search and replace, by abusing a built-in feature of the language. I made some simple tests and the thing was 600 times faster than the usual way of going through the text one character at a time. Now, I come from a culture where you shouldn't brag. When I grew up in Switzerland, little children learn that it's not really OK to insist that you're better than other children or that you did something soooo great. I was constantly hitting against that, but something must have stuck. Well, I still don't really like to brag, I prefer a tone of understatement, even when I think I did something great. On the other hand, I had included a quite braggy comment in the little subroutine that I wrote. The human ego is a confusing thing.

Back then, I should have published my find right away (there was even a discussion about search+replace on the AppleScript mailing list a week or two later). It would have been cool for me and it would have helped my fellow scripters. What I did was to write some more scripts for Emailer and publish those and together with announcing some of them, I wrote about my find. Much time later I also made a page about the thing called "austauschen", together with a snippet from that mail to the Claris Emailer mailing list (dated december 24th, 1997).

The way to do this has spread around, everybody in the AppleScript world is now using it and that's fine with me. Myself I'm not using AppleScript any more really. When I need something scripted I reach for a shell script much faster these days. So yesterday when I saw that post, I remembered all that story fondly: Yeah, I did that thing.

Posted by betabug at 10:36 | Comments (0) | Trackbacks (0)
19 December 2011

Socken für bergsteigende Apple-Geeks

Schön warm sind sie auch
X-Code Socken

Was trägt der bergsteigende Apple-Geek bevorzugt als Socken? Natürlich "X-Code" Socken, die sind schön warm und da schreibt sich dann wohl der Objective-C Code mit den Füssen. (Erklärung für Nicht-Programmierer: Die von Apple zum Mac OS X mitgelieferte Programmierumgebung hört auf den gleichen Namen.) Passend dazu empfehlen wir die griechische "Apple-Unterwäsche" auf (die als Witz schon uralt ist, aber hoffentlich immer wieder gern gesehen).

Die Socken habe ich im übrigen auf dem letzten Ausflug getestet. Sie sind schön weich und warm. Obwohl es neblig, feucht und kühl war, mit viel, viel Wind, war mir an den Füssen nie kalt. Die Schuhe dürfen allerdings nicht zu gross sein, da habe ich die leichte Tendenz gespürt, dass die Füsse in den Socken hin- und herrutschen.

Posted by betabug at 09:20 | Comments (2) | Trackbacks (0)
Prev  1   2   3   4   [5]