小编Jam*_*kby的帖子

ssh2_auth_pubkey_file身份验证始终失败

我正在尝试使用PHP的ssh2函数连接到另一台机器.我知道ssh密钥是在没有密码的情况下创建的并且分发正确,我可以ssh user@host在我的机器终端上发送到服务器.

PHP函数尝试使用ssh密钥文件连接到ip地址: -

 function minnerConnect($miner_serial) {

    $port = '7822';
    $miner_ip = $this->getMinerIp($miner_serial);

    $methods = array(
        'kex' => 'diffie-hellman-group1-sha1',
        'hostkey' => 'ssh-dss',
        'client_to_server' => array(
            'crypt' => '3des-cbc',
            'mac' => 'hmac-md5',
            'comp' => 'none'),
        'server_to_client' => array(
            'crypt' => '3des-cbc',
            'mac' => 'hmac-md5',
            'comp' => 'none'));
    $connection = ssh2_connect($miner_ip, $port, $methods);
    if (ssh2_auth_pubkey_file($connection, 'root',
        '/root/.ssh/id_dsa.pub',
        '/root/.ssh/id_dsa','')) {
      echo "Public Key Authentication Successful\n";
    } else {
      echo "Public Key Authentication Failed";
    }
Run Code Online (Sandbox Code Playgroud)

但显示的错误是: -

(!)警告:ssh2_auth_pubkey_file():使用公钥的root身份验证失败:第95行/var/www/application/models/miner_model.php中的回调错误

第95行是'/root/.ssh/id_dsa','')) {. …

php ssh ssh-keys dsa private-key

11
推荐指数
1
解决办法
9465
查看次数

取消绑定window.onbeforeunload()取消绑定

我正在将一个函数绑定到一个事件

window.onbeforeunload = function() {
 somefunction()
}
Run Code Online (Sandbox Code Playgroud)

正在按计划卸载,但是如果它们取消onbeforeunload,该功能仍然附加,是否可以检查用户是否取消onbeforeunload

javascript jquery

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

Xdebug laravel工匠命令

我经常使用xdebug来调试应用程序,我已经构建了一个laravel应用程序,它可以上传一个csv,将数据插入到数据库中,并将id输入到作业队列中.

我写了一个工匠命令,通过cron运行,然后对这些数据做一些事情.

Xdebug适用于通过浏览器访问该站点,但从cli运行时它不会破坏断点.

我运行php5-fpm.我的文件/etc/php5/fpm/php.ini,并/etc/php5/cli/php/ini 都包含以下设置:

zend_extension=/usr/lib/php5/20121212/xdebug.so 
xdebug.remote_enable = 1 
xdebug.idekey = 'dev_docker' 
xdebug.remote_autostart = 1 
xdebug.remote_connect_back = {{my host ip}} 
xdebug.remote_port = 9000 
xdebug.remote_handler=dbgp
Run Code Online (Sandbox Code Playgroud)

然后我运行artisan命令

php artisan jobqueue::process --batch-size=10 --sleep=10
Run Code Online (Sandbox Code Playgroud)

我知道命令正在运行 - > info('text')显示在终端中

谁知道我错过了什么?

php xdebug command-line-interface laravel artisan

7
推荐指数
3
解决办法
5543
查看次数

Dockerfile CMD未在容器启动时运行

所以我为一个项目编写了一个Dockerfile,我已经定义了一个CMD来启动容器以运行应用程序.

Dockerfile看起来像

# create our mount folders and volumes
ENV MOUNTED_VOLUME_DIR=sites
RUN mkdir /$MOUNTED_VOLUME_DIR
ENV PATH=$MOUNTED_VOLUME_DIR/sbin:$MOUNTED_VOLUME_DIR/common/bin:$PATH
RUN chown -Rf www-data:www-data /$MOUNTED_VOLUME_DIR

# Mount folders
VOLUME ["/$MOUNTED_VOLUME_DIR/"]

# Expose Ports
EXPOSE 443

# add our environment variables to the server
ADD ./env /env

# Add entry point script
ADD ./start.sh /usr/bin/startContainer
RUN chmod 755 /usr/bin/startContainer

# define entrypoint command
CMD ["/bin/bash", "/usr/bin/startContainer"]
Run Code Online (Sandbox Code Playgroud)

start.sh脚本,做一些git的东西,如克隆正确的repo,设置环境变量,以及启动主管.

启动脚本以此开头

#!/bin/bash

now=$(date +"%T")
echo "Container Start Time : $now" >> /tmp/start.txt
/usr/bin/supervisord -n -c /etc/supervisord.conf
Run Code Online (Sandbox Code Playgroud)

我像这样开始我的新容器

docker …
Run Code Online (Sandbox Code Playgroud)

bash docker boot2docker dockerfile

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

1024覆盖未标记为覆盖的函数

我在我正在制作的Flash乐器中不断出现此错误:

1024覆盖未标记为覆盖的函数

在此行中发现错误:

public function stop():void
Run Code Online (Sandbox Code Playgroud)

flash action actionscript-3 flash-cs5

6
推荐指数
1
解决办法
6338
查看次数

业力茉莉花没有执行所有测试

所以我有6个业力茉莉花测试,在一个文件中我有3个,我测试我所有的工厂

工厂的测试文件如下

describe('Quiz Factories', function() {

    beforeEach(function() {

        //Ensure angular modules available
        beforeEach(module('geafApp'));

        beforeEach(inject(function (_counter_) {
            counter = _counter_;
        }));

        beforeEach(inject(function (_answer_sheet_) {
            answer_sheet = _answer_sheet_;
        }));

        beforeEach(inject(function (_questions_) {
            questions = _questions_;
        }));

    });

    it('it should return a number', function () {
        expect(counter).toBeNumber();
    });

    it('it should return an empty object', function () {
        expect(answer_sheet).toBeEmptyObject();
    });

    it('it should return an empty object', function () {
        expect(questions).toHaveObject(answers);
    });

});
Run Code Online (Sandbox Code Playgroud)

在我的控制台日志中显示执行4中的4

PhantomJS 1.9.8(Mac OS X 0.0.0):执行4中6成功(0.004秒/0.029秒)

所以出于某种原因,在工厂测试文件的第一个'它'之后它跳过其他两个,即使没有失败并且所有都包含在beforeEach中

unit-testing jasmine angularjs karma-jasmine

6
推荐指数
2
解决办法
5842
查看次数

根据分类术语生成URL别名

我有一个词汇类别,里面有四个术语.我想要做的是,如果内容被标记为一个终端,特别是说"term1",将url生成为word1/[node:title],而所有其他标签只是标准的url格式.

如果我想要URL中的术语显然id使用模式替换但我想要使用另一个单词如果使用特定标签

drupal drupal-7 drupal-taxonomy drupal-modules

3
推荐指数
1
解决办法
2237
查看次数

HTML图像映射和悬停css

我在图像地图上工作,作为导航的一部分创建的前一个开发.它将把英国地图切割成区域,以便导航到网站的某些部分.之前的dev使用了img贴图,但是图像贴图不能正确使用css,因为图像贴图是一种传统方法.

贝娄是代码

<style type="text/css">

#map a {
    cursor: hand;
}

</style>

<div id="mapimage"><img src="ukmap.gif" USEMAP="#map" TYPE="image/png" TITLE="Join your local network" WIDTH=294 HEIGHT=486></div>

 <map id="map" name="map">


    <area shape="poly" id="northern" alt="Northern" title="Northern" coords="123,248,134,271,139,294,141,301,156,321,167,317,183,307,180,288,188,298,205,302,225,290,239,289,248,274,211,229,199,208,176,170,168,170,148,207,123,238" href="#" target="" />

    <area id="wales" shape="poly" alt="Wales" title="Wales" coords="100,302,92,332,110,338,111,355,64,374,88,400,133,398,154,404,164,384,161,372,144,364,145,344,154,321,143,302,103,293" href="#" target="" />

    <area id="westmidlands" shape="poly" alt="West Midlands" title="West Midlands" coords="181,368,195,360,206,351,189,326,182,305,149,321,142,358,147,369,163,376" href="#" target="" />

    <area id="eastmidlands" shape="poly" alt="East Midlands" title="East Midlands" coords="215,365,233,341,233,328,254,320,238,284,210,293,192,304,177,290,184,320,204,353,203,366" href="#" target="" />

    <area id="london" shape="poly" alt="London" title="London" coords="227,385,235,398,244,402,255,391,259,384,239,379,230,383" href="#" target="" />

    <area id="east" shape="poly" alt="East" title="East" coords="260,315,287,316,288,364,271,389,259,390,246,377,225,382,222,368,217,357,235,327" …
Run Code Online (Sandbox Code Playgroud)

html javascript css jquery imagemap

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

Dockerfile COPY文件未在VOLUME上显示

所以我试图让我们的公司采用Docker发布工作流程,所以我必须使用docker和我希望合并的所有技术来制作项目.

我创建了一个Dockerfile来构建我们的VM环境,除了最后几步之外,一切正常.

我有我的机器上的文件夹与我们的标准化的搬运工LEMP堆,当我建立这个项目在我的/文件/ kitematic/IMAGE_NAME这是我们将初始化一个git仓库创建一个新的安装体积图像.

出于这个原因,我想使用COPY或添加将所有dockerfiles复制到新的Docker卷中,因此它包含在git仓库中以跟踪更改,以及让devs更容易克隆repo构建并继续.

Dockerfile的最后一部分是

# Create Mounted Folders
RUN mkdir /$SMACK_APP_VOL_DIR && \
mkdir /$SMACK_APP_VOL_DIR/www && \
mkdir /$SMACK_APP_VOL_DIR/docker_stack

# set owners of web folders before mounting
RUN usermod -u 1000 www-data

# set folder groups
RUN chown -Rf www-data:www-data /$SMACK_APP_VOL_DIR

# Mount folders
VOLUME ["/$SMACK_APP_VOL_DIR/www","/$SMACK_APP_VOL_DIR/docker_stack/"]

# Expose Ports
EXPOSE 443
EXPOSE 80

# Add git commands to allow container updating
ADD ./docker_stack/pull /usr/bin/pull
ADD ./docker_stack/push /usr/bin/push
RUN chmod 755 /usr/bin/pull && chmod 755 /usr/bin/push

# Supervisor Config …
Run Code Online (Sandbox Code Playgroud)

docker boot2docker dockerfile docker-compose

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