Skip to content

Instantly share code, notes, and snippets.

@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 July 13, 2025 22:17
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}個蕃茄"
@KunYi
KunYi / rgtool.go
Created November 10, 2023 07:32
DHI800 Oscilloscope option license generator
package main
/*
the code from https://gitlab.com/riglol/rigolee/hdo-tools
modify for DHO800
*/
import (
"bytes"
"crypto/aes"
"encoding/binary"
"errors"
@KunYi
KunYi / docker-compose.yml
Created August 1, 2023 07:43
for iotsharp & iotgateway testing
version: '3.4'
services:
pgsql:
image: postgres
restart: always
ports:
- 5432:5432
volumes:
- ./data/postgresql:/var/lib/postgresql/data
environment:
@KunYi
KunYi / entrycontainer.sh
Last active July 17, 2023 09:36
entry container for android 6 with intel platform
#!/bin/bash
WORKSPACE=$PWD
docker run --privileged -it \
--rm \
--volume=${WORKSPACE}:/droid \
--hostname droid-build \
android-build-trusty:latest
exit 0
@KunYi
KunYi / build-container4droid6.sh
Created July 17, 2023 09:10
build container for droid6 development
#!/bin/bash
cp ~/.gitconfig ./gitconfig
docker build --build-arg userid=$(id -u) --build-arg groupid=$(id -g) --build-arg username=$(id -un) --tag android-build-trusty:latest .
@KunYi
KunYi / Dockerfile
Created July 17, 2023 09:08
Dockerfile for build Android 6/Intel platform
FROM ubuntu:14.04
ARG userid
ARG groupid
ARG username
RUN apt-get update && apt-get install -y git-core gnupg flex bison gperf build-essential zip curl zlib1g-dev \
gcc-multilib g++-multilib libc6-dev-i386 lib32ncurses5-dev x11proto-core-dev libx11-dev \
lib32z-dev ccache libgl1-mesa-dev libxml2-utils xsltproc unzip python openjdk-7-jdk \
&& apt-get install -y python mingw32 tofrodos \
&& apt-get install -y squashfs-tools efitools bc ccache tesseract-ocr \