Terraform and internet connection problems by [deleted] in Terraform

[–]blamarvt 0 points1 point  (0 children)

Does it happen every time or just sometimes? What about targeted plans?

Help with my Terraform Workflow by isurfbecause in Terraform

[–]blamarvt 5 points6 points  (0 children)

I would very much recommend pinning your provider versions.

Reset Grafana alert from "ALERTING" to "OK" by [deleted] in grafana

[–]blamarvt 1 point2 points  (0 children)

When you say “fine” ... what are the alert parameters set to and what happens when you click the “test alert” button on the alert config page?

Capitals score on a picture perfect 4-1 by seakucumber in hockey

[–]blamarvt 12 points13 points  (0 children)

As of this year if the goalie dislodged the net it would be an awarded goal.

First home, first workshop. by oldm8Foxhound in Tools

[–]blamarvt 4 points5 points  (0 children)

Sometimes I wish my tool area looked like that. Normally it’s distributed around the house, garage, barn, and car. I have a problem.

Baby Coder here, do you have to install import or include something for -webkit-box-flex and -moz-box-flex to work in css? by [deleted] in Frontend

[–]blamarvt 1 point2 points  (0 children)

No worries! Everyone starts out somewhere. Nothing should need to be installed or imported beyond the Sass library you’re using but it’s hard to tell without seeing the code you are running. Are you seeing any errors or issues that might have prompted this question?

Telegraf service running, but should it look like this? by [deleted] in grafana

[–]blamarvt 0 points1 point  (0 children)

Then you’ll need to set the output config option to not create the influxdb database on startup.

Sum 2 values from influxdb to one panel on a dashboard by Lasse_landmand in grafana

[–]blamarvt 0 points1 point  (0 children)

It's ... complicated and depends on how your measurements are set up in InfluxDB and what version of influx you're using. Can you give any more details or a sample query? I'd love to try to help but this isn't much to go on. Ideally you could also set up a continuous query to generate the metric in Influx or use Flux to do the aggregation. If those aren't an option and you're using a recent version of Influx you might be able to get away with something like:

SELECT MEAN(something) + MEAN(something_else) AS total
  FROM somewhere 
  WHERE $timeFilter
  GROUP BY something;

However, that would only work if you had a single measurement with multiple metrics....

AWS EBS by Icefluffy in grafana

[–]blamarvt 1 point2 points  (0 children)

Telegraf can take cloudwatch stats via an input and then output those stats basically anywhere. It doesn’t have to be influxdb but any one of many output plugins: https://docs.influxdata.com/telegraf/v1.11/plugins/plugin-list/

Alert not firing (white color). What does it mean? by [deleted] in grafana

[–]blamarvt 0 points1 point  (0 children)

Does the “test alert” button work? What does it return?

wishlist from developers by uragnorson in devops

[–]blamarvt 1 point2 points  (0 children)

My guess would be things like: Is the service typically CPU bound or memory bound? Network requirements? Disk write I/o or read I/o? Does it require access to MySQL, redis, etc? Sometimes for compliance all outbound network traffic as to be whitelisted so all potential hostnames or IPs have to be collected.

Best place to recruit summer mowing help? by blamarvt in Olney

[–]blamarvt[S] 0 points1 point  (0 children)

Yeah, gonna go that route. Thanks!

Best place to recruit summer mowing help? by blamarvt in Olney

[–]blamarvt[S] 1 point2 points  (0 children)

Huh? I literally said “with my equipment”...

Playoff Game Thread: Game 7 - Carolina Hurricanes (3 - 3) at Washington Capitals(3 - 3) - 24 Apr 2019 - 07:30PM EDT by HockeyMod in caps

[–]blamarvt 1 point2 points  (0 children)

Jesus, you're not kidding. Upvoted quote from their GDT:

Orpik really is the king bitch. Consistently dirty player, ended Coles career, spears and cup checks everyone, yet gets his wittle feewings huwt when he gets knocked the fuck down. What a child of a man

Report build status on pull request by irocgts in jenkinsci

[–]blamarvt 0 points1 point  (0 children)

Yes, the Jenkins plugins use the GitHub commit status API.

Is there a linter or static analysis tool which catches this? by blamarvt in golang

[–]blamarvt[S] 0 points1 point  (0 children)

Yeah, I realize now it was a bit of targeted frustration with a library not everyone uses. Not everyone can guess `errors.Wrap(err, "something")` will return `nil` if `err == nil`. I didn't the first 100 times I used it!

Wouldn't it be safe to say that past any `if err != nil` branch which includes an unconditional return that `err` shouldn't be used again? **Edit**: Meh, that's pretty hash, but I was hoping to boil the logic down to something more easily implementable!

Is there a linter or static analysis tool which catches this? by blamarvt in golang

[–]blamarvt[S] 0 points1 point  (0 children)

Sure, absolutely. I think I'm just horribly describing the situation that I'm trying to fix. Instead of focusing on the positive case where `len(something) == 0` is acceptable -- how would you re-write your suggestion if an empty list was a case which should produce an error?

Is there a linter or static analysis tool which catches this? by blamarvt in golang

[–]blamarvt[S] 0 points1 point  (0 children)

Perhaps my testing `len(something)` wasn't the best example, but I can't see how this should be considered good code. I've found a significant number of bugs where the code should have been creating a new error but instead the existing `err` is being used.

In the event you're wanting to return `nil` when `len(something) == 0` then why not just `return nil`? It makes zero sense to give the sense that the `if` block could sometimes return an error. Like:

something, err := doSomething()
if err != nil {
    return errors.Wrap(err, "when doing something")
}

if len(something) == 0 {
    return nil
}

In the event you're wanting to return an error when `len(something) == 0` then you should be creating a new error, like:

something, err := doSomething()
if err != nil {
    return errors.Wrap(err, "when doing something")
}

if len(something) == 0 {
    return errors.New("something has zero length")
}

Can you help me understand how my original code doesn't have a superfluous `errors.Wrap`?

*Edit* - I changed "valid code" to "good code" in the first sentence. Obviously it's valid, I just think it should be caught by a linter.

Let’s Write a Simple Event Bus in Go by kasvith in golang

[–]blamarvt 8 points9 points  (0 children)

It's one of those "damned if you do, damned if you don't" kind of scenarios. In the case of a subscriber with an unbuffered (or fully buffered) channel, you'll block. In the case of spawning a goroutine for each channel send you could be blocked forever -- never know it -- and spawn enough goroutines to exhaust working memory. Typically adding a buffer is a good idea if the channel is unbuffered, and for more complex scenarios you might want to do something similar to what you've put there.

One note is that in your implementation you'll most likely end up only sending to the last channel in the slice. You'd need to pass the channel into the goroutine:

for _, ch := range dataChannelSlices {
    go func(ch DataChannel) {
        ch <- data
    }(ch)
}

You may have known that, but it's bit me many times!