小编ser*_*hei的帖子

set -e在bash脚本中的含义是什么?

我正在研究脚本在从Debian存档(.deb)文件解压缩该包之前执行的这个preinst文件的内容.

该脚本具有以下代码:

#!/bin/bash
set -e
# Automatically added by dh_installinit
if [ "$1" = install ]; then
   if [ -d /usr/share/MyApplicationName ]; then
     echo "MyApplicationName is just installed"
     return 1
   fi
   rm -Rf $HOME/.config/nautilus-actions/nautilus-actions.conf
   rm -Rf $HOME/.local/share/file-manager/actions/*
fi
# End automatically added section
Run Code Online (Sandbox Code Playgroud)

我的第一个问题是关于这一行:

set -e
Run Code Online (Sandbox Code Playgroud)

我认为脚本的其余部分非常简单:它检查Debian/Ubuntu包管理器是否正在执行安装操作.如果是,它会检查我的应用程序是否刚刚安装在系统上.如果有,脚本将打印消息"MyApplicationName刚刚安装"并结束(return 1意味着以"错误"结束,不是吗?).

如果用户要求Debian/Ubuntu软件包系统安装我的软件包,该脚本还会删除两个目录.

这是对的还是我错过了什么?

linux bash shell sh

617
推荐指数
9
解决办法
34万
查看次数

Composer容器中的root用户

在Docker容器中运行Composer时,我有一个基本问题.

是否可以在容器内运行composeras用户root?我很困惑,创建文件的所有者(例如使用时composer require)是root.

root在容器内部运行OK最佳实践?

root user-permissions composer-php docker

10
推荐指数
1
解决办法
5816
查看次数

Nginnx配置Yii 2高级应用程序模板

我无法配置Nginx服务器,以便:

  • /index.php文件将被发送以响应"index.php"请求.
  • public_html/frontend/web/index.php文件将被发送以响应"admin/index.php"请求.

请问我哪里错了.这是我的配置:

server {
    listen        80;
    server_name   yii2.lo;
    server_tokens off;

    client_max_body_size 128M;
    charset       utf-8;

    access_log    /var/log/nginx/yii2-access.log main buffer=50k;
    error_log     /var/log/nginx/yii2-error.log notice;

    set           $host_path      "/srv/http/yii2/public";
    set           $yii_bootstrap  "index.php";

    index         $yii_bootstrap;

    location / {
        root          $host_path/frontend/web;
        try_files $uri $uri/ /$yii_bootstrap?$args;

    }

    location /admin {
        root          $host_path/backend/web;
        try_files $uri $uri/ /$yii_bootstrap?$args;
    }

    location ~ \.php$ {
        try_files $uri =404;

        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_index           $yii_bootstrap;

        # Connect to php-fpm via socket
        fastcgi_pass unix:/run/php-fpm/php-fpm.sock;

        fastcgi_connect_timeout     30s;
        fastcgi_read_timeout        30s;
        fastcgi_send_timeout        60s; …
Run Code Online (Sandbox Code Playgroud)

nginx yii2 nginx-location

7
推荐指数
1
解决办法
1万
查看次数

在 MacOS 上,hunspell 在 Library/Spelling/ 中找不到现有的 .aff 和 .dic 文件

我已经使用brew 命令下载了 hunspell,并想在 Emacs 中使用它,但是 hunspell 似乎没有在 中找到我的*.aff*.dic文件~/Library/Spelling,即使它们在那里。

使用命令行命令hunspell -D,结果是:

SEARCH PATH:
.::/usr/share/hunspell:/usr/share/myspell:/usr/share/myspell/dicts:/Library/Spelling:/Users/macbook/.openoffice.org/3/user/wordbook:/Users/macbook/.openoffice.org2/user/wordbook:/Users/macbook/.openoffice.org2.0/user/wordbook:/Users/macbook/Library/Spelling:/opt/openoffice.org/basis3.0/share/dict/ooo:/usr/lib/openoffice.org/basis3.0/share/dict/ooo:/opt/openoffice.org2.4/share/dict/ooo:/usr/lib/openoffice.org2.4/share/dict/ooo:/opt/openoffice.org2.3/share/dict/ooo:/usr/lib/openoffice.org2.3/share/dict/ooo:/opt/openoffice.org2.2/share/dict/ooo:/usr/lib/openoffice.org2.2/share/dict/ooo:/opt/openoffice.org2.1/share/dict/ooo:/usr/lib/openoffice.org2.1/share/dict/ooo:/opt/openoffice.org2.0/share/dict/ooo:/usr/lib/openoffice.org2.0/share/dict/ooo
AVAILABLE DICTIONARIES (path is not mandatory for -d option):
/Users/macbook/Library/Spelling/cs_CZ
Run Code Online (Sandbox Code Playgroud)

这里,cs_CZ是存储我个人拼写的文件的名称。该文件夹中还有其他文件,包括cs_CZ.affcs_CZ.dic以及en_GB,但 hunspell 会忽略这些文件。

在 Emacs 中,我尝试过:

SEARCH PATH:
.::/usr/share/hunspell:/usr/share/myspell:/usr/share/myspell/dicts:/Library/Spelling:/Users/macbook/.openoffice.org/3/user/wordbook:/Users/macbook/.openoffice.org2/user/wordbook:/Users/macbook/.openoffice.org2.0/user/wordbook:/Users/macbook/Library/Spelling:/opt/openoffice.org/basis3.0/share/dict/ooo:/usr/lib/openoffice.org/basis3.0/share/dict/ooo:/opt/openoffice.org2.4/share/dict/ooo:/usr/lib/openoffice.org2.4/share/dict/ooo:/opt/openoffice.org2.3/share/dict/ooo:/usr/lib/openoffice.org2.3/share/dict/ooo:/opt/openoffice.org2.2/share/dict/ooo:/usr/lib/openoffice.org2.2/share/dict/ooo:/opt/openoffice.org2.1/share/dict/ooo:/usr/lib/openoffice.org2.1/share/dict/ooo:/opt/openoffice.org2.0/share/dict/ooo:/usr/lib/openoffice.org2.0/share/dict/ooo
AVAILABLE DICTIONARIES (path is not mandatory for -d option):
/Users/macbook/Library/Spelling/cs_CZ
Run Code Online (Sandbox Code Playgroud)

使用推荐输入“czech”运行 ispell-change-dictinary 后,ispell-word 给出:

使用捷克语词典启动新的 Ispell 进程 hunspell... ispell-init-process: 无法打开名为“czech”的词典的词缀或词典文件。

...和flyspell模式:

启用 Flyspell 模式时出错:(无法打开名为“czech”的词典的词缀或词典文件。)

谢谢。

macos emacs spelling hunspell

5
推荐指数
1
解决办法
3427
查看次数

Schema.org itemtype Person vs ProfilePage

请解释一下我应该为用户页面使用Schema.org的微数据?

以下是我感兴趣的网页的一个小例子:

<body itemscope="itemscope" itemtype="http://schema.org/ProfilePage">
    <div itemtype="http://schema.org/Person" itemscope>
        <h2 class="vcard-names">
            <span itemprop="name" class="user-name">John Doe</span>
            <em itemprop="additionalName" class="user-nick">admin</em>
        </h2>
        <div class="vcard-details">
            <dl title="Email">
                <dd>
                    <a class="email" data-email="john@doe.com" href="mailto:john@doe.com">john@doe.com</a>
                </dd>
            </dl>
            <dl title="Home Page">
                <dd>
                    <a href="http://doe.com" itemprop="url">http://doe.com</a>
                </dd>
            </dl>
            <dl title="Birthday">
                <dd>
                    <time itemprop="birthDate" content="1983-05-16T00:00:00+0000" datetime="1983-05-16T00:00:00+0000">
                        Monday, May 16, 1983
                    </time>
                </dd>
            </dl>
            <dl title="User groups">
                <dd class="tagcloud">
                    <span>Approved</span>
                    <span>Users</span>
                    <span>Admins</span>
                </dd>
            </dl>
            <div class="user-bio">
                <h4>Bio</h4>
                <p itemprop="about">
                    Inquisitive Russian Developer, Web Coder, Linux Fun, Buddist, Bloger, Avid Reader, Music Lover, …
Run Code Online (Sandbox Code Playgroud)

html microdata schema.org

2
推荐指数
1
解决办法
2392
查看次数