Mac OSX

Quick Links

my DNS servers Free DNS @ afraid.org OzHosting
useful links WhoIs database Rebuilding Ubuntu (15.10) from scratch Ubuntu Samba Server configuration

Parallels

(20240227:162348) I bought a new MacBook Pro 14, with an M3 chip, 16GB of memory, and a 1TB SSD. It runs MacOS Sonoma 14.3.1, but unfortunately, as I discovered when I went to investigate dual-booting options, that it will not do dual boots! Urks! So I bought a subscription to Parallels. Some gotchas follow.

Network connexions under Parallels

Networking to Parallels is a hassle. Here are the settings that I find work (open Control Centre first, in the top menu bar, which may require moving to MacOS first, then back again):

Source Default Adapter
Advanced: Open Network Preferences
Connect Mac to this network checked
IPv4 checked
Enable IPv4 DHCP checked

Sharing files across MacOS and Ubuntu

(20240227:162348) There is a wealth of material on file sharing between MacOS and Windows, but bugger all for Ubuntu. So I had to go hunting, only to find the usual sorry state of documentation: either non-existent, or if it does exist, several versions old, or the things described just do not exist on my system! Urks again!

So here's how I got file sharing to work:

  1. open the Linux winow, and make sure it is not full screen (green button)
  2. With the VM running, click the Ubuntu 22.04 menu item in the top menu bar. Select Services->Services Settings.
  3. Check all "Files and Folders", "Internet", "Messaging", "Pictures", and (optional) "Searching" and "Text". Click Done when finished.
  4. Now select Devices in the top menu bar, and for
    USB & Bluetooth->Configure
    in Network, enable the LAN connector
    in Sound & Camera, enable Camera and Microphone
    Network
    enable Shared Network
    Sharing->Configure
    enable Mirror Mac and Linux user folders
    enable Share custom Mac folders with Linux (you may want to identify specific folders to share under Manage Folders)
    enanble Share Mac volumes with Linux

You will need to shut down the VM at this point and restart it for these changes to take effect (or maybe just logout and login again, that is not clear). On restarting, you should see the new shared Mac folders as network devices in the Files window.

Mac OS Apache

(20240401:134117) I went to install Apache2 under Mac OS 14.3, only to discover that it is possible only with an Apple Developer licence, when you get to install a digital certificate that says you can. This pissed me off no end! I mean, who buys a computer to be told by the seller what you can and cannot run on that computer? Apple, you have failed dismally!

So what have I done about it? It has reinforced my resolve to get my old Ubuntu Intel box running again, and I have just given up on running MacOS. It will be like Windows on the old Intel box - it's there, but I will never use it, preferring to run Ubuntu under Parallels. Clunky, but needs must. This is the last time I buy a Mac.

Fixing the network access

(20240401:162849) Another gotcha! I have been unable to SSH from the Ubuntu VM to the rest of my home network. So I sent a support request to Parallels to ask how to fix it. Arvind replied fairly quickly, saying:

          You can try setting the network of the virtual machine to default adapter (bridge mode).
          In this mode, the VM shares the same network with your host Mac OS.
          i. Shutdown Ubuntu virtual machine.
          ii. Right click on Parallels Desktop icon from the Dock.
          iii. Open Control Center > Click on cogwheel > Hardware > Network: change it to 'Default Adapter' (Under Bridge network).
        
That was the easy part.

I did step (i). Then step (ii). There was a funny "gear"/"cogwheel" looking thing, which I clicked, and it reopened the VM. So I shut that down again, and restarted Parallels. Then I got a strange page which I had never seen before, called "My Subscriptions" which three options: a) Restore Purchases, b) Enter Subscription Key, c) Buy new Subscriptions. None of these seemed relevant.

So I went back to Arvind, asking him what to do. He asked for a screenshot. Took me a while to generate that, and even then, it was the wrong window. Finally got a shot of the right window, and am now awaiting a response.

Guess what? All I had to do was close the window, and refollow the instructions. No confusion about the "gearwheel" this time (I got confused with the Ubuntu icon last time), and everything worked as it should. There is a salutory lesson there, but I'm still not quite sure what it is.

Hints and Fixes

Getting Apache to run under MacOSX 10.11, 10.12

Ha! Not under MacOS 14! See above.

  1. ensure ~/Sites is available (can be link to e.g., public_html)
  2. check that we have index.html, index.xml in this directory
  3. edit /etc/apache2/users/ajh.conf - it should look like
    <Directory "/Users/ajh/Sites/">
            AllowOverride All
            Options Indexes MultiViews FollowSymLinks ExecCGI
            Require all granted
    </Directory>
              
  4. check that the file ajh.conf has permissions 664 and owner root:admin
  5. edit the /etc/apache2/httpd.conf file, and ensure the following modules are enabled/disabled:
    LoadModule authn_dbm_module libexec/apache2/mod_authn_dbm.so
    LoadModule authn_anon_module libexec/apache2/mod_authn_anon.so
    LoadModule authn_dbd_module libexec/apache2/mod_authn_dbd.so
    
    LoadModule authz_dbm_module libexec/apache2/mod_authz_dbm.so
    LoadModule authz_owner_module libexec/apache2/mod_authz_owner.so
    
    #LoadModule proxy_module libexec/apache2/mod_proxy.so
    #LoadModule proxy_connect_module libexec/apache2/mod_proxy_connect.so
    #LoadModule proxy_ftp_module libexec/apache2/mod_proxy_ftp.so
    #LoadModule proxy_http_module libexec/apache2/mod_proxy_http.so
    #LoadModule proxy_fcgi_module libexec/apache2/mod_proxy_fcgi.so
    #LoadModule proxy_scgi_module libexec/apache2/mod_proxy_scgi.so
    
    LoadModule cgi_module libexec/apache2/mod_cgi.so
    LoadModule vhost_alias_module libexec/apache2/mod_vhost_alias.so
    LoadModule actions_module libexec/apache2/mod_actions.so
    LoadModule userdir_module libexec/apache2/mod_userdir.so
              
  6. The /etc/apache2/extra/httpd-vhosts.conf also needs to be adjusted. For dimboola, I use
    <VirtualHost *:80>
        ServerAdmin ajh@ajhurst.org
        DocumentRoot "/Users/ajh/public_html/"
        ServerName dimboola
        ServerAlias dimboola
        ErrorLog "/private/var/log/apache2/error_log"
        CustomLog "/private/var/log/apache2/access_log" common
    </VirtualHost>
              
  7. Now restart the server
                sudo apachectl restart
              
    and check that the configuration is correct:
                sudo apachectl configtest
              
    which should reply with "Syntax OK". Rectify any flagged errors and restart.

Karabiner Keys

If you want to know what name to give various keys when redefining them in Karabiner, please refer to this page.

Mail Folder Sort Order not maintained

My (Mac OSX) mail folders suddenly started being displayed in non-alpha order whenever I added a new folder. I'm not the only person to notice this - there is an Apple Discussion Thread on it. The original page is available, but in case it disappears, I've saved a copy at FixMailSort.html. Here is the gist:

Kenji Kono

Re: Mail Not Sorting new Folders Added Alphbetically
Jan 28, 2010 8:05 PM (in response to Matt Garr)
Hi,

I'm not sure, but I suspect the new Snow Leopard feature ...
http://www.apple.com/macosx/refinements/enhancements-refinements.html#mail
... that lets you move folders around manually might be what's causing
the weird behavior.

In Leopard, you could move a folder inside another folder but,
otherwise, they would always stay in alphabetical order, I think.

Anyways, in Snow Leopard (and Leopard for that matter), there's an
invisible file around ~/Library/Mail/<name of your email
account>/.mboxCache.plist It seems to keep a list of the mboxes in
that folder/account. In Snow Leopard, the first time you manually move
an mbox out of alphabetical order, a new key called
MailboxDisplayOrder seems to get created in that plist for all the
existing "non-special" (i.e. not INBOX, Sent, Drafts, etc.) mboxes in
that folder. Once that key exists, it seems like new folders get
appended to the end of the order.

I don't know the right way to fix the problem though. I'm really just
posting my observations, based on what I'm seeing on my computer. I'd
be very careful about manually messing with invisible files in your
mail, especially if you don't have a good backup. (No idea if you can
restore an invisible file with Time Machine.) A lot of this is
guesswork. But I thought maybe it'd help someone.

Later,
k
        

The solution is to delete the offending .mboxCache.plist file. You should exit Mail before you do this, and it will get rebuilt next time you run Mail.

Invisible files

When I first obtained a Mac, using (IIRC) Mac OS 3.1 or thereabouts, my son discovered that there was a resource fork bit that made files invisible. He delighted in changing that bit on files that I used, so I rapidly discovered how to unset it again. That facility is still there in OS X, so I have documented that little lurk to avoid any future mischief.

To make a file invisible:

$ /Developer/Tools/SetFile -a V file-name

(upper case V)

To make a file visible:

$ /Developer/Tools/SetFile -a v file-name

(lower case v)

Safari Plug-Ins

I installed/updated my Adobe reader, and the next time I used Safari, it asked me if I wanted to install the Adobe plug-in to make Safari use the Adobe reader for PDF files. I said yes at the time, but after a bit of use, found it too slow. Granted, it does have more features, but not the one I wanted, which was to open it up outside the browser. With the standard Preview option, this was just a right-mouse pull down "Open in Preview", very convenient. But how to get back to Preview?

A bit of Googling revealed the answer. In Tiger (10.4) and Leopard (10.5), there is a folder /Library/Internet Plug-Ins/ that contains all the plug-ins. Remove the one called AdobePDFViewer.plugin, restart Safari, and you are back with Preview.

And while on the subject of Safari, here's how to change the default browser preference:

  1. Open Safari (/Applications).
  2. From the Safari menu, choose Preferences.
  3. Click the General button.
  4. Choose a different browser from the Default Web Browser pop-up menu.
(from http://support.apple.com/kb/HT1637)

Time Machine Repair

A colleague had difficulties recovering his Time Machine backups when he had his motherboard replaced, and he sent me this URL about a fix. It seemed like good insurance to add it to this page: http://www.macosxhints.com/article.php?story=20080128003716101

OpenOffice recovery documents

When Open Office (version 3) "loses" its recovery files, and keeps asking to recover (non-existent) files, edit the file: /Users/ajh/Library/ApplicationSupport/OpenOffice.org/3/user/registry/data/org/openoffice/Office/Recovery.xcu to delete the element nodes containing the offending file path. Then save this file, and restart OpenOffice.

Finding out the screen resolution

I run a number of different displays, and when starting up various programs I need to know the current screen resolution. This little script does the trick:

        #!/bin/bash
        #
        # screenres      determine screen resolution 'HEIGHTxWIDTH'
        # screenres -w   determine screen resolution 'WIDTH'
        # screenres -h   determine screen resolution 'HEIGHT'
        #
        res=`xdpyinfo | awk '/dimensions/ {print $2}'`
        if [ "$1" = '-h' ] ; then
          # extract height and print
          expr "$res" : '.*x\([0-9]*\)'
        elif [ "$1" = '-w' ] ; then
          # extract width and print
          expr "$res" : '\([0-9]*\)'
        else
          # print full resolution
          echo $res
        fi
      

Apple's X11 Cut and Paste

Apple did a Great Thing in making X11 available as part of OS X, but it was always going to be a difficult task, given the different "look and feel" of the two user interfaces. To try and fix the inconsistency between the OS X cut and paste, and X11's cut and paste, check out this Fix for Apple's X11 Cut and Paste

Keyboard Shortcuts on Booting

To find out all those nifty keyboard things when things go wrong, here's a page to describe the Keyboard Startup Shortcuts.

Automatically changing the Desktop Picture in Snow Leopard

I had a cool little script that changed the desktop background picture (aka wallpaper) automatically, according to parameters stored in an XML file. See this Multithreaded Image Viewer for details. Most of it was pretty plain python programming (I even set it as an exercise in concurrent programming one year), but it relied upon a shell script setBackground.sh that used an Applescript script to do the actual picture change via a set desktop picture to file MyPicFile.

Here's what that script looks like:

      #!/bin/sh
      #
      # simple shell script to set the backgroup image
      # uses an Applescript call to do the actual work
      # call:
      #  setBackground.sh <imageFilename>

      FILE=$1

      #echo $FILE >>output.txt

      /usr/bin/osascript <<END
      tell application "Finder"
        set myFile to POSIX file "$FILE" as string
        set desktop picture to file myFile
      end tell
      END
    

But then it broke in Snow Leopard, for reasons I do not understand. Attempts to find how to do this task via much Googling also proved fruitless. While fiddling around with the standard Apple Change Desktop Background pop-up memu, I hit on the idea of having a folder with only one image in it, and setting the reload time to 5 seconds, the shortest reload time.

Hence this new script for setBackground.sh. It looks like this:

      #!/bin/sh
      FOLDER=/Users/ajh/Pictures/Desktop
      FILE=$1

      rm $FOLDER/*
      ln -s $FILE $FOLDER
    

I used a soft link without thinking about why. It could be a hard link, I guess.

(20100330:094441) And this is not perfect by any means. It breaks on my laptop when I put it to sleep, or change locations, or both, or neither (hard to say which, since it seems very erratic!) Every so often I have to invoke "Change Desktop Background", and reselect the folder in which the temporary item is placed.

(20101216:160200) The behaviour in Snow Leopard is now consistent with Leopard again. I don't know what happened, but I now use the script identified at the beginning of this item. I'm keeping the rest of the story here just in case.

Filename extensions

I noticed while using Keynote that my filename extensions were getting thrown away. I was not the only one to be puzzled by this behaviour, so I thought I should comment on the fix required.

Go to the Finder Preferences, and click the Advanced tab. Under Snow Leopard, the top check box should be "Show all filename extensions". If this is unchecked, click it, and your filename extensions will magically reappear!

For some reason, Apple appears to have changed the default value on this from Leopard to Snow Leopard, leaving many users puzzled as to what is going on.

Fixing the X11 "Focus Follows Mouse" hassle

In a terminal, type:

    defaults write org.x.X11 wm_ffm -bool true
and then restart X11.

This page is copyright, and maintained by John Hurst. 9 accesses all since
07 May 2026
My PhotoMy PhotoTrain Photo

Local servers: Localhost Newport Albury Geelong Jeparit Reuilly Spencer (accessible only on local network.)
Public Web Servers: ajhurst.org ajh.co ajh.id.au (not all may be active.)
Dynamically generated at 20260524:0544 from an XML file modified on 20260502:0235, by index.py version 1.6.8.