Skip to content

Instantly share code, notes, and snippets.

View adventofcode-2021-day-24-input.txt
inp w inp w inp w inp w inp w inp w inp w inp w inp w inp w inp w inp w inp w inp w
mul x 0 mul x 0 mul x 0 mul x 0 mul x 0 mul x 0 mul x 0 mul x 0 mul x 0 mul x 0 mul x 0 mul x 0 mul x 0 mul x 0
add x z add x z add x z add x z add x z add x z add x z add x z add x z add x z add x z add x z add x z add x z
mod x 26 mod x 26 mod x 26 mod x 26 mod x 26 mod x 26 mod x 26 mod x 26 mod x 26 mod x 26 mod x 26 mod x 26 mod x 26 mod x 26
div z 1 div z 1 div z 1 div z 26 div z 1 div z 1 div z 26 div z 26 div z 1 div z 26 div z 1 div z 26 div z 26 div z 26
add x 11 add x 14 add x 13 add x -4 add x 11 add x 10 add x -4 add x -12 add x 10 add x -11 add x 12 add x -1 add x 0 add x -11
eql x w eql x w eql x w eql x w eql x w eql x w eql x w eql x w eql x w eql x w eql x w eql x w eql x w eql x w
eql x 0 eql x 0 eql x 0 eql x 0 eql x 0 eql x
View adventofcode-2021-day-21-part-2.go
package main
import (
"fmt"
"io/ioutil"
"os"
"strings"
"time"
)
@badouralix
badouralix / adventofcode-2021-day-11-part-1.go
Last active Dec 22, 2021
Broken solution for https://adventofcode.com/2021/day/11 with octopuses' energy reset right after reaching level 9
View adventofcode-2021-day-11-part-1.go
package main
import (
"fmt"
"io/ioutil"
"os"
"strconv"
"time"
)
@badouralix
badouralix / docker-inspect-badouralix-toolbox.diff
Created Oct 17, 2021
Manifest diff between a dockerhub automated build and a github actions buildx
View docker-inspect-badouralix-toolbox.diff
--- /dev/fd/12 2021-10-17 22:41:24.781976179 +0200
+++ /dev/fd/13 2021-10-17 22:41:24.782659614 +0200
@@ -1,16 +1,18 @@
[
{
- "Id": "sha256:72d07b8a8fe82dd9b2bfbd0563cde24bef1f96850d24fe5064d8f4332a1d69ad",
- "RepoTags": [],
+ "Id": "sha256:aee45b190f924dc26249645e038a168a5d5d25ca857e39452efa5e0c6c70c532",
+ "RepoTags": [
+ "badouralix/toolbox:latest"
@badouralix
badouralix / openmetrics.yaml
Last active Oct 9, 2021
Datadog autodiscovery annotations for openmetrics
View openmetrics.yaml
apiVersion: v1
kind: Pod
metadata:
name: {{ $pod_name }}
labels:
service: {{ $service }}
annotations:
ad.datadoghq.com/{{ $container_name }}.check_names: '["openmetrics"]'
ad.datadoghq.com/{{ $container_name }}.init_configs: '[{}]'
ad.datadoghq.com/{{ $container_name }}.logs: |
@badouralix
badouralix / README.md
Last active Oct 12, 2021
Install dnsperf on ubuntu - 2021 edition
View README.md
@badouralix
badouralix / INSTALL.md
Created Oct 4, 2021
Small example of a dependency problem in python ecosystem
View INSTALL.md
$ poetry install
Updating dependencies
Resolving dependencies... (0.2s)

  SolverProblemError

  Because no versions of black match >21.9b0,<22.0
   and black (21.9b0) depends on typing-extensions (>=3.10.0.0), black (>=21.9b0,<22.0) requires typing-extensions (>=3.10.0.0).
  And because tensorflow (2.6.0) depends on typing-extensions (>=3.7.4,<3.8.0)
@badouralix
badouralix / status.conf
Created May 30, 2021
Nginx in rancher configuration for datadog monitoring
View status.conf
server {
listen 81;
server_name localhost;
access_log off;
allow 127.0.0.1;
allow 172.17.0.0/16; # docker bridge cidr
allow 10.42.0.0/16; # rancher managed cidr
deny all;
@badouralix
badouralix / large.py
Created May 2, 2021
PoC of an interesting buggy behavior in Python.
View large.py
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
PoC of an intresting buggy behavior in Python.
"""
from pprint import pprint
@badouralix
badouralix / Dockerfile
Last active Jun 24, 2020
RPi Garden - small project to take care of Lily
View Dockerfile
# Build dependencies
FROM python:3.7-alpine AS build
RUN apk update && apk add build-base
COPY requirements.txt /tmp/requirements.txt
RUN pip install --install-option="--prefix=/requirements" --requirement /tmp/requirements.txt
# Build runtime image
FROM python:3.7-alpine
COPY --from=build /requirements /usr/local
COPY garden.py /usr/local/bin/garden