在多链的源码中,多次出现函数指针的身影:

1
2
3
4
5
6
7
8
9
10
11
12
typedef json_spirit::Value(*rpcfn_type)(const json_spirit::Array& params, bool fHelp);

class CRPCCommand
{
public:
std::string category;
std::string name;
rpcfn_type actor;
bool okSafeMode;
bool threadSafe;
bool reqWallet;
};

阅读的难点在于,源码中的 json_spirit::Value(*rpcfn_type)(const json_spirit::Array& params, bool fHelp) 中间没有空格。

调用函数指针,获取结果:

1
json_spirit::Value result = pcmd->actor(params, false);

Win 10

Clean log files

C:\Windows\System32\winevt\Logs
按Ctrl+A全选后使用 Shift + Delete 删除,一些正被services使用的文件无法被删除。

Open Administrator Powershell:

1
2
Get-EventLog -List
Remove-EventLog -LogName "some Log from list"

ps-eventlog.png

禁用休眠

休眠会将系统内存保存到磁盘文件hiberfil.sys中。可以通过

1
powercfg /hibernate off

关闭休眠功能

Linux

Refer to https://billystudio.github.io/2018/05/16/Command-of-the-day-May-sixteenth-2018/

更改docker镜像源为阿里云

1
2
sudo vim /etc/docker/daemon.json
cat /etc/docker/daemon.json

{
“registry-mirrors”: [“https://gvv1xf6d.mirror.aliyuncs.com"]
}

拉取系统镜像并运行:

1
2
docker pull debian
docker run -it debian bash

更改debian镜像源

1
2
3
4
5
6
7
8
9
10
cd /etc/apt
cp sources.list sources.list.bak
echo "deb http://mirrors.tuna.tsinghua.edu.cn/debian/ buster main contrib non-free" > sources.list.tsinghua
echo "deb http://mirrors.tuna.tsinghua.edu.cn/debian/ buster-updates main contrib non-free" >> sources.list.tsinghua
echo "deb http://mirrors.tuna.tsinghua.edu.cn/debian/ buster-backports main contrib non-free" >> sources.list.tsinghua
echo "deb http://mirrors.tuna.tsinghua.edu.cn/debian-security buster/updates main contrib non-free" >> sources.list.tsinghua
mv sources.list.tsinghua sources.list
apt install apt-transport-https ca-certificates
sed -E -i 's/http/https/' sources.list
apt update

docker commit e7f167a49946 wsd/testimg:1 # container id
docker run -it wsd/testimg:1 bash

KDE is a highly configurable modern Linux desktop environment which is developed by OpenSUSE company.

阅读更多

Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×