Showing all posts tagged tech:

Protect the base

An interesting story in the news today is about Gmail adding an "unsubscribe" link to marketing e-mails. Of course this is not exactly a new feature, having first launched in 2009.

Some of the commentary about why Google is doing this seems to me a bit misguided. Someone from Slate on Monocle’s The Briefing (sorry, missed the name) characterised this move as Google trying to make Gmail more useful for users and therefore more sticky.

I think the actual reason Google is doing this is to reduce or even eliminate a channel marketers can use to connect with consumers without going through Google. Subscribing to e-mail updates is a direct connection between consumers and brands. Google would rather be the middleman in that transaction, selling AdWords to brands and collecting a toll on all the traffic.

What makes me fairly certain of this analysis is that Gmail’s unsubscribe feature relies on the sender including the list-unsubscribe header as per RFC 2369, so it won’t help with spam or with dodgy marketing e-mails in general, only with entirely legitimate and technically correct marketing communications.

I’m not on Team "Everything Google does is evil!", but that doesn’t stop me from taking a clear-eyed look at what they do.

Adventures in AppleScript

Here’s a handy little AppleScript to switch the Bluetooth audio output device on a Mac.



Why do this? Well, partly because I can and it’s fun, but partly because I run a headless Mac Mini, and I’d rather not have to VNC into it just for something this trivial. Since AppleScript can be run from the command line via `osascript`, this little script can easily be triggered from SSH.



The next step is to make an iPhone-optimised web control panel for this and a couple of other equally simple tasks.



     set theDevice to "HT-CT260"



 tell application "System Events" to tell process "SystemUIServer"

          tell (first menu bar item of menu bar 1 whose value of attribute "AXDescription" is "Bluetooth")

               click

               delay 0.2

               tell menu item theDevice of front menu

                    click

                    delay 0.2

                    try

                         click menu item "Connect" of menu theDevice

                         click menu item "Use as audio device" of menu theDevice

                    end try

               end tell

          end tell

     end tell



     tell application "Finder" to activate



It wasn’t obvious how to do this, and then I had to do it twice, because I did the development on Mavericks, only to realise that the Bluetooth Preferences pane is different between Mavericks and Mountain Lion… The method above works on both versions though, so it’s all good.



If you need to do this sort of thing from scratch, the Accessibility Inspector in Xcode is your friend. I obviously started out trying to browse menu items off the Finder menu bar by using `UI Elements` directly in the AppleScript Editor. The problem is that this only gives the Apple menu and the basic menus (File, Edit, View, Go, Window and Help), none of the widget menus over to the right. Because they belong to SystemUIServer. Of course.



If you need to use this actual script, you’ll want to set the value of `theDevice` to your own device rather than "HT-CT260". I didn’t make this script to take inputs, so there’s no downside for me in hardcoding the value. Apart from that, it should be ready to go.

Stop helping me!

How is it that these days the best power user tools are the ones where you can turn all the "helpful" features off?

What am I talking about? Go ahead. Open a Microsoft Word document. Place your cursor anywhere in the text. Try to select one character using only the keyboard.

You can’t. Word "helpfully" expands your selection to the entire word. Sure, you can turn this behaviour off: on a Mac, go to Word > Preferences > Edit and uncheck "When selecting, automatically select entire word".1

Sometimes the behaviour is more annoying, like Excel’s complete failure to handle dates, or some of the more obnoxious iOS autocorrect failures, such as insisting that when I typed "its" I must really have meant "it’s".

The uncanny valley between n00bs and gurus is where the wizards live

The reason these functions are there is to assist the "average" user: someone who is more than a Muggle, but less than a power user. These are the sorts of people who don’t know about shift-alt-arrow to select an entire word, and instead laboriously tap-tap-tap that arrow key until they have selected the word. They complain that "Word is hard to use", and eventually Word gets the default behaviour of selecting the entire word.

This of course drives actual power users up the wall, because if we had wanted to select an entire word, we would have used the command that actually does that. And if I wanted to futz around with regular expressions, I wouldn’t have opened Excel in the first place. And so on and so forth.

This is why I use my highly advanced graphical user interface to run… a command line. In fact, a Terminal window is one of the most frequent apps you’d find open in my session, right behind Safari and ahead of my mail clients.


Image by Nicola Perantoni via Unsplash


  1. On Windows, the instructions change as follows: take your computer, throw it out the nearest window, then go and buy a Mac. 

The circle is complete

Over at the ever-fascinating Stratechery, Ben Thompson dissects [Microsoft’s Mobile Muddle](http://stratechery.com/2014/microsofts-mobile-muddle/). I especially like one of his recommendations (emphasis mine):

Embrace services. Services seek to touch every device, and, as I’ve written previously, are much more suited to Microsoft’s culture. Moreover, Microsoft has many of the pieces already in place, along with their primary remaining trump card: Office. Microsoft should use this trump card with Apple specifically: offer Office on iPad exclusively for a specified time in exchange for Bing as the default search, fuller iCloud integration with Azure, and/or built-in Xcode support for Azure cloud services. Apple has most of the best customers – the ones who will pay for services; Microsoft needs those customers desperately, and Nadella should go hat in hand to Cupertino.

The irony here is huge for those of us who remember 1997, and Steve Job’s MacWorld speech:



> We have to let go of this notion that for Apple to win Microsoft has to lose. We have to embrace a notion that for Apple to win Apple has to do a really good job, and if others are going to help us, that’s great, cause we need all the help we can get…The era of setting this up as a competition between Apple and Microsoft is over as far as I’m concerned. This is about getting healthy, and this is about Apple being able to make incredibly great contributions to the industry, to get healthy and prosper again.



The situation is almost perfectly symmetrical. Without Apple, Microsoft is… well, not dead; there’s a lot of life left in a rump-Microsoft focused on enterprise sales alone. On the other hand, for Microsoft to survive in its current incarnation as the Everything Company, it needs to do something extreme like this.



I think this move would also make sense for Apple, as a way of further getting out from under Google’s thumb without having to build all the services for themselves. I mean, I actually found Apple Maps to be [an improvement](http://findthethread.postach.io/platform-wars-are-here-again), but there have been too many issues with iCloud as well for Apple to be seen as properly credible in online services.



If Microsoft really were to follow all of Ben Thompson’s advice and also fork Android using its own services, we could end up with a duopoly of strong cloud-based mobile back-ends, with Apple providing the balance between them. Sounds like a pretty good future to me...

Feature-complete

I was reading a piece in the WSJ which is a perfect example of a very common mistake in product strategy: The Business Card Will Not Die.

When the tech-savviest people on the planet meet, how do they exchange contact info? The same people who hail taxis by app and pay back friends via email have a wild way of sharing details: They hand over paper business cards.

And the only thing worse than handing over business cards is not having any to hand over. My own new business cards have yet to be printed. But if everyone I meet these days has a smartphone, with memory and wireless capabilities galore, why do I even need these 3.5 x 2 inch pieces of card stock?

The question is phrased as if it were obviously absurd - but it’s not. The article goes into a few of the suggested replacements, and guess what? None of them are as good as the humble business card!

One requires NFC, which not many phones have. Another requires scanning QR codes, which is fiddly. Bumping phones seems like it should work, but I had the app on my phone for a year and never met a single other person who used it. Ditto for the audio tones in Evernote Hello.

If you want to replace a universally-adopted technology, your replacement needs to be not just as good as what you are trying to usurp, but substantially better. Business cards have a very high bar for replacement:

  • Universal compatibility

  • High legibility

  • No battery life constraints

  • No network connectivity requirement

  • No potential security hole

What, security on business cards? Well, yes. Any time you accept data into your device, you run the risk of unwittingly executing malicious code. NFC seems the most vulnerable tech, but a QR code could redirect to a trojan, and do so transparently so that users are not even aware their connection has been hijacked.

In contrast, the business card works as-is in just about any situation. You can exchange cards in a moment, stick them in a pocket with confidence that they will still exist and be legible later, and carry effectively unlimited numbers about until you’re ready to go through them.

This doesn't mean that you’re stuck with the cards, of course. Cards work well as a vector for information, but less well as an archive. For a start, the search capabilities are terrible. Personally, I import the data with Evernote Hello, which makes it easy to scan and OCR the contact info from the card itself, geo-tag the contact, add notes on the conversation, and save the lot in the cloud.

The answer is obvious for business cards, but too many businesses try to do the same sort of thing in other fields. If you get frustrated with explaining how your app is better than existing options, it might be time to take a step back and see whether you’re not better off building a complementary solution instead of attempting a displacement.


Image by Diogo Tavares via Unsplash

(Not so) Benign neglect

IT: "We won’t support you weirdos and your Macs."

Me: "Oh, so it’ll be like that time my Windows laptop lunched everything in the Registry to do with network interfaces, and your offered solution was for me to airmail you the hard disk drive for you to format it and reinstall the OS. Got it. Quaking in my boots, I am." Proceeds to order MacBook


Time passes


IT: "We will be upgrading the webmail servers [which Mac Outlook relies on] over the weekend."

Me, on Monday morning: "How come I seem to have a 25% success rate in sending e-mails all of a sudden?"

*headdesk*

I get that IT can’t support every crazy thing that users get up to. Really, I do. I used to be a sysadmin - ok, a PFY, but still.

But would it be too much to ask that at least things that are IT’s responsibility get done properly? Or is this going to be like the time I wrote in to point out an expired SSL cert, and was told that to make the error go away, I should stop using Firefox?

Intersections

A wise person once advised me to try to find my own intersection.

No, this wasn’t advice about a street map! The idea is that all of us are in various circles, starting from the most inclusive ("human") and going through increasingly selective ones ("database high-availability expert", "lutenist", "olympic athlete"). Very few people can be at the absolute pinnacle of any one field, but if you place well in a few different fields, you have a shot at placing very well at the intersection of those different circles. I’m not a betting man, but if I were, I would lay good odds against there being many people in the intersection of the three random fields I threw out there!

1476382_10153661810990013_1990982286_n.jpg

I am still working at getting better at everything I do, and indeed adding new circles if I can, "father of a girl" being the latest. I did have cause to ponder the following question yesterday: what is the intersection of the sets "marketing professional" and "busts out awk at the drop of a hat"?

Context: I was looking back at the past year of (work) blogging, and wanted to see posting frequency, average views per post by author, engagement, and that sort of thing. Our blogging platform does not seem to let ordinary users dump data to file - admins may have that capability, but I don’t. This meant that my first hurdle was getting the data out.

Predictably, Excel choked when I simply copied from the web page and pasted into a worksheet. Browser developer tools helped me make sure that I was copying just the table and not extraneous DIV elements, but the data I wanted were split across multiple pages, and Excel couldn’t handle multiple TH table headers, especially in combination with cells spanning multiple rows.

I ended up pasting the raw HTML into vim, cleaning it up so it was all a single TABLE, and dropping that into Excel.

Next problem: Excel can’t handle dates.1 Despite the dates being in one of the formats Excel claims to recognise (like "February 7, 2014") I could not for the life of me persuade it to treat that cell as a date, even after trimming the trailing timestamp.

Back to Terminal! A quick romp with vim and awk produced the following (in case it’s useful to anyone else):

 BEGIN {

      FS = ";"

      OFS = ";"

      split("January February March April May June July August September October November December", month, " ")

      {

           for (i in month) {

                month_nums[month[i]]=i

           }

      }

 }



 {

      split($7, datebits, " ")

      myday = substr(datebits[2], 1, length(datebits[2])-1)

      myyear = substr(datebits[3], 3, 2)

      mymonth = month_nums[datebits[1]]

      likes = substr($3, length($3))

      bookmarks = substr($4, length($4))

      print $1, $2, likes, bookmarks, $5, $6, myday"\/"mymonth"\/"myyear

 }

Note that despite the fact I had told Excel to export as CSV, meaning comma-separated values, it actually used semicolons as the separator, so I had to set the separator for awk myself with the FS and OFS variables. Yes, I know it’s probably possible to persuade Excel to do the right thing here, but this was easier and quicker.

This translates my extended "February 7, 2014" date into "7/2/14" format, which Excel seems to be able to digest, now that its food has been chewed for it by awk. I was then able to use fun Excel functions like FREQUENCY and SUMIF to actually extract and graph the data I was after in the first place.

Fun times. Nearly as fun as that time I had to turn to Ethereal and rtmpdump to watch some videos when the online Flash player turned out to be even more brain-dead than is usual for the breed.

So much for marketing types only knowing PowerPoint…


  1. Well, we knew that. If I had a buck for every time I have wanted to murder whoever coded Excel's date-handling routines, I'd be able to afford that Porsche. The reason they are so bad is they work just well enough that you can't treat the dates as strings, without actually, y'know, working for date manipulation - hence the whole expedition with awk

We don't have to care, we're IT

Brian Katz comments with his usual incisiveness on Mobile Device Management (MDM) in "IT is in the Experience Business".

MDM is dead and it’s been dead for a long time.

Oh thank $DEITY. As I have had occasion to comment myself, users don’t want their devices to be managed. They - or in fact we, since I’m a subject of MDM, not an admin - will tolerate a reasonable amount of inconvenience in the name of what we recognise as reasonable security requirements. What we don’t want is for our phones to end up like our Windows laptops, taking half an hour to boot and prone to all sorts of random malfunctions, slowdowns and incomprehensible roadblocks due to the number of "security" solutions they are larded down with.

This is exactly what is driving the enterprise adoption of Macs. Techies had been running Linux and maybe keeping the corporate Windows image around in a VM, but now civilians are moving to the Mac as fast as they can manage. Now we know the answer to the question "how bad do products have to be to drive even Muggles to change platform?".

IT isn’t just in the solution business anymore. It can’t be reactive and spend months trying to build the perfect thing the business asked for but needed much sooner than IT could deliver. IT is in the experience business. Users need to have great interactions that lead to fantastic experiences that help them get stuff done and move the business towards its goal.

(Emphasis mine)

Exactly right. Enterprise IT apps are all overgrown with feeping creatures, and users can’t get away from them fast enough. It doesn’t matter whether the apps are home-grown or COTS that has been customised, because the issue is not a technical problem but a worldview problem within IT.

Enterprise IT departments have always operated like The Phone Company, but this is now a post-breakup world, and now IT does have to care. Users bring their own tools, their own devices, even their own clouds. Users help themselves and each other; anything to avoid dealing with the hell-desk.

But things don’t have to be this way. Brian concludes his post with this statement of the business of IT:

We’re in the business of providing secure right time experiences that allow the user to (in the words of the army) be all they can be.

Now that is an IT vision that users might actually enjoy.

Jumping the fence

Facebook just released their new iPhone client, an app called Paper. It’s quite nice, and gets good reviews.

Bit of a jerk move on the name, mind.

If you are in the US, you can just download Facebook Paper, but if you’re in the rest of the world, you’re out of luck.

Or are you?

There are a few different unofficial ways to get apps onto an iPhone, bypassing these sorts of geographical restrictions: sideloading, changing the country on your existing iTunes account, or creating a whole new Apple ID from scratch.1

Sideloading

Sideloading2 means that you install the app from your computer, but without going through iTunes. You will need to have access to the actual app file, so you will need a co-conspirator in the US to get you the app. Your confederate can find these as .ipa files in the iTunes Media/Mobile Applications subdirectory of their main iTunes directory.

Once you have the relevant .ipa file, you can use the iPhone Configuration Utility3 to load the app onto your phone. Once you’ve done this, the app should behave normally, including for updates.

Changing the country

You can change the country of an existing iTunes account quite easily: open the App Store app, scroll all the way to the bottom of the "Featured" tab, tap on your Apple ID, choose "View Apple ID" in the popup, and tap on "Country/Region" to change to the US store.

HT1311_03--account_settings-002-en.png

There is a pretty big downside to this method: your payment details will be reset, which would not be too bad, except that it also loses any recurring subscriptions you have set up. I have a few that I didn’t want to mess this, so I didn’t follow through, and can’t vouch that this method works.

Creating a new Apple ID

I didn’t want to do this because it seemed like it would be a huge hassle, but it’s actually fairly painless. There is only one wrinkle to be aware of. Apple in their wisdom will not let you create an Apple ID from scratch without setting a means of payment. However, if you sign out from your existing Apple ID, then go to install a free app (such as, oh for instance Facebook Paper), you are prompted to log in with an existing Apple ID or create a new one. If you start the process this way, you will then be able to select "None" for your method of payment.

none+iphone+13+11+16.jpg

You’ll need an e-mail address that you have not previously used with Apple to complete the registration. Once you have done this, finish downloading Facebook Paper, then log out of your US account and log back in as yourself.

Facebook Paper should pick up your existing FB credentials saved in iOS and work normally from this point on.


  1. Well, or move physically to another country, but that’s a bit beyond the scope of this post. 

  2. This is the method I used to load Google+ onto my iPad back when it was iPhone only. Remember when we were all excited about G+? 

  3. This page is not really up to Apple’s usual standards: all-lower-case title for a start, and a confusing mix of version numbers and platforms all jumbled together with no explanation. 

#ScumbagPenTester

tl;dr version: CISO pays for pen-test, receives ridiculous report. In addition to involving legal, he shares it with a prominent security blogger. Hilarity (and viral hashtag #ScumbagPenTester) ensue.

My favourite bit of the report is probably this:

MySQL configured to allow connections from 127.0.0.1. Recommend configuration change to not allow remote connections.

I

used to put stuff like this in pen tests to see if my boss was paying attention.

This sort of thing happens
in every industry, but what shocks me is that someone would try it on in an area like security. If you know you need a pen-test, surely you know enough to recognise 127.0.0.1?