分类: 服务器

  • Flarum支持中文搜索

    cd /www/wwwroot/lecent.wang
    curl -L https://install.meilisearch.com | sh
    chmod +x meilisearch
    mv meilisearch /usr/local/bin/
    meilisearch --version
    screen -S meili
    meilisearch --master-key="SDT8rEyLVsVpQSHEzVuGhxPGFJz_mIiieuzmXnc2xA4"
    composer require clarkwinkelmann/flarum-ext-scout
    php flarum scout:import "Flarum\User\User"

  • flarum上传插件权限设置

    # 1. 进入您的网站根目录
    cd /www/wwwroot/lecent.wang
    # 2. 将所有文件所有权分配给 Web 服务器用户(宝塔一般是 www 用户)
    chown -R www:www .
    # 3. 给 Flarum 需要写入的两个核心目录赋予 775 权限
    chmod -R 775 storage
    chmod -R 775 public/assets

    宝塔面板,PHP,安装exif

  • 宝塔安装Flarum

    cd /www/wwwroot/lecent.wang
    composer create-project flarum/flarum .
    chown -R www:www /www/wwwroot/lecent.wang
    chmod -R 755 /www/wwwroot/lecent.wang

    设置伪静态

    宝塔 → 网站 → lecent.wang → 设置 → 伪静态

    填入:

    location / {
    try_files $uri $uri/ /index.php?$query_string;
    }

    http://lecent.wang

    完成安装

  • conda安装GATK

    conda create -n gatk -c bioconda -c conda-forge gatk4
    conda activate gatk
    gatk --version
    

  • Linux的shutdown

    NAME#名称
    shutdown – Halt, power off or reboot the machine
    #shutdown – 停止、关闭或重新启动计算机

    SYNOPSIS#概要

       shutdown [OPTIONS...] [TIME] [WALL...]
    

    DESCRIPTION#描述
    shutdown may be used to halt, power off, or reboot the machine.
    #shutdown 可用于停止、关闭或重新启动计算机。

       The first argument may be a time string (which is usually "now"). Optionally, this may be followed by a wall message to be sent to all logged-in users before going down.
       #第一个参数可以是时间字符串(通常是 “now”)。(可选)此消息后跟一条 wall 消息,该消息将在关闭之前发送给所有登录用户。
    
       The time string may either be in the format "hh:mm" for hour/minutes specifying the time to execute the 
    shutdown at, specified in 24h clock format. Alternatively it may be in the syntax "+m" referring to the specified number of minutes m from now.  "now" is an alias for "+0", i.e. for triggering an immediate
     shutdown. If no time argument is specified, "+1" is implied.
       #时间字符串可以采用 “hh:mm” 格式,表示小时/分钟,指定执行关机的时间,以 24 小时时钟格式指定。或者,它可能采用语法 “+m” 表示从现在开始的指定分钟数 m。 “now” 是 “+0” 的别名,即用于触发立即关闭。如果未指定 time 参数,则隐含 “+1”。
    
       Note that to specify a wall message you must specify a time argument, too.
       #请注意,要指定 wall 消息,还必须指定 time 参数。wall 消息会显示在屏幕上。
    
       If the time argument is used, 5 minutes before the system goes down the /run/nologin file is created to ensure that further logins shall not be allowed.
       #如果使用 time 参数,则在系统关闭前 5 分钟创建 /run/nologin 文件,以确保不允许进一步登录。
    

    OPTIONS#选项
    The following options are understood:
    #了解以下选项:

           --help
               Print a short help text and exit.
               #打印简短的帮助文件
    
           -H, --halt
               Halt the machine.
               #停止机器。
    
           -P, --poweroff
               Power the machine off (the default).
               #关闭设备电源(默认)。
    
           -r, --reboot
               Reboot the machine.
               #重启。
    
           -h
               The same as --poweroff, but does not override the action to take if it is "halt". E.g.  shutdown --reboot
               #与 --poweroff 相同,但不会覆盖 “halt” 时要执行的操作。例如 shutdown --reboot
               -h means "poweroff", but shutdown --halt -h means "halt".
               #-h 表示 “关机”,但 shutdown --halt -h 表示 “停止”。
    
           -k
               Do not halt, power off, or reboot, but just write the wall message.
               #不要停止、关闭电源或重新启动,而只需编写 wall 消息。
    
           --no-wall
               Do not send wall message before halt, power off, or reboot.
               #请勿在停止、关闭电源或重新启动之前发送 wall 消息。
    
           -c
               Cancel a pending shutdown. This may be used to cancel the effect of an invocation of shutdown with a time argument that is not "+0" or "now".
               #取消待处理的关闭。这可用于取消使用非 “+0” 或 “now” 的 time 参数调用 shutdown 的效果。
    
           --show
               Show a pending shutdown action and time if there is any.
               #显示待处理的关闭操作和时间(如果有)。
               Added in version 250.
               #在版本 250 中添加。
    

    EXIT STATUS#退出状态
    On success, 0 is returned, a non-zero failure code otherwise.
    #成功时,返回 0,否则返回非零失败代码。

    COMPATIBILITY#兼容性
    The shutdown command in previous init systems (including sysvinit) defaulted to single-user mode instead of powering off the machine. To change into single-user mode, use systemctl rescue instead.
    #以前的 init 系统(包括 sysvinit)中的 shutdown 命令默认为单用户模式,而不是关闭计算机电源。要更改为单用户模式,请改用 systemctl rescue。

    SEE ALSO#另见
    systemd(1), systemctl(1), halt(8), wall(1)

    systemd 255

  • conda安装最新版本的R

    首先创建和激活R环境

     conda create -n R
     conda activate R

    然后选择下列中的其中一个,安装最新版本的R

    conda install conda-forge::r-base
    conda install conda-forge/label/broken::r-base
    conda install conda-forge/label/cf201901::r-base
    conda install conda-forge/label/cf202003::r-base
    conda install conda-forge/label/gcc7::r-base

    R Base | Anaconda.org

  • Windows安装composer

    首先,你的电脑需要安装PHP(需要加入path),然后在PHP目录下运行cmd,依次输入下面命令。

    php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
    php composer-setup.php
    php -r "unlink('composer-setup.php');"

    然后在安装composer的文件夹里,添加composer.bat文件,并写入下面的内容:

    echo @php "%~dp0composer.phar" %*

    echo:命令行工具,用于输出文本。

    @php:调用PHP解释器。

    “%~dp0composer.phar”:引用当前目录下的composer.phar文件。

    %*:传递给批处理文件的所有参数。

    在批处理中,

    %~d0代表驱动器号
    %~p0代表路径
    %~dp0代表当前批处理文件所在的目录的完整路径。

    在批处理中,通常用百分号表示变量。

  • Win11的Ubuntu子系统安装Miniconda

    1. 进入miniconda的官网主页(https://docs.conda.io/en/latest/miniconda.html)。

    2. 下拉,直到找到Linux installers,找对应的Python版本,我的是3.10,选择3.9的版本,在第一个链接上点鼠标右键,复制链接地址。

    3. 运行Windows11的子系统Ubuntu,输入wget空格,然后点鼠标右键,如图。

    4. 输入bash Miniconda3-latest-Linux-x86_64.sh,然后一顿回车,如果需要写yes的时候,输入yes

    5. 等待安装完成,关闭Ubuntu重新打开,看到用户名前面有(base)即表示成功,可以通过下面的命令查看conda版本。

    本文短链接:https://wp.me/p80aHo-Gj

  • 密码保护:CentOS添加新的用户组并给予权限

    此内容受密码保护。如需查阅,请在下方输入密码。

  • CentOS新4G硬盘底座安装,格式化,挂载

    服务器空间不足,新买了两块4T的硬盘,用硬盘底座连接到服务器上。硬盘是全新的,没有格式化,不能直接识别,需要进行格式化过程。先通过下面命令查看硬盘是否被识别。

    sudo fdisk -l
    

    可以看到,sdb和sdc两块4T的硬盘被识别到了。

    使用fdisk命令可以对硬盘进行分区,但是有2T大小的限制,我们使用gdisk命令,该命令需要先进行安装。

    sudo yum install -y gdisk
    

    安装完成后,gdisk和fdisk的命令几乎一样。以sdc为例:

    sudo gdisk /dev/sdc
    

    依次选择n(add a new patition),默认回车(分区数量,默认1),默认回车(起始位置),默认回车(终止位置),w(write table to disk and exit)。接下来可以检查一下,并进行格式化。

    lsblk
    sudo mkfs.ext4 /dev/sdc1
    

    接下来就是挂载,还是以sdc为例,如果没有这个目录,则需要新建一个。

    sudo mount /dev/sdc1 /media/c
    cd media/c
    

    进入盘里,成功。