小编jas*_*onz的帖子

C代码中的switch-case中的"..."是什么

这是一段代码/usr/src/linux-3.10.10-1-ARCH/include/linux/printk.h:

static inline int printk_get_level(const char *buffer)
{
  if (buffer[0] == KERN_SOH_ASCII && buffer[1]) {
    switch (buffer[1]) {
    case '0' ... '7':
    case 'd':  /* KERN_DEFAULT */
      return buffer[1];
    }
  }
}
Run Code Online (Sandbox Code Playgroud)

它是一种运营商吗?为什么"C编程语言"没有提到它?

c gcc gcc-extensions

49
推荐指数
4
解决办法
3268
查看次数

16
推荐指数
4
解决办法
3389
查看次数

如何在没有空闲的情况下安装python?

我正在使用Archlinux,我发现在编写Python时我不需要空闲.

以下是默认PKGBUILD文件的一部分:

    ./configure --prefix=/usr \
                --enable-shared \
                --with-threads \
                --with-computed-gotos \
                --enable-ipv6 \
                --with-valgrind \
                --with-system-expat \
                --with-dbmliborder=gdbm:ndbm \
                --with-system-ffi

     ln -sf idle3     "${pkgdir}"/usr/bin/idle
Run Code Online (Sandbox Code Playgroud)

我可以在不安装Idle的情况下构建python吗?
提前致谢.

python python-idle python-3.x

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

nginx:如何获取包含破折号的 url 参数?

我正在使用 nginx 变量$arg_来获取 url args。

但我发现该 url 是否类似于“ http://foobar.com/search?field-keywords=foobar ”,$arg_field_keywords或者$arg_field-keywords不起作用。

我可以field-keywords$arg_

提前致谢。

nginx

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

apt_repository 模块失败 ansible

有时,当我运行我的剧本时,它会引发下一次失败:

FAILED! => {"changed": false, "failed": true, "module_stderr": "", "module_stdout": "Traceback (most recent call last):\r\n  File \"/root/.ansible/tmp/ansible-tmp-1457967885.72-104659711487416/apt_repository\", 
line 3210, in <module>\r\n    main()\r\n  File \"/root/.ansible/tmp/ansible-tmp-1457967885.72-104659711487416/apt_repository\", line 469, in main\r\n`    `cache.update()\r\n  File \"/usr/lib/python2.7/dist-packages/apt/cache.py\", line 440, 
in update\r\n    raise FetchFailedException(e)\r\napt.cache.FetchFailedException: W:Imposible obtener` `http://security.ubuntu.com/ubuntu/dists/trusty-security/main/source/Sources`  `La suma hash difiere\r\n, 
W:Imposible obtener http://security.ubuntu.com/ubuntu/dists/trusty-security/main/binary-amd64/Packages  La suma hash difiere\r\n, W:Imposible obtener http://security.ubuntu.com/ubuntu/dists/trusty-security/main/binary-i386/Packages  La suma hash difiere\r\n, 
E:Algunos archivos de` `índice fallaron al descargar. Se han ignorado, o se han utilizado unos` `antiguos en su lugar\r\n", 
"msg": "MODULE FAILURE", …
Run Code Online (Sandbox Code Playgroud)

java apt ansible ansible-playbook ansible-2.x

5
推荐指数
2
解决办法
5032
查看次数

在Ansible 1.9中的运行时指定SSH配置文件

我正在管理两个配置不同的服务器环境.我访问通过指定命令行上不同的SSH配置两个环境,因为我需要指定一个不同的User,ProxyCommand以及对SSH其他选项列表.

例如

ssh oldserver.example.org -F config_legacy

ssh newserver.example.org -F config
Run Code Online (Sandbox Code Playgroud)

为了在我的服务器上配置和维护状态,我一直在使用Ansible(版本1.9.0.1),它读取由其中的一行指定的SSH配置文件ansible.cfg:

...
ssh_args =  -F some_configuration_file
...
Run Code Online (Sandbox Code Playgroud)

ansible.cfg装入多种方式:

def load_config_file():
    ''' Load Config File order(first found is used): ENV, CWD, HOME, /etc/ansible '''

    p = configparser.ConfigParser()

    path0 = os.getenv("ANSIBLE_CONFIG", None)
    if path0 is not None:
        path0 = os.path.expanduser(path0)
    path1 = os.getcwd() + "/ansible.cfg"
    path2 = os.path.expanduser("~/.ansible.cfg")
    path3 = "/etc/ansible/ansible.cfg"

    for path in [path0, path1, path2, path3]:
        if path is not …
Run Code Online (Sandbox Code Playgroud)

python ssh ansible

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