iOS 系统自带的“相机”应用无法进行删除,也就是说正常情况下不会丢失该功能。如果您无法在 iPhone 桌面上找到“相机”应用,可以从资源库中找到并移回至桌面,或检查“屏幕使用时间”设置。

  1.打开资源库查找“相机”:

  在 iPhone 桌面上连续向左轻扫,直至看到“应用资源库”,在资源库中找到“相机”图标,长按拖回到桌面,放置到理想的位置即可。

来自:https://g.pconline.com.cn/x/1585/15859231.html
捕获组与非捕获组概念:https://segmentfault.com/a/1190000021043947
文章中的工具用的正则表达式公式: https://regex101.com/
非捕获部分:(?:.*?<span title="(.*?)" .*?<\/span>)?




对天气中的温度和风力有时间只有一个温度和风力的情况的判断算法:
温度部分:
    $temperature = '';
    if (preg_match('/<span>(.*?)<\/span>\/<i>(.*?)<\/i>/', $matches[4], $temp_matches)) {
        $temperature = $temp_matches[1] . '/' . $temp_matches[2];
    } else if (preg_match('/<i>(.*?)<\/i>/', $matches[4], $temp_matches)) {
        $temperature = $temp_matches[1];
    }

风力部分:
问ChatGPT:我只想知道正则如何匹配到下面这段的:

<p class="win">
<em>
<span title="南风" class="S"></span>
<span title="南风" class="S"></span>
</em>
<i>&lt;3级</i>
</p>
对下面这段正则作下解释:

<p class="win">.*?<span title="(.*?)" .*?<\/span>(?:.*?<span title="(.*?)" .*?<\/span>)?
上面第一个.*?是非贪婪匹配它后面的:<span title=。
上在第二个(.*?)是匹配南风。
上在第三个.*?是非贪婪匹配它后面的:<\/span>。
是对的吧?
二、最想知道的是:
(?:.?<span title="(.?)" .?</span>)?
上在这段正则里面的:?:.? 是想干嘛的呢?
它最后的问号是用来匹配0次或1次用的,这个是这么理解吧。

ChatGPT回答如下:
你说得基本是对的。让我逐步解释一下你提到的正则表达式是如何匹配 `<p class="win">` 这段 HTML 代码的,以及 `(?:.*?<span title="(.*?)" .*?<\/span>)?` 这部分正则表达式的具体作用。

### 1. 正则表达式整体

```regex
<p class="win">.*?<span title="(.*?)" .*?<\/span>(?:.*?<span title="(.*?)" .*?<\/span>)?
```

#### 1.1. `<p class="win">.*?<span title="(.*?)" .*?<\/span>`

- `<p class="win">`: 匹配 `<p>` 标签的开头部分,class 属性为 `win`。
- `.*?`: 非贪婪模式匹配任意字符,尽量少的字符,直到遇到 `<span title=`。
- `<span title="(.*?)"`: 匹配第一个 `span` 标签,并捕获 `title` 属性的值。`(.*?)` 是一个非贪婪模式的捕获组,匹配 `title` 属性的内容,这里会匹配到 `南风`。
- ` .*?<\/span>`: 非贪婪模式匹配任意字符,直到遇到 `</span>`。

这一部分的正则表达式解释如下:
- `<p class="win">` 精确匹配标签的开始部分。
- `.*?` 尽量少的匹配任意字符,直到遇到 `<span title=`。
- `<span title="(.*?)"` 匹配 `span` 标签的 `title` 属性,捕获组 `(.*?)` 非贪婪模式匹配 `title` 的内容,即 `南风`。
- ` .*?<\/span>` 匹配从 `title` 属性结束到 `</span>` 标签结束的所有字符。

#### 1.2. `(?:.*?<span title="(.*?)" .*?<\/span>)?`

- `(?: ... )`: 非捕获组,匹配括号内的内容,但不捕获它。
- `.*?`: 非贪婪模式匹配任意字符,尽量少的字符,直到遇到 `<span title=`。
- `<span title="(.*?)"`: 匹配第二个 `span` 标签,并捕获 `title` 属性的值。`(.*?)` 是一个非贪婪模式的捕获组,匹配 `title` 属性的内容,这里会匹配到第二个 `南风`。
- ` .*?<\/span>`: 非贪婪模式匹配任意字符,直到遇到 `</span>`。
- `?`: 匹配前面的非捕获组 0 次或 1 次。即这部分是可选的。

这一部分的正则表达式解释如下:
- `(?: ... )` 表示一个非捕获组,不会保存匹配结果。
- `.*?` 尽量少的匹配任意字符,直到遇到 `<span title=`。
- `<span title="(.*?)"` 匹配 `span` 标签的 `title` 属性,捕获组 `(.*?)` 非贪婪模式匹配 `title` 的内容,即第二个 `南风`。
- ` .*?<\/span>` 匹配从 `title` 属性结束到 `</span>` 标签结束的所有字符。
- `?` 表示这个非捕获组是可选的,可以匹配 0 次或 1 次。

### 2. 匹配示例

以你提供的 HTML 代码为例:

```html
<p class="win">
<em>
<span title="南风" class="S"></span>
<span title="南风" class="S"></span>
</em>
<i>&lt;3级</i>
</p>
```

- `<p class="win">`: 匹配 `<p class="win">`。
- `.*?`: 非贪婪模式匹配任意字符,直到遇到 `<span title=`。匹配到 `\n<em>\n`。
- `<span title="(.*?)"`: 匹配 `<span title="南风"` 并捕获 `title` 属性的值 `南风`。
- ` .*?<\/span>`: 匹配 `class="S"></span>\n`。

接下来是可选部分:

- `(?:.*?<span title="(.*?)" .*?<\/span>)?`:
  - `.*?`: 非贪婪模式匹配任意字符,直到遇到 `<span title=`。匹配到 `\n`。
  - `<span title="(.*?)"`: 匹配 `<span title="南风"` 并捕获 `title` 属性的值 `南风`。
  - ` .*?<\/span>`: 匹配 `class="S"></span>\n`。
  - `?`: 表示这个部分是可选的,可以匹配 0 次或 1 次。这次匹配到 1 次。

### 总结

- `<p class="win">.*?<span title="(.*?)" .*?<\/span>`: 匹配 `<p class="win">` 开始标签,直到第一个 `span` 标签的 `title` 属性,并捕获其值。
- `(?:.*?<span title="(.*?)" .*?<\/span>)?`: 匹配从第一个 `span` 标签结束到第二个 `span` 标签结束的内容,并捕获第二个 `span` 标签的 `title` 属性,整个部分是可选的。
- `?` 表示前面的非捕获组是可选的,可以出现 0 次或 1 次。



再对正则知识点细节性问:
(?: ... ) 表示一个非捕获组,不会保存匹配结果。
上面这个是什么意思,请再接合解释下面正则:
(?:.?<span title="(.?)" .*?</span>)?

ChatGPT回答:
好的,让我们详细解释一下 `(?: ... )` 和具体的正则表达式 `(?:.*?<span title="(.*?)" .*?<\/span>)?`。

### 非捕获组 `(?: ... )`

- `(?: ... )` 是一个**非捕获组**,它的作用是将括号内的内容进行分组,但不保存这个组的匹配结果。这和普通的捕获组 `(...)` 不同,普通捕获组会保存匹配结果供后续引用,而非捕获组则不会保存。
- 非捕获组主要用于在需要进行分组但不希望保存匹配结果的情况下,这样可以节省内存,并且在使用正则表达式时不需要担心额外的捕获组会影响捕获组编号。

### 具体的正则表达式 `(?:.*?<span title="(.*?)" .*?<\/span>)?`

#### 分解解释

1. **`(?: ... )`**:
   - 这是一个非捕获组,括号内的内容会被当作一个整体来处理,但不会保存匹配结果。

2. **`.*?`**:
   - 非贪婪模式匹配任意字符,尽量少的字符,直到遇到 `<span title=`。
   - 这里匹配的是从 `<p class="win">` 到第一个 `<span title="...">` 之间的任意字符,包括换行符等。

3. **`<span title="(.*?)"`**:
   - 匹配 `<span title="` 字符串,并捕获 `title` 属性的值。
   - `(.*?)` 是一个非贪婪模式的捕获组,匹配 `title` 属性的内容。例如,`南风`。

4. **` .*?<\/span>`**:
   - 非贪婪模式匹配任意字符,直到遇到 `</span>`。
   - 这里匹配的是从 `title` 属性结束到 `</span>` 标签结束的所有字符。

5. **`(?: ... )?`**:
   - 问号 `?` 表示前面的非捕获组是可选的,可以匹配 0 次或 1 次。
   - 整个非捕获组 `(?: ... )` 是可选的,意味着可以有一个额外的 `span` 标签,或者没有。

#### 具体示例

以你的 HTML 代码为例:

```html
<p class="win">
<em>
<span title="南风" class="S"></span>
<span title="南风" class="S"></span>
</em>
<i>&lt;3级</i>
</p>
```

匹配过程如下:

1. **第一部分** `<p class="win">.*?<span title="(.*?)" .*?<\/span>`:
   - 匹配 `<p class="win">` 开始标签。
   - `.*?` 非贪婪模式匹配任意字符,直到遇到第一个 `<span title=`。
   - 匹配并捕获第一个 `span` 标签的 `title` 属性值 `南风`。
   - 匹配 `</span>` 标签。

2. **第二部分** `(?:.*?<span title="(.*?)" .*?<\/span>)?`:
   - `(?: ... )` 非捕获组,将内容作为整体处理。
   - `.*?` 非贪婪模式匹配任意字符,直到遇到第二个 `<span title=`。
   - 匹配并捕获第二个 `span` 标签的 `title` 属性值 `南风`。
   - 匹配 `</span>` 标签。
   - `?` 表示非捕获组是可选的,可以匹配 0 次或 1 次。

### 完整正则表达式的匹配过程

完整的正则表达式 `(?:.*?<span title="(.*?)" .*?<\/span>)?` 在匹配过程中的作用如下:

1. 从 `<p class="win">` 开始,匹配任意字符直到第一个 `<span title=`。
2. 捕获第一个 `span` 标签的 `title` 属性值。
3. 匹配 `</span>` 标签。
4. 非捕获组 `(?: ... )?` 的内容(可选):
   - 匹配任意字符直到第二个 `<span title=`。
   - 捕获第二个 `span` 标签的 `title` 属性值。
   - 匹配 `</span>` 标签。

这段正则表达式会成功匹配以下内容,并分别捕获两个 `span` 标签的 `title` 属性值:

```html
<p class="win">
<em>
<span title="南风" class="S"></span>
<span title="南风" class="S"></span>
</em>
<i>&lt;3级</i>
</p>
```

结果是捕获两个 `span` 标签的 `title` 属性值 `南风` 和 `南风`。如果只有一个 `span` 标签,那么也能成功匹配,只会捕获第一个 `title` 属性值。

除开strace外还有一款性能分析工具:
sudo yum install perf
perf record -F max -a -g -- screen -ls

perf record -F max -a -g -- screen -ls
info: Using a maximum frequency rate of 11,000 Hz
There is a screen on:
        16882.abc       (Detached)
1 Socket in /var/run/screen/S-root.

[ perf record: Woken up 14 times to write data ]
[ perf record: Captured and wrote 4.143 MB perf.data (34888 samples) ]
可在不同设备上读取的perf.data 文件. 您可以使用 perf 工具将性能数据记录到 perf.data 文件中,以便在不同的设备上分析。


echo Soft: $(ulimit -Sn)
echo Hard: $(ulimit -Hn)
Soft: 1024000
Hard: 1024000

立即生效的解决办法(重启配置失效):
ulimit -Sn 10000
ulimit -Hn 50000

重启后永久生效实操:
要在 CentOS 7 上永久设置 `ulimit`,您需要修改 `/etc/security/limits.conf` 文件。这个文件允许您设置系统级别的资源限制。您可以按照以下步骤进行修改:

1. 打开终端并以 root 用户身份登录。
2. 使用文本编辑器(如 `vi` 或 `nano`)打开 `/etc/security/limits.conf` 文件:

```bash
sudo vi /etc/security/limits.conf
```

3. 在文件末尾添加以下行:

```
*       soft    nofile  10000
*       hard    nofile  50000
```

这里,`soft` 代表软限制,`hard` 代表硬限制。软限制是系统允许的最大值,超过此限制时会发出警告。硬限制是系统允许的绝对最大值,超过此限制时会导致操作失败。通常情况下,软限制和硬限制是相同的。

4. 保存并关闭文件。在 vi 中,您可以按 `Esc` 键输入 `:wq` 然后按 `Enter` 保存并退出。

5. 重新启动系统或重新登录以使更改生效。

现在 `ulimit` 的设置应该在系统重新启动后生效,并且将永久保持。

fix: Normalize RLIMIT_NOFILE (LimitNOFILE) to sensible defaults:
https://github.com/moby/moby/pull/45534

gnu screen run extremely slow when using 'root' user in container since docker 23.0.1 #45380:
https://github.com/moby/moby/issues/45380


=============================================================

火焰图
on-cpu火焰图可以用于分析cpu是被哪些线程、哪些函数占用的,可以方便的找到热点代码便于后续分析优化。下面我们介绍下火焰图的生成和使用方法。

使用方法
准备FlameGraph工具。
git clone https://github.com/brendangregg/FlameGraph.git
用perf record采集CPU信息。
perf record -e cpu-clock -g  ./perf_test
Ctrl+c结束执行后,在当前目录下会生成采样数据perf.data。

用perf script工具对perf.data进行解析。
perf script -i perf.data &> perf.unfold
将perf.unfold中的符号进行折叠。
./stackcollapse-perf.pl perf.unfold &> perf.folded
最后生成svg图。
./flamegraph.pl perf.folded > perf.svg
perf.svg 用浏览器就可以打开

来自:https://github.com/moby/moby/pull/45534

$date = microtime(true);// 返回浮点数,小数点前面是当前时间的时间戳,小数点后为当前时间的微秒
var_dump($date);
// 输出:float(1566897763.0927)



PHP的round函数用于四舍五入浮点数。它的作用是返回最接近一个数字的整数,也可以指定小数点后的位数。例如:

$float = 3.14159;
$rounded = round($float, 2); // 返回 3.14
$rounded = round($float); // 返回 3


要求:timestamp 时间戳 :"timestamp": "1709986011923"        #13位的毫秒数,时间戳(精确到毫秒),当前时间5分钟内请求有效
实现:
cat sendmsg_2.php

php sendmsg_2.php
1709986816.8926         #获取当前Unix时间戳,包括微秒  
1709986816893            #转换为毫秒

Mac下面压缩是zip的,放FreeBSD下面怎么解压呢?
FreeBSD下面安装unzip的方法是:
pkg install  -y unzip #注意:-y是安装在unzip的前面才行

二是:Port方式安装:
-->whereis unzip  查找port源
一般是/usr/ports/archivers/unzip
cd /usr/ports/archivers/unzip
make install clean
rehash    ---在不重启服务器的条件使安装了的命令生效
就可以用unzip命令了 。。
然后通过ftp上传PHPWind_GBK_5[1].3.zip
用unzip PHPWind_GBK_5[1].3.zip
在服务器上解压。。

===> Options unchanged
/!\ WARNING /!\

You have security/openssl installed but do not have
DEFAULT_VERSIONS+=ssl=openssl set in your make.conf

===>  License Info-ZIP accepted by the user
===>   unzip-6.0_8 depends on file: /usr/local/sbin/pkg - found
=> unzip60.tar.gz doesn't seem to exist in /usr/ports/distfiles/.
=> Attempting to fetch https://downloads.sourceforge.net/project/infozip/UnZip%206.x%20%28latest%29/UnZip%206.0/unzip60.tar.gz
===>   Generating temporary packing list
install  -s -m 555 /usr/ports/archivers/unzip/work/unzip60/unzip  /usr/ports/archivers/unzip/work/stage/usr/local/bin
cd /usr/ports/archivers/unzip/work/unzip60 &&  install  -s -m 555 funzip unzipsfx /usr/ports/archivers/unzip/work/stage/usr/local/bin
/bin/ln -sf unzip /usr/ports/archivers/unzip/work/stage/usr/local/bin/zipinfo
install  -m 555 /usr/ports/archivers/unzip/work/unzip60/unix/zipgrep /usr/ports/archivers/unzip/work/stage/usr/local/bin
install  -m 444 /usr/ports/archivers/unzip/work/unzip60/man/unzip.1  /usr/ports/archivers/unzip/work/stage/usr/local/share/man/man1
cd /usr/ports/archivers/unzip/work/unzip60/man && install  -m 444 funzip.1 unzipsfx.1 zipgrep.1 zipinfo.1  /usr/ports/archivers/unzip/work/stage/usr/local/share/man/man1
cd /usr/ports/archivers/unzip/work/unzip60 && install  -m 0644 README WHERE /usr/ports/archivers/unzip/work/stage/usr/local/share/doc/unzip
====> Compressing man pages (compress-man)
===>  Installing for unzip-6.0_8
===>  Checking if unzip is already installed
===>   Registering installation for unzip-6.0_8
Installing unzip-6.0_8...
===>  Cleaning for unzip-6.0_8

来自:https://dude6.com/article/182115.html
问题:
php的这段代码,不支持访问http时redirect到https,如:
访问:http://jtgl.beijing.gov.cn/jgj/lszt/659722/660341/index.html
307 Temporary Redirect导到:https://jtgl.beijing.gov.cn/jgj/lszt/659722/660341/index.html

请将该函数修改成能自动导到https并获取到相应body内容:
//发起https的get请求
function https_get($url,$timeout=120){
   $curl = curl_init();
   curl_setopt($curl, CURLOPT_URL, $url);
   curl_setopt($curl, CURLOPT_HEADER, 0);
   curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
   curl_setopt($curl, CURLOPT_TIMEOUT,$timeout);
   curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);  // 跳过检查                                                                                                                  
   curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);  // 跳过检查                                                                                                                  
   $res = curl_exec($curl);                                                                                                                                                          
   curl_close($curl);                                                                                                                                                                
   return $res;   //返回json对象                                                                                                                                                    
}  

回答:
要在PHP中自动将HTTP请求重定向到HTTPS并获取响应内容,您可以使用curl来检测HTTP响应头中的重定向,然后执行相应的HTTPS请求。以下是修改后的函数示例:

function https_get($url, $timeout = 120) {
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, $url);
    curl_setopt($curl, CURLOPT_HEADER, true);
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($curl, CURLOPT_TIMEOUT, $timeout);
    curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
    curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
    curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true); // 启用重定向跟随

    $response = curl_exec($curl);

    $httpCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);
    if ($httpCode == 301 || $httpCode == 302) {
        $matches = array();
        preg_match('/Location:(.*?)\n/', $response, $matches);
        $newUrl = trim(array_pop($matches));

        if (!empty($newUrl)) {
            curl_setopt($curl, CURLOPT_URL, $newUrl);
            $response = curl_exec($curl);
        }
    }

    curl_close($curl);
    return $response;
}

$url = "http://jtgl.beijing.gov.cn/jgj/lszt/659722/660341/index.html";
$response = https_get($url);
echo $response;


php -a 测试是OK的。




问题二:那直接在shell下用curl命令实现上面307的Location转向获取到转向后的内容,用什么参数实现呢?我记得好像是有相应参数的。
是的,您可以使用`curl`命令行工具来获取重定向后的内容。要实现HTTP 307重定向的自动跟随,您可以使用`-L`或`--location`参数,这会让`curl`自动跟随重定向并获取最终的内容。下面是示例:


使用`-L`参数,`curl`将自动处理HTTP 307 Temporary Redirect,并获取最终的内容。

3XX response code


       -L, --location
              (HTTP) If the server reports that the requested page has moved to a different location (indicated with a Location: header and a 3XX response code), this option will make
              curl redo the request on the new place. If used together with -i, --include or -I, --head, headers from all requested pages will be shown. When authentication is used, curl
              only sends its credentials to the initial host. If a redirect takes curl to a different host, it will not be able to intercept the user+password. See also --location-
              trusted on how to change this. You can limit the amount of redirects to follow by using the --max-redirs option.
1、命令行直接打开「控制台」应用程序:/System/Applications/Utilities/Console.app
2、手工打开「控制台」应用程序步骤:使用 Spotlight 搜索:点击屏幕右上角的放大镜图标或按下 Command + 空格键,然后在弹出的搜索栏中输入 "控制台"(Console)。

在搜索结果中,你应该会看到 "控制台" 应用程序的图标。点击它以打开应用程序。

一旦打开 "控制台" 应用程序,你将看到左侧的导航栏,其中包含不同类型的日志。你可以选择 "日志报告" 以查看系统日志文件。
==============================================================================================
崩溃报告(Crash Reports):这些报告通常包含有关应用程序或进程崩溃的信息。如果 WindowServer 或其他进程崩溃,相关信息可能会出现在这些报告中。

Spin报告(Spin Reports):Spin 报告包含关于进程的信息,可能会显示进程卡住的情况。这些报告可能提供一些线索,说明哪个进程可能导致了问题。

日志报告(Log Reports):日志报告通常包含系统和应用程序的日志信息。虽然它们不是系统日志,但可能包含有关 WindowServer 或其他进程活动的记录。

诊断报告(Diagnostics Reports):诊断报告通常是系统生成的详细报告,用于识别和解决问题。你可以查看这些报告以获取更多信息。

请打开这些报告,查看是否有与 WindowServer 或其他进程相关的信息,以便更好地了解问题的根本原因。如果你不确定如何解释报告中的信息或需要进一步的帮助,建议联系 Apple 支持或专业人员进行更详细的故障排除。感谢你的耐心和理解。
系统类型:64 位操作系统, 基于 x64 的处理器
经实践发现得安装:X86的,64位的无效。
下载:vcredist_x86.exe
DownLoadURL: https://download.microsoft.com/download/1/6/5/165255E7-1014-4D0A-B094-B6A430A6BFFC/vcredist_x86.exe
微软官网下载入口:https://www.microsoft.com/zh-cn/download/details.aspx?id=26999

来自:https://zhuanlan.zhihu.com/p/651888193
实际修改二进制步骤:https://www.windows11.pro/1359.html
<span>00000008 行中 FE 下<strong>的 03 值</strong>,如下面的屏幕截图所示。</span>
<p><strong><span>6.</span></strong><span>按</span><strong><span>DEL</span></strong><span>删除</span><strong><span>03</span></strong><span>并键入</span><strong><span>01</span></strong><span>。</span></p>

导出再修改:
Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\StuckRects3]
"Settings"=hex:30,00,00,00,fe,ff,ff,ff,7a,f4,00,00,03,00,00,00,3c,00,00,00,3c,\
  00,00,00,00,00,00,00,fc,03,00,00,80,07,00,00,38,04,00,00,78,00,00,00,01,00,\
  00,00



Windows11是一款由微软公司推出的PC操作系统,在该版本中,开发商进行了一系列的更新和优化,那么不少用户在下载win11下载安装之后,应该怎么把任务栏放左边呢?现在通过这篇文章给大家介绍一下。

首先使用键盘快捷键“Win+R”调出运行程序。
在运行中输入“regedit”,回车确定,打开注册表编辑器。
将如下路径复制到注册表路径中“\HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\StuckRects3”


然后在右侧找到“settings”,双击打开它。

然后找到“00000008”一行,“FE”一列下的数值,将它改为“00”即可。
点击在新窗口中浏览此图片

这里“00”表示“左边”,“01”表示“上方”,“02表示右边”,“03”表示“底部”。

From:https://g.pconline.com.cn/x/1628/16289115.html

https://answers.microsoft.com/zh-hans/windows/forum/all/%E6%88%91%E5%9C%A8%E6%B3%A8%E5%86%8C%E8%A1%A8/bc7546bf-c353-420d-9386-775255c9e8a2

https://zhuanlan.zhihu.com/p/385038278
在Mac上,软链接(symbolic link)是一种特殊类型的文件,它指向另一个文件或目录的路径。默认情况下,当你使用打包工具(例如tar命令)打包软链接时,会将软链接本身打包进去,而不是它所指向的实际文件。

如果你想要在打包时将软链接解析成实际文件路径并打包实际文件,可以使用-L选项来强制解析软链接。这样,打包工具会将软链接解析成实际文件,并将实际文件打包进去。

下面是使用tar命令打包时解析软链接的示例命令:


这个命令会将/path/to/symlink软链接解析成实际文件,并将实际文件打包到archive.tar.gz中。

另外,如果你想要直接拷贝软链接所指向的原始文件,而不是拷贝软链接本身,可以使用cp命令的-L选项。这样,cp命令会拷贝软链接所指向的实际文件而不是软链接本身。

下面是使用cp命令拷贝软链接指向的原始文件的示例命令:

这个命令会拷贝/path/to/symlink软链接所指向的实际文件到/path/to/destination目录中。

请注意,tar命令和cp命令中的-L选项可能在不同的操作系统和版本中略有不同,请根据你的系统和命令版本来查阅相关文档以确保正确使用。


=========
在 CentOS 7 中,systemctl 会根据服务的名称在 /var/run 目录下的 systemd 子目录创建对应的 PID 文件。具体来说,对于服务名称为 pdfwatcher 的服务,systemctl 会在 /var/run/systemd/ 目录下创建一个名为 pdfwatcher.service 的 PID 文件。

你可以通过以下命令查看该 PID 文件的内容:

bash
Copy code
cat /var/run/systemd/pdfwatcher.service
该文件中只包含一个数字,即 pdfwatcher 服务的进程号。这样,systemctl 就可以根据 PID 文件来跟踪服务的进程,并执行相应的管理和控制操作。

请注意,/var/run 目录通常在系统启动时自动挂载,并用于存储运行时的变量数据和进程相关信息。因此,当服务启动时,systemd 会自动在这个目录下创建 PID 文件。




User
我没有找到对应的pid文件,我的systemctl的service文件是写成这样的,为何没有生成呢?
cat /usr/lib/systemd/system/pdfwatcher.service
# It's not recommended to modify this file in-place, because it
# will be overwritten during upgrades.  If you want to customize,
# the best way is to use the "systemctl edit" command.

[Unit]
Description=pdfwatcher is a real-time monitoring pdf file chmod value is no longer 400 and alarm daemon
After=network.target

[Service]

Type=forking

ExecStart=/usr/local/pdfwatcher/bin/pdfwatcherd -d

ExecStop=/usr/local/pdfwatcher/bin/pdfwatcherd stop

PrivateTmp=true

[Install]
WantedBy=multi-user.target
import cycle not allowed
而且如果项目很大的时候,一个包下面有很多 .go 文件,只提示包与包的循环引用(如上图),是很难定位到哪个 .go 文件和哪个 .go 文件直接进行了循环引用,难以排查。

go-cyclic run --dir  ~/go_learning/src/pdfwatcher.src.cctv.cn
Failed. 1 circular dependence chains were found.

┌---→  /Users/jackXiang/go_learning/src/pdfwatcher.src.cctv.cn/Requests/Request.go
┆                                       ↓
└---     /Users/jackXiang/go_learning/src/pdfwatcher.src.cctv.cn/Loger/Loger.go


安装:
go install github.com/elza2/go-cyclic@latest
go: downloading github.com/elza2/go-cyclic v1.1.0
go: downloading github.com/fatih/color v1.15.0
go: downloading golang.org/x/mod v0.8.0
go: downloading github.com/urfave/cli/v2 v2.24.4
go: downloading github.com/mattn/go-isatty v0.0.17
go: downloading github.com/mattn/go-colorable v0.1.13
go: downloading golang.org/x/sys v0.6.0
go: downloading github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673
go: downloading github.com/cpuguy83/go-md2man/v2 v2.0.2
go: downloading github.com/russross/blackfriday/v2 v2.1.0



来自:https://link.zhihu.com/?target=https%3A//github.com/elza2/go-cyclic
背景:容器中用docker stop  4d393592c6ec ,sameersbn/redmine:5.0.5 的容器会产生如下日志,docker logs 4d393592c6e  #docker stop 4d393592c6ec  会触发下面的退出,而不是臆想的主动退出了,是手工执行出现docker 退出。

2023-05-18 07:52:16,943 WARN received SIGTERM indicating exit request
2023-05-18 07:52:16,943 INFO waiting for unicorn, cron, nginx to die
2023-05-18 07:52:16,945 INFO stopped: nginx (exit status 0)
2023-05-18 07:52:16,946 INFO stopped: cron (terminated by SIGTERM)
2023-05-18 07:52:17,947 INFO stopped: unicorn (exit status 0)

是一个SIGTERM信号,kill -l 发现15) SIGTERM,编号15,才知道是我自己停止的,而不是长时间运行出现自动退出。这个很重要,因为容器的稳定性相当重要。
下面就以这段C代码进行模拟容器的退出并发SIGTERM信号,如下:
test.c


send.c 用于发送SIGTERM 信号给test


SIGTERM : 程序结束信号,与SIGKILL不同的是该信号可以被阻塞和处理。通常用来要求程序自己正常退出。Shell命令kill 默认产生这个信号。
gcc  test.c -o test
gcc  send.c -o send
运行程序:
./test

./send 12345  //12345是test的pid



终端下输入:
kill 12345
也会给test发送SIGTERM 信号。
or kill -15 12345
kill -SIGTERM 12345



来自:https://blog.csdn.net/a379039233/article/details/80715461
More signal:
#kill -l
1) SIGHUP       2) SIGINT       3) SIGQUIT      4) SIGILL       5) SIGTRAP
6) SIGABRT      7) SIGBUS       8) SIGFPE       9) SIGKILL     10) SIGUSR1
11) SIGSEGV     12) SIGUSR2     13) SIGPIPE     14) SIGALRM     15) SIGTERM
16) SIGSTKFLT   17) SIGCHLD     18) SIGCONT     19) SIGSTOP     20) SIGTSTP
21) SIGTTIN     22) SIGTTOU     23) SIGURG      24) SIGXCPU     25) SIGXFSZ
26) SIGVTALRM   27) SIGPROF     28) SIGWINCH    29) SIGIO       30) SIGPWR
31) SIGSYS      34) SIGRTMIN    35) SIGRTMIN+1  36) SIGRTMIN+2  37) SIGRTMIN+3
38) SIGRTMIN+4  39) SIGRTMIN+5  40) SIGRTMIN+6  41) SIGRTMIN+7  42) SIGRTMIN+8
43) SIGRTMIN+9  44) SIGRTMIN+10 45) SIGRTMIN+11 46) SIGRTMIN+12 47) SIGRTMIN+13
48) SIGRTMIN+14 49) SIGRTMIN+15 50) SIGRTMAX-14 51) SIGRTMAX-13 52) SIGRTMAX-12
53) SIGRTMAX-11 54) SIGRTMAX-10 55) SIGRTMAX-9  56) SIGRTMAX-8  57) SIGRTMAX-7
58) SIGRTMAX-6  59) SIGRTMAX-5  60) SIGRTMAX-4  61) SIGRTMAX-3  62) SIGRTMAX-2
63) SIGRTMAX-1  64) SIGRTMAX
原因
此磁盘已经被其他进程占用。

解决方法
方法1
ps -aux |grep " image(创建的磁盘名称)"
//通过上述命令找到相关进程杀死(该磁盘可能被别人占用,建议询问后在杀)
kill -9 “上述命令查出的进程号”
重新拉虚拟机
方法2
sb.img文件镜像大小制作: qemu-img create -f qcow2 sb.img 50G
启动虚拟机 fdisk -l 查看查看磁盘信息 一般会输出/dev/vda或/dev/vdb信息
mkfs.ext4 /dev/vda 格式化磁盘(分区磁盘,查看本地/document/Newer_enviroment_construct/分区磁盘命令)
新建一个文件夹mkdir /tmp , 并挂载磁盘 mount /dev/vda /tmp
替换原来的disk

实践如下:
ps -aux|grep "win10"
root     1519052  2.3  0.1 883548 92928 ?        Sl   14:51   1:25 /usr/bin/qemu-img convert -f qcow2 -O qcow2 -o compat=1.1,lazy_refcounts /backup/virtImages/win10_bak_10_10_0_119.img /backup/virtImages/win10_bak_10_10_0_168.img


kill -9 1519052


错误如下:
启动域时出错: 内部错误:process exited while connecting to monitor: 2023-05-12T07:49:37.817008Z qemu-kvm: -blockdev {"node-name":"libvirt-2-format","read-only":false,"driver":"qcow2","file":"libvirt-2-storage","backing":null}: Failed to get "write" lock
Is another process using the image [/backup/virtImages/win10_bak_10_10_0_119.img]?

Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/asyncjob.py", line 75, in cb_wrapper
    callback(asyncjob, *args, **kwargs)
  File "/usr/share/virt-manager/virtManager/asyncjob.py", line 111, in tmpcb
    callback(*args, **kwargs)
  File "/usr/share/virt-manager/virtManager/object/libvirtobject.py", line 66, in newfn
    ret = fn(self, *args, **kwargs)
  File "/usr/share/virt-manager/virtManager/object/domain.py", line 1280, in startup
    self._backend.create()
  File "/usr/lib64/python3.6/site-packages/libvirt.py", line 1234, in create
    if ret == -1: raise libvirtError ('virDomainCreate() failed', dom=self)
libvirt.libvirtError: 内部错误:process exited while connecting to monitor: 2023-05-12T07:49:37.817008Z qemu-kvm: -blockdev {"node-name":"libvirt-2-format","read-only":false,"driver":"qcow2","file":"libvirt-2-storage","backing":null}: Failed to get "write" lock
Is another process using the image [/backup/virtImages/win10_bak_10_10_0_119.img]?

来自:https://blog.csdn.net/qq_36657175/article/details/124748507
在Windows上,虽然它不是通用的,但许多应用程序都支持快捷键Ctrl + Shift + V来粘贴而不格式化。其中包括Chrome,Firefox和Evernote。

要在Mac上以纯文本格式粘贴,您可以使用笨拙的快捷键Option + Cmd + Shift + V粘贴而无需格式化。这是系统范围的快捷方式,因此与Windows不同,它应可在任何地方使用。


在 Mac 系统中,使用以下快捷键可以复制 Word 中的纯文本内容而不带样式:
Command + Shift + V
在 Word 中,将文本从一个位置复制到另一个位置时,默认情况下会保留原始文本的格式和样式。如果您只想复制纯文本,可以使用这个快捷键,它可以在将文本粘贴到目标位置时自动去除原有格式和样式。


word如何在表格和标题之间插入空白行?
https://www.zhihu.com/question/569150619
brew list java|grep java.security
/usr/local/Cellar/openjdk/18.0.2/libexec/openjdk.jdk/Contents/Home/conf/security/java.security


java无法连接SqlServer 出现安全限制的解决方法(TLS加密被拒绝)

集群mysql:1、改了2个my.cnf  wait_timeout=60 ;  与jar配置相同 2、同步了新的数据库3、17.26:8202上的前端指向了集群库Q: 26上连接ssl集群有个异常,Caused by: javax.net.ssl.SSLHandshakeException: No appropriate protocolA:修改jre/lib/security/java.security中的jdk.tls.disabledAlgorithms,删除SSLv3, TLSv1, TLSv1.1,然后重启应用即可

/usr/local/jdk8/jre/lib/security/java.security
# jdk.tls.disabledAlgorithms=SSLV3, TLSv1, TLSv1.1, RC4, DES, MD5withRSA, \


来自:https://blog.csdn.net/kfepiza/article/details/119084415



Linux:
pm -ql jdk-1.8.0_66|grep java.security
/usr/local/java/jre/lib/security/java.security
Windows上用curl -d"" 上传的编码是:EUC-CN
curl -d"向东阳 向守仁"  XXX.XXXX.com
EUC-CN




来自:https://blog.csdn.net/wuxianbing2012/article/details/79727259
分页: 2/271 第一页 上页 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 下页 最后页 [ 显示模式: 摘要 | 列表 ]