Mac Slack Client Keeps Crashing

Found this morning that my Mac Slack client (v1.13, build 2813) kept on crashing on start up (I’m running Mac OSX 10.9 Mavericks). It was working fine until the latest Mac update (Security Update 2015-006 version 1.0 18/08/2015).

The crash reporter tells me something along the lines of this:

  Application Specific Information:
  *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Could not make an sqlite3 statement for: CREATE TABLE IF NOT EXISTS downloads (team         TEXT NOT NULL, token        TEXT NOT NULL, href         TEXT NOT NULL, state        TEXT NOT NULL DEFAULT 'pending', http_status  TEXT NOT NULL DEFAULT '', file_path    TEXT NOT NULL DEFAULT '', file_exists  TEXT NOT NULL DEFAULT 'false', mime_type    TEXT NOT NULL DEFAULT '', start_ts     TEXT NOT NULL DEFAULT '', end_ts       TEXT NOT NULL DEFAULT '', base64_png   TEXT NOT NULL DEFAULT ''); | (
  )'
  terminating with uncaught exception of type NSException
  abort() called

Uninstalling/reinstalling didn’t fix the issue. I ended up deleting the following folder in my home directory:

~/Library/Containers/com.tinyspeck.slackmacgap

This obviously holds some sort of data, so I’m not sure of the entire consequences of doing this. For a start, you need to sign into all your accounts again. It doesn’t appear to impact your slack history or anything like that.

Fixing Mac Book Pro – No Internal Speakers

This happens on occassion on the Mac Book Pro – You lose the internal speakers and are only left with digital out. A sign this has occurred is that the red light in the headphone port (where you plug in your headphones) will be on.

There are numerous ways to try to fix this, anything from system preference tweaks all the way to opening up your Mac Book.

Here’s the simplest thing you can try (and it does seem to work with a bit of persistence):

  1. Open System Preferences > Sound
  2. Plug in your headphones as you won’t have control over the volume/mute of the digital output
  3. Once headphones shows up on the list, move the volume slider up and down and check/uncheck the mute button.
  4. Unplug your headphones
  5. Check if digital out has disppeared and been replaced by Internal Speakers.
  6. Rinse and repeat. Note it can take several attempts before this works. For example, after 3 times, I finally had internal speakers appear for a second then disappear back to digital out. On the fifth attempt, internal speakers appeared again and this time stayed. Basically what you are doing is trying to get the Macbook to recheck its sensors and correctly revert to internal speakers.

Good luck.

Mac App Store Login

Was getting the message: “An unknown error occurred” when trying to sign into the Mac App Store with my Apple ID (This is on OSX 10.9 Mavericks).

Solution (weirdly) is to move/delete the following file:
/Library/Preferences/SystemConfiguration/NetworkInterfaces.plist

And restart your mac. It does work. Don’t forget to restart before you try signing in again.

Mac terminal pbcopy and pbpaste

In case you didn’t know, there are two commands for managing the clipboard in the Mac terminal:

  • pbcopy to copy
  • pbpaste to paste

FYI, the “pb” stands for pasteboard. These are super nifty if you want to copy the result of a command directly into your clipboard, and of course if you want to paste the last clipboard entry into your terminal window.

aText

I just switched over to using aText as my text-expansion software on the Mac (have previously tried TextExpander and DashExpander).

It does everything I need, imports snippets from Text Expander, and costs a fraction of the price of TextExpander. So I’m thoroughly impressed.

One caveat which I’ve found is that if multi-line snippets aren’t expanding properly for you e.g.

Example Snippet

With

Mulitple Lines

Expands to:

Example Snippet With Multiple Lines

Try enabling “Always use Clipboard to insert snippets” in the preferences. That fixed up this problem for me in Sublime Text and Netbeans.

Thanks to Tran for creating such a great product and letting me know about this fix too.

Locking Your Mac

One nice feature in Windows is you can press Windows Key + L and lock you screen quickly.

You can emulate this behaviour (to some extent) on the Mac without additional software. The keys CTRL + SHIFT + EJECT will put your display to sleep. However, by itself that won’t lock your screen.

What you can do though is also go into System Preferences > Security & Privacy and select “Require password for sleep and screen saver” and set that to occur immediately (any other setting will cause the relevant delay before prompting for password. That may be what you want (e.g. if you want a 5s grace, use after 5 seconds).

One caveat, is that whenever your display goes to sleep, you will need to type in your password to get back in. Perhaps that’s annoying, perhaps that improves the security of your mac.

If you do want to try out a 3rd party lock screen, have a look at QuickLock App. If you go down this road, and don’t read the instructions like me, once you lock your screen, to unlock you actually type the characters in your password (no need to hit enter or anything at the end). If you get them correct, the screen will unlock. There’s no unlock password entry text field or button to press. I found this really counterintuitive, due to the lack of feedback.¬†Personal preference I guess.

Java not working Mac Google Chrome

After the most recent java updates to JRE 1.6.0_37 (2012-006) from Apple I found that Google Chrome (and to lesser extent other browsers) were no longer working correctly with Java applications. Typically the message was to install the Missing Plugin which takes you off to the Oracle Java site, that then complains about the fact that Java 7 is 64 bit and Chrome is a 32 bit web browser. This isn’t a viable solution anyway as Java 7 has its own set of problems on Mac OSX Lion 10.7.

It took a lot of Google searching and tweaking but I finally came across the following solution from Apple Рsee radar #11530556.

It involves re-linking the JavaAppletPlugin.plugin in the system following these instructions:

sudo mkdir -p /Library/Internet Plug-Ins/disabled

sudo mv  /Library/Internet Plug-Ins/JavaAppletPlugin.plugin 
/Library/Internet Plug-Ins/disabled

sudo ln -s /System/Library/Java/Support/Deploy.bundle/Contents/Resources/
JavaPlugin2_NPAPI.plugin /Library/Internet Plug-Ins/JavaAppletPlugin.plugin

Mac OSX Command-tab tips

Just a few tips on using command-tab on OSX (10.7-Lion). While holding command-tab:

  • You can use the arrow keys to move left-right through the icon list
  • You can press up arrow to see windows associated with an app
  • Once in the windows mode (up arrow), you can continue to command-tab through application windows
  • You can use command + tilda (key above tab) to browse through all windows.
  • In some applications you can access history in this way (e.g. TextMate)
  • Command-Q will close a window

There are heaps more, that I’m sure I’ll discover (in the usual Apple way) but these have been quite helpful so far.