• 0 Posts
  • 41 Comments
Joined 11 months ago
cake
Cake day: August 23rd, 2023

help-circle

  • You’re likely not going to find a premade dashboard that does exactly what you want, but grafana is extremely powerful if you’re willing to put in the time to learn it. There are ways to visualize things across hosts without having to configure things separately for every host. If you’re using the same mechanism to scrape metrics from each (sounds like you’re using prometheus + node exporter?), this could be as simple as adding a by (node) (or whatever the label name is if it’s not node) grouping to the query on each panel.









  • I’m not actually familiar with truenas or its ui, but if you have kubectl access you should be able to poke around in the logs and see what’s going on. I’m not sure if these logs are shown in the ui anywhere. With helm, there are so many different things it could be that there’s no use in speculating without some logs.








  • Python

    Easy one today

    code
    import pathlib
    
    base_dir = pathlib.Path(__file__).parent
    filename = base_dir / "day9_input.txt"
    
    with open(base_dir / filename) as f:
        lines = f.read().splitlines()
    
    histories = [[int(n) for n in line.split()] for line in lines]
    
    answer_p1 = 0
    answer_p2 = 0
    
    for history in histories:
        deltas: list[list[int]] = []
        last_line: list[int] = history
    
        while any(last_line):
            deltas.append(last_line)
            last_line = [last_line[i] - last_line[i - 1] for i in range(1, len(last_line))]
    
        first_value = 0
        last_value = 0
        for delta_list in reversed(deltas):
            last_value = delta_list[-1] + last_value
            first_value = delta_list[0] - first_value
    
        answer_p1 += last_value
        answer_p2 += first_value
    
    print(f"{answer_p1=}")
    print(f"{answer_p2=}")