cannot find -lbz2

ubuntu下编译源码出现错误

1
/usr/bin/ld: cannot find -lbz2

解决办法

1
apt-get install libbz2-dev

wireshark过滤数据包的第一个INT

比如,tcp连接,往往包头第一个INT或第二个INT表示包的类型,可以用wireshark过滤显示指定类型的数据包,比如过滤包头第一个INT对应整型值为10的包的过滤表达式为

1
ip.addr == 192.168.1.21 && tcp.port == 7222 && frame[54:4]==0a:00:00:00

附:tcpdump抓包

1
tcpdump -i eth0 -w file.cap host 192.168.168.18 and tcp port 8081

refer to:
https://blog.csdn.net/qq_19167629/article/details/83088878

WordPress备忘录

url自动生成链接,主题的functions.php中添加下面的代码即可:

1
add_filter('the_content', 'make_clickable');

GeneratePress: 样式表 (style.css)

1
font-family: sans-serif,'宋体';

清理表空间

1
2
3
4
5
6
7
8
DELETE FROM wp_posts WHERE post_type = 'revision';
DELETE FROM wp_postmeta WHERE meta_key = '_edit_lock';
DELETE FROM wp_postmeta WHERE meta_key = '_edit_last';
DELETE FROM wp_postmeta WHERE meta_key = '_wp_old_slug';
DELETE FROM wp_postmeta WHERE meta_key = '_revision-control';
DELETE FROM wp_postmeta WHERE meta_value = '{{unknown}}';
OPTIMIZE TABLE wp_postmeta;
OPTIMIZE TABLE wp_posts;

常用插件

1
2
3
4
5
6
7
8
9
Blackout: Dark Mode Widget	Adds a toggle widget to your website that activates dark mode on click.
Protection against DDoS		Protection against DDoS.
Quotmarks Replacer		Quotmarks Replacer disables wptexturize function that keeps all quotation marks and suspension points in half-width form.
WordPress 导入工具		从 WordPress 导出文件中导入日志、页面、评论、自定义字段、分类、标签或更多内容。
WP-Syntax			Syntax highlighting using GeSHi supporting a wide range of popular languages.
代码美化器			本插件使用Google代码美化器将文章中的代码片段以语法高亮显示。
经典编辑器			启用WordPress经典编辑器和旧式的编辑文章页面,包括TinyMCE、Meta Boxes等。支持扩展此页面的旧插件。
2em				add "text-indent:2em" support to editor.
WP Statistics			此插件为您提供有关网站访问者的完整信息。

refer to:
https://www.wpdaxue.com/wordpress-make-clickable.html
https://www.fujieace.com/wordpress/revisions.html
https://www.91wordpress.com/1963.html
https://blog.csdn.net/weixin_30958745/article/details/113611053

VMWare磁盘读写提速

VMWare不生成vmem文件的方法是在.vmx文件中增加两行:

1
2
sched.mem.pshare.enable = "FALSE"
mainMem.useNamedFile = "FALSE"

refer to:
https://blog.csdn.net/shanzhizi/article/details/8293638
http://www.360doc.com/content/15/1120/11/73007_514517328.shtml
http://www.guyiren.com/archives/3210
https://blog.csdn.net/mnmnwq/article/details/79557305
https://blog.51cto.com/kitzk/553493
https://segmentfault.com/q/1010000002954977
https://bbs.kafan.cn/thread-1355085-1-1.html

found no \bibdata command

在CTeX套件的WinEdt编辑器里点击BibTeX按钮后,出现错误:

1
2
I found no \bibdata command---while reading file test.aux
I found no \bibstyle command---while reading file test.aux

有一种原因为.bib文件未保存,因为WinEdt是不会自动保存的,即使点了PDFTexify按钮也不会保存,需要先保存.bib文件再点BibTeX按钮,就不会出现这个错误了。

正确写法参见:
CTeX例子

CTeX例子

test.tex

1
2
3
4
5
6
7
8
\documentclass{article}
\usepackage{ctex}
\usepackage{cite}
\begin{document}
Hello every one!\cite{articleA}大家还好么?
\bibliographystyle{plain}
\bibliography{refs}
\end{document}

refs.bib

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
@ARTICLE{articleA,
author = {Mr.Woodman},
title = {Woodman's Trueman},
journal = {IEEE magzine},
year = {11},
volume = {2(3)},
pages = {4-42},
owner = {trueman},
timestamp = {02}
}
 
@Inbook{Book1,
author="Mrs.Woodman",
editor="Editor Woodman",
title="Woman",
bookTitle="Woodman's woman",
year="1992",
publisher="Woodman House",
address="New York St.1",
pages="33--25",
isbn="111-222-1",
doi="10.1011/111-11-111-1111-1_11",
url="http://url.org/index.html"
}

Premiere编辑时没有声音

编辑视频时没有声音的原因有很多种,我这里会到情况是由于启动Pr时提示过错误消息框:

1
2
3
无法应用设备设置,因为发生了以下错误:
 
MME 设备内部错误。

解决方法:
点击菜单->编辑->首选项->音频硬件,弹出对话框中,默认输入选择“无输入”,点“确定”保存,退出Pr再重启。

我这样操作后,再编辑视频时就有声音响应了。

Android Studio调试时apk中的lib文件夹不见了

现象:
Build -> Make Project生成的apk包中含lib文件夹及里面的.so动态库,而点击IDE中的Debug按钮后发现生成的apk包中lib文件夹及.so库都没了。

解决方法:
在右上角“Make Project(Ctrl + F9)”图标的右边下拉框中点击“Edit Configurations...”,在“Run/Debug Configurations”对话框中,选择app -> General -> Installation Options -> Deploy下拉框的“APK from app bundle”,并点击OK保存。这样点击IDE中的Debug按钮后,传到设备中进行交互调试的apk中也会包含进lib内容。

禁止RestartByRestartManager

有时候很烦人,程序跑着跑着就重启了,这并不是因为程序崩了,而是在新版的visual studio中对MFC程序默认增加了一个功能:程序自动重启。要禁用它,只须在程序最开始继承自CWinApp的类的构造函数中将下面一句话注释掉:

1
2
	// support Restart Manager
	//m_dwRestartManagerSupportFlags = AFX_RESTART_MANAGER_SUPPORT_RESTART;