Skip to content

Instantly share code, notes, and snippets.

View superboum's full-sized avatar
💮
Working for Deuxfleurs

Quentin Dufour superboum

💮
Working for Deuxfleurs
View GitHub Profile
@superboum
superboum / Cargo.toml
Created April 28, 2024 07:32
Example of a custom Hickory Rust DNS server (custom Authority)
[package]
name = "dns"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
tokio = { version = "1", features = ["full"] }
hickory-server = "0.24.1"
@superboum
superboum / LICENCE.txt
Last active April 12, 2024 22:23
Install Debian with Debootstrap + Grub EFI
MIT LICENSE
Copyright 2018 Quentin Dufour
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR TH
@superboum
superboum / benchmark-base.md
Last active March 9, 2024 10:12
Benchmark your disk with FIO

Install FIO on Ubuntu/Debian:

sudo apt update
sudo apt install -y fio lshw

Install FIO on Fedora:

@superboum
superboum / sms.py
Created November 6, 2017 19:07
Python script to easily send messages to your phone via the Free Mobile API
#!/usr/bin/python3
import requests, sys
payload = {
'user': sys.argv[1],
'pass': sys.argv[2],
'msg': sys.stdin.read()
}
r = requests.get("https://smsapi.free-mobile.fr/sendmsg", params=payload)
@superboum
superboum / README.md
Last active December 16, 2023 16:48
android debloat
@superboum
superboum / droneci-secret-dump.go
Created February 25, 2022 08:35
Decode/Dump Drone CI secrets from database
package main
import (
"bufio"
"os"
"crypto/aes"
"crypto/cipher"
"encoding/hex"
"errors"
"fmt"
@superboum
superboum / git_ci.sh
Created March 14, 2023 14:56
git get specific commit
mkdir mydest ; cd mydest
git init
git remote add origin https://git.deuxfleurs.fr/Deuxfleurs/garage.git
git fetch origin 703ac43f1c7c0538ac72a06afc16ad182c3aaba1
git checkout 703ac43f1c7c0538ac72a06afc16ad182c3aaba1 -b branch_name
qemu-system-x86_64 -enable-kvm \
    -m 4G -smp 4 \
    -device virtio-vga-gl,xres=1280,yres=720 \
    -serial mon:stdio \
    -display sdl,gl=on,show-cursor=on \
    -usb -device usb-mouse -device usb-kbd  -device usb-tablet \
    -net user,hostfwd=tcp::8022-:22 -net nic \
    -drive format=raw,file=chromiumos_qemu_image.bin
    
foc = 45 * pow(10, -3)
conf = 0.03 * pow(10, -3)
for ouv in [3.5, 4, 5.6, 8, 11, 16]:
hyper = (foc * foc) / (ouv * conf) + foc
ppn = (hyper * hyper) / (hyper + (hyper - foc))
print(f"{ouv} {round(hyper, 1)}m {round(ppn, 1)}m")
for ouv in [3.5, 4, 5.6, 8, 11, 16]:
hyper = (foc * foc) / (ouv * conf) + foc
for p in [1, 1.25, 1.5, 1.75, 2, 2.5, 3, 4, 5, 7, 10, 20]:
@superboum
superboum / kdbx_xml_to_csv.py
Created January 13, 2022 15:06
Convert Keeweb XML output to KeepassXC CSV
import xmltodict,collections,csv
def group(v, out):
if 'Entry' in v:
item = v['Entry']
if isinstance(item, collections.OrderedDict):
entry(item, out)
elif isinstance(item, list):
for e in item:
entry(e, out)