Barely Legally

Confessions of a Moot Court Bailiff

The Bard of Suck

Willy Staley’s profile of Mike Judge in the New York Times is full of gems like this:

Calling “Idiocracy” a documentary is one of those jokes about Donald Trump that was made constantly in the latter months of 2016 and now reeks of a certain strain of ineffectual liberal smugness. Still, it’s an observation not entirely without merit. As recently as two years ago, the movie felt like a relic of the jingoistic Bush years, but then history shuddered in such a way as to render it clairvoyant.

In “Idiocracy,” the secretary of state is sponsored by Carl’s Jr., a company whose chairman very nearly became our current secretary of labor. In 2505, the Oval Office is occupied by an ex-wrestler and porn star named Dwayne Elizondo Mountain Dew Herbert Camacho; our president has been on the business end of a Stone Cold Stunner and once appeared in a nonpornographic segment of an otherwise soft-core Playboy VHS tape, dumping sparkling wine onto a limousine. His name is a brand name, too.

I hope one day to learn there’s a German word for “proposing something deliberately absurd which later turns out to be entirely factual.” They’ve got all the best ones, like joy derived from the suffering of others, and “grief bacon.” This would just complete the trifecta.

Of course, this profile largely exists to promote Judge’s new work, not his old. Turns out Silion Valley rhymes with Idiocracy more than I had thought:

If “Idiocracy” imagined that America would one day amuse itself into ruin, then “Silicon Valley” offers a compelling case for how we’ll go about doing it — not in spite of our best and brightest, but because of them.

Do the Germans have a word for “Mike Judge kinda needs a hug?”

Published in I'm More of a Druid of Meh on

Tech Bros Gone Wild

If you haven’t read Susan Fowler Reflecting on one very, very strange year at Uber yet, do have a read about the kind of people that run Uber. Here’s how her piece starts:

After the first couple of weeks of training, I chose to join the team that worked on my area of expertise, and this is where things started getting weird. On my first official day rotating on the team, my new manager sent me a string of messages over company chat. He was in an open relationship, he said, and his girlfriend was having an easy time finding new partners but he wasn’t. He was trying to stay out of trouble at work, he said, but he couldn’t help getting in trouble, because he was looking for women to have sex with. It was clear that he was trying to get me to have sex with him, and it was so clearly out of line that I immediately took screenshots of these chat messages and reported him to HR.

And it only gets more ridiculous from there. Now, Uber is not the only tech company that mishandles sexual harassment claims; maybe Silicon Valley companies in general are disrupting stagnant office environments in favor of free market sexual harassment policies. After all, according to the 2015Elephant in the Valley survey of senior women in technology, 60% reported unwanted sexual advances; of those, nearly two-thirds had received advances from a superior. Half of those advances from a superior happened more than once.

These problems have solutions. One tech CEO, Debbie Madden, writes Many in Tech Have Gotten Harassment Against Women in the Workplace Right for Decades:

Here’s an idea: adopt a zero tolerance policy for harassment. Do this today, and hold people accountable for their actions. For all of the Uber employees who have done wrong — fire them immediately. Yes, Uber must investigate and confirm each allegation. But that doesn’t take years, it takes days. Once confirmed, fire immediately.

Firing employees who sexually harass other employees? How disruptive! There’s more to it than just firing the lousiest male employees, though: Rachel Thomas wrote last fall about The Real Reason Women Quit Tech (and How to Address It). She includes lots of great ideas and links to studies and articles, but this bit about internalized gender bias might be my favorite:

Researchers at Deutsche Bank hypothesized that women managing directors were leaving the firm to work for competitors because they were seeking greater work/life balance. However, they discovered instead that women were leaving because they were being offered higher ranking jobs by competitors that they weren’t being considered for internally.

It must be tough to run a business when you only promote half of your qualified employees.

Published in It's a Man's World on

Slimy as a Service

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.

Published in Government Officials and Other Miscreants on

Executive Power Run Amok

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.

Published in I Scream, Yoo Screams on

How I Update Jekyll From My iPhone: Part 2

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 Ulysses.app, 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 Notes.app 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:

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

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 Transmit.app 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 Workflow.app, 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:

sed -i '' 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. 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.

Conclusion

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 Workflow.app 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.

Published in Nobody Asked, Nerd on

How I Update Jekyll From My iPhone: Part 1

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.

Published in Nobody Asked, Nerd on