Saturday, January 18, 2014

PostgreSQL 9.3 setup after the initial Macports installation

I recently installed PostgreSQL 9.3 using MacPorts. I know some of you use HomeBrew but I still have enough things installed using MacPorts, that work and upgrade well, that I'm still in the MacPorts camp. MacPorts installed PostgreSQL OK, but getting the installation initialized and running took a few hours on a Saturday. Here is a shell script to summarize what finally worked for me.

In creating the script above, I started with hints from:
https://coderwall.com/p/xezzaa

I also needed these hints on OS X postgres user creation:
http://www.working-software.com/node/30

sudo dscl . change /Users/postgres NFSHomeDirectory /opt/local/var/db/postgresql82 /opt/local/var/db/postgresql93

This did not work:

sudo dscl . change /Users/postgres RealName "\n PostgreSQL-82 Server" 'PostgreSQL-93 Server'
<main> attribute status: eDSAttributeNotFound
<dscl_cmd> DS Error: -14134 (eDSAttributeNotFound)

But this did work:

sudo dscl . -create /Users/postgres RealName "PostgreSQL Administrator"

See: http://gilmation.com/articles/compile-and-configure-postgresql-on-mac-os-x/


Friday, March 22, 2013

Apple bookmark hell (resolved)

See the previous post in time sequence for background information.

INVARIANT


  • Keep bookmarks on Xmarks server correct at all times; Xmarks offers more control.
  • On Mac Chrome/Firefox, UPLOAD good bookmarks to Xmarks server.
    • Guard this TREASURE.

PROBLEM


  • Bookmarks on iPhone/iPad were all messed up, because iCloud bookmarks were all messed up.
    • Bookmarks on desktop Chrome / Firefox / Safari were all good, thanks to Xmarks.
  • There seemed to be no way to delete the messed up bookmarks on iCloud.

SOLUTION

  1. On iPhone/iPad, turn OFF iCloud/Safari syncing and DELETE local (messed up) bookmarks.
  2. On Mac System Preferences, turn OFF iCloud/Safari syncing.
  3. On Mac Safari, DELETE ALL BOOKMARKS.
  4. On Mac Safari, use Xmarks for Safari to DOWNLOAD good bookmarks from Xmarks server.
  5. On Mac System Preferences, turn ON iCloud/Safari syncing.
  6. Good ["fresh-looking" imported from Xmarks] Mac Safari bookmarks should propagate to iCloud.
  7. If you see on Mac Safari messed up bookmarks:
    • Delete Safari bookmarks, go back to 2nd step and retry.
    • You aren't winning until the Mac Safari bookmarks stay OK after iCloud is re-enabled.
  8. Then on iPhone/iPad, turn ON iCloud/Safari syncing.
  9. If iPhone/iPad bookmarks are still messed up:
    • Go back to 1st step and retry.
    • You haven't won until the iPhone/iPad Safari bookmarks stay OK after iCloud is re-enabled.



Monday, March 18, 2013

Apple bookmark hell

My Chrome bookmarks are perfect, and synced to an Xmarks server. I have Xmarks for Safari and Xmarks for Firefox, and so my bookmarks are also perfect on Safari and Firefox. Enter iCloud. There seems to be no way to get bookmarks from a Mac to iPhone/iPad without going through iCloud. The problem is that iCloud's bookmarks are a train wreck, duplicates everywhere, everything out of order. I can't delete the iCloud bookmarks, I can only "merge" with them. Well, I don't want to merge perfectly good bookmarks with a pile of crap. I want to delete the iCloud bookmarks and have them replaced with what's on Safari, Apple's own browser. I can't believe there's no way to do that. I've been through the Apple Community pages and various blogs, and there are some people who write recipes with 23 steps, turning computers and devices off and on a half dozen times. Really? Apple is usually so good, but my God, I can't believe it's so bad at this. Does anyone happen to have a magic incantation?

Friday, October 14, 2011

pilot-friendly iPads

I made a spreadsheet of iPad versions for a CAP friend who found out, the hard way, that he'd bought the wrong iPad for flying purposes. He intended to buy an iPad with 3G capability, because [whether or not you activate 3G service], 3G models have a GPS receiver. But a BestBuy sales droid convinced him to buy a non-3G model and add a mifi device that connects to Verizon. While that can help you create a small (4-5 machine) slow-speed WiFi network in a place on the ground that doesn't have any WiFi, it does nothing for you in an airplane because most of the time you won't get cell tower signals. In an airplane, you need to receive signals from GPS satellites.

The issue of whether you can benefit from an additional GPS receiver with WAAS capability, either plugged into your iPad, or connecting through the air [short distance] via Bluetooth, is a separate issue. One friend has a Bluetooth GPS, I bought the plugin kind, and I may switch to the Bluetooth variety. The GPS inside my iPad works fine, but the extra receiver gives you better reliability and precision. The plugin kind gets power from your iPad but itself can be plugged in to your cockpit's cigarette lighter keeping your iPad charged; its main drawback is that you can't use it with a certain kind of knee strap. The Bluetooth kind needs to be charged before you fly.

IPadVersions

Sunday, August 07, 2011

Monday, July 04, 2011

Nice travel video about Kazakhstan

Our fourth exchange student, Adil, who is coming from Almaty, Kazakhstan for the 2011-2012 school year, sent us this travel video made by a Russian videographer friend of his, Denis Matveev, who visited Kazakhstan in the summer of 2010. The video reminds me of Colorado, where I lived in 1972. Denis is creative and his other videos are good too. Take some time to browse his site; it will put a smile on your face.

Tuesday, February 02, 2010

Pain after macports "routine" MySQL/PHP update, now relieved

I did a port selfupdate, and updated a few ports, then spent four hours underwater dealing with things that suddenly stopped working:
  php5 fatal error call to undefined function mysql_connect
Making sure I had the following installed (with options I needed) fixed the error above.
  • mysql5-server 5.1.42_0 (was already OK)
  • php5 5.3.1_1+apache2+darwin_10+fastcgi+macosx+mysql5+postgresql83+sqlite
  • php5-mysql 5.3.1_2+mysqlnd
I checked the setup with php_info(), but then I got another error:
  mysql_connect() [function.mysql-connect]: [2002] No such file or directory (trying to connect via unix:///tmp/mysql.sock)
After some investigation, I created a php.ini file:
$ sudo cp /opt/local/etc/php5/php.ini{-development,}
$ sudo chown username /opt/local/etc/php5/php.ini
Edited php.ini:
< mysql.default_socket =
--
> mysql.default_socket = /opt/local/var/run/mysql5/mysqld.sock
(I have a memory of having done something like this before, but apparently I had to do it again.)

Then, of course, I got new errors:
mysql_connect() [function.mysql-connect]: OK packet 6 bytes shorter than expected.
mysql_connect() [function.mysql-connect]: mysqlnd cannot connect to MySQL 4.1+ using old authentication in ...
The Google helpfully led me to this stackoverflowanswer (why didn't I think of that first?!), and the answer was a total surprise. Happily, after the final fix, everything is working again:
mysql> select Length(`Password`), Substring(`Password`,1,1)
from `mysql`.`user` where `user` = 'username';
+--------------------+---------------------------+
| Length(`Password`) | Substring(`Password`,1,1) |
+--------------------+---------------------------+
| 16 | 3 |
| 16 | 3 |
| 0 | |
+--------------------+---------------------------+
3 rows in set (0.07 sec)
mysql> set password for 'username'@'localhost' = PASSWORD('password');
Query OK, 0 rows affected (0.00 sec)
mysql> select Length(`Password`), Substring(`Password`,1,1)
from `mysql`.`user` where `user` = 'username';
+--------------------+---------------------------+
| Length(`Password`) | Substring(`Password`,1,1) |
+--------------------+---------------------------+
| 41 | * |
| 16 | 3 |
| 0 | |
+--------------------+---------------------------+
3 rows in set (0.00 sec)
Now that a good chunk of my "free day" has been used up, I think I'm going outside for some fresh air.