Skip to content

Instantly share code, notes, and snippets.

@KunYi
KunYi / kernel_6.6.30_booting.log
Created May 16, 2024 05:43
JDCloud AX1800 Pro with Kernel 6.6.30 booting log
[ 0.000000] Booting Linux on physical CPU 0x0000000000 [0x51af8014]
[ 0.000000] Linux version 6.6.30 (kunyi@kunyi-TP-P53) (aarch64-openwrt-linux-musl-gcc (OpenWrt GCC 13.2.0 r26467-ecf848762d) 13.2.0, GNU ld (GNU Binutils) 2.42) #0 SMP PREEMPT Tue May 14 02:41:28 2024
[ 0.000000] Machine model: JDCloud AX1800 Pro
[ 0.000000] OF: reserved mem: 0x0000000000060000..0x0000000000065fff (24 KiB) nomap non-reusable memory@60000
[ 0.000000] OF: reserved mem: 0x0000000040000000..0x0000000040ffffff (16384 KiB) nomap non-reusable nss@40000000
[ 0.000000] OF: reserved mem: 0x000000004a100000..0x000000004a4fffff (4096 KiB) nomap non-reusable bootloader@4a100000
[ 0.000000] OF: reserved mem: 0x000000004a600000..0x000000004a9fffff (4096 KiB) nomap non-reusable memory@4a600000
[ 0.000000] OF: reserved mem: 0x000000004aa00000..0x000000004aafffff (1024 KiB) nomap non-reusable memory@4aa00000
[ 0.000000] OF: reserved mem: 0x000000004ab00000..0x000000004e1fffff (56320 KiB) nomap non-reusable memory@4ab
@KunYi
KunYi / libusb_xb_test.c
Last active May 2, 2024 04:49 — forked from xpn/libusb_xb_test.c
LibUSB test with XBOX One controller
// to code base on
// https://gist.github.com/xpn/9dca0c1663ecdee76ede
// and modify to another pid(0x0b12)
//
// build commands on Ubuntu 22.04
// gcc libusbxboxone.c -o test_xboxone -lusb-1.0
//
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@KunYi
KunYi / HelloWorld.c
Created April 12, 2024 08:39
UEFI Hello world for allocate runtime service data
/** @file
This sample application bases on HelloWorld PCD setting
to print "UEFI Hello World!" to the UEFI Console.
Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
#include <Uefi.h>
@KunYi
KunYi / CE7OSLoader_Build.log
Created April 9, 2024 08:04
WEC7 UEFI Loader build log on EDK2 202404 with GCC 11
kunyi@kunyi-TP-P53:/tmp/edk2$ build -t GCC -b RELEASE -a IA32 -p MdeModulePkg/CE7OSLoader.dsc
Build environment: Linux-5.15.0-102-generic-x86_64-with-glibc2.35
Build start time: 16:02:11, Apr.09 2024
WORKSPACE = /tmp/edk2
EDK_TOOLS_PATH = /tmp/edk2/BaseTools
CONF_PATH = /tmp/edk2/Conf
PYTHON_COMMAND = python3
@KunYi
KunYi / neuron_v2.7_modbus2mqtt.log
Created February 26, 2024 09:58
just log message route, demo modbus to mqtt
2024-02-26 17:49:05:351 [INFO] [neuron] driver.c:171 update driver: Modbus, group: Modbus, tag: Modbus, type: NEU_TYPE_UINT16, timestamp: 1708940945349 n_meta: 0
2024-02-26 17:49:05:371 [DEBUG] [neuron] driver.c:1695 Modbus-Modbus timer: 30
2024-02-26 17:49:05:767 [INFO] [neuron] metric_handle.c:121 GET /api/v2/metrics?category=app&node=MQTT [200]
2024-02-26 17:49:06:004 [DEBUG] [neuron] adapter.c:594 adapter(MQTT) recv msg from: Modbus (nil), type: NEU_REQRESP_TRANS_DATA
2024-02-26 17:49:06:004 [DEBUG] [neuron] adapter.c:117 adapter(MQTT) recv msg from: Modbus (nil), type: NEU_REQRESP_TRANS_DATA, 0
2024-02-26 17:49:06:004 [DEBUG] [MQTT] mqtt_client.c:255 pub [/neuron/MQTT, QoS0] 107 bytes
2024-02-26 17:49:06:371 [DEBUG] [Modbus] log.h:125 >>(12) 0x00 0x66 0x00 0x00 0x00 0x06 0x01 0x03 0x00 0x00 0x00 0x01
2024-02-26 17:49:06:373 [DEBUG] [Modbus] log.h:125 <<(6) 0x00 0x66 0x00 0x00 0x00 0x05
2024-02-26 17:49:06:373 [DEBUG] [Modbus] log.h:125 <<(11) 0x00 0x66 0x00 0x00 0x00 0x05 0x01 0x03 0x02 0x00 0x00
2024-02
@KunYi
KunYi / prepare_openresty_source.txt
Last active February 7, 2024 15:36
from pull & configure & build for openrestry
$ git clone github.com/openresty
$ git checkout 7b7fcbe0784f8551217d44ce7c7b06c5dd28b0ac
$ make
----------------------
below is log (make 2>&1 | tee prepare.txt
----------------------
./util/mirror-tarballs
openresty 1.25.3.1
@KunYi
KunYi / simple_web.c
Last active March 28, 2025 20:19
a example for libuv + llhttp
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
/* include libuv & llhttp */
#include <llhttp.h>
#include <uv.h>
#define DEFAULT_PORT 8080
@KunYi
KunYi / com525.class.php
Created January 21, 2024 08:22 — forked from Sarjuuk/com525.class.php
communication interface for SIEMENS S5-CP524 and S5-CP525 communications processor
<?php
// Procedure 3964R
// Interpreter RK512
class Com525
{
// commands
private const CMD_SEND = 0x41; // 'A'
private const CMD_SEND_X = 0x4F; // 'O'
@KunYi
KunYi / neuron_v2.7.7.log
Created January 19, 2024 07:56
EMQ Neuron v2.7.7.log
2024-01-19 15:39:01:710 [WARN] [neuron] daemon.c:181 write /tmp/neuron.pid, error Success(0)
2024-01-19 15:39:01:714 [NOTICE] [neuron] persist.c:450 schema head version=none
2024-01-19 15:39:01:716 [NOTICE] [neuron] persist.c:393 success apply schema `./config/0000_2.2.0_initial.sql`, version=`0000` description=`2.2.0_initial`
2024-01-19 15:39:01:724 [NOTICE] [neuron] persist.c:393 success apply schema `./config/0001_2.3.0_users.sql`, version=`0001` description=`2.3.0_users`
2024-01-19 15:39:01:726 [NOTICE] [neuron] persist.c:393 success apply schema `./config/0002_2.3.0_node_cache.sql`, version=`0002` description=`2.3.0_node_cache`
2024-01-19 15:39:01:728 [NOTICE] [neuron] persist.c:393 success apply schema `./config/0010_2.4.0_subscription_params.sql`, version=`0010` description=`2.4.0_subscription_params`
2024-01-19 15:39:01:732 [NOTICE] [neuron] persist.c:393 success apply schema `./config/0020_2.4.0_static_tag.sql`, version=`0020` description=`2.4.0_static_tag`
2024-01-19 15:39:01:734 [NOTICE] [neuron] p
@KunYi
KunYi / python_chapt01
Created November 21, 2023 06:58
Code Red: When Watermelons Win Over Tomatoes
#!/usr/bin/python
def 螢幕輸出(str):
print(str)
def 買西瓜(num):
return f"{num}個西瓜"
def 買蕃茄(num):
return f"{num}個蕃茄"