Skip to content

Instantly share code, notes, and snippets.

View DurandA's full-sized avatar

Arnaud Durand DurandA

View GitHub Profile
@DurandA
DurandA / wpa_supplicant.conf
Created December 13, 2016 12:52
wpa_supplicant.conf for secure-unifr
network={
ssid="secure-unifr"
key_mgmt=WPA-EAP
auth_alg=OPEN
eap=PEAP
identity="<identity>"
password="<password>"
ca_cert="/etc/certs/QuoVadis_Root_CA_2.pem"
phase2="MSCHAPV2"
}
@DurandA
DurandA / Makefile
Created March 13, 2018 09:54
CryptoAuthLib makefile for Linux I2C userspace
.PHONY: all libcryptoauth libateccssl libpkcs11 dist install clean
OPTIONS := ATCAPRINTF ATCA_HAL_I2C ENGINE_DYNAMIC_SUPPORT USE_ECCX08 ECC_DEBUG
SYSTEM_INCLUDES := /usr/include
# Define helpful macros for interacting with the specific environment
BACK2SLASH = $(subst \,/,$(1))
SLASH2BACK = $(subst /,\,$(1))
FIND = $(shell find $(abspath $(1)) -name $(2))
@DurandA
DurandA / thingy-server.js
Last active November 2, 2018 04:53
Thingy:52 Web Thing server using webthing-node
const {Action, Event, Property, Thing, WebThingServer} = require('./index');
const uuidv4 = require('uuid/v4');
var Thingy = require('thingy52');
var Color = require('color');
console.log('Reading Thingy environment sensors!');
class ButtonEvent extends Event {
constructor(thing, state) {
@DurandA
DurandA / pom.xml
Last active February 18, 2020 12:58
Software Engineering I Maven template
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>ch.unifr.diuf.softeng</groupId>
<artifactId>exercise0-duranda-gremaupa</artifactId>
<version>1</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>11</java.version>
</properties>
@DurandA
DurandA / litex_client.py
Created July 15, 2019 20:53
LiteScope SoC definition for the TinyFPGA BX
from litex.tools.litex_client import RemoteClient
from litescope.software.driver.analyzer import LiteScopeAnalyzerDriver
wb = RemoteClient(csr_csv="test/csr.csv")
wb.open()
analyzer = LiteScopeAnalyzerDriver(wb.regs, "analyzer", debug=True, config_csv="test/analyzer.csv")
analyzer.configure_subsampler(1) ## increase this to "skip" cycles, e.g. subsample
analyzer.configure_group(0)
@DurandA
DurandA / Makefile
Created August 6, 2019 12:39
NextPNR makefile for TinyFPGA BX
# Makefile borrowed from https://github.com/cliffordwolf/icestorm/blob/master/examples/icestick/Makefile
#
# The following license is from the icestorm project and specifically applies to this file only:
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
@DurandA
DurandA / config.json
Last active November 3, 2019 22:03
esp32-ble2mqtt config
{
"wifi": {
"ssid": "eduroam",
"eap": {
"method": "PEAP",
"ca_cert": "/certs/QuoVadis_Root_CA_2.pem",
"username": "MY_USERNAME",
"password": "MY_PASSWORD"
}
},
@DurandA
DurandA / aes-ni.c
Last active August 1, 2023 12:35 — forked from acapola/aes-ni.c
AES128 how-to using GCC and Intel AES-NI
#include <stdint.h> //for int8_t
#include <wmmintrin.h> //for intrinsics for AES-NI
//compile using gcc and following arguments: -g;-O0;-Wall;-msse2;-msse;-march=native;-maes
//internal stuff
//macros
#define DO_ENC_BLOCK(m,k) \
do{\
m = _mm_xor_si128 (m, k[ 0]); \
@DurandA
DurandA / subflow.json
Created November 21, 2019 13:25
Node-RED Thingy:52 subflow
[
{
"id": "aa418b47.80ad28",
"type": "subflow",
"name": "thingy subflow",
"info": "",
"category": "thingy",
"in": [
{
"x": 400,
@DurandA
DurandA / autotag.py
Created December 8, 2019 00:28
Tag git commits according to the author
#!/usr/bin/env python3
import subprocess
tags = {
'[email protected]': 'tagname'
}
fetch = subprocess.run(['git', 'fetch', 'origin', 'master'], stderr=subprocess.DEVNULL)
assert(fetch.returncode == 0)