Secret
c
D:\msys64\home\unix2linux\lua2\redis>echo %DATE%T%TIME%
2024-12-31T 8:55:47.94
D:\msys64\home\unix2linux\lua2\redis>printf "%DATE%%TIME%" | openssl dgst -md5
MD5(stdin)= b40c65cc4796709fea4fb6e370ab355b
D:\msys64\home\unix2linux\lua2\redis>uuidgen
e9ce2966-8cf6-4e80-862e-1914261ee784
D:\msys64\home\unix2linux\lua2\redis>uuidgen | openssl dgst -md5
MD5(stdin)= 64763802aba6d3b6e67505659a36b4fd
D:\msys64\home\unix2linux\lua2\redis>linux_date +"%s%N"
1735606709895182500
D:\msys64\home\unix2linux\lua2\redis>linux_date +"%s%N" | openssl dgst -md5
MD5(stdin)= e88ac702f6da42dd731179501d5e7aec
Auth
c
D:\msys64\home\unix2linux\lua2\redis>redis-cli -a e88ac702f6da42dd731179501d5e7aec
Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.
127.0.0.1:6379> config get requirepass
1) "requirepass"
2) "e88ac702f6da42dd731179501d5e7aec"
127.0.0.1:6379>
Configure
c
###############################################################################
requirepass 'e88ac702f6da42dd731179501d5e7aec'
###############################################################################
dbfilename "dump.rdb"
save 900 1
save 300 10
save 60 10000
###############################################################################
Keys
c
D:\msys64\home\unix2linux\lua2\redis>red
Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.
127.0.0.1:6379> config get dir
1) "dir"
2) "D:\\msys64\\home\\unix2linux\\lua2\\redis"
127.0.0.1:6379> keys *
(empty array)
127.0.0.1:6379> save
OK
127.0.0.1:6379> flushall
OK
127.0.0.1:6379> ping
PONG
Flush
c
127.0.0.1:6379> flushdb
OK
127.0.0.1:6379> flushall
OK
127.0.0.1:6379>
Data Dictionary : Run Mode
c
[
{
"ID": 0,
"Key": "ON",
"Value": "running",
"Data": "",
"Description": ""
},
{
"ID": 1,
"Key": "OFF",
"Value": "freezing",
"Data": "",
"Description": ""
}
]
Data Dictionary : Predict Mode
c
[
{
"ID": 0,
"Key": "YOLO V5",
"Value": "yolov5s.pt",
"Data": "",
"Description": ""
},
{
"ID": 1,
"Key": "Fireworks V1",
"Value": "fireworksv1.pt",
"Data": "",
"Description": ""
}
]
c
127.0.0.1:6379> set data-dictionary:run-mode "[{'ID':0,'Key':'ON','Value':'running','Data':'','Description':''},{'ID':1,'Key':'OFF','Value':'freezing','Data':'','Description':''}]"
OK
127.0.0.1:6379> set data-dictionary:predict-mode "[{'ID':0,'Key':'YOLO V5','Value':'yolov5s.pt','Data':'','Description':''},{'ID':1,'Key':'Fireworks V1','Value':'fireworksv1.pt','Data':'','Description':''}]"
OK
127.0.0.1:6379> save
OK
127.0.0.1:6379> keys *
1) "data-dictionary:predict-mode"
2) "data-dictionary:run-mode"
127.0.0.1:6379> get data-dictionary:run-mode
"[{'ID':0,'Key':'ON','Value':'running','Data':'','Description':''},{'ID':1,'Key':'OFF','Value':'freezing','Data':'','Description':''}]"
127.0.0.1:6379> get data-dictionary:predict-mode
"[{'ID':0,'Key':'YOLO V5','Value':'yolov5s.pt','Data':'','Description':''},{'ID':1,'Key':'Fireworks V1','Value':'fireworksv1.pt','Data':'','Description':''}]"
Data Dictionary List
c
D:\msys64\home\unix2linux\lua2\redis>curl "http://localhost:9999/api/redis/dictionary/list?master=run-mode&slave=0"
{
"code": 0,
"msg": "success",
"data": {
"master": "run-mode",
"slave": "0",
"token": [
{
"ID": 0,
"Key": "ON",
"Value": "running",
"Data": "",
"Description": ""
}
]
}
}
D:\msys64\home\unix2linux\lua2\redis>curl "http://localhost:9999/api/redis/dictionary/list?master=predict-mode"
{
"code": 0,
"msg": "success",
"data": {
"master": "predict-mode",
"slave": "",
"token": [
[
{
"Data": "",
"Description": "",
"ID": 0,
"Key": "YOLO V5",
"Value": "yolov5s.pt"
},
{
"Data": "",
"Description": "",
"ID": 1,
"Key": "Fireworks V1",
"Value": "fireworksv1.pt"
}
]
]
}
}
Data Dictionary Save
c
D:\msys64\home\unix2linux\lua2\redis>curl -H "Accept: application/json" -H "Content-type: application/json" -X POST -d "{\"ID\":0,\"Name\":\"redis\"}" "http://localhost:9999/api/redis/dictionary/save?master=view-mode"
{
"code": 0,
"msg": "success",
"data": {
"master": "view-mode",
"slave": "",
"body": {
"ID": 0,
"Name": "redis"
}
}
}