Skip to content

Instantly share code, notes, and snippets.

Install MicroPython and running python scripts on ESP32
Tools required
esptool.py: pip install esptool
ampy: pip install adafruit-ampy
Download firmware for ESP32 from MicroPython: http://micropython.org/download#esp32
Installation
Erase flash on ESP32: esptool.py --port /dev/tty.SLAB_USBtoUART erase_flash
@edwios
edwios / genMakeFile_nRF52.sh
Last active October 9, 2017 11:35
Script to generate SRC_FILES and INC_FOLDERS in Makefile
#!/bin/bash
# Script to generate SRC_FILES and INC_FOLDERS in Makefile
#
# Require:
# app_config.h
#
# Output:
# SRC_FILES
# INC_FOLDERS
@edwios
edwios / build-ovpn.sh
Last active March 13, 2019 06:05
Build OpenVPN .ovpn file
#!/bin/bash
#
# Tool to build ovpn file sutable for distribution to client machines.
#
# Install:
# Put inside /etc/openvpn/clients
#
# Usage:
# build-ovpn.sh name_of_ovpn_file
#
@edwios
edwios / Jigglebone.cs
Created November 27, 2018 05:40
Jiggle bone for Unity
//
// Jiggle Bone (Simple version)
// - by WarpZone
//
// TO USE:
// Simply attach this script to any Transform in your model's hierarchy.
//
// FEATURES:
// - It doesn't matter what the forward normal of your bone is, it just works.
// - Bounce and sway can be configured independently
# git clone https://github.com/CMU-Perceptual-Computing-Lab/openpose.git
# cd openpose
# mkdir build
# cd build
# cmake -DOpenCV_INCLUDE_DIRS=/home/stli/deeplearning/opencv_3.4/opencv-3.4.0/build/install/include \
-DOpenCV_LIBS_DIR=/home/stli/deeplearning/opencv_3.4/opencv-3.4.0/build/install/lib \
-DCaffe_INCLUDE_DIRS=/opt/movidius/caffe/build/install/include \
-DCaffe_LIBS=/opt/movidius/caffe/build/install/lib/libcaffe.so -DBUILD_CAFFE=OFF ..
# make -j`nproc`
@edwios
edwios / motherless_dl.sh
Last active February 21, 2019 07:42
Extract video from Motherless
#!/bin/bash
REFR=$1
if [ -z "${REFR}" ]; then
echo -n "Motherless URL?"
read REFR
fi
FN=`basename ${REFR}`.mp4
if [ -e "${FN}" ]; then
FN=`basename ${REFR}`_$$.mp4
fi
@edwios
edwios / VRMSizeFixer.cs
Last active March 12, 2019 02:23
VRM Size Fixer: to fix the size difference of those VRoid models in Unity
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class VRMSizeFixer : MonoBehaviour {
public float minSize;//調整後の最小サイズ
public float maxSize;//調整後の最大サイズ
public GameObject VRMModel;//対象のモデル
private Transform transSelf;
private Animator anime;
@edwios
edwios / openvpn_setup.sh
Created March 13, 2019 06:02
Script to setup OpenVPN server and keys
# Create nologin openvpn user
adduser --system --shell /usr/sbin/nologin --no-create-home openvpn
apt install openvpn easy-rsa
apt install iptables-persistent
# Enable IPv4 forwarding
# Optional disable a bunch of IPv6 related stuff
vi /etc/sysctl.d/99-sysctl.conf
sysctl -p
# Create Cert directory
make-cadir /etc/openvpn/certs
using UnityEngine;
using System.Collections;
public class changecolor : MonoBehaviour
{
public Color[] colors;
private Vector3 positionxyz;
public Color Rcolor;
void OnTriggerEnter(Collider other)
@edwios
edwios / newscr.md
Last active November 6, 2019 02:15
Test of Net.ReadNetFromONNX()

Markdown test

/*** script shows Dnn.ReadNetFromONNX() is not supported ***
 * Error shown was:
Assets/Scripts/newscr.cs(15,36): error CS0117: 'Net' does not contain a definition for 'ReadNetFromONNX'
***/

using System.Collections;
using System.Collections.Generic;