Skip to content

Instantly share code, notes, and snippets.

View yunqu's full-sized avatar
🏠
Working from home

Yun Rock Qu yunqu

🏠
Working from home
View GitHub Profile
@yunqu
yunqu / eth0
Created July 19, 2018 18:18
Enable USB-Ethernet using USB port on PYNQ of Ultra96 board
# /etc/network/interfaces.d/eth0
auto eth0
iface eth0 inet dhcp
@yunqu
yunqu / wifi_connect.ipynb
Last active July 19, 2018 18:36
Useful notebook to connect to WiFi
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@yunqu
yunqu / makefile
Last active August 8, 2018 22:45
Easy script to locate relevant files (with changing yocto machine name) in petalinux project
all:
@echo "1. Found $(YOCTO_IMAGE_NAME)"
@echo "2. Found $(YOCTO_RPM_NAME)"
PLNX_IMAGES_FOLDER := /opt/builds/PYNQ_20180606/sdbuild/build/Pynq-Z2/petalinux_project/build/tmp/deploy/images
PLNX_RPM_FOLDER := /opt/builds/PYNQ_20180606/sdbuild/build/Pynq-Z2/petalinux_project/build/tmp/deploy/rpm
YOCTO_IMAGE_NAME := $(shell find $(PLNX_IMAGES_FOLDER) \
-wholename '*/*.tgz' | grep -E '(.*)/modules-\1\.tgz' )
YOCTO_RPM_NAME := $(shell find $(PLNX_RPM_FOLDER) \
-wholename '*/*.rpm' | grep -E '(.*)/kernel-devsrc-1.0-r0.\1\.rpm' )
@yunqu
yunqu / install.sh
Created October 8, 2018 23:30
enable jupyter notebook/lab ipywidgets and plotly
# run as sudo
pip3 install --upgrade bqplotly
pip3 install --upgrade ipywidgets
pip3 install --upgrade plotly
@yunqu
yunqu / ggc.sh
Created October 9, 2018 16:21
Start greengrass core service on board
# one time only
sudo tar -xzvf greengrass-OS-architecture-1.6.0.tar.gz -C /
sudo tar -xzvf GUID-setup.tar.gz -C /greengrass
cd /greengrass/certs/
sudo wget -O root.ca.pem http://www.symantec.com/content/en/us/enterprise/verisign/roots/VeriSign-Class%203-Public-Primary-Certification-Authority-G5.pem
# every time
cd /greengrass/ggc/core/
sudo ./greengrassd start
@yunqu
yunqu / common.cmake
Created March 8, 2019 00:42
Install opencv 3.1.0
# This file is included from a subdirectory
set(PYTHON_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../")
ocv_add_module(${MODULE_NAME} BINDINGS)
ocv_module_include_directories(
"${PYTHON_INCLUDE_PATH}"
${PYTHON_NUMPY_INCLUDE_DIRS}
"${PYTHON_SOURCE_DIR}/src2"
)
@yunqu
yunqu / redis-warnings.md
Last active April 17, 2019 17:30
Resolve redis server warnings when booting up ray

Go to your log folder as instructed when you start ray.

cat redis-shard_0.out

You may see the following warnings.

875:C 17 Apr 2019 16:32:39.561 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
5875:C 17 Apr 2019 16:32:39.561 # Redis version=5.0.3, bits=64, commit=00000000, modified=0, pid=5875, just started
@yunqu
yunqu / check_os_package.py
Created April 22, 2019 20:42
Code to check OS package in Python
import re
import shutil
import subprocess
rootfs_packages = {
'jupyter': '4.4',
'python3-opencv': '3.2.0',
'lm-sensors': '1'
}
@yunqu
yunqu / CMakeLists.txt
Created May 1, 2019 17:12
CMake for PYNQ package
PROJECT(PYNQ)
CMAKE_MINIMUM_REQUIRED(VERSION 3.0.0)
SET(PROJECT_DESCRIPTION "https://github.com/Xilinx/PYNQ")
SET(CMAKE_CXX_STANDARD 14)
SET(CMAKE_CXX_STANDARD_REQUIRED ON)
MESSAGE("-- Target system processor: ${CMAKE_SYSTEM_PROCESSOR}")
SET(PYNQ_VERSION_MAJOR 2)
SET(PYNQ_VERSION_MINOR 5)
SET(PYNQ_VERSION_STRING ${PYNQ_VERSION_MAJOR}.${PYNQ_VERSION_MINOR})
MESSAGE("-- PYNQ version: ${PYNQ_VERSION_STRING}")
@yunqu
yunqu / dtbo_led_demo.ipynb
Last active May 10, 2019 22:07
LED demo using device tree overlay
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.