Just one geek's opinions and epiphanies

The Interview


Spoilers ahead, you've been warned.

I had the opportunity tonight to watch The Interview starring James Franco, and Seth Rogen. There has been a lot in the news lately about this movie, and the chaos surrounding the films release. If you aren't familiar with it all, well, this isn't a recap of all that. This is my thoughts on the movie.

The long and short of it is this, people are really hating on the movie. I am sure most of this conversation is because of all the hype the movie had, with the press, and actions in cyber security surrounding the film. Basically, it was another Seth Rogen and James Franco movie.

If you saw This is the End, that also starred Seth Rogen, and James Franco, then you basically saw The Interview. Except instead of rapture, it's Kim Jong Un. The two Americans are teamed up in an awkwardly homosexual relationship and they are thrown against odds to defeat some super power. They experience drugs and they ultimately conquer something.

If you are expecting an amazing film with a lot of laughs, then this probably isn't the film for you. If you are looking for a few laughs, some carnage and Seth Rogen being awkwardly persued by James Franco, then this is the movie for you.

I rather enjoyed the film, but I think it was because I was expecting it to suck more than it did. All in all, good film.

Fedora 21 Launched!


Well, Fedora 21 is in the wild... time to update my workstation. Back in a while

Seattle Social Experiment #1 Update


Seattle Social Experiment #1 Update

Well I have to say I am really surprised. I have gone two weeks with a 12-pack in the fridge at the office, and not once has a can gone missing. Color me surprised. I am impressed. I guess I was wrong in my hypothesis.

What shall I experiment with next?

Seattle Social Experiment #1


Background

Back in September I took a position at Zulily, and I moved to Seattle. As I am sure is no surprise to anyone, in Seattle Coffee is king! I mean, it has it's own Wikipedia Page. Unfortunately I never really acquired the taste for hot coffee. Iced is fine. However, there are no iced coffee machines in my office.*

The Problem

So what is the problem? There is caffeine in the office, right? Yes, but as I stated I don't like hot coffee, I am more of a cold drink guy. In fact, my drink of choice is Mtn Dew.

Time to tldr this puppy. 1 set of vending machines, with 0 bottles of MtnDew (also those bottles are $1.50 a pop, screw that!) The closest store with MtnDew to the office is 50ft in elevation change (up hill) and they only sell 1 liter bottles, and those are almost $3. Safeway sells 12-packs for about $4. Some quick math:

  • 1 liter = 33.814oz = $3 = $0.08/oz
  • 12-pack of 12oz cans (144oz) = $4 = $0.02/oz

The rest of the problem is how to drink cold Mtn Dew. There is only 1 way to get ice in the office, it is 1 city block and 1 stair case away. Too far, and it turns off at 2pm, so there is no cold drinks after 2. Insane.

The Experiment:

Against my better judgement I have decided to bite the bullet and put a 12-pack in the fridge. I plan to take a few stabs at this with the following being the hypothesis:

Phase 1

A lone 12-pack will be raided (taken without payment or thanks)

If this happens, well it happens. I won't fault those who take my Mtn Dew, it is an amazing drink.

Phase 2

Phase two of the experiement will be a 12-pack with a sign that reads:

Please don't drink my Mtn Dew -- Bear

I figure this will lose less Mtn Dew, but it isn't as friendly to those craving the sweet nectar. Which brings me to phase three of my plan.

Phase 3

A 12-pack with a sign that reads:

1 Can = 2 Quarters ($50)

I will leave a small paper cup at the bottom. I will either earn a little coin, or lose coin and MtnDew.

Let the experiment begin.

Salting Random Crons


So you want to create a random cron, with Salt... here's how:

random-cron:
  cron.present:
    - name: /usr/bin/someCronScript
    - minute: {{ range(0,59,1)|random }}
    - hour: {{ range(0,23,1)|random }}

That lovely snippet will create a cron that runs daily at a random hour and random minute. They are statically added to the crontab, but they are assigned randomly.

What we have here is a declaration that runs cron.present and sets the parameters name, minute, and hour.

name is the line that is executed when the cron fires

minute is passed some jinja {{ range(0,59,1)|random }}

Let's break that down further. Inside the mustaches ({{) we use the range function range() which takes 3 parameters. The first is the starting number, here we have 0. The second is the ending number, we have 59. The third parameter is optional and takes the step of the range. We have selected 1, which is the default. This gives us a range of numbers from 0 to 59. Finally we pass that through the filter random, which picks one of the numbers are random.

We repeat this process for hour but with 0 through 23 for the hours of the day.

Finally cron.present will give us a * for the other cron times.

We are provided with (something similiar to) the following in our cron tab:

17 13 * * * /usr/bin/someCronScript

And that is how you assign a random cron time with Salt.