S.J. Brougher's Blog

January 11, 2016

Travis CI and Codecov

I ended up at OpenShift because I was looking for a free Jenkins solution, Jenkins being the CI tool with which I’m most familiar. But, I’ve since discovered Travis CI, which is incredibly open-source friendly and perfect for this plugin project. Along with that, I discovered Codecov which stores code coverage statistics (calculated with Jacoco). With both of these up and running, there’s no need for the Jenkins solution on OpenShift.


So, what to do with OpenShift? With all three gears open, I can get a SonarQube instance running (one gear for the server, one gear for the unused scalable web front, and one gear for the database). That being said, having Travis and Codecov running significantly reduces the need to get that running, so it’s been put on the back burner for the moment.




 •  0 comments  •  flag
Share on Twitter
Published on January 11, 2016 07:56

December 31, 2015

Review: The Dark Tower by Stephen King

Buy on Amazon


Light spoilers for the whole series above, deep spoilers near the end (another warning will be issue).


I am not one of Stephen King’s Constant Readers. I picked up The Gunslinger in a Barnes & Noble on a whim and fell in love with the first line: The man in Black fled across the Desert, and the Gunslinger followed. In the subsequent days, I fell in love with the entire book. To my disappointment, The Gunslinger is the peak of the series.


There have been high points (The Wolves of the Calla) and particularly low points (The Waste Lands) but the series could never match the brutal, elegant, beautiful simplicity of that first book.


And finally, we get to the core of it: The Dark Tower has never been about anything other than Stephen King. He claims to hate the word “metafiction” (which means an author has inserted themself into their book), but he drags the whole series through what is, ultimately, a metafictional narrative and nothing else. The Dark Tower series exists for one reason and one reason alone: to tie together the collective, varied works of Stephen King. Not only that, but he inserts himself into the story as, basically, the prophet of our Lord and Savior Gan, Keeper of the Dark Tower. A fascinating look into the mind of Stephen King? Yes. An engaging story? Not really. The final body blow after you realize you’ve wasted years of your life reading a story about other stories you haven’t read? King literally becomes his own deus ex machina… then lampshades it.


Deep spoilers to follow. You’ve been warned.


The Dark Tower ends twice, one of which I kind of liked, the other I really didn’t. Let’s talk about the one I liked first.


What Roland finds at the top of the Dark Tower is… a return to the desert first seen in The Gunslinger, and the beginning of his journey once again. As we’ve been told oh so many times, ka is a wheel, so a return to the beginning should not surprise anyone. As a reader of Stephen King, an ending that’s more than slightly horrific for the protagonist shouldn’t surprise anyone, either. Honestly, there’s nothing else that should be at the top of the tower.


What Susannah finds in New York, on the other hand, is a cop out. Eddie, Jake, and Oy sacrificed themselves for the mission, for ka, for each other, and for Roland. To find them strolling around New York City in some alternate where so Susannah can find them diminishes their sacrifices. It makes sense, I guess, and it doesn’t break any rules of the world… but 11th hour resurrections are always the wrong decision. Always. It takes a clear-cut cause and effect chain and says, “Gotcha! Different effect! Surprise happy ending!” Oh, they don’t live happily ever after, they merely live and have happiness? That’s a lot different; thanks, I feel better about your cop out now .


On it’s own, I’d give the book The Dark Tower 3 roses out of 5. As a stand-in for the series as a whole, I’d give it 2. Knowing what I know now, I would read The Gunslinger and stop there.




 •  0 comments  •  flag
Share on Twitter
Published on December 31, 2015 07:24

WordPress to JBake content conversion tool

Over the Christmas break, I’ve been coding up a tool to convert all my WordPress posts into JBake content. The idea is that it would take a WordPress Export file and turn it into the content and assets folders in JBake. Since I’ve got my JBake instance running in Gradle, I’m writing this as a Gradle plugin. That being said, I’m not entirely comfortable with Groovy, so there’s only a small Groovy shim between the Gradle build and the main application, which is pure Java. If this plugin gets some traction with other people, I’ll write a similar shim for a Maven plugin.


The plugin’s called wp2jbake and I’ve open-sourced the code (GPL2) and it can be found on GitHub here.


The most difficult part of all this, oddly enough, has been trying to setup Jenkins and Sonar on OpenShift. OpenShift is a cloud-based PaaS product from RedHat, and they give you 3 small gears for free (which seems perfect for a small, opensource CI platform). I ran into two primary problems. First, I’m not an ops guy, so every step of this is a painstaking example of how not to go about setting these things up. More importantly, it turns out it’s impossible within OpenShift to setup what I’m looking for without going over the 3 gear limit.


“You’re going over the 3 gear limit,” some of the more informed of you are saying. “But it sounds like you only need two gears, one for Jenkins and one for Sonar. Three, max, if the database is on its own gear.” Which is exactly what I thought, but I ran into certain problems specific to OpenShift’s restrictions.


First, we have to talk about how OpenShift handles applications. When you create an application, first you need a “web” application to handle web requests. This can be something basic like a Tomcat or PHP instance, or something more complete like Jenkins. You can then add to this web application additional “cartridges,” things like databases or certain clients that don’t require inbound web requests. You can’t have more than one web cartridge in an application.


OpenShift also has a concept of “scalable”. When you create a web application, you can make it scalable, which means it can dynamically spin up instances of itself on additional gears (if your account has them open). There are certain exceptions to this; Jenkins, for instance, can’t be scalable because it shares file resources. Similarly, the “DIY” cartridge which I was using to install Sonar could not be made scalable for the same reason. Sonar, however, requires a database instance (unless you’re using the embedded H2 instance, but then what’s the point? If it restarts, you’ll lose your data.)


Sonar also requires this database instance to be accessible to both the client and the server, our client in this case being our Jenkins instance. The Jenkins and DIY cartridges are both web cartridges, so they must be different applications. But to be externally accessible, the database has to sit on its own gear, either in one of these applications or on a different one. Neither Jenkins nor DIY can be made scalable, which means the database can’t be a cartridge on either of them. A database is not a web cartridge, so it can’t sit as its own application. So, to get around this, I could make a different app scalable (PHP or NodeJS or something) and just ignore the web part of that. Problem solved, right? Except count the gears:


1 – Jenkins application


1 – DIY Sonar application


2 – Database application (1 for the web app that I’m not even using and 1 for the database)


Is there a way around this? Not right now. There’s been a feature request for at least two years to make a scalable DIY cartridge, but it hasn’t happened yet. It seems strange to me that you can’t spin up a solitary gear with a database, but there you go.


So, right now I do have a Jenkins server up and running and polling from GitHub every hour, but I’m going to have to setup a local SonarQube instance until/if I find a better solution.




 •  0 comments  •  flag
Share on Twitter
Published on December 31, 2015 04:20

December 19, 2015

Switching from WordPress.com to JBake on GitHub pages

In an effort to cut costs, I recently migrated from a hosted site to WordPress.com. WordPress.com’s about a tenth the price of a hosted solution, but comes with some pretty significant caveats (the biggest being their “no plugins” rule). As a programmer, not having plugins essentially hamstrings my ability to fiddle with the site, something I’m wont to do every few months.


I’ve also been investigating static site generators, which have intrigued me for a while. Compared to dynamic sites, a static site is blazing fast (since no calculations need to be performed, it just serves the pages), but they also come with some caveats (no dynamic content). At first glance, it seems like having a static site has more in common with having a Geocities site in the 90s than having a modern website.


But Javascript has come a long way since then, and comments (and other systems) can now work via services like Disqus which use Javascript, thus allowing dynamic content on a static site.


With that in mind, I’m going to convert this website to a JBake site (JBake is a Java-based static site generator) hosted on GitHub (for free–thank you GitHub!) The WiP site can be found here, the generated code for which can be found here. Finally, the JBake code can be found here.


I hope to document this process as it comes along. So far, I’ve got JBake building using Markdown and Thymeleaf on Gradle using this guy’s tutorial and plugins. That post’s a little out of date, so if you want to follow in my footsteps you may want to look through the JBake code’s Gradle files. I’ve licensed all the code under the GPLv2.


My next step’s going to be to export all my posts, images, tags, etc. from WordPress.com then convert all that into JBake content in Markdown. I hope to create a JBake or Gradle plugin for this process, so other people can as well.




 •  0 comments  •  flag
Share on Twitter
Published on December 19, 2015 06:02

December 8, 2015

It Follows

Buy on Amazon


Trigger warning for sex crimes involving children.


The Good

The monster in It Follows is an intriguing concept; it somehow distills the standard slasher villain into it’s most basic components while still feeling entirely new.


The monster is invisible to everyone other than its victims and can, itself, look like anyone. This combination breeds a special brand of paranoia into its victims, since nothing they see can be verified by anyone else and their stalker can be literally anyone they see.


True to its name, it follows. No matter where you go, it will walk directly toward you. The key word is walk; it’s not very fast. You can drive or fly, but it always knows where you are, and will always walk straight toward you. It can’t be fooled and, given its super strength, it can’t be stopped. Well, I would have actually liked a bit more explanation into this. Like, if you tricked it into jumping into a large pit, then filled that pit with quick drying cement, can it get out of that? How about molten lead? A fair few questions remain outside the scope of the movie. From a more practical standpoint, if you flew to Europe, could it cross the ocean? It seems like this should have been their first plan, but no one tried more than “drive an hour away”.


The Bad

Now that we’re post-Cabin In The Woods, can we stop using the standard set of protagonists? It’s boring. Yes, your “virgin” archetype isn’t really a virgin, but she’s still the archetype. Oh, your “jock” doesn’t actually play sports and is the “bad boy” of the school? The smart guy is also the stoner? Please try harder, or, even, at all.


After the core group gets past the belief curve everything plays out just about how you’d expect; the only surprises are the unintentionally uncomfortable ones (detailed below).


The Ugly (spoilers ahead)

How this monster chooses its targets is, well, presumably there was a “patient zero” at one point, we don’t know how this thing got started. But it can be transferred to another person by having sex with them. That’s right, this is the monster-personification of an STI. The only problem is, transferring it to someone makes it stop coming after you. So, essentially, this monster works via the real world, pervasive, and dangerous myth that has sprung up many times around the world: having sex will cure you of your infection. Usually, the myth says it’s sex with virgins, which typically means people are raping children to “cure” themselves of the disease. Not only does this fail spectacularly by not curing the infection, but it also spreads the infection and, oh yes, children were raped.


This happened with syphilis in Europe. It’s happening right now with HIV in Africa.


I can’t tell if the writers were aware of this, or just bumbled into it, but either way it’s pretty disgusting that this movie re-enforces the myth that having sex with someone will cure your “infection”. It seems like this is probably unintentional; going along with the theme of “distilling the classic slasher villain”, then sex has to have negative consequences (because for some reason that trope hasn’t died). But this is just gross in all the wrong ways.




 •  0 comments  •  flag
Share on Twitter
Published on December 08, 2015 17:33

July 29, 2015

Spoiler Review: Beyond the Shadows by Brent Weeks

Spoilers!

The first two books of the Night Angel trilogy I classify as very good popcorn books: incredibly readable, but not a lot else. Beyond the Shadows, however, transcends popcorn book status and becomes something legitimately great, and I'd like to talk about why, and I can't without spoilage.

Continue reading



 •  0 comments  •  flag
Share on Twitter
Published on July 29, 2015 17:34

July 16, 2015

I Am Not A Serial Killer by Dan Wells

I read it in one day.

The clear point of comparison for I Am Not A Serial Killer/John Cleaver is to Dexter, so let's start there. I like John better, as a character and a serial killer. Don't get me wrong, I really enjoy Dexter (also read 'em in a day), but I've never really been afraid of Dexter. Despite his total lack of empathy and tendency to murder, he blends in so well that I would gladly be his friend. We could golf, have barbecues. The wives and kids playing in the back yard while we drink something manly and appropriate and make quips about bloody meat (or something). Dexter is so in control that, for a serial killer, he's down-right cuddly.

Continue reading



 •  0 comments  •  flag
Share on Twitter
Published on July 16, 2015 16:45

The Martian by Andy Weir

The Martian by Andy Weir is the best hard science fiction I've ever read (disclaimer: I haven't read a lot of hard science fiction). Simultaneously hilarious, nail-biting, and heroic while being scientifically accurate (the final print version, at least). And, since it's science fiction in the very-near-future, there's little-to-no hand-waving; the technology in the book is technology we have and understand today.

Continue reading



 •  0 comments  •  flag
Share on Twitter
Published on July 16, 2015 15:59

July 4, 2015

Review: The Bonehunters by Steven Erikson

It's difficult for me to say too many good things about Steven Erikson's Malazan series, and the books have been getting even better.

Continue reading



 •  0 comments  •  flag
Share on Twitter
Published on July 04, 2015 11:17

June 10, 2015

Review: Firefight by Brandon Sanderson

Firefight is a serviceable sequel to the amazing Steelheart. We get a bit more of an understanding of the Epics and their powers, particularly where their powers come from... and not much else.

Continue reading



 •  0 comments  •  flag
Share on Twitter
Published on June 10, 2015 16:35