Skip to content

Instantly share code, notes, and snippets.

View jasonmnemonic's full-sized avatar

Jason M jasonmnemonic

View GitHub Profile
@jasonmnemonic
jasonmnemonic / mac-vendor.txt
Created November 9, 2020 13:59 — forked from aallan/mac-vendor.txt
List of MAC addresses with vendors identities
000000 Officially Xerox
000001 SuperLAN-2U
000002 BBN (was internal usage only, no longer used)
000003 XEROX CORPORATION
000004 XEROX CORPORATION
000005 XEROX CORPORATION
000006 XEROX CORPORATION
000007 XEROX CORPORATION
000008 XEROX CORPORATION
000009 powerpipes?
@jasonmnemonic
jasonmnemonic / usb-rndis.sh
Created November 10, 2020 13:26 — forked from hardillb/usb-rndis.sh
A script to configure libcomposite USB Ethernet Gadget that will be recognised by Windows based on https://github.com/RoganDawes/P4wnP1/blob/62b5c40d9461e4b80998c54830625d6c855833f0/boot/init_usb.sh
#!/bin/bash
cd /sys/kernel/config/usb_gadget/
mkdir -p pi4
cd pi4
echo 0x1d6b > idVendor # Linux Foundation
echo 0x0100 > idProduct # change to get Windows to rescan while testing
echo 0x0100 > bcdDevice # v1.0.0
echo 0x0200 > bcdUSB # USB2
@jasonmnemonic
jasonmnemonic / README.md
Created November 12, 2020 10:26 — forked from Gadgetoid/README.md
Raspberry Pi Zero / Windows 10 automatic RNDIS driver install for composite gadgets

Preface

I owe my very rapid learning journey in the world of ConfigFs to several key sources which aren't necessarily relevant to this result, but I feel deserve a mention anyway.

@jasonmnemonic
jasonmnemonic / rpi4-usb.sh
Created November 12, 2020 11:03 — forked from ianfinch/rpi4-usb.sh
Raspberry Pi 4 USB Gadget
#!/bin/bash
# Set up a Raspberry Pi 4 as a USB-C Ethernet Gadget
# Based on:
# - https://www.hardill.me.uk/wordpress/2019/11/02/pi4-usb-c-gadget/
# - https://pastebin.com/VtAusEmf
if ! $(grep -q dtoverlay=dwc2 /boot/config.txt) ; then
echo "Add the line dtoverlay=dwc2 to /boot/config.txt"
exit
fi
@jasonmnemonic
jasonmnemonic / receipt5.md
Created November 16, 2020 16:28
How to make a Raspberry Pi an RTSP streamer and how to consume this?

RTSP streaming from Raspberry PI

Introduction

This gist describes the necessary software installation steps for a Raspberry PI in order to enable the PI's camera to act as an external camera for the Dragonfly Java application. This gist shows, how to make a Raspberry PI an RTSP streaming server. The resulting feed can then be used as input for the Dragonfly Java app or the Accuware Dragonfly Demo - Calibration Mode server. The RTSP server on the Raspberry PI must be made publicly available, if calibration is a requirement.

Prerequisites

@jasonmnemonic
jasonmnemonic / rpio.md
Created December 2, 2020 13:26 — forked from jperkin/rpio.md
Raspberry Pi GPIO Comparison

Comparing node.js GPIO implementations

Here are two simple programs testing the performance of my rpio library against popular alternatives which use the /sys interface (with the number of npm stars indicated for a rough idea of popularity).

rpi-gpio (9 stars)

This test is based on an example on the rpi-gpio page.

As modules which uses /sys depend upon asynchronous behaviour they require callbacks to ensure that the next operation starts only when the previous one has completed.

@jasonmnemonic
jasonmnemonic / i2c.c
Created December 14, 2020 16:13 — forked from JamesDunne/i2c.c
C library for reading/writing I2C slave device registers from Raspberry Pi 1 Model B
#include <stdio.h>
#include <string.h>
#include <fcntl.h>
#include <linux/i2c-dev.h>
// Terrible portability hack between arm-linux-gnueabihf-gcc on Mac OS X and native gcc on raspbian.
#ifndef I2C_M_RD
#include <linux/i2c.h>
#endif
@jasonmnemonic
jasonmnemonic / gcc compiler optimization for arm systems.md
Last active December 18, 2020 10:52 — forked from hostmaster/gcc compiler optimization for arm systems.md
GCC compiler optimization for ARM-based systems

GCC compiler optimization for ARM-based systems

2017-03-03 fm4dd

The gcc compiler can optimize code by taking advantage of CPU specific features. Especially for ARM CPU's, this can have impact on application performance. ARM CPU's, even under the same architecture, could be implemented with different versions of floating point units (FPU). Utilizing full FPU potential improves performance of heavier operating systems such as full Linux distributions.

-mcpu, -march: Defining the CPU type and architecture

These flags can both be used to set the CPU type. Setting one or the other is sufficient.

@jasonmnemonic
jasonmnemonic / mosquitto.hpp
Created March 1, 2021 16:26 — forked from grisu48/mosquitto.hpp
Mosquitto C++ Wrapper
/**
* Mosquitto C++ Wrapper
* (C) 2017, Felix Niederwanger
* MIT License
*/
#ifndef _MOSQUITTO_HPP_
#define _MOSQUITTO_HPP_
#include <string>
@jasonmnemonic
jasonmnemonic / AES.c
Created March 4, 2021 10:00 — forked from grisu48/AES.c
A simple example of using AES encryption in Java and C.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
/*
* MCrypt API available online:
* http://linux.die.net/man/3/mcrypt
*/
#include <mcrypt.h>