Skip to content

Instantly share code, notes, and snippets.

@badouralix
badouralix / VSCODE.md
Last active March 6, 2024 14:25
Personal vscode settings

Personal vscode settings

code --list-extensions | sort | pbcopy
cat $HOME/Library/Application\ Support/Code/User/keybindings.json | pbcopy
cat $HOME/Library/Application\ Support/Code/User/settings.json | pbcopy
diff <(cat $HOME/Library/Application\ Support/Code/User/settings.json) <(curl https://gist.githubusercontent.com/badouralix/f003f3dcec20f1660e8b132e1b76596b/raw/settings.json -s)
use std::io::prelude::*;
use std::net::{TcpListener, TcpStream};
fn handle_client(mut stream: TcpStream) {
println!("Youpi");
let mut buffer = Vec::new();
stream.read_to_end(&mut buffer).unwrap();
println!("{}", buffer.len());
// println!("{buffer:?}");
stream.write(&buffer).unwrap();
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
@badouralix
badouralix / adventofcode-2021-day-11-part-1.go
Last active December 22, 2021 03:02
Broken solution for https://adventofcode.com/2021/day/11 with octopuses' energy reset right after reaching level 9
package main
import (
"fmt"
"io/ioutil"
"os"
"strconv"
"time"
)
@badouralix
badouralix / adventofcode-2021-day-21-part-2.go
Created December 22, 2021 03:01
Broken solution for https://adventofcode.com/2021/day/21, not sure why it does not work
package main
import (
"fmt"
"io/ioutil"
"os"
"strings"
"time"
)
@badouralix
badouralix / docker-inspect-badouralix-toolbox.diff
Created October 17, 2021 20:46
Manifest diff between a dockerhub automated build and a github actions buildx
--- /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 / README.md
Last active October 12, 2021 09:33
Install dnsperf on ubuntu - 2021 edition
@badouralix
badouralix / openmetrics.yaml
Last active October 9, 2021 15:05
Datadog autodiscovery annotations for openmetrics
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 / INSTALL.md
Created October 4, 2021 22:04
Small example of a dependency problem in python ecosystem
$ 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 22:03
Nginx in rancher configuration for datadog monitoring
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;