Skip to content

Instantly share code, notes, and snippets.

View mixaz's full-sized avatar

Mikhail Zemlyanukha mixaz

  • freelancer
  • Russia
View GitHub Profile
@mixaz
mixaz / starfive1_boot.log
Created February 7, 2023 08:33
StarFive VisionFive1 RISC-V PCB boot log, Fedora image
[gmixaz@gmixaz-thinkpad ~]$ head my.log -n 200
picocom v3.1
port is : /dev/ttyUSB0
flowcontrol : none
baudrate is : 115200
parity is : none
databits are : 8
stopbits are : 1
escape is : C-a
@mixaz
mixaz / MessageLoggingTransport.java
Last active August 8, 2022 00:00
Java XML-RPC transport with logging and filtering NIL values
import java.io.BufferedReader;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.apache.xmlrpc.XmlRpcException;
@mixaz
mixaz / rpi_copyrootfs.sh
Last active September 21, 2020 16:22
Bash script to extract rootfs from Raspbian images
#!/bin/bash
PATH=/sbin:${PATH}
set -e
usage()
{
cat <<EOF
@mixaz
mixaz / TF_opencv.md
Last active February 6, 2019 10:02
Installing TensorFlow app with OpenCV shared lib dependency on Beaglebone Black (BBB)

Building a TF app with dependencies (OpenCV) for ARM target (Beaglebone Black).

  1. Build (cross compile) TF application using https://github.com/lhelontra/tensorflow-on-arm, using Bazel and TF binary in-source build (tf_cc_binary bazel target). It will have no dependencies, except ones added by your code (OpenCV in my case). No TF runtime needs to be installed on target device.

tensorflow-on-arm config needs changes to build your app target, instead default build-pip-package. Building apps with C API (tf_cc_binary) is described at https://www.tensorflow.org/guide/extend/cc (not available at time of this writting).

For your app Bazel BUILD script you will probably need to specify dependencies (OpenCV libs and include headers in my case), which in turn may depend on their dependencies, so I used -rpath-link option to point to target's sysroot lib folders.

  1. On target device install OpenCV dependencies. I built OpenCV on device (had to disable Python modules in OpenCV configuration, since BBB has 500Mb RAM
@mixaz
mixaz / copy_diff_files.sh
Last active July 5, 2017 16:10
Copies all changed files (but not new or deleted ones) from AOSP tree, via 'repo' command
# usage:
# source build/envsetup.sh
# ./copy_diff_files.sh <folder to copy files to>
export T=$ANDROID_BUILD_TOP/$1
mkdir -p $T
repo forall -c 'mkdir -p $T/$REPO_PATH && cp -pv --parents `git diff --name-only` $T/$REPO_PATH'