Archive for the ‘Apple’ Category

Crazy Update to Mac OS X 10.9.5

Friday, September 19th, 2014

Software Update

This morning I updated to the latest version of Mac OS X on my primary Retina MacBook Pro. I've done this dozens of times, so I knew the biggest issue would be getting everything back up and going after the restart. But today was different. Wow.

So I started the update and everything was fine, then it goes to the reboot phase, and it starts to come back up, and the gray screen with the white spinner shows up, and it stays there... and it stays there... and it stays there. It was there a good 15 mins, and at that point I thought it was locked up.

So I shut it down, tried again. Same thing.

Oh crud. Yes, I have a complete Time Machine backup, but this is annoying.

So I reset the NVRAM. No difference.

Then I did a safe boot and showed the console. This time, it's doing an fsck - makes sense. I said "Let it go...", and I started working. I have to admit I was really worried - after about 30 mins, but then it was up!

Sweet! It was back. I did a reboot and it was fine. So I will now let me other machine takes it's time - an hour at least, to make sure it's done. Apple makes good things - I just wish I'd had a little more faith in them this morning.

[9/21] UPDATE: the update on my work laptop went fine. Better than expected, and I have no idea why. But I'm sure glad it went smoothly.

Huge Fan of the Thunderbolt Display

Thursday, September 4th, 2014

Thunderbolt

I've been at The Shop for a little over two years now, and I've had a Thunderbolt Display for all that time. I have to admit that I haven't really used it a lot - until recently, but now that I have - in conjunction with my 15" Retina MacBook Pro, it's really quite amazing.

So much so that I've got one at home, and I'm liable to get another. They are just so amazingly nice, and slick, and Apple is - well... Apple - and it just works and does everything you can imagine needing to be done. Amazing tools from an amazing company.

Wow... it's nice to write nice things about good tools!

Getting PostgreSQL 9.3 Support into PHP 5.4.24 on Mac OS X 10.9

Monday, April 21st, 2014

PostgreSQL.jpg

A while back I wrote about getting PostgreSQL support into PHP as it was packaged with Mac OS X 10.6. Since then, a lot has happened with Mac OS X, and PostgreSQL, and I find that I'm once again in need of developing PHP and PostgreSQL on my MacBook Pro. So I wanted to refresh this list and make it a little simpler at the same time.

Getting PostgreSQL 9.3

The first big difference in this post is that I'm switching to Homebrew and that's made the entire operation a lot smoother. There's no 32-bit/64-bit issue as Homebrew does both, and it builds in on your box, so again, a lovely customized solution with a simple command:

$ brew install postgresql

It even has a nice, simple informational blurb about how to start/stop and upgrade. Very nice. But now that it's on the box, and ready to roll, let's add in the PostgreSQL support to the PHP 5.4.24 that's installed with Mac OS X 10.9.

Activating PHP in Apache

The first thing to do is to activate PHP in the supplied Apache 2 with OS X 10.9. This is a single line in a single file - /etc/apache2/httpd.conf. There's a line and you need to uncomment it:

  LoadModule php5_module libexec/apache2/libphp5.so

and then add a new file called /etc/apache2/other/php5.conf and have it contain:

  <IfModule php5_module>
    AddType application/x-httpd-php .php
    AddType application/x-httpd-php-source .phps
 
    <IfModule dir_module>
      DirectoryIndex index.html index.php
    </IfModule>
  </IfModule>

which does all the other PHP configuration in a separate file to make upgrades easy.

Building in PostgreSQL extra for PHP

At this point we need to get the source code for the exact version of PHP that Apple ships. This is pretty easy by getting the PHP 5.4.24 source from a mirror and unpacking it into a directory. We then just run the following commands:

  $ cd php-5.4.24/ext/pgsql/
  $ phpize
  $ ./configure
  $ make

at the end of this process, you'll have a file: php-5.4.24/ext/pgsql/.libs/pgsql.so and that needs to be placed in the right directory and referenced in the php.ini file.

For Mac OS X 10.9.2, this is accomplished with:

  $ sudo cp .libs/pgsql.so /usr/lib/php/extensions/no-debug-non-zts-20100525/

and then edit the php.ini file to set the extension directory:

  extension_dir=/usr/lib/php/extensions/no-debug-non-zts-20100525/

and then add the line:

  extension=pgsql.so

Finishing Up

At this point, a simple restart of apache:

  $ sudo apachectl restart

and everything should be in order. Hit a URL that's a static file with the contents:

  <?php
    phpinfo();
  ?>

and you should see all the details about the PHP install - including the PostgreSQL section with the version of Postgres indicated. It's all up and running now.

What Would I Build?

Monday, November 25th, 2013

Storm

I've been playing around with Storm for a while now, and while I don't think there are all that many folks in the world that are expert at it, I'm certainly an advanced novice, and that's good enough for the amount of time I've put into it. I've learned a lot about how they have tired to solve the high-performance computing platform in clojure and on the JVM, and I've come away with an affirmation of the feelings I had when I was interviewed for this job, and discussing functional languages: Garbage Collection is the death of all functional languages, and certainly Storm.

I like the simplicity of functional languages with a good library of functions. Face it, Java took off over C++ because C++ was the base language, and Java had the rich object set that everyone built on. It made a huge difference in how fast people could build things. So if you want a functional language to have a lot of traction fast, you need to make sure that you don't send people to re-invent the wheel to do the most basic tasks.

But the real killer is Garbage Collection. I'm not a fan, and the reason is simple - If I'm trying to do some performant coding, I want to control when that happens, and under what conditions. It's nice for novices to be able to forget about this and still write stable code, but when you want to move 1,000,000 msgs/sec, you can't do it without pools, lockless data structures, mutability, and solid resource control. None of which I get in the JVM - or anything based on it.

So what's a coder to do? Answer: Write another.

There used to be Xgrid from Apple, but they dropped that. They didn't see that it was in their best interests to write something that targets their machines as nodes in a compute cluster, and they aren't about to write something where you can use cheap linux boxes and cut them out altogether. Sadly, this is a company, and they want to make money.

But what if we made a library that used something like ZeroMQ for messaging, and then we used something like C++ for the linux side, and Obj-C++ for the Mac side and made all the tools work like they do for Storm - but instead of using clojure and the JVM, and a ton of tools on the server-side to handle all the coordination and messaging, let's use something that's far more coupled with the toolset we're working with.

First, no Thrift. It's bulky, expensive, and it's being used as a simple remote procedure call. There are a lot better alternatives out there when you're using a single language. Stick with a recent version of ZeroMQ and decent bindings - like their C++ ones. Start small and build it up. Make a decent console - Storm is nice here, but there's a lot more that could be done, and the data in the Storm UI is not really easily discernible. Make it clearer.

Maybe I'll get into this... it would certainly keep me off the streets.

Updated to iOS 6.1.2

Wednesday, February 20th, 2013

iPhone 4

While I was updating Java on my laptop, I noticed that Apple posted an update to iOS - 6.1.2, and so I had to download that before I left for the train. The release notes that I read on the web this morning say it's for an Exchange bug that would cause excessive network traffic, and therefore battery drain, but I didn't notice the problem in 6.1.1 - but I'm not sure that I'm using Exchange connectivity any more. I think GMail switched over to IMAP for iOS 6.

In any case, it's nice to keep things up to date, and this was just another little thing to do to get a progress bar moving across a screen.

Updated Java from Apple and Oracle

Wednesday, February 20th, 2013

Software Update

This morning I noticed that Apple had a Java 1.6 update for the Java exploit that's been going around, and Oracle had another for 1.7. It's interesting how vulnerable Java is these days - maybe because the other, historically more likely, back-door (open ports on boxes), has dried up of late. So the jerks turn to Java, and find problems and exploits there.

Seems reasonable to stay up to date because some Facebook and Apple engineers have had their machines compromised by visiting a hacked web site. Amazing that they can do this from visiting a website, but that makes sense in the context of Java plugins.

Crazy what poorly written software combined with kids with too much time on their hands can lead to. Kinda annoying…

Finally Moved to Java 1.7.0_13 on My MacBook Pro

Tuesday, February 5th, 2013

java-logo-thumb.png

Well… I've really held off about as long as I can, and even then, it's probably a bit too long for what I'm doing. This morning I downloaded the Oracle JDK 1.7.0_13 with the latest security fixes for my main laptop. This is a big switch as I'd been holding out for Apple to step back in and really do Java right, but I think they are past that now, and it's up to Oracle to make Java work on Macs, and I pray that they do.

I'm doing more clojure coding, and with that, I really need to have the 1.7 JDK underneath, as there are optimizations that are done in the compiling if it's on the 1.7 platform. Since we're using that on the linux boxes at The Shop, and I have 1.7 on my work laptop, it makes sense to give it up, and switch.

I guess it's like my 17" MacBook Pro… legacy hardware. I'll move to the 15" with retina display for my next machine, and it's a beauty, and it's nice that it's smaller and lighter with the same pixel count, so it's a win - really, but it's a big change from all the years I've had these 17" machines.

Face the future, Bob… it might not be what you want, but it's all you have.

Horribly Slow Time Machine Backups

Wednesday, January 30th, 2013

TimeMachine.jpg

Yesterday evening - as I was packing up to leave work, I noticed that my Time Machine backup hadn't completed. True, there was a new Xcode release yesterday, and that was bound to make the first backup after that large, but still… to have it take a full day and not be done? Well… I had to pack up, but this morning I wanted to get to the bottom of this and figure it out.

What I found was that the backup was working, but horribly slowly. I started googling, and it appeared that the convict is between Spotlight's indexing and Time Machine's backing up. Since I'm not a huge fan of Spotlight (I use LaunchBar, and always have) - I was ready to turn it off. But as I read on, I learned that wasn't the best idea either.

What it seems was the best alternative was to start fresh with Spotlight. SImple wipe out it's cache, reboot, and let it churn for about an hour rebuilding the indexes, and then the two would peaceably co-exist. So to that end, I said:

  $ sudo rm -rf /.Spotlight-V100/*

then a quick reboot, and about an hour of indexing later, Spotlight was back in the saddle. Time Machine then backed up it's 6+ GB very quickly after that, and things were fine.

Sometimes, it takes a little help, but this technology is about the most wonderfully designed stuff I've ever had the pleasure to work with. Amazing.

Xcode 4.6 is Out

Tuesday, January 29th, 2013

xcode.jpg

This morning I saw that Xcode 4.6 was out, and so I had to get it for my laptop. It included an update to the command line tools, as you'd expect, and the release notes indicate that they have pulled in all the Cx11 additions for C++, which - to me, is a great win. This includes the move semantics which makes a lot of the code I've written just a while lot more memory efficient - sweet!

There are also updated to the rest of the tools, and I was thinking, as I was updating just now, that Xcode has been my very favorite development environment of all time. It's just wonderful. Complex, yes. Hard to find things, certainly. But in the end, an amazingly powerful tool.

iTerm2 is Good, but Terminal.app is Better

Wednesday, January 23rd, 2013

Terminal.gif

I switched from Terminal.app to iTerm2 about a week ago because I liked the way it's double-click selection was controllable in preferences, and each tab in a window was selectable with the Cmd-1, Cmd-2, etc. whereas Terminal.app uses this to switch between windows. Not typically how that hotkey is used in other apps I use.

Plus, How different could it be - really? kept running through my mind. It's a shell. Should be pretty simple. Well… it's not that simple, and I've finally had it with iTerm2.

In the past week, large outputs to the terminal have crashed the entire iTerm2 app. I'm not saying that if it were like Chrome or Safari, and only the one shell session crashed, I'd be "ok" with it, but to have multiple windows with multiple tabs crash on you due to one tab is more than a little annoying to me.

So I'm heading back, and I'll probably never switch off it simply because Terminal.app never crashes on me. Just never. The convenience of the selection and tab switching would be nice to have, but I just can't have a crashing terminal program. Nope.