https://www.cnblogs.com/chegxy/p/14020233.html
星期三, 6月 04, 2025
星期二, 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
星期二, 2月 18, 2025
星期一, 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
Check libraries dependence
Ref: https://albert-oma.blogspot.com/
check libraries dependence:
$ arm-linux-gnueabihf-readelf -d ./gst-launch-1.0
訂閱:
文章 (Atom)