Blog Ipsa Loquitur

Mike Isaac in the New York Times on How Uber Used its Secret Greyball Tool to Deceive Authorities Worldwide:

Uber’s use of Greyball was recorded on video in late 2014, when Erich England, a code enforcement inspector in Portland, Ore., tried to hail an Uber car downtown as part of a sting operation against the company. At the time, Uber had just started its ride-hailing service in Portland without seeking permission from the city, which later declared the service illegal. To build a case against the company, officers like Mr. England posed as riders, opening the Uber app to hail a car and watching as miniature vehicles on the screen made their way toward the potential fares.

But unknown to Mr. England and other authorities, some of the digital cars they saw in the app did not represent actual vehicles. And the Uber drivers they were able to hail also quickly canceled. That was because Uber had tagged Mr. England and his colleagues — essentially Greyballing them as city officials — based on data collected from the app and in other ways. The company then served up a fake version of the app populated with ghost cars, to evade capture.

While underhanded, Uber’s use of an automated system to dodge regulators is not terribly surprising. Uber is notorious for ignoring laws and regulations until it can lobby for those laws and regulations to be loosed or lifted entirely. The fact that Uber spent the time and energy to develop a system for avoiding regulators instead of just paying fines should tell you all you need to know about how often Uber expected to be fined.

For me, the most outrageous bit of the Isaac piece comes a bit later:

Yet using its app to identify and sidestep the authorities in places where regulators said Uber was breaking the law goes further toward skirting ethical lines — and, potentially, legal ones. […]

In a statement, Uber said, “This program denies ride requests to users who are violating our terms of service — whether that’s people aiming to physically harm drivers, competitors looking to disrupt our operations, or opponents who collude with officials on secret ‘stings’ meant to entrap drivers.”

Ah, yes. Violent criminals and other government officials: the scourge of taxi drivers everywhere. Thank goodness Uber is there to protect its drivers from the outlaw and law enforcement alike. Well, not “its drivers,” per se, because the drivers are definitely independent contractors and not employees. If the drivers were employees, Uber would have to bear the cost of payroll taxes and health insurance.

Filed on under Government Officials and Other Miscreants

Here’s John “Bush Torture Memo” Yoo with a powerful op-ed in the New York Times, titled Executive Power Run Amok:

As an official in the Justice Department, I followed in Hamilton’s footsteps, advising that President George W. Bush could take vigorous, perhaps extreme, measures to protect the nation after the Sept. 11 attacks, including invading Afghanistan, opening the Guantánamo detention center and conducting military trials and enhanced interrogation of terrorist leaders. Likewise, I supported President Barack Obama when he drew on this source of constitutional power for drone attacks and foreign electronic surveillance.

But even I have grave concerns about Mr. Trump’s uses of presidential power.

During the campaign, Mr. Trump gave little sign that he understood the constitutional roles of the three branches, as when he promised to appoint justices to the Supreme Court who would investigate Hillary Clinton. (Judge Neil M. Gorsuch will not see this as part of his job description.) In his Inaugural Address, Mr. Trump did not acknowledge that his highest responsibility, as demanded by his oath of office, is to “preserve, protect and defend the Constitution.” Instead, he declared his duty to represent the wishes of the people and end “American carnage,” seemingly without any constitutional restraint.

​Politics makes for strange bedfellows. You can have my pillow, Mr. Yoo.

Filed on under I Scream, Yoo Screams

Previously, on Barely Legally, I ran a lengthy blog post describing how to install and configure Jekyll on your server instead of using it on a desktop. This post describes how I publish blog posts from my iPhone.

Part 3: Setting up your iPhone

Honestly, setting up Jekyll is the tough part. The easy part is putting stuff online. You can get any FTP app to send any text file from your phone to your server, and then just walk away. I try to make this part of the process as frictionless as possible, and here’s how I do it:

First, by using a specific app to generate the markdown files Jekyll’s going to be looking for. I use, and I can’t recommend it enough. Ulysses works on my phone and my computer, and it’s designed to organize lots of text files. There are thousands of text editing apps, and while you can probably just use the built-in to generate markdown files, I like the way Ulysses works.

In particular, Ulysses on iOS supports TextExpander shortcuts, and I have a shortcut set up to pre-format a markdown file for Jekyll when I start writing.

When I type jjyaml, I get:

layout: post
title: %|
date: %Y-%m-%d %H:%M

Ulysses uses the first line as the file name, so I end up with a file named something like YYYY-MM-DD-title.markdown as Jekyll is expecting. This works on both the Mac and iOS.

Second, I use to send the finished blog post to my server, into the \_posts folder. But there’s a twist.

If you just use the Share Sheet in Ulysses to send a finished blog post to Transmit, Jekyll has a fit because the first line of the markdown file is not —, as expected. This is because Ulysses on iOS uses the first line of a document as the filename, but keeps the first line of the document in the file. Twistier: if you manually delete the “YYYY-MM-DD-file.markdown” from the first line, Transmit will name the uploaded file ---.markdown, because that is the first line now. Either way, Jekyll is unhappy either because of a non-standard first line or a non-standard file name.

As I recall, you used to be able to start the first line of a document with @: and Ulysses on the Mac would treat whatever followed as the filename. A first line that started with @: would be excluded from the actual finished document if you exported it. But on iOS, Ulysses started including the @: in the filename, which was a giant hassle to try to parse out. I ended up dropping the @: from the TextExpander shortcut.

So I don’t send the file directly from Ulysses to Transmit anymore. I send it from Ulysses to, using a workflow that makes sure Transmit receives a file with an actual name apart from the first line. This workflow solves the “first line or file name” problem from the previous paragraph by naming the file for the contents of the first line, and then erasing the first line. You can see this workflow here.

After all this, I can upload a blog post from Ulysses on iOS by tapping Share at the top of any document. It’s a lot easier than bringing my laptop everywhere I go.

Part 4: Setting Up Your Mac

With one-button publishing on my iOS devices, I wanted to see if I could come up with a similarly frictionless way to publish a Jekyll post on my Mac. Unsurprisingly, the answer is yes, and it’s a lot easier on a computer because macOS is more flexible than iOS.

I set up Hazel on my laptop, with a folder monitored for any new files with the .markdown extension. If a markdown file shows up in that folder, Hazel strips out the first line by running a quick shell script:

/usr/bin/sed -i .deletethis '1d' $1

Which removes the first line of the file. On macOS, this does not rename the file to ---.markdown like it does on iOS. Then Hazel uploads the file to my FTP server and deletes the backup version sed made with the .deletethis extension. I really, really appreciate how Hazel has built-in support for the SFTP protocol, and even supports using key-based authentication for the connection instead of a password. That alone is worth the purchase price.

And one last Hazel rule: I set up an External Folder in Ulysses to hold all my old blog posts. Every day, Hazel uses rsync to download any new blog post from my server’s \_posts folder into my laptop’s External Folder in Ulysses. The command looks like this:

rsync -avz ServerName:/path/to/server/blog/posts /path/to/local/copy/of/posts

This is great, because if I notice a typo on a blog post, I use Ulysses on my phone to login my server with Transmit and directly edit that post’s markdown source file. Jekyll will automatically regenerate a few minutes later, and the next time I open my laptop, I’ll have a copy of that error-free blog post in the External Folder available in Ulysses.

Note: this is separate from the CloudKit-synced Ulysses Library, so I would recommend storing your External Folder in an iCloud, Dropbox, or Google Drive folder. That way, you can get at your latest blog posts from your phone, even if you haven’t kept a copy in your proper Ulysses Library; this is in keeping with the whole “phone first” philosophy that started this quixotic misadventure.


This setup isn’t perfect. I would really love to have a script to download blog posts from the server directly into my Ulysses Library. That Library gets automatically synced to every iOS device I own. But Ulysses on macOS doesn’t allow other programs direct access to the files in its Library, so I have to use the External Folder workaround. This, in turn, means I don’t really have one canonical folder full of markdown files. I have the one in the iCloud Ulysses Library, and one in an External Folder library with a few more posts than in the Ulysses Library. Not a dealbreaker, but I do have to remember to reconcile those two periodically.

Realistically, adding support for AppleScript on macOS would be a huge improvement for Ulysses. I’d use it to move newly-downloaded blog posts from the External Folder into the iCloud Library in Ulysses, eliminating the two folders business.

I’d also like the iOS versions of Ulysses and/or Transmit to be a little more flexible with the way they handled files passing from one to the other. It’s a little ridiculous to have to use a third app just to solve the “first line or filename” problem, and even more ridiculous when one of them updates and I have to tinker with the workflow to accomodate the change.

For my part, nothing in this workflow handles the embedding of images, which Ulysses supports beautifully in both iOS and macOS. I can include all the images I want in the post, but they’d get stripped out by during the upload process. I don’t generally include images in blog posts, so it’s not a huge problem to upload and manually link those when they come up.

Overall, I’m very pleased with how frictionless my workflow is at this point, even if I spent an inordinate amount of time tinkering to set this whole Rube Goldberg system up. And hopefully, writing this all out helps someone with their blogging setup at some point down the road.

Filed on under Nobody Asked, Nerd

I launched this site with the name “Almost Legally” just about a decade ago, at the end of my first year of law school. I’d spent a good amount of time tinkering with WordPress in college, and I was pretty comfortable with the software systems involved. And while those were the halcyon days for sites like Tumblr and LiveJournal, I felt it was important to keep my writing on my own site, instead of joining someone else’s. So I paid a small web hosting company four dollars a month for a folder to FTP into and a SQL database to point WordPress at.

WordPress is a fine platform, and it’s the gold standard for user-friendly blog software, but it’s overkill by a country mile for a one-man comedy law blog. WordPress has a ton of moving pieces and I really just need something to show a bunch of text. There are some philosophical arguments to be made for using a tool no more complicated than the job requires, and I generally find those convincing.

So I rented an entire server and taught myself how to administer that. This was probably a net increase in work, and definitely an increase in moving pieces, but it was a great chance to learn a new set of skills.

So I migrated this blog from WordPress to Octopress, and later to Jekyll. This meant giving up one of my favorite features in WordPress. See, WordPress has a pretty great mobile app for drafting, editing, and publishing posts on the go. Because WordPress runs on a server, you can log into the system anywhere and write new stuff or edit a typo you just found.

Jekyll, on the other hand, isn’t a suite of software you run on a server. It’s a series of shell scripts to which you feed a folder of text files; when it’s done, you have a folder full of HTML files you upload to a web server. So there’s no app for your phone or otherwise: you have to have a folder of text files and a computer to run the Jekyll command-line program.

This creates some friction. A decade ago, I owned a flip phone and did all my computing from my laptop. Jekyll would have been a great fit. But it’s 2017: I do most of my computing from my iPhone and go days or weeks without opening my laptop. So really, a central server and a slick app with which to publish posts would be great! WordPress is overkill, but some of those moving pieces come in really handy when you’re trying to make writing as frictionless as possible.

So here’s what I do to make sure updating my Jekyll site from my iPhone is as simple as if I still used WordPress. This is definitely not the only way to do it, it’s almost certainly not the right way to do this, and it’s probably not the smartest way to do this. But when I was trying to figure out how to do this, I pieced together a lot of information from a lot of different sources. Hopefully, having this all in one spot is useful for someone else.

Filed on under Nobody Asked, Nerd

Popehat’s Ken White, on How To Read News Like A Search Warrant Application:

If you’re not familiar with them, search warrant applications include a declaration under penalty of perjury from the investigating officer or agent. The declaration and supporting paperwork are supposed to identify the location to be searched, the items to be seized, and the specific facts providing probable cause that those items are evidence of a crime. Federal courts scrutinize search warrants more closely than state courts. That’s not the law; that’s just reality.

When I was a prosecutor, my job was to review proposed warrant applications from federal agents and make sure that they complied with legal requirements before submitting them for approval to federal magistrate judges. As a criminal defense attorney, my job is to analyze warrant applications that have yielded searches of my clients and scrutinize them for flaws and constitutional failures that I can present carefully and forthrightly to a judge so that the judge can then ignore or rationalize them. The critical eye that prosecutors and judges are supposed to use when reviewing a warrant application — and that defense lawyers use in evaluating whether they can be challenged — comes in handy in assessing the trustworthiness of news. Three doctrines in particular come to mind.

​Handy advice for critical thinking in any situation.

Filed on under Bureau of Fake Search Warrants

As the Democratic Party regroups and prepares for its time as an opposition party, it’s worth re-reading Matt Stoller’s piece in The Atlantic,How Democrats Killed Their Populist Soul. He begins immediately after Watergate, when a wave of reform-minded young Democrats were elected to Congress. These “Watergate Babies” swept out establishment Democrats who had led Congress since the economic populism of the New Deal era.

Over the next 40 years, this Democratic generation fundamentally altered American politics. They restructured “campaign finance, party nominations, government transparency, and congressional organization.” They took on domestic violence, homophobia, discrimination against the disabled, and sexual harassment. They jettisoned many racially and culturally authoritarian traditions. They produced Bill Clinton’s presidency directly, and in many ways, they shaped President Barack Obama’s.

The result today is a paradox. At the same time that the nation has achieved perhaps the most tolerant culture in U.S. history, the destruction of the anti-monopoly and anti-bank tradition in the Democratic Party has also cleared the way for the greatest concentration of economic power in a century. This is not what the Watergate Babies intended when they dethroned Patman as chairman of the Banking Committee.

Here’s a spoiler of how this story ends, with Bill Clinton elected the 43rd President with a platform completely silent on anti-monopoly policies for the first time since the 1920s. ​

Old problems also reemerged. Financial crises unseen since the 1920s began breaking out across the world, from Mexico to East Asia, prompted by “hot-money” flows. Deflation, rather than inflation, and a capital glut, rather than a capital shortage, started to concern policymakers. And it turns out, according to a McKinsey study, that a disproportionately large amount of the productivity gains from the remarkable computerization of the economy were the result of just one company: Walmart, the new A&P. The mega store’s economic influence “reached levels not seen by a single company since the 19th-century.” The gains of the 1990s, it turns out, were not structural, but illusory. Early in Bush’s term, the stock-market bubble burst and wages collapsed. A few years later, a global banking crisis, induced by a financial sector that had steadily gained power for 40 years, erupted. Concentration of power in the private sector, it turned out, had its downsides.

Filed on under The Do Not Pass Go Chronicles