Skip to content

Instantly share code, notes, and snippets.

View mcarbonneaux's full-sized avatar

CARBONNEAUX Mathieu mcarbonneaux

View GitHub Profile
@mcarbonneaux
mcarbonneaux / esphome_config.yaml
Created May 7, 2024 11:41 — forked from skylord123/esphome_config.yaml
Wiegand ESP32-POE config
esphome:
name: west_warehouse_access_control
platform: ESP32
board: esp32-poe
includes:
- custom_components/wiegand_device/wiegand_device.h
ethernet:
use_address: west_warehouse_access_control
type: LAN8720
@mcarbonneaux
mcarbonneaux / README.md
Created March 18, 2024 09:51 — forked from saulshanabrook/README.md
Saving Web Crypto Keys using indexedDB

This is a working example on how to store CryptoKeys locally in your browser. We are able to save the objects, without serializing them. This means we can keep them not exportable (which might be more secure?? not sure what attack vectors this prevents).

To try out this example, first make sure you are in a browser that has support for async...await and indexedDB (latest chrome canary with chrome://flags "Enable Experimental Javascript" works). Load some page and copy and paste this code into the console. Then call encryptDataSaveKey(). This will create a private/public key pair and encrypted some random data with the private key. Then save both of them. Now reload the page, copy in the code, and run loadKeyDecryptData(). It will load the keys and encrypted data and decrypt it. You should see the same data logged both times.

@mcarbonneaux
mcarbonneaux / Self-Signed SSL with SAN.md
Created January 14, 2024 17:16 — forked from KeithYeh/Self-Signed SSL with SAN.md
Create self-signed SSL certificate with SubjectAltName(SAN)

How to create a self-signed SSL Certificate with SubjectAltName(SAN)

After Chrome 58, self-signed certificate without SAN is not valid anymore.

Step 1: Generate a Private Key

openssl genrsa -des3 -out example.com.key 2048

Step 2: Generate a CSR (Certificate Signing Request)

@mcarbonneaux
mcarbonneaux / bash_regex_match_groups.md
Created October 11, 2023 14:22 — forked from JPvRiel/bash_regex_match_groups.md
Bash regular expression match with groups including example to parse http_proxy environment variable

The newer versions of bash include a regex operator =~

Simple example

$ re='t(es)t'
$ [[ "test" =~ $re ]]
$ echo $?
0
$ echo ${BASH_REMATCH[1]}
es
# activate the virtualenv
source /home/superset/.virtualenvs/superset/bin/activate
fabmanager reset-password --app superset --username admin --password enteryournewpassword
SELECT table,
formatReadableSize(sum(bytes)) as size,
min(min_date) as min_date,
max(max_date) as max_date
FROM system.parts
WHERE active
GROUP BY table
@mcarbonneaux
mcarbonneaux / Makefile
Created July 3, 2023 21:12 — forked from joostd/Makefile
Use xmllint to validate SAML 2.0 metadata (or similarly, any other SAML document) using an XML Catalog file
all: saml-2.0-os xsd/xenc-schema.xsd xsd/xmldsig-core-schema.xsd xcatalog/saml-metadata.xml
saml-2.0-os:
mkdir -p saml-2.0-os
wget http://docs.oasis-open.org/security/saml/v2.0/saml-2.0-os.zip
unzip -d saml-2.0-os saml-2.0-os.zip *.xsd
xcatalog/saml-metadata.xml:
mkdir -p xcatalog
xmlcatalog --noout --create xcatalog/saml-metadata.xml
@mcarbonneaux
mcarbonneaux / opnsense_add_OCSP_stapling.md
Created June 22, 2023 15:25 — forked from Da-Juan/opnsense_add_OCSP_stapling.md
opnsense/haproxy: add OCSP stapling support

Here is a work around to automate OCSP stapling on Opnsense with HAproxy plugin.

Hope it helps :)

I created a script based on acme.sh's haproxy deploy hook.

As /tmp is emptied on reboot you need to regenerate ocsp files on startup so I put the script as a startup script: /usr/local/etc/rc.syshook.d/start/99-ocsp (symoblic links in rc.syshook.d don't work).

#!/bin/sh                          
@mcarbonneaux
mcarbonneaux / vcredistr.md
Created May 18, 2023 19:25 — forked from ChuckMichael/vcredistr.md
Visual C++ Redistributable Packages

Microsoft Visual C++ Redistributable Packages

  • Microsoft Visual C++ 2005 Redistributable Package
    • x64 8.0.61000 (EOL)
    • x86 8.0.61001 (EOL)
  • Microsoft Visual C++ 2008 Redistributable Package
    • x64 9.0.30729.6161 (EOL)
    • x86 9.0.30729.6161 (EOL)
  • Microsoft Visual C++ 2010 Redistributable Package
  • x64 10.0.40219.473
<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
xmlns:bal="http://schemas.microsoft.com/wix/BalExtension"
xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
<Bundle
Name="Example Product"
Version="1.2.3.4"
Manufacturer="John Doe"
Copyright="© 2022 John Doe"