Skip to content

Instantly share code, notes, and snippets.

View DurandA's full-sized avatar

Arnaud Durand DurandA

View GitHub Profile
@MichaelLawton
MichaelLawton / install-bluez-5.43.sh
Created February 11, 2017 02:53
How to use web bluetooth in Chrome/Opera on Ubuntu 16.04
# Download and install BlueZ 5.43 and libreadline7 packages
wget http://mirrors.kernel.org/ubuntu/pool/main/r/readline/libreadline7_7.0-0ubuntu2_amd64.deb
wget http://ftp.debian.org/debian/pool/main/b/bluez/bluez_5.43-1_amd64.deb
sudo dpkg -i libreadline7_7.0-0ubuntu2_amd64.deb
sudo dpkg -i bluez_5.43-1_amd64.deb
# Restart system or BlueZ service
# Enable chrome://flags/#enable-experimental-web-platform-features and restart Chrome
anonymous
anonymous / Makefile.build
Created October 25, 2016 15:16
app_main.c
APP = hello
APP_MODULES = src
APP_FS_PATH = $(CURDIR)/fs
APP_CONF_SCHEMA = $(CURDIR)/src/conf_schema.yaml
MG_ENABLE_JS = 0
MG_ENABLE_CLUBBY = 0
MG_FEATURES = -DMG_ENABLE_HTTP_STREAMING_MULTIPART \
-DMG_NO_BSD_SOCKETS \
-DMG_LOCALS \
@cure53
cure53 / wasm.md
Last active October 17, 2023 00:16
Calling alert from WASM

Calling alert from WebAssembly (WASM)

This very simple and minimal tutorial documents in a few easy steps how to play with WebAssembly (WASM) and get first results within minutes.

While the code below is mostly useless, it will show, how to call the alert function from within a WASM file and thus demonstrate how to import and export DOM objects.

Of course, this exercise has no real use. It is just meant to show, that getting started with WASM isn't hard. And there is no need for a complex build-chain, tons of tools or a dedicated VMs. Just use a browser, one online tool and that's it.

And Now?

@genaromadrid
genaromadrid / ca_validation.md
Last active July 16, 2024 11:28
Validate a Certificate against a Certificate Authority using OpenSSL

Certificate CA Validation

The easy way

To validate a certificate agains a certificate authority you just have to run

openssl verify -trusted ca_root.pem -untrusted intermediate_ca.pem certificate.pem

You'll see a 'OK' message at the end of the output

@jbn
jbn / aiohttp_uptime_http_server.py
Created April 7, 2016 12:24
An example showing how to stream HTML in a aiohttp server.
import asyncio
from aiohttp import web
import subprocess
async def uptime_handler(request):
# http://HOST:PORT/?interval=90
interval = int(request.GET.get('interval', 1))
# Without the Content-Type, most (all?) browsers will not render
@mcgodfrey
mcgodfrey / servo_controller.v
Last active December 12, 2021 04:36
Servo controller in verilog. Takes an 8-bit position and converts it into the pwm signal required by a servo motor.
/*
servo controller
Based on code from Mojo tutorial
https://embeddedmicro.com/tutorials/mojo/servos
Takes an 8-bit position as an input
Output a single pwm signal with period of ~20ms
Pulse width = 1ms -> 2ms full scale. 1.5ms is center position
*/
module servo_controller (
@JonathanThorpe
JonathanThorpe / sipiradio.py
Last active October 14, 2024 09:00
Si473x i2c/i2s radio for Rasperrby Pi
#!/usr/bin/python3
import quick2wire.i2c as i2c
import time
import RPi.GPIO as GPIO
import alsaaudio
import threading
import logging
import sys
#Work in progress library for Si473x for Raspberry Pi by Jonathan Thorpe <[email protected]>
@chatchavan
chatchavan / README.md
Last active April 27, 2024 20:33
Setup Wifi on Raspberry Pi

Setup Wireless LAN for Raspberry Pi

The following guide describes how to setup Raspberry Pi to connect to Wifi. It was tested on the following environment:

  • Raspberry Pi Model B
  • Edimax EW-7811Un USB Wifi dongle
  • OS: Raspbian Jessie

Here are the overview of the steps:

@rctay
rctay / SimpleHTTPServerWithUpload.py
Created December 19, 2015 15:20 — forked from UniIsland/SimpleHTTPServerWithUpload.py
Simple Python Http Server with Upload
#!/usr/bin/env python
"""Simple HTTP Server With Upload.
This module builds on BaseHTTPServer by implementing the standard GET
and HEAD requests in a fairly straightforward manner.
"""
@bloodearnest
bloodearnest / selfsigned.py
Last active March 25, 2025 18:33
Create a self-signed x509 certificate with python cryptography library
# Copyright 2018 Simon Davy
#
# 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