Skip to content

Instantly share code, notes, and snippets.

@alpapad
alpapad / make-local-cert.sh
Created September 6, 2022 06:41 — forked from jdeathe/make-local-cert.sh
Generate a Root CA + Intermediate CA for local (internal) use on Mac OSX using cfssl and add the intermediate certificate to your keychain so it can be trusted by your local browser.
#!/usr/bin/env bash
# REF: https://github.com/cloudflare/cfssl
# Change working directory
cd -- "$(
dirname "${0}"
)" || exit 1
readonly CA_ROOT_CERT_KEY="ca-root"
# 0. ON WINDOWS :
# On windows, to check which WSL you use, type ` wsl --list --verbose ` in admin cmd.
# If you are not in WSL2, reinstall the machine with WSL2 : https://docs.microsoft.com/fr-fr/windows/wsl/install-win10
# 1. Make sure you are running with systemd
# sudo systemctl must not say "Failed to connect to bus"
# If so, I recommand you to reinstall the VM. You can try this repo too : https://github.com/DamionGans/ubuntu-wsl2-systemd-script.git
# 2. On WSL2 machine
# /!\ Create an user with A PASSWORD and with sudo access
@alpapad
alpapad / docker-wsl2.md
Created September 4, 2022 09:13 — forked from martinsam16/docker-wsl2.md
How to install wsl2 ubuntu + docker + docker-compose

Activate wsl2

dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
wsl --set-default-version 2

Install and Configure Ubuntu

@alpapad
alpapad / vwcdavr nano v3
Created August 31, 2022 11:58 — forked from olii/vwcdavr nano v3
vwcdavr nano v3, cd changer emulator
// Copyright http://www.audi-a6.com.ua/viewtopic.php?f=30&t=5557&start=20#p127185
// Tested with Arduino Nano v3 Atmega328p
// Head unit tested: Skoda Symphony CD
// Connect pin 11 with DataIn
// pin 13 with Clock
// Gnd to Gnd
// no need to connect DataOut unless you need advanced features
@alpapad
alpapad / arduino_audi_cdc.ino
Created August 31, 2022 11:45 — forked from chemicstry/arduino_audi_cdc.ino
Audi Concert Radio CDC protocol for arduino
// works also with ATMEGA8 - tested
// SPI PINS used for transfer from CDCemulator to RADIO:
// MOSI (arduino pin 11) -> DataIN
// CLK (arduino pin 13) -> CLK
#include <SPI.h>
//#include <SoftwareSerial.h>
#define PREV 9 //PB1,pin 15
#define PLAY 5 //PD5, pin 11
@alpapad
alpapad / Jenkinsfile
Created November 20, 2018 10:36 — forked from Romeh/Jenkinsfile
pipeline {
// run on jenkins nodes tha has java 8 label
agent { label 'java8' }
// global env variables
environment {
EMAIL_RECIPIENTS = 'mahmoud.romeh@test.com'
}
stages {
stage('Build with unit testing') {
import java.util.*;
public class MutableJson {
public static void main(String[] args) {
MutableJson json = new MutableJson(
new HashMap<String, Object>() {{
put("store", new HashMap<String, Object>() {{
put("name", "Some Store");
put("books", Arrays.asList(