I should have known that.

Recently, I upgraded my laptop to run macOS Sierra. Along with the OS updates, I also used brew to update python3. I was not paying attention and ended up upgrading PostgreSQL to the newest version, 9.6.2. I was unhappy that I was not paying attention, but I was glad that upgrades to PostgreSQL and MongoDB were also done with the upgrade to Python 3.

I use brew to start and stop PostgreSQL as needed, so I started it to check to see how it ran after the update. ‘psql’ gave me a version number, but I could not get it started to show me the schemas or tables from previous work. I also saw the following error message:

psql: could not connect to server: no such file or directory
Is the server running locally and accepting
connections on Unix domain socket “/tmp/.s.PGSQL.5432”?

Very strange error message, so I started doing Google searches to see what could be wrong. There some dead ends involving checking for a PID file and checking permissions in /usr/local/var/postgres. Eventually, I ran into what looks like the answer in two related locations: a blog post describing upgrades to PostgreSQL and another one describing the upgrade process using brew. Apparently, I had two versions of PostgreSQL on my machine.

> brew info postgresql

confirmed it. Both pages described what I have to do, so I’ll do it. I should have known I needed to do this. Now I know.

Adventures with Windows, part 2

As I mentioned earlier, I had trouble loading the free update to Windows 10. I now have a 5 GB file in my Windows 7 instance, but it never finished installing. It was stuck on 99% complete install for hours. I grew frustrated and decided to punt on the install.

Some websites mentioned that the Windows 10 update needed a fully patched and updates Windows 7 system in order to finish installing. It’s possible that may be true. It’s definitely true that I needed to patch Windows 7 as soon as possible. After installing an antivirus program (Avira) along with FireFox and Chrome, I decided to run the Windows update.

That did not go well either. I selected Windows Update from the Windows Control Panel and the “Other Programs” list on various occasions. I never got the impression that anything was happening. From other websites, I knew that the initial Windows update should take roughly 90-120 minutes. I would run Windows update 3 hours with  no indication that anything was happening.

I decided to try to install Windows updates directly from the browser. My browser was immediately updated to IE 11. Immediately is relative. It still took roughly 90 minutes to download and install 14 updates for IE 11 only. Once it was done, I went back to update.microsoft.com to see if that would list files to download. I was told to set the update back to Windows Update. I did not know any better, so now going to update.microsoft.com bounces me over to Windows Update again.

I may try downloading Windows 7 SP1 by itself. Maybe that will take care of some of the missing updates. It’s possible my home download speed is too slow to download any information quickly enough. It would be nice to go somewhere with a big pipe and not a lot of traffic. Where could that be?

Adventures with Windows 10: part 1

Microsoft announced that free upgrades to Windows 10 would end on July 29, 2016. I bought a full copy of Windows 7 to load onto a VirtualBox Virtual Machine several years ago, but never got around to installing it. I realized that this week would be a good time to get that project started and finished.

A while back, I created a ISO file of the Windows 7 installer DVD. I know that my current laptop does not have an optical drive, but the older one (the one with the failing trackpad) does. I suspect I bought the installer when I had the older laptop, but I also knew that I would need an ISO, if not for a new laptop, then for the desktop, which also does not come with an optical drive. (Weird.)

I created a new VirtualBox Virtual Machine to handle Windows 7. I remember I created a virtual optical drive in the virtual machine settings and attached the ISO to that virtual drive. Everything looks ready. Let’s start. Immediately, I get a message saying “Failed. No bootable medium found.”

I aborted and checked the settings again. There was a google search that suggested I hit the F12 key during boot up. That may have solved some issues, if I had tried it. I knew I needed an external optical drive any way, in case I sell or destroy the old laptop, so I drive down to the local Apple store and buy an overpriced optical drive.

I come back home and attach it to the new laptop. I can see the Windows 7 optical disk in the finder. I misunderstand how to load it in the Virtual Machine settings and end up starting the installer from the ISO. I know because if the installer were using the disk, I should have heard spinning sounds from the optical drive, which I did not.

It looks like Windows 7 is installing this time. I know it’s supposed to reboot to finish installation. What slips from my mind is that the second time, it’s supposed to reboot from the hard drive, not the ISO / optical drive. I keep interrupting the boot process by manually booting from the optical drive. It turns out that I installed several copies of Windows 7 into the virtual hard drive until I ran out of space.

I can see this is not working, so I start over with a fresh Virtual Machine. I decide not to add a virtual hard drive after realizing that the link to an optical drive already existed. When I start the blank windows machine this time, I was asked to pick a bootable drive. I was given the option of the drive with the Windows installer or the ISO (?). I pick the drive and go through the installation again, along with my extra second installation from the optical drive after reboot.

I read a bit online. (Google is your friend.) At this point, I realize that I need to let the reboot work without interference from me. I wipe out the Windows partitions created by the Windows installer and start over.

Finally, the Windows 7 installer works. I have a running Windows 7 instance running in VirtualBox. Next steps:

  • upgrade to Windows 10 for free – nope, 99% freeze. See next post.
  • load an anti-virus application – I’ve done research on free AV
  • load all other windows updates – nope
  • install Firefox and Chrome – eventually

All of that is for another time.

Catching up with Python

I always forget that major software upgrades in OS X reset permissions in /usr/local. When I checked my brew install, I saw that message. I played around with write permissions only, but in the end, did what brew recommended and reset the permissions as described. That allowed me to update brew and move on to the next task: updating Python3.

I was not as far back as I expected. I was sitting on Python 3.4. The upgrades went smoothly and I’m back to Python 3.5.1. I thought I had modules installed, but I’m not getting any list of local modules installed. It’s very possible, since I never did much with on the desktop. That will be the next task.

Resetting after El Cap install

I have some more free time, so I decided to reset my El Capitan system as a development machine again.

I bought my license for BBEdit 11.5, so I installed that. I’ve used Visual Studio Code at work. I like how the window can take over the entire screen, but I don’t like how only three tabs for files are allowed per window. If you need more files open, you need to open another window. It seems weird. I’ve used TextMate. Again, I like how tabs are used to show files instead of the list used by BBEdit. I’m used to BBEdit’s quirks, so I’ll go with that for the moment

I need to reload Apache. I use the standard setup:

sudo apachectl start

However, Apache would not start this time. Running

apachectl configtest

shows an error with something called LockFile.

After some searches with StackExchange, I find out that LockFile is an Apache directive active for Apache <= 2.2. El Capitan runs Apache 2.4.16. Comment out the section that includes the LockFile directive and restart Apache. Localhost is working again.

I’m using the instructions in this page to activate Apache and PHP. phptest.php works after restarting, but I have the PHP timezone problem again. I had to copy a php.ini file from the included php.ini.default, set the timezone to “America/Los_Angeles” and restart Apache. Problem solved. More stuff coming soon.

installed intl extension for PHP

I’m getting ready to install CakePHP 3.1.3 on my laptop. I discovered that I needed the intl PHP extension installed as a requirement for CakePHP. I tracked down several web pages with instructions and I decided to use this one, considering I had good luck with the page the last time I needed to install the intl extension. The page is for OS X Mavericks. I found no significant changes when I followed along for my Yosemite laptop. The only real change that I saw was that there was a new version of the ICU installer (56.1 as opposed to 52.1 described on the page).

I was surprised that I needed to install PECL and PEAR, considering that I don’t use PEAR that much any more. PEAR did not give me trouble. However, pecl.php.net was down the afternoon I wanted to install the software, so I had to wait until the next morning to install it.

Like I mentioned, the ICU installation instructions are almost the same. The only difference is the updated version of ICU, 56.1. Substituting the new version into the suggested Terminal commands went well

I thought I already had AutoConf installed, from what I saw in some libraries in /usr/local, but I decided to install it again to be sure. I had no trouble with it.

PECL gave me no trouble when I wanted to install the intl extension. Somehow, my php.ini file had been updated with the extension command pointing to intl.so. I thought that was odd, but I let it go. When I checked phpinfo(), there was a new entry for the intl extension. Very nice.

odd home-brew issue with permissions,

I was going to update files installed through home brew and I noticed an odd error message:

Error: unable to unlink old ‘share/man/man1/brew.1’ (Permission denied)

or something like that. That’s never happened before. /usr/local should not have a permissions problem, unless MySQL is involved somehow. (B’). I run ‘brew doctor’ on the command line and it suggests permission fixes for /usr/local/bin/, /usr/local/share, /usr/local/share/man and /usr/local/share/man/man (?). Why did this happen?

I know that “rootless” access is being enabled in OS X 10.11, El Capitan. The idea is this “System Integrity Protection” will make it difficult for malware to install itself in /System, /bin, /sbin, and /usr. However, /usr/local was supposed to be left alone. Also, I’m running Yosemite, not El Cap. Even so, I need to run my updates, so I run the following in Terminal

sudo chown -R “$USER”:admin /usr/local/bin

sudo chown -R “$USER”:admin /usr/local/share

When I run “brew update” again, my system is ready for brewing.

From what I can tell, it looks like folder permissions may be reset during each system software update. I can’t confirm it, but it makes sense. If I had problems after a system update, I would run the Disk Utility and have it repair permissions. Usually, whatever problem I had would go away. It looks like OS X wants to be helpful, but also interferes with the way I have things set up. I’ll make it work.