Linux命令
查看centos版本:cat /etc/redhat-release
查看服务及状态:systemctl list-unit-files --type=service
查看已安装软件包:yum list installed
查看网线连接状态:cat /sys/class/net/eth0/operstate
查看网卡连接状态:ethtool eth0 | grep detected
查看centos版本:cat /etc/redhat-release
查看服务及状态:systemctl list-unit-files --type=service
查看已安装软件包:yum list installed
查看网线连接状态:cat /sys/class/net/eth0/operstate
查看网卡连接状态:ethtool eth0 | grep detected
vi /etc/systemd/system/obtain-ipv6.service
[Unit]
Description=Auto Obtain IPV6 Address
After=network.target
[Service]
Type=simple
ExecStart=/usr/bin/obtain-ipv6.sh start
ExecStop=/usr/bin/obtain-ipv6.sh stop
ExecReload=/usr/bin/obtain-ipv6.sh reload
[Install]
WantedBy=multi-user.targetsystemctl enable obtain-ipv6.service
vi /usr/bin/obtain-ipv6.sh
#!/bin/bash
if [ $1 == "start" ];then
    dhclient -6 ens3
elif [ $1 == "STOP" ];then
    dhclient -6 -r
elif [ $1 == "reload" ];then
    dhclient -6 -r
    dhclient -6 ens3
fichmod u+x /usr/bin/obtain-ipv6.sh
修改主题下的index.php
将如下代码放在$this->need('header.php');后
/** 文章置顶 */
$sticky = '1'; //置顶的文章id,多个用|隔开
if($sticky){
    $sticky_cids = explode('|',$sticky); //分割文本
    $db = Typecho_Db::get();
    $pageSize = $this->options->pageSize;
    $select1 = $this->select()->where('type = ?', 'post');
    $select2 = $this->select()->where('type = ? && status = ? && created < ?', 'post','publish',time());
    //清空原有文章的列队
    $this->row = [];
    $this->stack = [];
    $this->length = 0;
    $order = '';
    foreach($sticky_cids as $i => $cid) {
        if($i == 0) $select1->where('cid = ?', $cid);
        else $select1->orWhere('cid = ?', $cid);
        $order .= " when $cid then $i";
        $select2->where('table.contents.cid != ?', $cid); //避免重复
    }
    if ($order) $select1->order('', "(case cid$order end)"); //置顶文章的顺序 按 $sticky 中 文章ID顺序
    if ($this->_currentPage == 1) foreach($db->fetchAll($select1) as $sticky_post){ //首页第一页才显示
        $sticky_post['sticky'] = $sticky_html;
        $this->push($sticky_post); //压入列队
    }
    $uid = $this->user->uid; //登录时,显示用户各自的私密文章
    if($uid) $select2->orWhere('authorId = ? && status = ?',$uid,'private');
    $sticky_posts = $db->fetchAll($select2->order('table.contents.created', Typecho_Db::SORT_DESC)->page($this->_currentPage, $this->parameter->pageSize));
    foreach($sticky_posts as $sticky_post) $this->push($sticky_post); //压入列队
    $this->setTotal($this->getTotal()-count($sticky_cids)); //置顶文章不计算在所有文章内
}                | Date | Time | Distance | Avg. Pace | 
|---|---|---|---|
| 2023-10-11 | 05:58-06:24 | 5KM | 5'07" | 
| 2023-10-13 | 06:05-06:30 | 5KM | 4'51" | 
| 2023-10-14 | 06:19-06:42 | 5KM | 4'45" | 
| 2023-10-15 | 06:44-07:59 | 15KM | 4'57" | 
| 2023-10-17 | 06:12-06:36 | 5KM | 4'50" | 
| 2023-10-19 | 06:37-07:02 | 5KM | 4'52" | 
| 2023-10-20 | 06:18-06:42 | 5KM | 4'54" | 
| 2023-10-23 | 06:00-06:24 | 5KM | 4'52" | 
| 2023-10-26 | 06:02-06:26 | 5KM | 4'46" | 
| 2023-10-30 | 06:12-06:36 | 5KM | 4'48" | 
| 2023-11-3 | 05:28-05:53 | 5KM | 5'00" | 
| 2023-11-5 | 08:04-09:50 | 21KM | 5'00" | 
| 2023-11-23 | 05:54-06:16 | 5KM | 4'28" | 
| 2023-11-24 | 05:43-06:06 | 5KM | 4'39" | 
| 2023-11-26 | 06:18-07:05 | 10KM | 4'44" | 
| 2023-12-6 | 06:22-06:44 | 5KM | 4'29" | 
| 2023-12-10 | 07:03-07:50 | 10KM | 4'44" | 
| 2023-12-13 | 06:29-06:51 | 5KM | 4'25" | 
| 2024-1-1 | 06:16-07:03 | 10KM | 4'43" | 
| 2024-1-6 | 09:06-10:13 | 11.8KM | 5'27" | 
| 2024-1-27 | 09:34-10:40 | 11.74KM | 5'23" | 
| 2024-2-12 | 16:39-17:04 | 5KM | 4'49" | 
| 2024-3-6 | 18:39-19:47 | 11KM | 6'12" | 
| 2024-3-23 | 09:02-10:12 | 11.77KM | 5'48" | 
| 2024-4-2 | 05:47-06:12 | 5KM | 4'59" | 
| 2024-4-16 | 05:48-06:12 | 5KM | 4'51" | 
| 2024-6-19 | 05:38-06:03 | 5KM | 5'03" | 
| 2024-6-25 | 05:49-06:14 | 5KM | 4'57" | 
| 2024-6-27 | 05:51-06:15 | 5KM | 4'47" | 
| 2024-7-5 | 05:56-06:19 | 5KM | 4'42" | 
| 2024-7-9 | 05:50-06:14 | 5KM | 4'56" | 
| 2024-7-10 | 05:44-06:10 | 5KM | 5'18" | 
| 2024-7-15 | 05:57-06:21 | 5KM | 4'47" | 
| 2024-7-17 | 05:49-06:14 | 5KM | 4'56" | 
| 2024-7-19 | 05:42-06:06 | 5KM | 4'51" | 
| 2024-7-22 | 05:58-06:23 | 5KM | 4'58" | 
| 2024-7-25 | 05:58-06:21 | 5KM | 4'40" | 
| 2024-8-4 | 04:51-05:16 | 5KM | 4'55" | 
| 2024-8-6 | 05:45-06:09 | 5KM | 4'46" | 
| 2024-8-8 | 05:56-06:19 | 5KM | 4'46" | 
| 2024-8-15 | 05:55-06:20 | 5KM | 4'56" | 
| 2024-8-20 | 05:39-06:04 | 5KM | 4'46" | 
| 2024-8-22 | 05:59-06:24 | 5KM | 4'56" | 
| 2024-8-24 | 06:55-08:12 | 11KM | 6'09" | 
| 2024-8-31 | 21:25-21:52 | 5KM | 5'04" | 
| 2024-9-2 | 05:49-06:15 | 5KM | 4'53" | 
| 2024-9-9 | 05:47-06:12 | 5KM | 4'59" | 
| 2024-9-13 | 05:24-05:49 | 5KM | 5'01" | 
| 2024-9-14 | 05:44-06:12 | 5KM | 5'12" | 
| 2024-9-26 | 05:53-06:18 | 5KM | 4'55" | 
| 2024-9-27 | 05:35-06:00 | 5KM | 4'55" | 
| 2024-9-29 | 05:55-06:19 | 5KM | 4'42" | 
| 2024-9-30 | 05:12-05:36 | 5KM | 4'47" | 
| 2024-10-1 | 07:49-08:22 | 5KM | 6'10" | 
| 2024-10-10 | 05:47-06:14 | 5KM | 5'22" | 
| 2024-10-12 | 05:47-06:13 | 5KM | 5'03" | 
| 2024-10-17 | 05:54-06:18 | 5KM | 4'56" | 
| 2024-10-24 | 05:57-06:22 | 5KM | 4'59" | 
| 2024-10-26 | 05:51-06:17 | 5KM | 5'07" | 
| 2024-10-30 | 06:02-06:27 | 5KM | 5'07" | 
| 2024-10-31 | 06:02-06:29 | 5KM | 5'13" | 
| 2024-11-4 | 05:57-06:23 | 5KM | 5'16" | 
| 2024-11-7 | 05:56-06:22 | 5KM | 5'08" | 
| 2024-11-9 | 16:04-17:10 | 11KM | 5'40" | 
| 2024-11-16 | 05:45-06:11 | 5KM | 5'06" | 
| 2024-11-25 | 20:47-21:13 | 5KM | 4'59" | 
| 2024-11-28 | 05:51-06:16 | 5KM | 4'54" | 
| 2024-11-29 | 05:56-06:22 | 5KM | 5'01" | 
| 2024-11-30 | 05:49-06:15 | 5KM | 5'08" | 
| 2024-12-5 | 05:41-06:06 | 5KM | 4'50" | 
| 2024-12-6 | 05:45-06:09 | 5KM | 4'54" | 
| 2024-12-13 | 05:35-05:59 | 5KM | 4'55" | 
| 2024-12-20 | 05:47-06:13 | 5KM | 5'12" | 
| 2024-12-29 | 07:17-07:40 | 5KM | 4'36" | 
| 2024-12-29 | 18:26-18:55 | 5KM | 5'11" | 
| 2024-12-31 | 05:50-06:15 | 5KM | 5'05" | 
| 2024-12-31 | 23:09-23:35 | 5KM | 5'08" | 
| 2025-1-20 | 17:18-17:43 | 5KM | 4'55" | 
| 2025-2-20 | 06:10-06:35 | 5KM | 4'59" | 
| 2025-2-22 | 06:40-07:06 | 5KM | 5'02" | 
| 2025-2-23 | 06:19-06:43 | 5KM | 4'46" | 
| 2025-2-25 | 21:59-22:27 | 5KM | 5'11" | 
| 2025-2-26 | 06:16-06:41 | 5KM | 4'53" | 
| 2025-2-28 | 05:56-06:20 | 5KM | 4'52" | 
| 2025-3-11 | 06:16-06:40 | 5KM | 4'48" | 
| 2025-3-13 | 05:59-06:24 | 5KM | 4'59" | 
| 2025-4-23 | 05:55-06:21 | 5KM | 5'17" | 
| 2025-4-24 | 05:54-06:23 | 5KM | 5'49" | 
| 2025-4-28 | 05:39-06:06 | 5KM | 5'14" | 
| 2025-4-29 | 05:54-06:19 | 5KM | 4'57" | 
| 2025-5-19 | 06:06-06:32 | 5KM | 5'09" | 
| 2025-5-21 | 06:09-06:35 | 5KM | 5'18" | 
| 2025-5-23 | 05:47-06:13 | 5KM | 5'08" | 
| 2025-5-26 | 05:55-06:19 | 5KM | 4'44" | 
| 2025-5-30 | 05:51-06:16 | 5KM | 4'49" | 
| 2025-6-4 | 06:09-06:35 | 5KM | 5'15" | 
| 2025-6-5 | 05:51-06:17 | 5KM | 5'13" | 
| 2025-6-18 | 05:49-06:14 | 5KM | 5'06" | 
| 2025-6-20 | 05:44-06:09 | 5KM | 5'03" | 
| 2025-6-24 | 05:48-06:12 | 5KM | 4'48" | 
| 2025-6-25 | 05:36-06:00 | 5KM | 4'52" | 
| 2025-7-3 | 05:54-06:18 | 5KM | 4'55" | 
| 2025-7-7 | 05:56-06:20 | 5KM | 4'54" | 
| 2025-7-9 | 05:48-06:13 | 5KM | 4'58" | 
| 2025-7-18 | 05:39-06:03 | 5KM | 4'55" | 
| 2025-7-24 | 06:11-06:35 | 5KM | 4'44" | 
| 2025-7-28 | 06:00-06:27 | 5KM | 5'20" | 
| 2025-7-29 | 05:47-06:13 | 5KM | 5'03" | 
| 2025-8-8 | 05:55-06:20 | 5KM | 4'57" | 
| 2025-8-11 | 05:56-06:22 | 5KM | 5'08" | 
| 2025-8-13 | 04:31-04:57 | 5KM | 5'15" | 
| 2025-8-23 | 05:57-06:23 | 5KM | 5'07" | 
| 2025-8-26 | 06:10-06:36 | 5KM | 5'09" | 
| 2025-8-28 | 05:57-06:24 | 5KM | 5'17" | 
| 2025-8-30 | 04:51-05:18 | 5KM | 5'26" | 
| 2025-8-31 | 04:28-05:19 | 10KM | 5'07" | 
| 2025-9-7 | 03:54-04:18 | 5KM | 4'50" | 
| 2025-9-13 | 05:44-06:10 | 5KM | 5'10" | 
| 2025-9-16 | 06:04-06:29 | 5KM | 4'59" | 
| 2025-9-27 | 04:25-04:50 | 5KM | 4'59" | 
| 2025-9-28 | 06:13-06:38 | 5KM | 5'02" | 
| 2025-9-29 | 06:12-06:37 | 5KM | 5'00" | 
| 2025-9-30 | 06:07-06:33 | 5KM | 5'07" | 
| 2025-10-25 | 14:11-15:20 | 11.8KM | 5'40" | 
| 2025-10-28 | 06:24-06:50 | 5KM | 5'07" | 
| 2025-10-29 | 06:11-06:37 | 5KM | 5'06" | 
| 2025-10-31 | 05:58-06:25 | 5KM | 5'21" | 
#include <stdio.h>
//351302984184056
#define IMEI "35130298418405"
int getIMEICheckDigit(char *imei)
{
    int i, sum1 = 0, sum2 = 0, temp, result = 0;
    for (i = 0; i < 14; i++) {
        if (i % 2 == 0) {
            //奇数位和
            sum1 += imei[i] - '0';
        } else {
            //偶数位乘2 个位十位和
            temp = (imei[i] - '0') * 2;
            sum2 += temp;
            if (temp >= 10) {
                sum2 -= 9;
            }
        }
    }
    temp = (sum1 + sum2) % 10;
    if (temp != 0) {
        result = 10 - temp;
    }
    return result;
}
int main(int argc, char *agrv[])
{
    printf("IMEI %s check digit is %d\n", IMEI, getIMEICheckDigit(IMEI));
    return 0;
}