Google Analytics

Friday, July 14, 2017

Mountebank Config File Issue and a Lesson At My Expense

tl;dr: Back up your stuff, and you have to create mountebank config files in something other than VisualStudio.

Okay, the first lesson to dole out for the day is to back up your blog entry drafts as you write them. I am currently going back through some projects we have been working on cleaning up and reworking tests to get better coverage (and finding some issues along the way, which has made this a very worthwhile excercise). In trying to get some tests working locally, I discovered they rely on mountebank, an incredibly handy code package that acts as a test double for downstream services. Tests were failing because I hadn't reinstalled mountebank locally since I had a crash about six weeks ago. 

So, I got mountebank re-installed. Some of the tests needed to be re-worked so. In doing so I ran into an extremely frustrating issue where MB just won't accept a configuration file. I was working from home, so my wife was suddenly an audience for the flood of expletives I can unleash at times while doing this job. After her admonishment and composing myself I realized I had run into this exact smae issue before. More on this later. I remembered I had even written down the exact nature of the issue before. I set about tryiing to find just exactly what had happened to what I wrote.

I remember thinking that it would make for a good blog post. Looking at my published blog posts, however, turned up nothing. Had I just saved it locally and then never published it? The crash I mentioned before was actually an issue with our corporate encryption software. Basically every file that I had created locally had been encrypted by the software, which then suddenly stopped recognizing that I was who I said I was and wouldn't decrypt anything. This included config files for software I used every day, which all then stopped working. Anyway, long story short, I lost basically everything I had written and only saved locally.

At one point I had sent out some notes to my fellow teammates on using mountebank. Maybe I had included my write-up for them. One sent me back that email, which included a couple links on getting started with MB, along with a note saying "I was looking forward to reading your blog post on it."  Argh!

So here I am re-creating that post along with the lesson for all to save those blog posts as drafts online, or somewhere where they will eventually be lost to corporate encryption perdition.

I'm going to make this a series of posts, building incrementally, since there is a lot of depth to mountebank that can be explored. With that in mind, I want to wrap this initial post up with a rundown of the problem I ran into once again yesterday,

You can begin running the mountbank API simply with the command 'mb' on the command line and then making a series of posts to it to set up the services you intend to impersonate. I've found for automated testing purposes it is simpler to pass a configuration file as an .ejs file. 

mb --configfile "C:/path/to/my/config.ejs"

The .ejs extension allows you to use javaScript and javaScript variables directly in the file, something to explore later. The issue is when you create this .ejb file in VisualStudio, VS does something to add additional info to the file which causes MB to choke on the file. MB will throw an error that the JSON in the file is incorrect. You will then spend the next half hour looking for stray brackets or misplaced commas and then copying in the content of previously-created files that work just fine and pulling out your hair.

Then you will try opening the file in a text editor like Notepad++ and re-copying the contents in, to discover that doesn't work either. Then you'll check to confirm that the .ejs file is being copied to the correct location upon build. You have to delete the file and re-create it in something other than VS. Notepad++ works just fine. I'm not sure if VS Code works. I've discovered now that this is an issue with both VS 2015 and VS 2017 (since my rebuild of the computer now has the latest VS).

Hope this helps out some of you to save both time and hair. My next post will hopefully get one at least started using mountebank for testing purposes.

Wednesday, June 14, 2017

The other day a friend passed away... err, well it was an acquaintance. No, Mike was a friend. I'm going to stick with that. I knew him because he came into Yesterday's while I was bartending. I guess it was a long battle with cancer and fuck cancer by the way. I hadn't thought of him for a while. Sometimes I see people out flying an UltraLight and I remember that Mike was the first person I knew who did that.

I haven't seen him in almost twenty years, so I can't exactly say I'll miss him. But I have to say... and this is my reason for writing this post... Mike was one of the most genuine people I've ever met, and I would be lucky if my boys treated people the same way Mike did. I liked Mike, probably loved him, but probably the highest compliment I could give to him is that if my boys treated people the same way Mike did, I'd be blessed.

Monday, February 13, 2017

Some thoughts before I go mad or burst into little toads...

This is going to sound like the ravings of a mad man. The book I just read, Carlo Rovelli's Seven Brief Lessons on Physics, would kind of predict that though, right? Einstein must have sounded like a lunatic when he suggested that time runs differently for different people depending on their context. 

As the saying goes, Time is what keeps everything from happening at once. The thing is, everything does happen all at once. It's only our observations that link these tings together. I will suggest, and I'm sure that it has already been suggested, is what differentiates the past from the future is that in the future we can predict with greater probability what will happen in the next future instant.

I once had the thought that if we could effectively fly all over the universe and make observations at the speed of light, time would essentially be meaningless. We could observe the the position, speed, and vector of every molecule, every atom, every subatomic particle, and from there extrapolate where they would be in the next instance and the next after that. We could build out a model of where every little molecule would be in the very next moment and what effect that would have on all the molecules around it at any given instance. Once we built out that model we could move back and forth through it, back and forth through time, over and over wherever we wanted to be at whatever moment. Then Mr. Heisenberg came into the mix.

Heisenberg, besides producing the finest meth that New Mexico has to offer, said that we couldn't predict with certainty the position and momentum of physical particles. Throw Mr. Schrödinger's cat into the mix and what it comes down to is that we can only say where those particles are or are going with some level of probability. So our reality is really only a hazy cloud of electrons and photons and quarks that we accept as solid because subsequent observations lead us to some probability that you and I exist and this keyboard I'm typing with is a solid structure of plastic molecules.

I learned today that probability is the reason that heat moves from warmer things to cooler things rather than vice-versa. It took me a moment to understand what Rovelli was talking about, but imagine this: you have a 20-degree rock and surround it with an equal mass of 80-degree water. (In a closed system, so disregard heat loss to the air, etc.) Within a given amount of time we would expect the rock to heat to 50 degrees and the water to cool to that temperature. Why doesn't the water heat to 100 degrees and the rock cool to 0 degrees? It has to do with probability. It IS possible for the second effect to occur, just really, really, REALLY unlikely. It is far more likely that the excited molecules of water will have their energy dissipate to the atoms of the cool rock rather than the rock's atom's transferring additional momentum to the water's. And that dissipation of heat and energy is how we see the flow of time. Probability leads us along a certain path rather than back.

Another thought occurs to me that because we are actually conscious of how time flows, we can change the universe, change the probability of the next moment just with a thought. Or maybe I can't. Maybe there is no multiverse, just this single universe and no matter what happens, I am fated to think and act a certain way no matter what. I hate the thought of that. In the larger scheme of things, I suppose that doesn't really matter.

Rovelli's book, along with Hawking's assertion that information isn't actually destroyed by a black hole counteracts the meaninglessness I felt after reading The Road. Surely you are thinking that I am truly straddling the border of real lunacy now. I can't explain it any more now than I could explain the utter void I felt after reading The Road. I know that none of this means anything. Me writing this only means as much weight as I personally give to it. In the larger scheme of things these words are utterly meaningless. In the utter scheme of things, however, finding a cure for cancer is only slightly more meaningful. We'll need a new way of thinking, of thinking about ourselves and our places in the surrounding universe, else we all will truly go mad.

There are approximately 100 billion stars in our galaxy and approximately 100 billion galaxies in the known universe. That means there are literally at least 10 billion-trillion stars that we know about. we are tiny specks of dust within tiny specks of dust. But maybe we can change the universe with a thought?

Update: They did this cool little succinct website in conjunction with Rovelli's book: http://www.sevenbrieflessons.com/.

Friday, January 20, 2017

The Jen!

Every year on this date I take a minute to do something that I should do much more often, contemplate how fortunate I am to have met and married my best friend. On this day of this year in particular I feel remarkably proud of Jennifer. I know how hard she has worked to be where she is. I could not do what she does - the long hours, late nights and early mornings, and still putting on a smile to deal with difficult people. Every year, every month, every day with her is a true blessing for me. So once again today I am privileged to celebrate her. She's my favorite thing to celebrate!

Sunday, July 10, 2016

On kissing.

A question was posed today, on an internet group that I regularly check in on, of what was your most romantic kiss. I've been thinking about it all morning. I've been married twice. There really is something special about kissing your spouse for the first time in front of all your friends and family. I wouldn't exactly say it's romantic though. When Jen first kissed me after saying yes to wanting to marry me, despite the unromantic setting of the nightclub where we met, that was pretty romantic. But probably the most romantic kiss I had was in France, New Year's Day 1991. For the record, all kisses in France are pretty romantic.

This one particular one stands out though. This girl who I adored came over with my Mom and Mike to see me. It was New Year's Eve and she and I were at a party in Grenoble. They played the song "New Year's Eve" by U2, because of course they did. We kissed. I don't know if it was at midnight or something else. What I do remember is thinking that I felt like things couldn't really get much better. I was young, in love, in France, and kissing a beautiful girl. It doesn't get much better than that, right?

Actually, it does. The romance there in France didn't exactly carry over back to the States. Not being in France has a tendency to eliminate a lot of romance. Like, I said, I've been married twice and there has been a lot of romance in the meantime. That kiss, though, carried with it the lesson that kissing means a whole lot. Ironically, it happened in France where I learned to kiss every acquaintance on each cheek practically ever day (which I do wish we would adopt as a habit in the U.S.!). But a kiss truly carries with it so much more of a message than "Hey, I kind of like you." It has the power to change people, maybe for the moment, maybe for the day, or year. Or maybe they'll think back on it 25 years later.

At the very least, good kisses make for good stories. The best kisses, of course, come from my wife's lips and the most romantic moments I have spent have probably been on our front porch swing. If there is any bit of a romantic in me though, in a small part it comes from kissing a girl in the earliest moments of 1991.

Wednesday, May 25, 2016

Been a While

It's been a while since I posted here. Lots has happened. I'm in a new job at Nordstrom. Jen's in a new job at Southwest. The Broncos even won a Super Bowl since I last wrote. You would have thought I would have posted a bunch about that. I should have. I'm regretting having been away. 

When I post here I want to post things that others will find interesting. Maybe I should pay attention to those things that I find interesting, because it is times like now that I sort of wonder what I've really been thinking about through last fall and the past winter. Ah well, life springs anew.

What I'd love to do is detail some of the cool things we're doing here at Nordstrom regarding creating software solutions in the cloud, Amazon's AWS to be specific. In the past, the posts here that got the most attention were those regarding Wix. I think that is because I was doing things using Wix that hadn't previously been very well documented before. Not that I documented a whole lot that was new. However, I figured every small problem that I had to scratch out meant someone else would run into it at sometime or another. So I blogged about it.

I'd love to do the same with the AWS things we are doing. We're doing things with AWS that I'm sure not many other people are already doing (in the relative sense), particularly because much of what we are doing is still using Windows and Microsoft tools. (The documentation for using AWS with PowerShell is particularly lacking.) In fact, I will be blogging about it, but most of the details I will be keeping from public eyes, so I'm not sure just how useful it will be outside of Nordstrom. Still, if you are interested in particulars, hit me up, and maybe I'll be able to share.

Jen and I started watching season one of Mr. Robot, and it has me even more paranoid about cyber-security than when I was programming election software. I don't want to give too many details about how we're building an application knowing there are people out there who are after whatever tidbit of information they can get in order to hack credit cards. Not that I don't think what we are creating is secure. It is; perhaps overly so. But no use in giving out information that isn't necessary.

All I'm saying is that I'm dying to blog about these things, but they will necessarily be in rather general terms. 

Friday, September 11, 2015

I'm going back to my GhostDoc post because I'm trying to set it up once again for myself after setting up a new dev. environment. I'm super-annoyed to see how horribly Blogger handled the XML Doc markup and annoyed at myself for not noticing it before.

I'd have to go back into the HTML view (and sift through how horribly Blogger creates its own markup) to add it all in correctly. I may just rewrite the article and make it available to download somewhere if people want. Or maybe I'll really try and go through and fix the markup.

Anyway, if you tried to use the post as reference before, I apologize and hope that maybe you found some things useful, even if the format of the XML sucked.