Skip to content

Instantly share code, notes, and snippets.

@KunYi
KunYi / weather-station.service
Created December 16, 2020 11:21
for my weather station project
[Unit]
Description=WeatherStation Mqtt bridge service
After=rc-local.service
[Service]
Type=simple
WorkingDirectory=/opt/weather
ExecStart=/opt/weather/runWeatherStation2MQTT.sh
Restart=always
RestartSec=30
@KunYi
KunYi / runWeatherStation2MQTT.sh
Created December 16, 2020 11:23
a startup script for my weather station project
#!/bin/bash -e
# setting ip
#/sbin/ifconfig eth0 192.168.92.183/27 192.168.92.161 || true
# java -classpath WeatherStation2MQTT.jar com.uwingstech.Main -b test.mosquitto.org -t "FORMOSA00001/WeatherStation01/rx"
/usr/bin/java -jar /opt/weather/WeatherStation2MQTT.jar -b 10.50.19.11 -t "none/FORMOSA00001/WeatherStation01/rx"
@KunYi
KunYi / script-template.sh
Created December 19, 2020 04:15 — forked from m-radzikowski/script-template.sh
Minimal safe Bash script template - see the article with full description: https://betterdev.blog/minimal-safe-bash-script-template/
#!/usr/bin/env bash
set -Eeuo pipefail
trap cleanup SIGINT SIGTERM ERR EXIT
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P)
usage() {
cat <<EOF
Usage: $(basename "${BASH_SOURCE[0]}") [-h] [-v] [-f] -p param_value arg1 [arg2...]
/**
* tpm2-utils - Linux utilities for TPM 2.0 devices
* Copyright (C) 2015 Jethro G. Beekman
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
@KunYi
KunYi / modbus-rtu-master.c
Created December 30, 2020 07:56
create a test program with libmodbus
/*
*---------------------------------------
*
* modbus-rtu-master.c
*
*---------------------------------------
*/
#include <stdio.h>
@KunYi
KunYi / settings.json
Created January 8, 2021 09:39
vscode with yocto project from https://youtu.be/PY4godidHx4?t=388
{
"files.exclude": {
"**/.git/objects/**": true,
"**/.git/subtree-cache/**": true,
"**/node_module/**": true,
"**/.svn/**": true,
"**/.hg/store/**": true,
"**/CVS/**": true,
"**/.DS_Store": true,
"**/build/cache/**": true,
@KunYi
KunYi / reserved-analysis.c
Created January 12, 2021 11:56
System reserved memory analysis on Windows
// System reserved memory analysis on Windows.cpp : Defines the entry point for the console application.
// the code from http://www.lab-z.com/revmem/
#include "stdafx.h"
#include <Windows.h>
#include <strsafe.h>
#include <tchar.h>
HKEY m_hKey;
@KunYi
KunYi / gist:08b15c149677a91b8419dfaf41a68f8a
Created March 5, 2021 11:00
STEP 7 Micro/WIN V4.0 SP9 for Siemens S7-200 Serial PLC
STEP 7 Micro/WIN V4.0 SP9 for Siemens S7-200 Family PLC, CHS version
http://www.ad.siemens.com.cn/productportal/Prods/s7-200-portal/MicroPower2013/general/online_resource/online_certification_soft.html
@KunYi
KunYi / adu-agent.log
Created March 22, 2021 07:50
Azure Device Agent running log for update success
Mar 22 06:01:42 raspberrypi3 systemd[1]: Started ADU Client service..
Mar 22 06:01:45 raspberrypi3 AducIotAgent[354]: 2021-03-22T06:01:42.7673Z [I] Agent (linux; 0.6.0-public-preview) starting. [main]
Mar 22 06:01:45 raspberrypi3 AducIotAgent[354]: 2021-03-22T06:01:42.7674Z [I] Agent built with handlers: microsoft/swupdate. [main]
Mar 22 06:01:45 raspberrypi3 AducIotAgent[354]: 2021-03-22T06:01:42.7678Z [I] Initalizing PnP components. [ADUC_PnP_Components_Create]
Mar 22 06:01:45 raspberrypi3 AducIotAgent[354]: 2021-03-22T06:01:42.7678Z [I] ADUC agent started. Using IoT Hub Client SDK 1.6.0 [AzureDeviceUpdateCoreInterface_Create]
Mar 22 06:01:45 raspberrypi3 AducIotAgent[354]: 2021-03-22T06:01:42.7679Z [I] Calling ADUC_Register [ADUC_MethodCall_Register]
Mar 22 06:01:45 raspberrypi3 AducIotAgent[354]: 2021-03-22T06:01:42.7679Z [I] IoTHub Device Twin callback registered. [ADUC_DeviceClient_Create]
Mar 22 06:01:45 raspberrypi3 AducIotAgent[354]: 2021-03-22T06:01:42.7683Z [W] Failed to pass connection string to D
@KunYi
KunYi / uboot-imx8mp-lpddr4-evk.log
Created April 12, 2021 07:11
u-boot for imx8mp lpddr4 evk
U-Boot SPL 2020.04-5.10.9-1.0.0+gad7b74b415 (Mar 05 2021 - 07:05:56 +0000)
DDRINFO: start DRAM init
DDRINFO: DRAM rate 4000MTS
DDRINFO:ddrphy calibration done
DDRINFO: ddrmix config done
Normal Boot
Trying to boot from BOOTROM
image offset 0x8000, pagesize 0x200, ivt offset 0x0
NOTICE: BL31: v2.4(release):lf-5.10.y-1.0.0-0-gba76d337e
NOTICE: BL31: Built : 08:27:48, Mar 1 2021