星期五, 8月 28, 2026

vim 中文

~/.vimrc 

set encoding=utf-8 

set fileencodings=utf-8,ucs-bom,big5,cp950,latin1 

set termencoding=utf-8 

set fencs=utf-8,big5 EOF

repomix

Tools 
  1. curl -fsSL https://deb.nodesource.com/setup_22.x | bash - 
  2. apt-get install -y nodejs 
  3. node -v
  4. npm install -g repomix
PDF to text
apt-get install -y poppler-utils  # 提供 pdftotext 指令
pdftotext -layout docs/arch.pdf docs/arch_pdf.txt


EXCEL to text
apt-get install -y csvkit # 提供 in2csv 指令
in2csv docs/spec.xlsx > docs/spec_excel.csv

星期四, 9月 11, 2025

wpewebkit

BR2_PACKAGE_ICU [=y] 

BR2_PACKAGE_JPEG [=y] 

BR2_PACKAGE_LIBEPOXY [=n]

BR2_PACKAGE_LIBGCRYPT [=n] && 

 BR2_PACKAGE_HAS_LIBGLES [=n] 

BR2_PACKAGE_HAS_LIBEGL [=n] 

BR2_PACKAGE_HAS_LIBEGL_WAYLAND [=n] 

BR2_PACKAGE_LIBTASN1 [=n]

BR2_PACKAGE_LIBXSLT [=n] 

BR2_PACKAGE_OPENJPEG [=n] 

BR2_PACKAGE_WAYLAND [=y]

 BR2_PACKAGE_WEBP [=n]

BR2_PACKAGE_WEBP_DEMUX [=n] 

BR2_PACKAGE_WPEBACKEND_FDO [=n] 


libsigsegv


output/build/host-m4-1.4.18/lib/c-stack.c

#ifndef SIGSTKSZ

#define SIGSTKSZ 16384
#endif

#undef SIGSTKSZ
#define SIGSTKSZ 16384

output/build/host-fakeroot-1.20.2/communicate.h
#if !defined(__GLIBC__) || __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 33
#define stat64 stat
#endif

package/fakeroot/fakeroot.mk
FAKEROOT_VERSION = 1.37.1.2
FAKEROOT_SOURCE = fakeroot_$(FAKEROOT_VERSION).orig.tar.gz
FAKEROOT_SITE = https://deb.debian.org/debian/pool/main/f/fakeroot

package/fakeroot/fakeroot.hash

sha256 959496928c8a676ec8377f665ff6a19a707bfad693325f9cc4a4126642f53224 fakeroot_1.37.1.2.orig.tar.gz


make host-libglib2 host-fakeroot
--------------------
toolchain
[*] Enable C++ support │ │

Build options ─────
libraries (shared only) --->
 Target packages  --->

 Graphic applications


BR2_PACKAGE_HAS_LIBGLES
BR2_PACKAGE_HAS_LIBEGL



星期四, 8月 28, 2025

Valgrind

valgrind: failed to start tool 'massif' for platform 'arm64-linux': No such file or directory

 export VALGRIND_LIB=/out/libexec/valgrind



v.sh


/mnt/sd/v/out/bin/valgrind \

    --tool=massif \

    --massif-out-file=/mnt/sd/v/massif_ls.out \

    --time-unit=B \

    --heap=yes \

    --max-snapshots=500 \

    vendor_3a_sample;


OUTFILE="$1"

echo "Snapshot Total Useful Extra"

awk '

  /^snapshot=/ { snap=$0 }

  /^mem_heap_B=/ { heap=substr($0, index($0,"=")+1) }

  /^mem_heap_extra_B=/ { extra=substr($0, index($0,"=")+1)

    total=heap+extra

    print snap, total, heap, extra

  }

' "$OUTFILE"

~


星期二, 6月 17, 2025

gitlab-ci-local


eval .gitlab-ci.yml

 TARGET_STAGE=daily gitlab-ci-local --variable TARGET_STAGE=daily


gitlab-ci-local




星期二, 5月 20, 2025

net snmp

 /etc/snmp/snmpd.conf

rocommunity public

agentAddress udp:161

pass .1.3.6.1.4.1.55554 /bin/bash /snmp.sh



 /snmp.sh
#!/bin/bash

opt=$1
oid=$2

echo "$(date) - called with opt=$opt oid=$oid" >> /tmp/snmp_script.log

if [ "$opt" = "-g" ]; then
  case "$oid" in
    ".1.3.6.1.4.1.55554.1.1.0")
      echo "$oid"
      echo "INTEGER"
      echo "1"
      ;;
    ".1.3.6.1.4.1.55554.1.2.0")
      echo "$oid"
      echo "STRING"
      echo "IPCamModelX"
      ;;
    *)
      exit 1
      ;;
  esac

elif [ "$opt" = "-n" ]; then
  # 簡單示範,回傳下一個 OID
  if [ "$oid" = ".1.3.6.1.4.1.55554.1.1.0" ]; then
    echo ".1.3.6.1.4.1.55554.1.2.0"
    echo "STRING"
    echo "IPCamModelX"
  else
    exit 1
  fi

elif [ "$opt" = "-s" ]; then
  # 如果要支援 set,這邊寫set邏輯
  exit 1

else
  exit 1
fi

Agent

 /usr/sbin/snmpd -V -f -Lo -C -c /etc/snmp/snmpd.conf -Dpass,persist,mib_modules


Client
snmpwalk -v2c -c public localhost .1.3.6.1.4.1.55554.1.1.0


Output
iso.3.6.1.4.1.55554.1.1.0 = INTEGER: 1


星期五, 5月 16, 2025

Pure RTSP over Websocket Player build in browser

 https://anzal.hashnode.dev/a-beginners-guide-to-rtsp-streaming-with-websockets-using-nodejs-and-ffmpeg

A Beginner’s Guide to RTSP Streaming with WebSockets Using Node.js and FFmpeg.



星期三, 4月 16, 2025

内存泄漏定位工具之 valgrind

 https://blog.csdn.net/weixin_45631738/article/details/129541098?utm_medium=distribute.pc_relevant.none-task-blog-2~default~baidujs_baidulandingword~default-1-129541098-blog-124682490.235^v43^pc_blog_bottom_relevance_base8&spm=1001.2101.3001.4242.2&utm_relevant_index=4



星期一, 1月 20, 2025

libevent timer

https://www.cnblogs.com/osbreak/p/17823102.html

 #include <iostream>

#include <event2/event.h> #include <signal.h> using namespace std; void timer(int sockfd, short what, void* arg) { cout << "[timer2]" << endl; } int main(int argc, char* argv[]) { event_base* base = event_base_new(); // 持久事件 event *ev = event_new(base,-1,EV_PERSIST,timer,0); //超时优化性能优化,默认event 用二叉堆存储(完全二叉树) 插入删除O(logn) //优化到双向队列 插入删除O(1) static timeval tv_in = {3,0}; const timeval *t; t = event_base_init_common_timeout(base,&tv_in); event_add(ev3,t3); // 性能优化:插入性能 O(1) // 进入事件主循环 event_base_dispatch(base); event_base_free(base); return 0; }

星期一, 1月 06, 2025

valgrind compilation

 https://blog.csdn.net/HZHejo/article/details/124682490


Check libraries dependence

 

Ref: https://albert-oma.blogspot.com/

check libraries dependence:

$ arm-linux-gnueabihf-readelf -d ./gst-launch-1.0


星期三, 12月 11, 2024

Virtual memory related


 Linux内存管理之vmap与vmalloc 圖文並茂 , 針對vmap_area

mmap system call 後, 進kernel 的流程 gitmind 自畫

https://elixir.free-electrons.com/linux/v5.10.230/source/mm/util.c 方便追code, 含各版本

AArch64 Linux memory layout



星期一, 12月 09, 2024

用 LD_PRELOAD 替換動態連結的函式庫

用 LD_PRELOAD 替換動態連結的函式庫

https://jasonblog.github.io/note/fcamel/04.html

星期一, 11月 25, 2024

TFAT


Power Fail Safe FAT File System
https://elinux.org/images/5/54/Elc2011_munegowda.pdf 


TI-LFAT and TI-LExFAT :
https://www.researchgate.net/publication/271722839_Design_and_Implementation_of_Log_Structured_FAT_and_ExFAT_File_Systems


KFAT:
https://www.researchgate.net/publication/344581895_KFAT_LOG-BASED_TRANSACTIONAL_FAT_FILESYSTEM_FOR_EMBEDDED_MOBILE_SYSTEMS

TFS4:
  1. https://elinux.org/images/5/54/Elc2011_munegowda.pdf
  2. https://bitsavers.computerhistory.org/components/samsung/flash/TFS4_v1.5.0_Porting_Guide_20060502.pdf




ExFAT

  1. https://events.static.linuxfound.org/images/stories/pdf/lceu11_munegowda_s.pdf





Renesas:. (not Transaction)
TFAT V.4.02 (FatFs R0.13c) for RX family allows to the format feature for SD memory card and USB memory in addition to eMMC and Serial Flash memory.
  1.  https://www.renesas.com/en/document/apn/rx-family-open-source-fat-file-system-m3s-tfat-tiny-module-using-firmware-integration-technology?language=en&srsltid=AfmBOootRvzRHDCmHPSjqznUcYY8yXmaEfAfhSOP7xiem1jOCZ-Jukhm
  2. https://www.renesas.com/en/software-tool/fat-file-system-m3s-tfat-tiny-rx-family#overview

星期二, 10月 08, 2024

github Permission denied (publickey)的简单解决方法

 https://blog.csdn.net/m0_65465945/article/details/134202945


1.执行 ssh-keygen -t rsa -C "你的git注册邮箱",在 .ssh 目录下会生成以下3个文件:

                (1)id_rsa,    (2)id_rsa.pub,    (3)known_hosts

2.在浏览器登录github,在Settings界面点击左边的 SSH and GPG keys,然后复制  id_rsa.pub 文件的内容到SSH keys,点击Add SSH key即可。


3. 执行 ssh -T git@github.com,就能看到成功了。


星期三, 9月 25, 2024

[English Skills] 進階英文 - 天啊!符號們怎麼唸啊?(下)

https://chipersonalbranding.blogspot.com/2017/09/english-skills.html 

https://chipersonalbranding.blogspot.com/2018/04/english-skills.html

pthread, sem_wait, mutex, atmoic, concurrent-programs, sysprog21

 https://www.cnblogs.com/WindSun/p/11441234.html

https://hackmd.io/@sysprog/concurrency-atomics#wait-free-amp-lock-free