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 / build-bazel-qemu-arm.md
Last active February 19, 2022 01:49
Build Bazel on QEMU for Pynq-Z1/Pynq-Z2

Building Bazel on armv7l QEMU

Here you'll learn how to build Bazel for Pynq-Z1 (image v2.4). A similar flow can be run directly on the board (native build). However, this guide is based on QEMU flow, which is running faster and cleaner than a native build on the board.

The same flow can also target aarch64 (ZCU104). You just have to work with the correct image (instead of Pynq-Z1-2.4.img, work with ZCU104-2.4.img).

@yunqu
yunqu / build-bazel.md
Last active May 25, 2022 02:43
Building the bazel package for aarch64 on Amazon A1

Building Bazel for aarch64

I am building bazel for aarch64 on Amazon A1 platform. This flow is pretty nice and much easier than the QEMU flow which is prone to QEMU bugs.

Requirement

  • An Amazon A1 platform running Ubuntu 18.04.
@yunqu
yunqu / build-ray.md
Last active October 12, 2022 07:54
Building Ray for aarch64

Building Ray for aarch64

There are multiple ways to build ray on aarch64 processors. We will use the PYNQ image v2.4 with Ubuntu 18.04 OS as an example. In this document, we will introduce 2 approaches to build ray; we will always prefer the second approach (building on Amazon A1) since it is faster, cleaner, and easy to reproduce.

Building from Source on the Target

@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