centos8 yum 相关国内镜像仓库弃用(deprecated)
今天centos8使用yum安装软件时报错。
今天centos8使用yum安装软件时报错。
服务器(centos8)在用户登录的时候会出现一些登录日志。 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 example.com systemd[1]: Started /run/user/0 mount wrapper. example.com systemd[1]: Created slice User Slice of UID 0. example.com systemd[1]: Starting User Manager for UID 0... example.com systemd[1]: Started Session 51 of user root. example.com systemd[20871]: Starting D-Bus User Message Bus Socket. example.com systemd[20871]: Reached target Timers. example.com systemd[20871]: Reached target Paths. example.com systemd[20871]: Listening on D-Bus User Message Bus Socket. example.com systemd[20871]: Reached target Sockets. example.com systemd[20871]: Reached target Basic System. example.com systemd[20871]: Reached target Default. example.com systemd[20871]: Startup finished in 51ms. example.com systemd[1]: Started User Manager for UID 0. example.com systemd[1]: session-51.scope: Succeeded. example.com systemd[1]: Stopping User Manager for UID 0... example.com systemd[20871]: Stopped target Default. example.com systemd[20871]: Stopped target Basic System. example.com systemd[20871]: Stopped target Sockets. example.com systemd[20871]: Stopped target Paths. example.com systemd[20871]: dbus.socket: Succeeded. example.com systemd[20871]: Closed D-Bus User Message Bus Socket. example.com systemd[20871]: Reached target Shutdown. example.com systemd[20871]: Starting Exit the Session... example.com systemd[20871]: Stopped target Timers. example.com systemd[1]: user@0.service: Killing process 20967 (systemctl) with signal SIGKILL. example.com systemd[1]: user@0.service: Succeeded. example.com systemd[1]: Stopped User Manager for UID 0. example.com systemd[1]: Stopping /run/user/0 mount wrapper... example.com systemd[1]: Removed slice User Slice of UID 0. example.com systemd[1]: run-user-0.mount: Succeeded. example.com systemd[1]: user-runtime-dir@0.service: Succeeded. example.com systemd[1]: Stopped /run/user/0 mount wrapper. 通过下面命令生成rsyslog的过滤规则; 1 2 3 4 5 6 7 8 9 10 echo 'if $programname == "systemd" and ($msg contains "Started /run/$msg" or $msg contains "Starting Session" or $msg contains "Started Session" or $msg contains "Created slice User" or $msg contains "Starting User Manager" or $msg contains "Starting User" or $msg contains "Starting D-Bus" or $msg contains "Reached target" or $msg contains "Listening on D-Bus" or $msg contains "Startup finished" or $msg contains "session-" or $msg contains "Stopping User Manager" or $msg contains "Stopped target" or $msg contain "dbus.socket" or $msg contains "Stopped target " or $msg contains "Removed session" or $msg contains "Removed slice User Slice of" or $msg contains "Stopped /run/user" or $msg contains "Stopped User Manager" or $msg contains "Stopping User Slice of" ) then stop' >/etc/rsyslog.d/ignore-systemd-session-slice.conf 根据实际情况, 新增相关过滤规则即可 ...
Pointer 和 references 主要区别 reference:总代表一个对象, 没有null reference;pointer则没有限制,可以为null poiner可以被重新赋值; reference不可以被重新赋值。 应用场景 如果在不同时间指向不同对象则使用pointer, 如果一旦代表该对象就不能改变选择reference. 相关代码: 使用reference更富效率, 如下面的例子,不需要测试rd的值,他代表某一个double 1 2 3 4 void printDouble(const double &rd) { cout << rd; } 而如果用pointers,那么就得测试下他是否为null。 1 2 3 4 5 6 void printDouble(const double *pd) { if (pd) { cout << *pd; } } 其他: 当然也有例外, 比如leveldb中就可以看到一下issue,DB::Get API should use reference instead of pointer #140 可以看到在下面一段描述,这里主要讨论关于函数参数使用引用还是指针。 1 2 3 4 5 6 7 8 9 10 11 Original issue 134 created by jvb127 on 2013-01-03T06:36:56.000Z: The current DB::Get API is defined as: virtual Status Get(const ReadOptions& options, const Slice& key, std::string* value) = 0; However, 'value' is not an optional parameter - it should point to a valid std::string. This is not checked by the implementation It could be considered to use a reference rather than a pointer: virtual Status Get(const ReadOptions& options, const Slice& key, std::string& value) = 0; 可以看到在google早些年的开发指南中,使用指针定义参数列表的参数和引用,通过const区分输入,输出参数。 ...
这篇文章 What every programmer should know about memory, Part 1 是出自lwn.net 作者 Ulrich Drepper 总线结构 常见的商用计算机结构: 北桥南桥结构: CPU通过FSB连接到北桥, 北桥包含内存控制器,通过不同内存控制器链接不同的RAM,如DRAM,SDRAM, Rambus,南桥主要连接I/O设备,支持不同总线接口如:PCI,SATA,USB。 特点: cpu到cpu之间数据要过北桥 所有设备与RAM需要通过北桥 RAM仅一个端口 通过南桥链接设备与cpu通讯需要经过北桥 瓶颈; 北桥处理能力成为瓶颈。 设备与内存: 北桥与内存 早些年设备间通讯需要通过cpu, 为了减少CPU压力,出现DMA,虽然减少cpu压力,但是占用北桥带宽。 为了增强北桥内存访问能力,有些系统支持北桥连接外部更多的内存控制器: 北桥连接外部内存控制器南北桥结构 特点: 增强北桥处理能力 瓶颈: 内部带宽 北桥成为中心关键节点,内存控制器接入越多 另外一种解决方法是将外部控制器集成到CPU中( NUMA) 将内存控制器集成到cpu中,不同cpu连接不同内存, 没有北桥瓶颈,但当访问链接到其他CPU的内存时使得访问变得复杂。 NUMA - Non-Uniform Memory Architecture RAM类型 Static RAM 需要多个晶体管,文章中提到有6个或4个的。 单元状态稳定,不需要刷新周期。 断电后数据丢失 Dynamic RAM 需要一个晶体管和一个电容 需要刷新不断刷新 DRAM 访问 如果要访问一个4G地址, 4GB的RAM需要2^32个地址线, 使用二进制编码,N 个地址线可以完成 2_N_ 个地址,使用N个地址线,除了电路设计复杂之外需要大量的芯片,DRAM设计时使用矩阵方式,将一维的操作转化为二维操作。使用行地址选择器和列地址选择器方式。简化了电路的设计。仅需要很少地址线,为了能区分行或列需要额外的一些lines。 总结: 处于成本考虑内存大多使用DRAM 需要单独选择存储单元才能使用 由于性价比考虑选择DRAM地址线设计使用矩阵方式。 在读取或写入操作的可用之前由于电器特性需要一段时间 ...
在搭建blog使用https服务,需要申请配置一个域名证书,使用了Let’s Encrypt申请了免费的https证书。
今天登录到博客提示需要升级php,更新了下镜像顺便把之前搭建的步骤整理了一下。
Given an integer array nums sorted in non-decreasing order, return _an array of the squares of each number sorted in non-decreasing order
Given two strings s and t, check if s is a subsequence of t
DeFi:Decentralized finance 是一种基于block-chain的金融形式。他不依赖于券商,银行,交易所等中心话的机构。
Given an integer array nums, return all the triplets numsi, numsj, numsk such that i != j, i != k, and j != k, and numsi + numsj + numsk == 0