Skip to content

Instantly share code, notes, and snippets.

View mpeven's full-sized avatar

Mike Peven mpeven

View GitHub Profile
@mpeven
mpeven / op_flow.py
Created April 6, 2018 18:19
Put optical flow arrows on an image
import cv2
import numpy as np
def put_optical_flow_arrows_on_image(image, optical_flow_image, threshold=2.0, skip_amount=30):
# Don't affect original image
image = image.copy()
# Turn grayscale to rgb if needed
if len(image.shape) == 2:
@mpeven
mpeven / profile.txt
Created November 29, 2017 22:28
oh no, this algo, for voxel flow, is too slow
Total time: 425.367 s
File: ntu_rgb.py
Function: get_voxel_flow_full at line 699
Line # Hits Time Per Hit % Time Line Contents
==============================================================
699 @profile
700 def get_voxel_flow_full(self, vid_id):
701 ''' Create a voxel grid with displacement vectors '''
702
TARGET = prog
LIBS = -lm -lcurl -ljson-c
CC = gcc
CFLAGS = -g -Wall
.PHONY: default all clean
default: $(TARGET)
all: default
/*
* Device Application
* ------------------
* This is the brains of the device.
* It serves 2 functions:
* 1) Updating the backend with all the relevant data.
* 2) Changing settings when certain things happen
* (ULPM, turning access to data on/off)
*/
@mpeven
mpeven / captive_portal.sh
Last active January 10, 2023 00:47
iOS captive portal
# Captive portal setup
########################################################
sudo apt-get update -qq
sudo apt-get install -qq dnsmasq vim hostapd ufw dnsutils netstat-nat conntrack nginx php5 php5-common php5-fpm
sudo mkdir /usr/share/nginx/html/portal
sudo useradd nginx
sudo chown nginx:www-data /usr/share/nginx/html/portal
sudo chmod 755 /usr/share/nginx/html/portal
########################################################
@mpeven
mpeven / usb_setup.sh
Last active June 15, 2016 13:31
Wifi in; USB out
# First get wifi using the GUI then run this shit
sudo apt-get -qq install dnsmasq hostapd isc-dhcp-server ufw dnsutils netstat-nat
##################################################
# Update network interfaces
#
cat << EOF > /etc/network/interfaces
source-directory /etc/network/interfaces.d
auto lo
@mpeven
mpeven / wifi_setup.sh
Last active December 22, 2018 14:52
wifi in ---- wifi out
# bring WiFi in from the panda adapter on wlan1
# push WiFi out from the built in adapter on wlan0
##################################################
# Install dnsmasq to provide IP addresses (via dhcp)
# Install hostapd to be an access point
#
sudo apt-get -qq install dnsmasq hostapd isc-dhcp-server ufw dnsutils netstat-nat
##################################################
# Update network interfaces
#
@mpeven
mpeven / yocto_setup.sh
Last active June 7, 2016 22:13
Yocto build: AP and Cellular
# This version:
# brings WiFi in from the Huawei adapter on eth1
# pushes WiFi out from the built in adapter on wlan0
# sets up an ip address on 192.168.5.2 to ssh into from another computer
# Update network interfaces
#
cat << EOF > /etc/network/interfaces
auto lo
@mpeven
mpeven / setup.sh
Last active July 21, 2017 07:34
Pi3 Hotspot Huawei-in WiFi-out
# This version:
# brings WiFi in from the Huawei adapter on eth1
# pushes WiFi out from the built in adapter on wlan0
# sets up an ip address on 192.168.5.2 to ssh into from another computer
##################################################
# Update
#
#sudo apt-get update
#sudo apt-get -qq upgrade