Manually pushing to Loki

There’s a very under-documented sharp edge in Loki: you need to give it timestamps as a string, and they need to be a nanosecond epoch. Minimal example: #!/usr/bin/env python3 from json import dumps from requests import post from time import time loki_url = ‘http://localhost:3100/loki/api/v1/push’ def loki_timestamp(): return f”{(int(time() * 1_000_000_000))}” payload = { ‘streams’: [ […]

Disney: not so magical

I’ve always been a “back of the house” kind of person. I don’t really do plot or story or emotion, but show me cool technical production and I’m all over it. I have some fond memories of doing Disney as a kid- particularly getting to ride in the front of the monorail with the operator- […]

The MEIPO Framework

I made this up out of whole cloth to help someone with mock interviews, but I think it’s broadly applicable to a lot of situations, particularly interview questions or technical conversations.  The idea is to work through goals from a high level to a nitpicky level of detail in an orderly way. Let’s say someone […]

How to manage Windows services with Salt

Suppose, not entirely hypothetically, that you need to manage a Windows service with Salt. You’re grabbing an executable from, I don’t know, say GitHub, and you want to be able to easily upgrade the service. You might start with something like this (I’m omitting other stuff you need to set up the service): windows_service_exe_file: file.managed: […]

On writing résumés

I know that the market is hot, especially in the tech business.  Regardless of industry, background, or skillset, you need to answer to one important question: How do you add value? This isn’t difficult.  Include a “summary” or “objective” section.  Tell me what you’re about.  How do you solve problems?  Do you like to dive […]

Online reviews are a scam

This may come as no surprise to many folks. And I’m fairly sure that Google won’t exactly promote the facts, or this post. But it’s true: try writing a truthful negative review for a business you’ve had problems with. I’ll bet you it gets hidden. But of course, Google won’t tell you that it’s hidden. […]

Black-Scholes functions for Google Sheets

// THANK YOU! brazenly stolen from // within the spreadsheet, of course, you can just use =NORMSDIST(X) function normalcdf(X){ //HASTINGS. MAX ERROR = .000001 var T=1/(1+.2316419*Math.abs(X)); var D=.3989423*Math.exp(-X*X/2); var Prob=D*T*(.3193815+T*(-.3565638+T*(1.781478+T*(-1.821256+T*1.330274)))); if (X>0) { Prob=1-Prob } return Prob } /** * Provides d1 for Black-Scholes. * * @param {30} DTE T-t in days to expiration […]

Handy commit hook

I try really hard to set myself up for success in the sense that I believe in setting up my environment to discourage mistakes (poka-yoke). I’ve been known to leave Office files open while I’m working in git, and occasionally things can get confused. To wit, I present a pre-commit hook that will prevent a […]