分类: 服务器

  • 一条powershell命令直接连接服务器

    电脑重装之后,不知道为什么,MobaXterm只要一连接就卡死。现在微软的powershell集成了OpenSSH 客户端,可以直接连接服务器,也可以语法高亮。

    ssh 用户名@主机名或IP
    ssh MrZhang@10.19.23.100 # 这是我们的服务器

    每次输入命令太麻烦,我们新建一个快捷方式:

    1. 桌面上点右键,新建,快捷方式;

    2. 输入命令;

    
    powershell.exe -NoExit -Command "ssh MrZhang@10.19.23.100"

    3. 给你的快捷方式起一个名字;

    4. 搞定。

  • 服务器打开tassel对话框

    1. Win + R

    mstsc

    2. 输入用户名和密码

    3. 打开终端

    4. 输入下面的命令

    # 1. 进入 TASSEL 安装目录
    cd /home/new/software/local/src/tassel-5-standalone/
    # 2. 运行启动脚本(注意前面有 ./)
    ./start_tassel.pl
  • screen后台处理数据

    screen -S myjob # 新建名为 myjob 的会话
    screen -r myjob # 重新连接
    screen -x myjob # 两个终端查看同一个会话
    screen -ls # 查看会话
    screen -S myjob -X quit # 外部删除会话
    # 继续运行并退出 Ctrl+A,D
    exit # 结束会话

  • 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代表当前批处理文件所在的目录的完整路径。

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