Skip to content

Instantly share code, notes, and snippets.

@KunYi
KunYi / setup OpenVINO 2019R3.txt
Created November 18, 2019 09:12
install OpenVINO 2019 R3 on Ubuntu 18.04 with Python3 for demo
# install steps for people_counting demo
# for Ubuntu 18.04 AMD64 & OpenVINO 2019R3
sudo apt update
sudo apt install vim curl wget apt-transport-https net-tools python3 python3-pip
cd Download
curl http://registrationcenter-download.intel.com/akdlm/irc_nas/15944/l_openvino_toolkit_p_2019.3.334.tgz
tar -xvzf l_openvino_toolkit_p_2019.3.334.tgz
cd l_openvino_toolkit_p_2019.3.334/
sudo ./install_GUI.sh
cd /opt/intel/openvino/install_dependencies/
@KunYi
KunYi / setup Yocto for NXP i.MX8 build env on Ubuntu 18.04.txt
Last active July 19, 2022 11:46
setup Yocto/NXP i.MX8 build environment on Ubuntu 18.04
# prepare common tools
sudo apt update
sudo apt upgrade
sudo apt install git gitk build-essential vim curl wget software-properties-common apt-transport-https ca-certificates
# add visual studio code repository
wget -q https://packages.microsoft.com/keys/microsoft.asc -O- | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main"
# add docker repository
@KunYi
KunYi / WMIPowerTest.c
Created November 26, 2019 02:50
WMI - MSPower_DeviceEnable demo
#include "stdafx.h"
#include <atlbase.h>
#include <atlstr.h>
#include <stdio.h>
#include <wbemidl.h> // For WMI
#pragma comment(lib, "wbemuuid.lib") // Link to WMI library.
// ref.
// https://docs.microsoft.com/en-us/windows/win32/wmisdk/creating-a-wmi-application-using-c-
@KunYi
KunYi / read SMBIOS data from kermel.txt
Created November 26, 2019 12:02
using WMI to read SMBIOS in Kernel Mode
copy from http://www.databaseforum.info/15/18/760a1fec0efb9bc0.html
Drivers >> Attn: Eliyas Yakub [MSFT] Re: SMBIOS info from kernel mode
Eliyas,
Thanks for your previous post on the subject. I was able
to successfully read the Raw SMBIOS data with minor
modifications. This data matches the data returned by
wbemtest for RawSMBiosTable instance as seen in the MOF
#include <windows.h>
#include <cfgmgr32.h>
int main()
{
DEVINST devParentInst = 0;
DEVINST devInst = 0;
CONFIGRET status = 0;
const DEVINSTID_W PhantomDevNode = (DEVINSTID_W)L"ROOT\\TOASTER\\0000";
const DEVINSTID_W ToasterBasicID = (DEVINSTID_W)L"TOASTER\\BASIC_TOASTER";
// the code modify
// from https://support.microsoft.com/en-us/help/831226/how-to-use-the-dnsquery-function-to-resolve-host-names-and-host-addres
// build/testing with VisualStudio 2019 passed
// and only support IPV4
// DNSQuery.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include <winsock2.h> //winsock
#include <ws2tcpip.h> //for tcpip api, inet_pton(), inet_ntop()
#include <windns.h> //DNS api's
#include <stdio.h> //standard i/o
@KunYi
KunYi / snp_test.go
Created March 28, 2020 10:26
/* for Sanica SNP-400 packing system testing */
package main
/*
for Sanica SNP-42x packing system testing
using RS485 communcation to control the
*/
import (
"bufio"
"bytes"
"errors"
"fmt"
kunyi@kunyi-GE62-6QF:~/repos/LoRaMac-node/build$ cmake -DCMAKE_MODULE_PATH="/home/kunyi/repos/LoRaMac-node/cmake" -DCMAKE_TOOLCHAIN_FILE="/home/kunyi/repos/LoRaMac-node/cmake/toolchain-arm-none-eabi.cmake" -DTOOLCHAIN_PREFIX="/home/kunyi/STMicro/gcc-arm-none-eabi-8-2019-q3-update" -DAPPLICATION="LoRaMac" -DSUB_PORJECT="classA" -DACTIVE_REGION="LORAMAC_REGION_US915" -DBOARD="NucleoL073" ..
CMake Warning (dev) in CMakeLists.txt:
No project() command is present. The top-level CMakeLists.txt file must
contain a literal, direct call to the project() command. Add a line of
code such as
project(ProjectName)
near the top of the file, but after cmake_minimum_required().
#include <stdio.h>
#include <stdint.h>
typedef struct _modbus_handler {
uint8_t slave;
uint8_t func;
uint16_t offset;
uint8_t size;
uint8_t replySize;
} MODBUS_HANDLER;
@KunYi
KunYi / 0001-add-device-tree-file-for-support-srg3352x.patch
Created October 8, 2020 11:43
add device tree files support AAEON SRG3352/SRG3352C -- create on bb-kernel/am33x-v5.4 -- 5.4.66-bone36 release
From 681f8a05a1fd562ac4e9f6373ce7cdd5c652e095 Mon Sep 17 00:00:00 2001
From: KunYi <[email protected]>
Date: Thu, 8 Oct 2020 19:38:20 +0800
Subject: [PATCH] add device tree file for support srg3352x
---
arch/arm/boot/dts/Makefile | 3 +-
arch/arm/boot/dts/am335x-srg-common.dtsi | 485 ++++++++++++++++++++
arch/arm/boot/dts/am335x-srg52.dts | 17 +
arch/arm/boot/dts/am335x-srg52c-wl183x.dtsi | 99 ++++