Sportsball... Sportsball everywhere!

Sportsball

I like to go and take a hike,
and sometimes go and ride a bike,
And though I do not fish for pike,
It’s sportsball that I do not like.

I do not like it on a hat,
Nor tattooed boldly on my cat,
And if I owned a sportsball jacket,
Into the trash I would pack it!

When I go to cast my ballot,
A horrid taste forms on my pallet,
Who there dares to go beg for money?
Rich sportsball pricks and it’s not funny.

And when the people pay their bond,
How do these ingrates then respond?
They move their teams and thus abscond
with peoples’ taxes far beyond.

And at the start of sportsball season,
Most people seem to loose their reason,
Because they fear to dream or think,
They fish used sportballs from the drink.

I find it sad that thought reform
has always been our culture’s norm,
Just watch the fans and soon you’ll know
that sportsball is just mind control.

And if this screed leaves you irate,
A sportsball fan I irritate,
Then keep on cheering corporate theft
and sportsball will be all that’s left.

Corporate Shuttle

To breathe is to suffer always said father.
Now that I’m him
this dull malaise kicks me
like the morning coffee.

Sitting on this asphalt ribbon to nowhere,
this bus is full of mistakes;
Together and silent,
Parched for sleep, we all sing this hymn:
We didn’t consent to this,
We never wanted to breathe.

10google-xlarge1

Listing the Current Branches of Multiple Git Repositories Under a Singe Parent Directory Using Bash

440px-strom_roka_borovica_velke_borove_03An interesting problem came up a work where I am maintaining a couple of legacy enterprise applications written in PHP. These applications were first developed over a decade ago and the version control was originally managed in SVN. Later they were moved to Git. I do not know the full reason why, though I have a theory, but both applications break down into multiple components, each of which is managed in a separate Git repository. This isn’t a huge issue, but it does create headaches when working on multiple tickets that impact multiple components. I want to make my changes for each ticket on a new Git branch for that ticket while leaving unmodified components on their master branch in Git. Unfortunately, there isn’t an easy solution to figure out what branch each Git repository is pointed at, a problem when there are perhaps ten separate repositories that all interact with each other.

Anyhow, yesterday I wrote a Bash script to address the issue, so I can now get a quick summary of what branch each repository is currently pointed at. Since writing the Bash script took a bit of research, trial and error (as Bash does), and was generally a bit of a pain in the ass (as Bash scripting is), I figured I’d publish my Bash script so that someone else out there might benefit from what otherwise would be a single use tool written for myself, and possibly a few interested team members working with these clusters of Git repos.


#!/bin/bash
app_path="${HOME}/path/to/application"

# Get all the repo paths for opsdb and store them in an array.
repo_paths=()
while IFS= read -r -d $'\0'; do
    repo_paths+=("$REPLY")
done < <(find ${app_path} -maxdepth 1 -mindepth 1 -type d -print0)

#echo ${#repo_paths[@]} # DEBUG Print the legth of the arrray.

# For each array, write the path and output the current branch.
for component_path in ${repo_paths[@]}; do
    echo -n "${component_path}: "
    git --git-dir=${component_path}/.git --work-tree=${component_path} rev-parse --abbrev-ref HEAD
done

SSHFS on OS X via Fuse and the Horrible Dot Underscore Turd Files

Once again, I have been issued a Mac to do development work, and as usual everything unixish on OS X almost works. To my delight, when faced with having to code against a Linux environment that I access via SSH, I found that since I last faced this situation, someone had made and is maintaining a port of Fuse for OS X with easy support for SSHFS. This discovery was a really great way to start the morning. I downloaded the installers, ran them, wrote my script to mount my remote machine to my filesystem, and had it working by the time I finished my first cup of coffee. Kudos to the team who maintain that port!

Of course, with the OS X filesystem in the mix, network attached filesystems never just work the way you want them to. In this case, the problem I ran into was the presence of files beginning with ._ the moment I created a new file in my repository and ran git status. I’ve seen these before. They pollute the files of most every filesystem ever touched remotely by a Mac, and they are totally invisible to the Mac user. They are used to store metadata for OS X, and are totally useless for any other computer. One Stack Overflow commenter deemed these dot underscore files “turd files”, which I consider an apt description. Apple calls the double underscore files “Apple Double” files. Whatever you want to call them, when being introduced into a client’s code repository on a Linux OS, these files beginning with ._ are turds and I want to prevent them from ever being created on my remote system.

It took some digging using a brand-name search engine, the name of which I will not disclose, but I was eventually directed back to the OSXFuse documentation, which, with a little reading, gave me a solution. (Cheers to working documentation!)

In the SSHFS connection string there are several options that can impact the creation of Apple Double (._) files. The two that I wound up using were noapplexattr and noappledouble. noapplexattr prevents OSX from even attempting to apply its extended attribute shenanigans to the SSHFS mounted operating system and noappledouble explicitly prevents the creation of any file beginning with a dot underscore as well as the also very annoying .DS_Store file. I’m not certain that both options were needed for my situation, but I used both and tested the result, and it seems to be working. Not almost working, just working.

My command for mounting my SSHFS looks like this (with sensitive bits redacted, of course):

sudo sshfs -o allow_other,defer_permissions,noapplexattr,noappledouble,IdentityFile=~/.ssh/id_rsa myusername@clientsserverhostname:/home/myusername /mnt/sshfs/mymountpoint

il_fullxfull-957561786_o31h
So long ._ files!

Server-Side Swift on Linux

“Can I write Web applications in Swift?” was a random question that popped into my head a few weeks ago after discovering Swift.org, a project that moves Swift programming language out of the domain specific role of replacing Objective C as the defacto language for building apps targeting Apple’s iOS and OS X platforms and into the Open Source ecosystem. The answer is, yes, thanks to the work being done by Perfect.

I have been curious about Swift since it first came out, though I am not a mobile developer. Recently, in a job interview, I spoke to the mobile team at a digital media company, and the iOS developer raved about the language, which led me down the rabbit hole. Seeing that Swift is capable of being a general purpose programming language, and that it can run on Linux makes me optimistic that organizations with strong iOS offerings may be able to run full-stack Swift applications similar to what Node.js / Web developers currently enjoy. The core advantage of Swift, of course, being not JavaScript. Whether Swift becomes a mainstream server-side language outside of the Apple fanpeople’s realm is anyone’s guess, but it is intriguing enough that I will be giving it a try over the next couple of weeks.

Today’s effort was seeing if I could get Swift and Perfect up and running on my Ubuntu 16.04 machine. Swift.org offers binary downloads for Ubuntu 14 and 15, but not 16, as of today. However, being lazy (or arguably organized) and wanting to used apt to manage the installation, I instead found this Swift package for Ubuntu 16.04, which, following the instructions, worked flawlessly, though it did involve editing my .bashrc file to include the package’s binary directory in my user’s PATH variable.

After installing the Swift compiler, I downloaded the Perfect sample project and built it, as per Perfect’s instructions. My first attempt at compilation failed, as I received the error:

/home/david/swift/PerfectTemplate/PerfectTemplate/Packages/LinuxBridge-2.0.1/LinuxBridge/include/LinuxBridge.h:6:10: fatal error: 'uuid/uuid.h' file not found
#include <uuid/uuid.h>
^
1 error generated.
<unknown>:0: error: build had 1 command failures

This seems to be a common dependency problem, and after a little digging, I was able to get the compilation to complete by running the command sudo apt-get install uuid-dev to install the uuid development package for Ubuntu. Easy peasy, right?

swift-perfect-hello-world-success

Great success!

The next step for me will be to try and build a working Web app on Linux in Swift using the Perfect library. Whether I find the language as pleasant as some iOS developers remains to be seen, but it seems like it is an experiment worth trying.

 

Forty

STEEL_RESERVE_40_A-500x500I’m 40 years old, and in less than a month my 40th year will be in the rear view mirror. I remember one day, when I was 25, when I had the realization that forty was only fifteen years away. I remember exactly where I was too. I remember cringing a little because being ten years old still felt recent and forty felt impossibly old. In an instant I realized that youth had a shelf life, and that sooner than I would like it would expire.

Thirty was a great year. My twenties were full of Sehnsucht, a portmanteau of undefined longing and lingering illness that only the mind of a German could condense into a single, two syllable word. I was relieved, despite the negative buzz about flipping that significant digit, to ditch the twentysomething angst for the decade of hustle that any responsible thirtysomething must endure. In my thirties my career finally hit its stride. I spent the decade in a more or less stable relationship. I learned to drink wine and spent romantic weekends in Mendocino, getting massages and sampling artisanal whatnots. I worked hard and took up running. I skipped some of the responsibilities that my peers took on; kids, mortgage. But I played harder than I did in my twenties. I had fun. And then life happened.

Forty is a canonical number. When Noah took his cruise, it rained for forty days and forty nights. Moses roamed the desert with his people for forty years. Jesus fasted in the desert and was tempted by Satan for forty days. Forty is big. It is more than the literal bundling of forty individual things. It’s something that’s not exactly quantifiable. How big was that thing? I don’t know, like forty.

Forty was a transformative year for me. The relationship that had been the bedrock of my life eroded from the Heraclitian constant – change, and I found myself thrust into the dating world as a forty year old man; the optics of which are not good. There are 38 year old women who will not date a forty year old man. I am too old and settling for me means admitting that one has past one’s “best by date” on the early side. I would write this off as a purely psychological phenomena,  but for the fact that I am not 39. I am forty.

I drink less now. Bars are noisy and crowded, and I am happier when I go several weeks without so much as a beer. My bottles of scotch and tequila sit on the shelf gathering dust. They are nice to look at. I like their aesthetics, but they make me happier as art objects than having their contents poured into shot glasses. I don’t work a program. I didn’t make some great effort to stop drinking. One day I just lost interest. Most of the time a good night’s rest is more appealing than a cocktail.

Work is interesting. My professional life has become less of a mystery. I understand everyone’s role better; their concerns, why they show up in the morning, and where they are headed at the end of the day. There aren’t as many puzzles to be solved. I watch the more junior people make the same mistakes I made and hack the same lessons that I hacked. Sometimes I have to watch them and let them do their thing. I try and give them encouragement, but some things are just best learned through experience. It’s a weird feeling observing their struggles, one that I might have felt earlier had I not opted out of parenthood.

I feel more too. In my thirties everything had to be rational. It had to fit in place. It had to be just so. Now I look at my thoughts and have a much better sense of what is a reality-based idea backed by logic and what is a feeling. I have stopped calling my feelings “wrong ideas” and tossing them in the bad pile. Now I divide them between rational and irrational, and try to keep them sorted that way. I choose my words more carefully too. I don’t just “think” everything anymore. I think rational things, I feel non-rational things. I try and modulate my decisions accordingly. I try and bring more mindfulness to how my decisions make me feel. I don’t always get it right but sometimes I do. And sometimes the result is boring. I may be happier, but happy and well balanced feels tedious a lot of the time.

I don’t want forty. I want to kick it down the street a few decades. I like the hustle. I want to make big deals, found a successful company, and swim in an Olympic sized swimming pool of my own money. And I miss that undefined longing that felt like a low grade infection. I don’t want to give up on the idea that there is something bigger and better out there for me than I can possibly imagine. But I’m forty. Forty is big. Forty is heavy. It is a wall; a boulder so big that Moses or Jesus or the Big Sky Man Himself can’t move it. Forty is the reality that I am just another human being passing through this insignificant speck in a vast but impermanent universe on my way, soon, to shuffle off this mortal coil.

Are Millennials Being Helicopter Parented at Work?

If you listen to the buzz about the Millennial Generation, you will generally here the same story of how never before has such a brilliant and talented generation been given so little opportunity and such tough circumstances. Not that I believe it’s the Millennials themselves saying these things. Yes, Generation Y, the children born to the Reagan Era, got the shaft when they entered the workforce during the recession and general economic downturn, and that coupled with huge student loan debt really did give them a raw deal that wasn’t anything they had control over. It was just bad luck.

But the rest of the narrative, about these hyper-talented young adults that would be taking over the world but for annoying, lazy, and incompetent old people, doesn’t seem to be coming from the typical Millennial themselves, but rather from a few media and Internet famous pundits with rather loud voices, many of whom seem to have been born some time between 1950 and 1965; namely the Millennial’s Baby Boomer parents.

Here, I cite a specific example. An article on LinkeIn entitled, Why Millennials Keep Dumping You: An Open Letter to Management. Written in typical clickbait fashion, this bit of embellished fluff portends to enlighten us as to why the average, everyday, overachieving, and hyper-talented Millennial isn’t living up to their full potential at work. (Spoiler alert: It’s your fault.) The funny thing is, the author, a “sales leadership consultant” by the name of Lisa Earl McLeod, isn’t even a Millennial. She appears to have been born some time in the mid 1960s. In fact the whole piece appears to be cribbed from a conversation with her cum laude daughter and then pureed with a healthy dose of Baby Boomer, “The man is keeping us down,” rhetoric. The fact that the alleged informant’s LinkedIn profile is in no way associated with the article makes me believe that she is embarrassed by her mother’s drivel. I certainly would be.

The article itself seems to boil down to four, very false, unprofessional, and pretty dangerous statements about work:

  1. The people who sit next to me and do not perform according to my standards are preventing me from doing my best work, which is unimaginably awesome.
  2. Things like profit and revenue are boring. My job needs to define me and your key performance indicators do not fulfill my need for self-actualization
  3. Thanks for for the free lunch and the comfortable office, boss, but I hate how boring you are
  4. My boss’ job is to make me feel like I’m changing the world, which I was raised to believe is my destiny. In absence of validation of that belief, it’s perfectly reasonable for me to drink to excess in the evenings and throw a slow-burn tantrum that ends in an early departure from my current position

Obviously I’m paraphrasing, but the gut-fee I get from this article, and what I get from most of the buzz about Millennials, is narcissism and blaming other people for ones shortcomings. If so and so behaved better or did this or that or made me feel good, then I would do what I’m supposed to do, not what I’m actually doing. But are narcissism and deflecting blame unique to Millennials? I don’t think so.

What I’m actually hearing from the Millennials I know is different. Many of them reject this way of thinking altogether. And many of them are the victims of helicopter parenting, where they were constantly monitored and reassured that when things didn’t go their way, that it was a temporary setback and that they were still awesome, and ultimately, if they stuck to the program, they would still be more awesomer! I think many of them, as adults, are unhappy about their upbringing, and struggle with reconciling that message with the stark reality of adulthood, just like every other generation before them. Anyone fortunate enough to have had parents has eventually had to deprogram themselves.

But the pundit class will keep beating the drum. And right now the pundits the narrative are closer in age to the elder McLeod than the younger McLeod. They are concerned parents who can’t quite grok why their kids aren’t happy and why their parenting philosophy didn’t produce the outcome that they expected. The Millennial generation isn’t any better or worse than any other generation, and that drives their parents crazy. So now the late era Baby Boomers are extending the range of their helicopter parenting to the media. They take to the screens, on television and online, and complain about how their kids’ careers are being sabotaged by lazy coworkers and lackluster bosses, because the reality that their kid didn’t grow up to become a superstar, despite the unreasonable level of effort they put into engineering the perfect child, is more than they are yet able to accept.

Boycott San Francisco!

People love San Francisco. There’s the great food, the proximity to wine country, and a general lack of snow. San Francisco has a rich heritage of counter culture, dreamers, homosexual poets, hippies, hipsters, and yuppies. Yes, I said it: yuppies. Not that yuppies are inherently bad. Okay, yuppies are inherently bad, but having a few bad apples around helps remind you how good the good apples really are. Having a lot of bad apples, though, means that you just have a lot of bad apples.

I’ve lived in the Bay Area for almost 30 years, San Francisco for six, and never before have I seen things get so bad and desperate. In a time when most regional US economies are not producing enough jobs, the Bay Area seems to have done the opposite. We have overproduced jobs to the point where there is no more housing for all the people who are coming here to fill those jobs. It has gotten so bad that I have begun looking for jobs elsewhere, in places where it might snow even, because I cannot afford to live here anymore. But I can’t find jobs in tech, outside of the few core hubs, that pay a competitive salary or match my level of skills and seniority. What I do find on sites like Craigslist are companies posting in other regions ads that beg developers to COME TO SAN FRANCISCO.

Well, here’s a news flash for all those employers. About fifteen years ago broadband Internet became a thing for middle class consumers. You do not need to bring any more warm bodies into your offices to create synergy. Those warm coding bodies would be happy to take 80% of what you’re offering an on-site employee and quietly code at home in Denver or Minneapolis or damn near anywhere else you can think of. And they will be more efficient, because the last thing you ever want your software engineer doing when they’re hacking on your core product offering is worrying about the increasingly realistic possibility that they may be homeless while earning a low six-figure salary, because a low six figure salary will not pay for a modest apartment in San Francisco these days.

And if you’re a programmer on the outside of Babylon looking in, dreaming of taco trucks, cheap cabernet, and enlightened free spiritedness, think twice. The people who are making what elsewhere would be very generous salaries by moving here are subsidizing their lifestyles. They’re going into debt, living off of trust funds, or growing weed in their closet. No one here has a retirement fund.

Maybe this is where the VCs are. Maybe this is where the intellectual ferment of the digital age starts, but it doesn’t have to end at the edges of the Bay, or even at the city limits of (gasp) Oakland. You can take it home. You can tell that VC that you’re going to start your company in your home town and save tons of their capital in the process. You can create jobs in your community. And if all you want is a job, you can tell Robollox or whomever is poaching for talent in your community that you would love to join their development team and you’d be happy to fly in once a month for the requisite face time, but you would rather rot in Hades than to give all of what should be your discretionary income to a scum sucking absentee landlord in the most screwed up housing market in these United States of America. Please, take those companies jobs and money, but also, please don’t come here. There is nowhere to live here. There are people renting tents in their back yards for $1,000 a month. There are people renting those tents. You will pretend to have fun for a while even though you will have no time or money to enjoy this once fabulous city. Then you will get sick of all of it and leave. The actually fun people can’t afford to live here anymore. The ones left, the odd indigenous San Franciscan excepted, are the die hard core of uptight yuppie scum who enjoy the smell of their own farts and will pay infinite amounts of rent for the status of having the correct zip code.

Move here at your own peril. I recommend an all out boycott. San Francisco has ceased to be livable and no one can afford flowers to wear in their hair.

URL Rewriting via VirtualHost Directive for the Slim PHP Framework

I’ve been using the Slim framework on and off for the past couple of years. I find it to be a nice piece of glue to structure my PHP applications without having to buy into someone else’s entire toolkit. In fact, I use it because it lets me use whatever tools I want and works seamlessly with Composer.

One thing that I find problematic getting a Slim project up and running is the insistence of the documentation that the rewrite to the front controller on Apache be configured in an .htaccess file. This is fine for shared hosting environments, but on applications where I control the server configuration and want to harden my infrastructure by avoiding such pitfalls as putting my server configuration in my document root, I would rather not have to put AllowOverride All anywhere in my Apache configuration files.

So, without further discussion, here is a VirtualHost file that I used to get Slim up an running on Apache with no .htaccess file. This was done for Apache/2.4.7 running on Ubuntu 14.04LTS. It took me several hours to remember how to do this, so hopefully this saves someone else some time in the future.

<VirtualHost *:80>
        ServerName web01.dev.example.com

        ServerAdmin david.cloutman@example.com
        DocumentRoot /var/www/web01.dev.example.com/htdocs

        RewriteEngine Off

        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteRule ^ /index.php [QSA,L]

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined


        <Directory />
                RewriteEngine On
                RewriteCond %{REQUEST_FILENAME} -s [OR]
                RewriteCond %{REQUEST_FILENAME} -l [OR]
                RewriteCond %{REQUEST_FILENAME} -d
                RewriteRule ^.*$ - [NC,L]
                RewriteRule ^.*$ /index.php [NC,L]
        </Directory>
</VirtualHost>

Donald Trump Takes Jesus Down a Peg

Ordinarily one does not launch a personal blog by handing the content immediately over to a guest blogger. This is particularly untrue when one wishes to speak to truth to power vis a vis politics and religion using one’s own unique voice. However, in this day and age we all must stand on the shoulders of giants; or at least the giant egos that own our government, media, and infrastructure. So, in the spirit of droit du seigneur, I present this guest post by a man who is know globally both for his humility and as a unique habitat for a fur bearing mammal not yet cataloged by cryptozoologists. He is also recognized by many, particularly himself, as an expert in everything.

Mr. Donald Trump:

When you look at my opponents in the Republican Party, they’re always going on about this Jesus guy like they’re trying to raise money from him. And they probably are. I’ve been to church and clearly the guy has some nice stuff. It’s not a bad. The catering leaves something to be desired, and I’ve spoken to that publicly already, but I like to hear myself sing in public, so I show up from time to time.

But have you read this guy’s book? Total wackadoodle, probably written during the Carter administration, about a bunch of government land deals. And he just keeps going on about about how he’s letting all these weird people in on the deal too. The guy’s got no business plan, no insurance, and as far as I can tell, no clue about real estate finance.

Look, I know that all sorts of religious weirdos, Zealots, rabble rousers, come out of Gallilee… and I presume that some of them might be good people, but most of them aren’t. That’s what Jesus’ people say. What I know is that my media reach twenty years ago was bigger that Jesus’ ever was. More people know who I am now than ever knew who this guy was. And by the time I was 33 I owned fifteen hotels in Manhattan and was worth a billion dollars.

What did that schmuck accomplish? Wandering the desert? Curing lepers of mange? I think we all know that I have better hair than that guy. My stylist charges $500 an hour. HE knows how to handle grooming issues.

And let me tell you something. This Jesus guy says that you should sell all you stuff and give it to the poor so you can enter his father’s magic Kingdom? No one ever had to do that to get into one of father’s my buildings. We built low income housing uptown when everyone said don’t build low income housing uptown. The guy’s clearly a slum lord renting some illegal units and giving his tenants a bad deal.

Here’s what I’m going to do. I’m going to make a deal with the Kingdom of Heaven. I’m going to put my assets into an S Corp, leverage the cash against payday loans for the poor at a reasonable – market rate based on the risk, mind you – but reasonable interest rate, and get in there. Then we’re going to demolish this Jesus guy’s father’s house, which is probably old and in need of renovation anyway, and I’ll put up a luxury condo high rise with 300% more rooms and new granite and appliances, all on cash margins. We’re going make this Kingdom of Heaven place great again. And I presume we’re going to raise the property values because the rapists, murderers, and drug addicts aren’t going to get in because we’re going to build a fence around it.