检索 COM 类工厂中 CLSID 为 {28E68F9A-8D75-11D1-8DC3-3C302A000000} 的组件失败,原因是出现以下错误: 80040154 没有注册类

根据自己是32位还是64位来选择Regsvr32,以下是用代码注册的DLL

// Assembly assembly = Assembly.LoadFile(dllPath);
// 获取CLSID
// Guid guid = new Guid(((GuidAttribute)Attribute.GetCustomAttribute(assembly, typeof(GuidAttribute))).Value);
using (Process process = new Process())
{
	string regPath = System.Environment.GetFolderPath(Environment.SpecialFolder.System);
	if (Environment.Is64BitOperatingSystem)
	{
		regPath = System.Environment.GetFolderPath(Environment.SpecialFolder.SystemX86);
	}
	regPath = Path.Combine(regPath, "regsvr32");

	string reg32DllPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Lib", "OPCDAAuto.dll"); // 要注册的dll路径
	ProcessStartInfo startInfo = new ProcessStartInfo(reg32DllPath)
	{
		WindowStyle = ProcessWindowStyle.Hidden,
		FileName = regPath,
		Arguments = $" {reg32DllPath} /s ",
		Verb = "runas"
	};
	process.StartInfo = startInfo;
	process.Start();
	process.WaitForExit();
}
Console.WriteLine(reg32DllPath + "注册成功");

angular1.5,$scope.$apply()强制更新

改变数据,视图不刷新的情况下,请加上$scope.$apply();

$scope.$apply(function() {
    var leftNewVal = (left / 0.5 + (mouseMoveX - mouseDownX) / 0.5);
    var topNewVal = (top / 0.5 + (mouseMoveY - mouseDownY) / 0.5);
    $scope.templatePosition.index[curKeyName].left = leftNewVal;
    $scope.templatePosition.index[curKeyName].top = topNewVal;
})

$scope.$watch('templatePosition',function(obj){
     $scope.progressStyle($scope .templatePosition);
}, true);

配置Fiddler拦截iOS/Andorid的https请求

Fiddler可以配置用来拦截https请求。但默认配置下仅支持拦截PC上的请求。在移动端上的https请求会因为证书问题而失败 .

fiddler默认的证书是基于命令行工具makecert.exe,几乎所有windows客户端都接受该工具生产的证书,但是apple ios设备(iphone、ipad)和少部分的android要求根证书和服务器证书包含makecert.exe生产的证书中所没有的其他元数据。为了兼容这些设备,需要下载fiddler插件”cermaker for ios and android”

去fiddler官网 https://www.telerik.com/fiddler/add-ons

找到

安装完成后重启Fiddler。

手机端重新下载证书,以前的先删掉

安装 信任

如果发现不行,需要将pc端的fiddler关掉重新打开

php 安装xhprof

当前环境 ubuntu20.04 php7.4.3

用pecl install xhprof

安装完成后修改php.ini 添加扩展和设置日志输出

## 添加扩展
extension=xhprof.so
## 设置输出路径
xhprof.output_dir=/home/asd/xhprof/log

完成后重启php

在入口文件增加代码

xhprof_enable(XHPROF_FLAGS_NO_BUILTINS | XHPROF_FLAGS_CPU | XHPROF_FLAGS_MEMORY);

注册php在终止执行时的函数

register_shutdown_function(function(){
	$data = xhprof_disable();   //返回运行数据
	//xhprof_lib 在下载的包里存在这个目录,记得将目录包含到运行的php代码中
	include '/usr/share/php/xhprof_lib/utils/xhprof_lib.php';
	include '/usr/share/php/xhprof_lib/utils/xhprof_runs.php';
	$objXhprofRun = new \XHProfRuns_Default();
	$objXhprofRun->save_run($data, "test"); //test 表示文件后缀
});

运行。发现/home/asd/xhprof/log下有日志文件

查看关系图

将/usr/share/php/xhprof_html 设置成可以通过nginx访问,访问index.php文件可以查看图

查看图之前需要安装 sudo apt install graphviz

activemq 增加连接的用户名密码

编辑 activemq.xml 在broker标签内,加一下代码

<plugins>

            <simpleAuthenticationPlugin>

                <users>

                    <authenticationUser username="user" password="user123" groups="users" />

                </users>

            </simpleAuthenticationPlugin>

        </plugins>

重启后即可

centos7 开启bbr

  1. 首先是查看当前服务器的内核版本
uname -sr
# BBR内核要求是4.9+,通常来说你通过上面这个命令出来的内核版本是在3.几

2. 启用 ELRepo 仓库

rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
rpm -Uvh https://www.elrepo.org/elrepo-release-7.0-3.el7.elrepo.noarch.rpm
yum install https://www.elrepo.org/elrepo-release-7.el7.elrepo.noarch.rpm

3. 安装新版的稳定版内核

yum --enablerepo=elrepo-kernel install kernel-ml -y

4. 安装完毕后使用下面的命令查看是否安装成功

rpm -qa | grep kernel



kernel-3.10.0-1127.el7.x86_64
kernel-tools-3.10.0-1127.13.1.el7.x86_64
kernel-3.10.0-1127.13.1.el7.x86_64
kernel-headers-3.10.0-1127.18.2.el7.x86_64
kernel-tools-libs-3.10.0-1127.13.1.el7.x86_64
kernel-ml-5.9.12-1.el7.elrepo.x86_64
## 里面kernel-ml-5.9.12-1.el7.elrepo.x86_64就是安装的新版版本内核(可能内核版本有变化)

5. 要设置系统启动顺序

sudo egrep ^menuentry /etc/grub2.cfg | cut -f 2 -d \'

##  排在第一的就是下次要启动的内核,从第一行为0依次数,0、1、2、3这样,看你的新内核是第几。

## 设置启动顺序
sudo grub2-set-default 0

6. 重启

reboot

7. 重启后,查看内核版本

uname -r

5.9.12-1.el7.elrepo.x86_64
## 显示为新版本内核

8. 重建内核配置

grub2-mkconfig -o /boot/grub2/grub.cfg

9. 重启

reboot

10. 在新安装好的CentOS7上面启用新内核,只需要复制下面的代码执行

echo 'net.core.default_qdisc=fq' | sudo tee -a /etc/sysctl.conf
echo 'net.ipv4.tcp_congestion_control=bbr' | sudo tee -a /etc/sysctl.conf
sudo sysctl -p

11. 然后输入下面的命令查看是否开启BBR成功

sudo sysctl net.ipv4.tcp_available_congestion_control

## 成功的话输出以下信息
net.ipv4.tcp_available_congestion_control = bbr cubic reno

## 继续验证 输入一下代码
sudo sysctl -n net.ipv4.tcp_congestion_control
## 正常输出
bbr
### 最后看内核模块是否加载
lsmod | grep bbr

## 正常输出
tcp_bbr  20480  22