Mac OS X
EnvPane - An OS X preference pane for environment variables
News: Release 0.7 is built for macOS 12 "Monterey" and up. It uses code-signed, universal binaries.
EnvPane is a preference pane for macOS that lets you set environment variables for all applications, both GUI and terminal. Not only does it restore support for ~/.MacOSX/environment.plist
(seeBackground), it also publishes your changes to the environment immediately, without the need to log out and back in. This works for changes made by manually editing ~/.MacOSX/environment.plist
as well via the preference pane UI.
EnvPane 0.7 was tested under macOS 12 "Monterey" on Apple Silicon and Intel.
For more information & downloads head on over to the GitHub repository.
Installing dbd-mysql for 64-bit binary installation of MySQL
The dbd-mysql gem assumes (?) an i386 architecture when building the native component of the driver. You'll need to set ARCHFLAGS appropriately and point the build at the installation of MySQL.
sudo env ARCHFLAGS="-arch x86_64" \ gem install mysql -- \ --with-mysql-config=/usr/local/mysql/bin/mysql_config
That should fix it.
Multiple Google Notifier instances for multiple accounts on Mac OS X
I use Google Notifier to have my Gmail account checked for new mail periodically and automatically. I have a secondary Gmail account that I don't use that often but that I would like to have notifier check as well. Unfortunately, Google Notifier currently supports a single Gmail account only. Here's a simple hack that works well for a few gmail accounts. In a nutshell, you need to clone the application package and modify the bundle id in the clone's Contents/Info.plist
file.
- Copy the Google Notifier application from
Applications
to a temporary location.
Overriding DHCP- or VPN-assigned DNS servers in Mac OS X Leopard
I'll have to break sad news to you: /etc/resolv.conf has been made redundant in Mac OS X. The dig and nslookup utilities still read it but most applications use a different mechanism for picking DNS servers when resolving host names. They generally go through Darwin's resolver library which instead of reading /etc/resolv.conf looks up DNS servers via the SystemConfiguration framework backed by configd. Survival of the fittest, I guess, or, Darwin's intelligent design.
Ok, ok, I'll stop trying to be funny ... Anyways, this would be all swell if there wasn't the occasional need for manually specifying DNS servers. For me this need typically arises when I connect to a VPN managed by an operator from hell. After hours and hours of hard work (my fingertips still hurt from all the googling) I present to you a solution:
With the VPN connected, launch scutil with root privileges:
hannes-mbp:~ Sysop$ sudo scutil Password:List all network services with DNS configuration:
> list State:/Network/Service/[^/]+/DNS subKey [0] = State:/Network/Service/A3551F2D-62CE-1234-B79A-6EE50CA7AE30/DNS subKey [1] = State:/Network/Service/F194302A-846C-4321-9325-6813DAE148F2/DNSPick one and show its contents.
> show State:/Network/Service/A3551F2D-62CE-1234-B79A-6EE50CA7AE30/DNS <dictionary> { SupplementalMatchDomains : <array> { 0 : } ServerAddresses : <array> { 0 : 192.168.1.74 1 : 217.0.43.81 } SupplementalMatchOrders : <array> { 0 : 100000 } }Ahh, this is the one! So let's get rid of those pesky servers. Obtain a working copy of the DNS configuration entry. It's called ... drum roll ... well, obviously: "d" (rolls eyes).
> d.init > get State:/Network/Service/A3551F2D-62CE-1234-B79A-6EE50CA7AE30/DNS > d.show <dictionary> { SupplementalMatchDomains : <array> { 0 : } ServerAddresses : <array> { 0 : 192.168.1.74 1 : 217.0.43.81 } SupplementalMatchOrders : <array> { 0 : 100000 } }Reset the ServerAddresses entry to an empty array:
> d.add ServerAddresses * > d.show <dictionary> { ServerAddresses : <array> { } SupplementalMatchDomains : <array> { 0 : } SupplementalMatchOrders : <array> { 0 : 100000 } }Write the working copy back:
> set State:/Network/Service/A3551F2D-62CE-1234-B79A-6EE50CA7AE30/DNSNote, that the line
d.add ServerAddresses *clears the ServerAddresses array, thereby removing all DNS-servers tied to that particular connection ("service" in Apple-talk). Without service-specific DNS servers, Mac OS will fall back to DNS servers from other network services. Not sure how exactly that works. If you want to specify particular DNS servers, use
d.add ServerAddresses * 10.0.1.2 112.21.44.66
By the way, the "*" signifies array values, so it's not some kind of wild card.
Pimp Da Kitty
I have been converted. After having preferred Windows on the desktop for the past 15 years, after six generations of
Yet Another Way To Screw Up The Control Panel,™
I felt the urge to try something else. Something thatJust Works.™
Those fifteen years were an interesting ride but for some reason the pride and satisfaction of finding just the right combination of registry settings that would let me mount a Samba share had worn off. I want to spend my time on something creative. Defragmenting the registry, scanning regularly for malware, and trying to find anti-virus software that doesn't take five minutes to load is fun and all, but how about an operating system that doesn't need any of that? You guessed right, I have become a Mac user. Enough of the trivialities, in this article I would like to list a handful of very useful Mac OS X applications and utilities I couldn't live without anymore.
Increase Wireshark Font Size on Mac OS X
Wireshark has a preference setting for the font of the capture display but it won't let you change the main font used for other UI elements such as like menu, toolbar and dialog windows. The default for the main font is illegibly small on my Mac OS X Leopard system -- I used Macports to install Wireshark and its dependencies. To fix it you need to add the gtk-font-name
setting to your .gtkrc-2.0
preference file:
echo 'gtk-font-name = "Sans 14"' >> ~/.gtkrc-2.0
This will affect all applications using the GTK 2.0 toolkit but I guess that's ok.