搜索 “#daily tips” ,共找到 239 项结果
×
  • Falcon
    3 小时前
    #daily tips# #php# nginx 中 fastcgi_intercept_errors on 表示接收fastcgi输出的http 1.0 response code,后端php可以输出header指示nginx输出什么错误页面。开启这个之后,我们才能在php里面自定义错误代码和页面。
  • Falcon
    今天 00:59
    #daily tips# 很不错的Linux可视化工具,能非常直观地看到 cpu 、内存、磁盘使用等情况,跟htop有异曲同工之妙。
    https://github.com/aristocratos/btop
    同类还有bottom:https://github.com/ClementTsang/bottom
    gtop:https://github.com/aksakalli/gtop
    gotop:https://github.com/xxxserxxx/gotop
    其他替换:
    these have been around for years. All of them are terminal-based tools.

    Grandpa top. Written 36 years ago, C, installed by default on almost every Unix descendant.
    bashtop, in pure bash! Beautiful and space efficient, and deserves special comment.
    bpytop, @aristocratos, the author of bashtop, rewrote it in Python in mid-2020; it's the same beautiful interface, and a very nice alternative.
    htop. A prettier top. Similar functionality. 16 years old!
    atop. Detailed process-focused inspection with a table-like view. Been around for 9 long years.
    iftop, a top for network connections. More than just data transfer, iftop will show what interfaces are connecting to what IP addresses. Requires root access to run.
    iotop, top for disk access. Tells you which processes are writing to and from disk space, and how much. Also requires root access to run.
    nmon a dashboard style top; widgets can be dynamically enabled and disabled, pure ASCII rendering, so it doesn't rely on fancy character sets to draw bars.
    ytop, a rewrite of gotop (ca. 3.0) in Rust. Same great UI, different programming language.
    slabtop, part of procps-ng, looks like top but provides kernel slab cache information! Requires root.
    systemd-cgtop, comes with systemd (odds are your system uses systemd, so this is already installed), provides a resource use view of control groups -- basically, which services are using what resources. Does not require root to run.
    virt-top top for virtualized containers (VMs, like QEMU).
    ctop top for containers (LXC, like docker)

     
  • Falcon
    前天 14:36
    #daily tips# 测试php-fpm配置是否正确



    php-fpm -t

    [04-Jul-2022 14:34:52] NOTICE: configuration file /usr/local/etc/php/8.0/php-fpm.conf test is successful
  • Falcon
    07-03 13:03
    #daily tips# MacOS 更改输入法切换快捷键



    参考Rio的回答: “默认是没有启用快捷键切换输入法的。在 System Preferences / Keyboard / Keyboard Shortcuts / Keyboard & Text Input 里面勾选 Select next source in Input menu,然后点击定义快捷键。我一般设置的是 Ctrl + Space (和 Windows 下类似)。 ”
  • Falcon
    07-02 07:49
    #daily tips# 一个漂亮的文档生成器,让你专注于内容而不是技术。
    https://docusaurus.io/docs
  • Falcon
    07-01 09:24
    #daily tips# 有哥们说,自从国内推出19开头的手机号之后,正则表达式改成了/^1[3-9]\d{9}$/ ,哈哈哈,也行吧……
  • Falcon
    06-30 14:17
    #稍后阅读# #daily tips# 支持CLI上传的网盘,号称无限临时空间,测试了速度也还行,感觉不错。分了国内版https://ttttt.link/ 和高手版 https://tmp.link/ ,我注册了个所谓的高手版的,它说没区别,但我上午用好像会限制区域,不搭梯子国内直接访问tmp会报区域限定。我想到的用途,因为它支持7天的大文件存储(好像有下载又会自动续期),这个可以用来做异地备份,相当于保留七天的全量异地备份。跟我用坚果云备份是一样的,不过它的流量和存储远大于坚果云,并且不需要自己另外写过期删除的功能。可能为了安全起见,压缩时要加个密码。
    v2ex讨论: https://www.v2ex.com/t/862795#reply44
  • Falcon
    06-29 07:13
    #daily tips# #php#

    php_sapi_name



    (PHP 4 >= 4.0.1, PHP 5, PHP 7, PHP 8)



    php_sapi_name(): string|false

    php_sapi_name — 返回 web 服务器和 PHP 之间的接口类型

    返回接口类型的小写字符串, 或者在失败时返回 false。



    尽管不够全面,可能返回的值包括了 apache、 apache2handler、 cgi (直到 PHP 5.3), cgi-fcgi、cli、 cli-server、 embed、fpm-fcgi、 litespeed、 nsapi、phpdbg。



    注意: 另一种方法

    PHP 常量 PHP_SAPI 具有和 php_sapi_name() 相同的值。



    示例 #1 php_sapi_name() 例子



    以下例子检测了子字符串 cgi,因为它也有可能会是 cgi-fcgi。



    <?php

    $sapi_type = php_sapi_name();

    if (substr($sapi_type, 0, 3) == 'cgi') {

    echo "You are using CGI PHP\n";

    } else {

    echo "You are not using CGI PHP\n";

    }

    ?>



    ref: https://www.php.net/manual/zh/function.php-sapi-name
  • Falcon
    06-27 15:12
    #daily tips# 随航 iPad 连接超时的解决方法(解决了我的问题):



    在mac端:系统偏好设置-> apple id -> 删除ipad -> 删除老mac。



    ipad端修改机器名称为英文,退出apple id,重启,登录apple id。



    ref: https://www.zhihu.com/question/385028253
  • Falcon
    06-27 10:38
    #daily tips# #Zerotier# 使用迁移助手后,Zerotier的地址也跟原来机器一样,两台机器会被识别成一台,不能同时在线。需要重置地址。

    在Mac上重置Zerotier 地址步骤如下:
    1. sudo launchctl unload /Library/LaunchDaemons/com.zerotier.one.plist
    2. cd "/Library/Application Support/ZeroTier/One" && rm -rf identity.public identity.secret
    3. sudo launchctl load /Library/LaunchDaemons/com.zerotier.one.plist

    此时会自动申请加入原网络,访问 https://my.zerotier.com/ ,找到对应的网络勾选允许新加入的节点。

    参考官方文档:https://zerotier.atlassian.net/wiki/spaces/SD/pages/327693/How+to+Clear+Reset+your+ZeroTier+Address