Fixing a Corrupt Mac OS X Server Open Directory Database

Terminal_iPhone

Recently I had an issue with my Mac Mini Server and fixing a corrupt Mac OS X Server Open Directory (OD) database.

One of the HDD’s had become unstable and it eventually just died. That left me with one drive available which is ok but it also caused some issues when the RAID array I was running was killed by the drive failure. I always keep backups and regular clones of my drives, but as the drive had been starting to fail for a while there was always a chance of corruption throughout the more recent copies. After decommissioning the dead drive I cloned the most recent copy back to suitable partitions on the secondary drive and booted it up. Everything seemed to be working without issue! Yay!

Then came the most recent OS X update to 10.8.4. Sitting at lunch during work last Friday I decided to go ahead and update the server using Prompt on my iPhone. I SSH’d in as usual and ran the commands for the update. It seemed to update smoothly and then wanted to reboot. After the reboot I reconnected via SSH and checked on the server state. Most of the services were running without issue.

The update did not likely cause any issues by itself, but after the reboot the Open Directory service would not start and upon diving a bit more deeply into the terminal I found that it was due to corruption. I tried some fixes and some restarts but to no avail. I was feeling rather gloomy that I might have to go back to a significantly older version on my server to get the OD working again even though everything else seemed fine.

Lunch was over, and there did not seem like much to do with the issue until I got home so I went back to work and tried to forget about it (unsuccessfully). Once work was finished I hopped on the subway and started researching the issue. I found many various fixes but most of the did not seem appropriate or did not work when I tried them. After a bit of research I started to see several sites mention certain slapd related fixes that sounded promising, so I fired up Prompt on my iPhone and logged in.

First of all, I used launchctl to unload the openldap:

$ sudo launchctl unload /System/Library/LaunchDaemons/org.openldap.slapd.plist

…then I ran a recommended recovery:

$ sudo db_recover -h /var/db/openldap/authdata/

To see how things went, I ran slapd with tool mode switches:

$ sudo /usr/libexec/slapd -Tt

…and it gave me this response:

53f31f93 bdb_monitor_db_open: monitoring disabled; configure monitor database to enable
config file testing succeeded

That looks promising, so I turned Open Directory back on:

$ sudo launchctl load /System/Library/LaunchDaemons/org.openldap.slapd.plist

The OD seemed to be working fine, but I wanted to reboot just to make sure it was stable enough:

$ sudo shutdown -r now

After the reboot everything (including OD) came up fine! I realized that people on the train were probably wondering why I was looking so excited peering at a black screen on my phone, but I still enjoyed my small victory 😉

Strava Workflow for Alfred v2

Alfred_and_strava

As I often feel a bit tired after my long rides I was looking for a way to get my rides up on Strava as easily and quickly as possible while spending as little time in front of my Mac as possible. I fairly quickly came up with building a Strava workflow for Alfred v2 that would simplify the process. My workflow makes it easy to open the Strava site in the default browser by simply typing ‘strava’ and to upload your rides/runs by typing ‘sup’. To upload rides/runs I would recommend plugging your device into your Mac or wirelessly connecting it, waiting for it to connect properly, then just type ‘sup’ (short for “Strava upload”) and then letting Strava find the data on your default device. If you only have one run or ride on the device, Strava will automatically upload it without any further input from you, giving you a few seconds to re-hydrate or towel off a bit. It is pretty easy.

You can download the workflow here.

Senseless Rivalry: Android, iOS, Mac and Windows

People have always fought over any little difference in preference or belief. I am sure that early humans found over which type of stick was better to use as a club when any of them could have done the same job. The same is clearly still true today and in my personal spheres is most pronounced when it comes to devices. Android, iOS, Mac, Windows (notice I chose alphabetical order to avoid showing a bias) are all popular, widely used and hotly fought over. Android people look down on iOS users and vice versa which Mac and Windows users sit in different camps and tend not to play nice. It is all very emotional for people.

I personally just find it very tiring and sometimes a bit frustrating. I do not buy devices to buy into one belief system or another, I buy devices that do what I want them to with a minimum of fuss, work together and fit into my workflow. They are tools to get things done. In my case those have moved towards Apple products, not because they are all superior but simply because they fit better into my current workflow and do what I want them to with a minimum of fuss. iOS devices work well with Mac computers and they can easily share resources and media so I have an iPhone. iPad was the only game in town when I got one and already having iOS apps it was more cost effective. I am not saying that Android phones are not great, or that for other people they are not perfect. There was no value judgement involved and I get very tired of having to feel like I must defend my choice to use iOS devices. Realistically, if I had gone with Android (which was not they best product when I bought into iOS, although that has changed since) I would have to go through the tiring process of defending that choice. Why do people have to be so obsessed with such things? Like I said, I think that people have always been that way, but that does not make it any easier for those of use who just want to get on with living our lives and not worry about such things.

Why don’t I just ignore those fights and life my life? As an IT pro it is pretty much impossible to avoid being asked (grilled) about such things and still do my job.

Can’t we all just get along?

Firefox: Opting Out of the Enterprise Market?

Is it just me, or did Firefox not just update to a shiny new version 4? It was a few months ago, and as an IT pro I can say that a lot of companies are still doing internal testing to decide on when or if to upgrade to version 4. Other companies are probably rolling out Firefox 4 to users computers in phases and hope to be finished soon. now they have released 4.1 (oops, version 5) right on its heels. Not only that, but they announced the end of security support for Firefox 4 which is all of 2-3 months old. This could be then end of Firefox in the enterprise market, and that would be a sad thing as it was the only real competitor with Internet Explorer as Google Chrome updates to new versions much too often and tends to leave IT departments worried about the changes and the impact on existing standard software.

Oh wait, isn’t that what Mozilla’s Firefox just did? Maybe following Google’s example wasn’t the best strategy. And it looks like following is what Firefox is going to be doing more and more from now on as their stable market share shrinks to devoted users, people who don’t pay attention to their browser and non-corporate professionals who don’t worry about their add-ons or compatibility. Even for a lot of Firefox devotees it might be a bit of a stretch as it is likely at least some of their plug-ins won’t work. Only time will tell at this point, but I would not predict an upsurge in Firefox’s market share after this shift in policy.

Maybe it is time to switch back to Safari on my Mac.

Some Tips on Online Privacy and Information Control

Sitting on the train most people probably feel anonymous. I personally like to pretend I am anonymous, but I know that the reality is probably different. At any time, without my knowledge, a photo of me could be taken, or even a photo with me in the background, and posted to the internet, where either Facebook, Google, Bing or some other service could realize the person in the photo is me and tag it if there is an existing photo associated with my name on one or more services. I could be completely unaware that such a photo existed until one day someone mentions it, it shows up in a search or I get turned down for a job because of something I might have been doing. The reality is that if you have any online presence at all, whether it be on Facebook, Google, Twitter, LinkedIn or any one of the other social media sites and you do not have complete awareness and control of your privacy settings on all of those sites you do not know exactly where you will pop up. If you do have no web-presence or are sure that you have complete control congratulations; you are one of the rare people who does not have to think about these things any further.

For the rest of us, a combination of privacy and information control is likely necessary to keep our online presence under control. As it is a virtual impossibility these days to be socially active and remain anonymous, there are a few steps that I have taken to help control my online image:

  1. Create accounts on popular services even if it is only to ensure that you have a controllable presence on that service. I have always created accounts on new and popular services when they first got popular as place-holders in case I needed to use them later or wanted to have a clean presence on the site. Only giving such information as your name and an email address (not necessarily your primary one) as well as posting a clean profile photo can be a way to ensure that people don’t associate you with someone with the same name and allow you to smoothly move into that service later if you so desire. This can also include creating all of the accounts with the same nickname or handle so you don’t have to think of a different username for every site you have to join eventually.
  2. Purchase your own .com domain. If only to redirect people to a favored profile, like on Facebook or LinkedIn, it is not a bad idea to purchase yourname.com as a way to control what people will see if they look you up on a search engine or get curious about you. It is usually about $10 a year, but if you already have a web presence it could be worth the additional control.
  3. Set up a Google Alert for your name. If you have a Google account you can set up a Google Alert for your name that will periodically send you indexed pages that mention you on Google. This might seem paranoid, but it might be nice to know that is being said out there for you (unless you have an extremely common name, in which case the alerts will probably just drive you crazy.)
  4. Regularly check your privacy setting on social networking sites. Facebook, LinkedIn and others tend to change their privacy rules, settings and services on a regular basis without really informing their user base. Hit those sites every few months to see if anything has changed and if you agree with the privacy policies they have posted. Also be sure to check your privacy settings at sites like Facebook tend to change those frequently and can actually have a fairly large impact on your public profile. You might also want to turn off people ability to tag you in photos on Facebook without your approval on Facebook (I have a lot of photos of parties or events in which people in the background might get in a bit of trouble if they were tagged; you know who you are!)
  5. Post an actual profile photo on Facebook. Many people have babies, dogs, cats, feet, strawberry jam, etc up on their Facebook profile but this can make it hard to clearly associate information you want to be associated with you to be found, especially if you have a relatively common name. If you really wanted to be anonymous you would have no public profile on Facebook in the first place, right?
  6. If you don’t want people to know it, don’t put it on Facebook or Tweet it. It sounds basic, but a lot of people have posted comments or statements to Facebook or Twitter only to have them passed along and become common knowledge. If the idea of the world knowing what you post is scary or if it could cause you trouble, think twice before posting it.

There are a lot of other things you can do, but some basic measures like the ones I have mentioned can help you control information about yourself can make your life a lot easier. As the days of anonymity are probably over, it is a good idea to take control instead and shape your image in a way that better represents who you want people to think you are!