A working workaround when losing audio in OS X Mavericks ;)

After plugging out the headphones again, Mavericks decided to rather do without audio output for the rest of its runtime. As none of the usual approaches worked to convince it to obey and I wasn’t quite willing to reboot it, I did a web search and found the following hint:

sudo kextunload /System/Library/Extensions/AppleHDA.kext

sudo kextload /System/Library/Extensions/AppleHDA.kext

I can hereby confirm that this worked in my case (with a 15″ MacBook Pro Retina 2014 model), Mavericks finally obeyed.

via Losing Audio in OS X Mavericks? Here’s what you can do about it! | iMore.

Turn off drop shadows on Mac OS X screenshots

Philip’s post about More OS X Leopard Tips & Tricks is quite dated, but basically, all the valuable tips there are still valid.

Among them also the tip how to get rid of the (usually annoying) drop shadows that Mac OS X adds to screenshots (enter the commands in a terminal window):

defaults write com.apple.screencapture disable-shadow -bool true
killall SystemUIServer

Adding shadows again:

defaults delete com.apple.screencapture disable-shadow

Mac OS X Server: Prevent “missing Bluetooth keyboard” startup interruption

Sometimes, it may seem convenient to quickly connect a Bluetooth keyboard and a Bluetooth mouse to a Mac OS X Server machine for administration. The not so intuitive consequence of this however is, that at future startups, if there’s no keyboard or mouse connected to the machine (which is the common case with servers), Mac OS X will by default fall back to searching for that once connected Bluetooth keyboard or mouse and even stops booting when it doesn’t find them.

In order to prevent this, do the following on your Mac OS X Server:

  1. Open Bluetooth Preferences
  2. Disconnect and remove any associated Bluetooth devices
  3. Click the “Advanced…” button
  4. In the advanced Bluetooth settings, deselect both “Open Bluetooth Setup Assistant at startup if no keyboard is detected” and “Open Bluetooth Setup Assistant at startup if no mouse or trackpad is detected”
  5. Unless really needed, disable Bluetooth on a server. So, better grab a USB keyboard and mouse next time you need to do some admin ;)

Screen Shot 2014-06-24 at 13.43.52

Screen Shot 2014-06-24 at 13.44.40

Automatically install any downloaded updates on Mac OS X

Check the recommended answer in this thread on superuser.com. For example, to autoinstall the updates at 8 PM daily, you basically need:

1.) Create /Library/LaunchDaemons/some.meaningful.name.plist

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>Label</key>
    <string>some.meaningful.name</string>
    <key>ProgramArguments</key>
    <array>
        <string>softwareupdate</string>
        <string>-i</string>
        <string>-a</string>
    </array>
    <key>StartCalendarInterval</key>
    <dict>
        <key>Hour</key>
        <integer>20</integer>
        <key>Minute</key>
        <integer>00</integer>
    </dict>
    <key>RunAtLoad</key>
    <false/>
    <key>KeepAlive</key>
    <false/>
</dict>
</plist>

2.) Execute the following in a terminal:

sudo launchctl load /Library/LaunchDaemons/some.meaningful.name.plist

Guaranteeing memory safety in Rust | Air Mozilla

Nicholas Matsakis of Mozilla on how Rust guarantees type soundness, memory safety, and data-race freedom while still offering control similar to C/C++:

(via Guaranteeing memory safety in Rust | Air Mozilla.)

Rust, with its funny name, reminds more of a mutt than an academic programming language. It’s that pragmatism however, that has a lot of potential to help solving well-known “real world” reliability problems in software engineering. It would definitely make a worthwhile addition to other programming languages taught in CS classes.

Mozilla has already started building Servo, a web browser engine based on Rust. While still far from usable (Disclaimer: I’ve just compiled and quickly tested the current master branch sources on Mac OS X Mavericks), it’s the right strategic move and I wonder when other browser projects, like Chromium, will start shifting to safer programming languages too.

Modern web browsers are very complex and accordingly vulnerable pieces of software and yet, with the rise of the browser as an app platform, we depend more and more on their reliability, safety and security.

Ironically, my Chrome browser irrecoverably froze while I was drafting this blog post. Although chrome doesn’t rust, some Rust would actually be a good thing for Chrome, in the long term.

Zimbra Desktop Update to 7.2.5 on Mac OS X Mavericks

When Updating Zimbra Desktop (documentation) to the latest version on Mac OS X 10.9.3 (Mavericks), the installation of the update fails. The hint how to work around this bug is quite subtle, well hidden in the Zimbra Desktop 7.2.5 release notes and even wrong and misleading, so here’s the corrected hint:

Issue # 88878: Unable to install Zimbra Desktop on OS X Mavericks machine.
Workaround: If launching Zimbra Desktop fails on an
OS X Mavericks machine, you can override your security
settings to open Zimbra Desktop:
1. In the Finder, locate the Zimbra Desktop .mpkg file. This
can likely be found in the Applications folder [wrong, see my notes below!].
2. Press the Control-key and click the file.
3. Choose Open from the pop-up menu.
4. Click Open.

Important hint: The ‘Zimbra Desktop.mpkg’ file is NOT located in the Applications folder though, but in a mounted ‘update.dmg’ image, named “Zimbra Desktop Installer” (its icon is probably shown on your desktop), and only as long as the warning dialog is being displayed (do NOT close it before running ‘Zimbra Desktop.mpkg’!). Further, auto-mounting of update.dmg only works the first time right after booting – otherwise, you either need to reboot your Mac or manually mount

/private/tmp/zdupdate/update.dmg

(e.g. by copying [optional] and double-clicking it).

Addendum: This update was obviously packaged in a rush and wasn’t tested well on Mac OS X Mavericks (I seriously hope that’s not a bad omen for the future support of ZD on Mac OS X!). For example, after updating ZD to 7.2.5 GA build 12038, I can’t compose new messages anymore as there’s the following Java error when clicking on the “New” button:

HTTP ERROR 500

Problem accessing /zimbra/public/launchNewWindow.jsp. Reason:

    PWC6033: Unable to compile class for JSP

PWC6199: Generated servlet error:
The type java.util.regex.Pattern cannot be resolved. It is indirectly referenced from required .class files

PWC6199: Generated servlet error:
The import java.util.regex.Pattern cannot be resolved

Caused by:

org.apache.jasper.JasperException: PWC6033: Unable to compile class for JSP

PWC6199: Generated servlet error:
The type java.util.regex.Pattern cannot be resolved. It is indirectly referenced from required .class files

PWC6199: Generated servlet error:
The import java.util.regex.Pattern cannot be resolved


	at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:123)
	at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:296)
	at org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:376)
	at org.apache.jasper.compiler.Compiler.compile(Compiler.java:437)
	at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:608)
	at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:360)
	at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:486)
	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:380)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:814)
	at com.zimbra.webClient.servlet.JspServlet.service(JspServlet.java:64)
	at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166)
	at com.zimbra.cs.servlet.SetHeaderFilter.doFilter(SetHeaderFilter.java:79)
	at com.zimbra.webClient.filters.SetHeaderFilter.doFilter(SetHeaderFilter.java:239)
	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
	at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)
	at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:218)
	at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
	at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
	at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:422)
	at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
	at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
	at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
	at org.mortbay.jetty.handler.rewrite.RewriteHandler.handle(RewriteHandler.java:230)
	at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
	at org.mortbay.jetty.Server.handle(Server.java:326)
	at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:585)
	at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:971)
	at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:549)
	at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
	at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:415)
	at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:429)
	at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:451)

Composing new messages on the ZCS web interface still works fine.