January 2015 Archives

New Favorite Amazon Filler Items

|

Amazon recently raised their free shipping threshold to $35, and that leaves me searching for items between $1 and $10 to pad an Amazon.com order with. A recent gift of Darn Tough Vermont socks has turned this hunt into a no-brainer.

Instead of a useless 5-lb. bag of rubber bands, why not pad your Amazon order with some Darn Tough Vermont Socks? Reasonably-priced, guaranteed forever, and OHMYGOSH! the colors…

(Click!)

See how easy that is?

Be sure to choose socks which are eligible for free shipping, or you don’t do yourself any favors.

I now have VoIP at work and each time my VoIP software switches back to “audio” (high-fidelity, stereo) mode, iTunes launches. What a pain in that butt that is.

Turns out, there’s a pretty simple way to solve this problem, and that is to disable the launch agent which pays attention to such things. It’s done by two simple terminal commands:

launchctl stop com.apple.rcd
launchctl unload /System/Library/LaunchAgents/com.apple.rcd.plist

I am finally going to move most of my file services from an old piece of server iron to a new Mac mini. (The Xserve is truly a beautiful piece of hardware, but it’s time to stop consuming so many watts just to serve up weather data.) Problem is, I have lots of things running on that server which aren’t supported by the new versions of Mac OS X Server. The big two are a custom build of PHP and MySQL.

But… Mac OS X Server (MOSXS, for short) no longer comes with MySQL built in. Instead, it uses PostgreSQL to serve up wiki and calendar data. With Yosemite, Apple got a bit wise and separated the databases for server functions from user functions. However, they haven’t made it easy to actually use that database. No matter what I tried, psql failed with the same errors that everybody else has seen, namely:

home:log admin$ psql
psql: could not connect to server: No such file or directory
    Is the server running locally and accepting
    connections on Unix domain socket "/var/pgsql_socket/.s.PGSQL.5432"?
home:log admin$

Apparently, there is a fairly easy solution to this problem as outlined here from user ajbr. Just in case Apple does something to the forums, here it is:

Hi there;

The server is running under user “_devicemgr”, and all you have to do is create a symbolic link to /Library/Server/ProfileManager/Config/var/PostgreSQL in /private/var, as follows:

ln -s /Library/Server/ProfileManager/Config/var/PostgreSQL /private/var/pgsql_socket

Also let others have write/read/exec privileges to the files there:

chmod -R o+wrx /Library/Server/ProfileManager/Config/var/PostgreSQL

Now you can run psql

sudo -u _devicemgr psql -d postgres

So, there is a way. But should I have the will?

Having updated PHP every time Mac OS X Server has been updated, I have been on that merry-go-round for long enough to know that if Apple updates PostgreSQL, I’ll have to maintain my databases every time they change it. (And that does happen, see commenter senso here.) Add in having to recode to use PostgreSQL from MySQL, and… I want off.

So how do I go about installing MySQL from scratch? I hate precompiled binaries. They feel so antiseptic and I don’t quite trust what happens underneath the hood. (No offense intended to them folks what do this work.) I like to build things from scratch, but I’ll admit: I’ve tried building MySQL from scratch, and it’s not for the faint of heart. And then I stumbled on this:

http://www.macminivault.com/mysql-mavericks/

Get Xcode. Install. Run. Download per the usual. Configure fails. /usr/include no longer exists. It’s moved into sudo ln -s /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include /usr/include ./configure fails again /usr/local also no longer exists

libjpeg

First, grab the libjpeg tarball from its source. Then extract it and throw it into your Installed directory or wherever you’re keeping all this stuff, and it’s important to keep it because as often as Apple wrecks custom PHP installations, you are going to have to do it all again someday.

Things have gotten a bit easier since I did this last time, about five years ago, and all you have to do is the standard configure/make/make install with one option, like this:

$ ./configure -enableshared 8< snip!

$ make 8< snip!

$ sudo make install All we have to do now is keep in mind that libjpeg is now located in /usr/local/lib according to make and can edit the flag appropriately.

‘—with-jpeg-dir=/usr/local’

libpng

Again, grab the source for libpng from its source and unpack it. Let’s see if anything’s changed since I last did this with v1.2.8.

$ ./configure $ make $ sudo make install $ ./pngtest pngtest.png which should produce a bunch of lines with r’s and w’s. If it does, then, Yay! Continue onward.

The libraries end up in /usr/local/lib, just like libjpeg, so its options look similar:

‘—with-png-dir=/usr/local’

./configure fails in the middle with this message: Failed to connect (primarytextfield_cell) outlet from (AppDelegate) to (NSTextFieldCell): missing setter or instance variable

which yields this message on your display (so this required VNC to the machine—not just terminal)

(screenshot)

Note that what it’s telling us is that it can’t find the headers (.h) files for X11, so they can’t be used to link PHP against.

install XQuartz

http://xquartz.macosforge.org/landing/

Do installation as required. Seems to replace Apple’s /usr/X11 with /opt/X11.

MySQL

Adds .h files, PHP now configures with

./configure ‘—prefix=/usr’ ‘—mandir=/usr/share/man’ ‘—infodir=/usr/share/info’ ‘—sysconfdir=/private/etc’ ‘—with-apxs2=/usr/sbin/apxs’ ‘—enable-cli’ ‘—with-config-file-path=/etc’ ‘—with-libxml-dir=/usr’ ‘—with-openssl=/usr’ ‘—with-kerberos=/usr’ ‘—with-zlib=/usr’ ‘—enable-bcmath’ ‘—with-bz2=/usr’ ‘—enable-calendar’ ‘—with-curl=/usr’ ‘—enable-exif’ ‘—enable-ftp’ ‘—with-gd’ ‘—with-jpeg-dir=/usr/local’ ‘—with-png-dir=/usr/local’ ‘—enable-gd-native-ttf’ ‘—with-ldap=/usr’ ‘—with-ldap-sasl=/usr’ ‘—enable-mbstring’ ‘—enable-mbregex’ ‘—with-mysql=mysqlnd’ ‘—with-mysqli=mysqlnd’ ‘—with-pdo-mysql=mysqlnd’ ‘—with-mysql-sock=/var/mysql/mysql.sock’ ‘—with-iodbc=/usr’ ‘—enable-shmop’ ‘—with-snmp=/usr’ ‘—enable-soap’ ‘—enable-sockets’ ‘—enable-sysvmsg’ ‘—enable-sysvsem’ ‘—enable-sysvshm’ ‘—with-xmlrpc’ ‘—with-iconv-dir=/usr’ ‘—with-xsl=/usr’ ‘—with-pcre-regex’ ‘—with-freetype-dir=/usr/X11R6’ ‘—enable-zip’