例如转发到服务器3002端口,域名Nginx配置:
1 | location / { |
如果使用宝塔面板,在[伪静态]部分配置。
测试,通过node test.js来listen3002端口,访问域名后显示test.js返回值:Hello World
test.js:
1 | const http = require('http'); |
例如转发到服务器3002端口,域名Nginx配置:
1 | location / { |
如果使用宝塔面板,在[伪静态]部分配置。
测试,通过node test.js来listen3002端口,访问域名后显示test.js返回值:Hello World
test.js:
1 | const http = require('http'); |
1 | server{ |
自定义 Wordpress Translatepress 语言切换菜单。
主题模板用的:
https://themeforest.net/item/optime-logistics-transportation-wordpress-theme/24380838
由于官方只兼容了WPML和自己的语言切换器,未兼容 Translatepress ,所以需要自己加上。
编辑主题文件,找到function.php 加入:
ref: https://translatepress.com/docs/developers/custom-language-switcher/
1 | function trpc_custom_language_switcher() |
打开 template-parts/header-layout.php 在判断语言菜单处加入:
1 | ... |
1 | show variables like 'log_bin'; |
结果为On表示有开启Log。
以 BT 环境为例,在 /www/server/data/ 看下 mysql-bin.00000x ,找到修改时间最近的那个文件。
我这里是 mysql-bin.000006
1 | /www/server/mysql/bin/mysqlbinlog --no-defaults --base64-output=decode-rows -v /www/server/data/mysql-bin.000006 > /www/server/data/mysql-bin.000006.txt |
导出为 mysql-bin.000006.txt 文件,这里是所有执行过的sql语句。
但文件太大了,不好下载,把最近3w行导出到新文件:
1 | tail -n 30000 /www/server/data/mysql-bin.000006.txt > /www/server/data/mysql-bin.000006_last_3w.txt |
下载 mysql-bin.000006_last_3w.txt ,在其中查找到被删数据的 insert 拿出来执行即可。
1 |
|
在 package.json 文件删除antd依赖。
在 https://www.jsdelivr.com/ 搜索antd得到js和css链接。
在 public/index.html ,放入js和css链接。
1 | ... |
然后在 src/index.js 中添加空白的导入语句
1 | import 'antd'; |
禁用依赖检查,在 package.json 文件中添加以下配置:
1 | "resolutions": { |
删除node_modules、yarn.lock,执行yarn install、yarn start即可。
文件传输到电视方式:
TV源项目:https://github.com/fanmingming/live
TV源地址:https://live.fanmingming.com/tv/m3u/ipv6.m3u
安卓电视可以用:
Tivimate(https://github.com/skysolf/iptv)
或
KODI:https://kodi.tv/download/android/
KODI设置中文、解决中文乱码、安装PVR插件、设置源说明:https://zhuanlan.zhihu.com/p/385068899
所用项目:https://github.com/Lozy/danted/
安装和管理方式在GitHub项目主页都有,这里不再重复。
需要注意的是,如果机器有多个IP,且配置文件中无 external.rotation: same-same 配置,则要手动加上。
配置文件:/etc/danted/sockd.conf
在配置文件 clientmethod: none 上面加一行:
external.rotation: same-same
embedding 是一种把文本转换为更低维的数据(向量)的方法。