小编occ*_*asl的帖子

为什么git协议比git-http-backend产生更多的对象?

我正在使用配置了(智能HTTP)的Git 1.7.1.我想看看这与git://协议相比有多快,因为现在它们应该是相同的.git-http-backend

结果是git://协议正在压缩更多对象(33,22921,193)以获得完全相同的 repo(甚至验证客户端),从而为我的项目创建一个大约30MB的packfile.

git://协议需要更多对象有什么理由吗?

git://输出

remote: Counting objects: 44510, done.
remote: Compressing objects: 100% (33229/33229), done.
Receiving objects: 100% (44510/44510), 124.07 MiB | 2.84 MiB/s, done.
remote: Total 44510 (delta 22755), reused 15866 (delta 7516)
Resolving deltas: 100% (22755/22755), done.
Run Code Online (Sandbox Code Playgroud)

http://输出

remote: Counting objects: 24299, done.
remote: Compressing objects: 100% (21931/21931), done.
remote: Total 24299 (delta 7517), reused 0 (delta 0)
Receiving objects: 100% …
Run Code Online (Sandbox Code Playgroud)

git

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

Mongoose删除文件中的数组元素并保存

我的模型文档中有一个数组.我想根据我提供的密钥删除该数组中的元素,然后更新MongoDB.这可能吗?

这是我的尝试:

var mongoose = require('mongoose'),
    Schema = mongoose.Schema;

var favorite = new Schema({
    cn: String,
    favorites: Array
});

module.exports = mongoose.model('Favorite', favorite, 'favorite');

exports.deleteFavorite = function (req, res, next) {
    if (req.params.callback !== null) {
        res.contentType = 'application/javascript';
    }
    Favorite.find({cn: req.params.name}, function (error, docs) {
        var records = {'records': docs};
        if (error) {
            process.stderr.write(error);
        }
        docs[0]._doc.favorites.remove({uid: req.params.deleteUid});

        Favorite.save(function (error, docs) {
            var records = {'records': docs};
            if (error) {
                process.stderr.write(error);
            }
            res.send(records);

            return next();
        });
    });
};
Run Code Online (Sandbox Code Playgroud)

到目前为止,它找到了文档,但删除或保存工作.

mongoose node.js

51
推荐指数
4
解决办法
8万
查看次数

如何在Dockerfile中为Jenkins for LDAPS添加SSL自签名证书?

我想在Jenkins的安全性下启用LDAPS,但我的LDAP服务器有一个自签名的CERT.有没有人这样做或有一些指示这样做?我必须使用keytool吗?

在我的Dockerfile中,我正在尝试以下操作,但这不起作用:

FROM jenkins

USER root

# Install CA certs
COPY ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
RUN chmod +r /etc/ssl/certs/ca-certificates.crt

# Install the Jenkins plugin  
COPY plugins.txt /usr/share/jenkins/plugins.txt
RUN /usr/local/bin/plugins.sh /usr/share/jenkins/plugins.txt

# Expose container port 33838 for Jenkins UDP-based auto-discovery
EXPOSE 33848/udp

ENV JAVA_OPTS -Xmx2048m
Run Code Online (Sandbox Code Playgroud)

jenkins docker dockerfile

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

无法绑定到'typeahead',因为它不是'input'的已知属性

我正在使用Angular 2.1.2并且我在使用ng2-bootstrap的typeahead功能时遇到了麻烦,我正在使用1.1.16版本.我也在使用Webpack.我基本上遵循网站上的示例,但我调整它以使用我提供的服务,它将提供typeahead字段的搜索结果.知道我为什么会收到这个错误吗?我也想知道为什么它在错误信息中说"当选"而不是像我在下面的HTML中那样"选中".

Unhandled Promise rejection: Template parse errors:
Can't bind to 'typeahead' since it isn't a known property of 'input'. ("elected | json}}</pre>
                    <input [(ngModel)]="selected"
                           [ERROR ->][typeahead]="chipFamilies"
                           (typeaheadOnSelect)="typeaheadOnSelect($event)""): AppComponent@76:27 ; Zone: <root> ; Task: Promise.then ; Value: Error: Template parse errors:(…) Error: Template parse errors:
Can't bind to 'typeahead' since it isn't a known property of 'input'. ("elected | json}}</pre>
                    <input [(ngModel)]="selected"
                           [ERROR ->][typeahead]="chipFamilies"
                           (typeaheadOnSelect)="typeaheadOnSelect($event)""): AppComponent@76:27
    at TemplateParser.parse (eval at <anonymous> (http://localhost:3000/vendor.js:94:2), <anonymous>:7711:21)
    at RuntimeCompiler._compileTemplate (eval at <anonymous> (http://localhost:3000/vendor.js:94:2), <anonymous>:17193:53) …
Run Code Online (Sandbox Code Playgroud)

ng2-bootstrap angular

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

使用Node.js轮询REST服务

我正在开发一种服务,每隔一分钟就会对Foursquare进行一些检查,并在NoSQL数据库中保存/更新结果.是使用setInterval包装http.request然后使用数据事件发射器聚合分块响应的最佳方法吗?我计划使用end发射器来解析JSON并在请求完成时推送到NoSQL DB.思考?

node.js

7
推荐指数
2
解决办法
6055
查看次数

CloudFormation模板中的Elasticache复制组ID

使用CloudFormation模板时如何设置Redis ReplicationGroup ID?文档中的所有选项都显示无法执行此操作,CLI可以轻松完成此操作.我的最终目标是拥有一个包含3个集群成员的Redis复制组,但我想选择名称而不是AWS为我设置一个唯一的名称.

这是我的模板的片段:

  "Resources": {
    "mqpReplicationGroup": {
      "Type": "AWS::ElastiCache::ReplicationGroup",
      "Properties": {
        "CacheNodeType": {
          "Ref": "CacheNodeType"
        },
        "CacheSubnetGroupName": {
          "Ref": "CacheSubnets"
        },
        "ReplicationGroupDescription": "Redis Replication Group",
        "Engine": "redis",
        "EngineVersion": {
          "Ref": "RedisVersion"
        },
        "NumCacheClusters": {
          "Ref": "NumberOfCacheNodes"
        },
        "AutoMinorVersionUpgrade": "true",
        "AutomaticFailoverEnabled": "true",
        "PreferredMaintenanceWindow": "sat:09:25-sat:22:30",
        "SnapshotRetentionLimit": "4",
        "SnapshotWindow": "00:05-05:30",
        "NotificationTopicArn": {
          "Fn::Join" :[":",["arn:aws:sns",{ "Ref" : "AWS::Region" },{ "Ref" : "AWS::AccountId" },"service-aws"]]
        },
        "SecurityGroupIds": [
          {
            "Fn::Join": [
              ",",
              {
                "Ref": "VpcSecurityGroupIds"
              }
            ]
          }
        ]
      }
    }, …
Run Code Online (Sandbox Code Playgroud)

amazon-web-services amazon-elasticache aws-cloudformation

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

可以在 ElasticSearch/Kibana 中漂亮地打印 JSON 日志消息

我的日志由 ElasticSearch 从应用程序服务器的标准输出建立索引。无需修改写入日志的源,是否可以“漂亮地打印”任何 JSON 日志消息?如果我尝试从记录器中漂亮地打印 JSON,则每一行都会在 ES 中记录为单独的条目。

如果没有,我的 Kibana/OpenSearch 仪表板中会显示此消息,如下所示:

在此输入图像描述

我们使用最新的 AWS OpenSearch 1.1。

elasticsearch kibana aws-elasticsearch

6
推荐指数
0
解决办法
720
查看次数

Git with Cygwin - 不接受用户名的用户输入

我正在尝试克隆需要身份验证的存储库.使用msysgit,我将收到提示输入用户名/密码,它将克隆.但是,在Cygwin(v1.7.9)中我也会收到提示,但是当我输入时它不会接受我的输入.我按ctrl-C中止,我的条目被缓冲,并尝试将其作为命令.

如何让Cygwin接受来自Git服务器的用户输入?

这是我看到的一个例子:

$ git clone http://gitsbx01.mycompany.com/git/qct/manifest.git
Cloning into manifest...
Username: [I type it and doesn't recognize so CTRL-C]

$ lou
bash: lou: command not found
Run Code Online (Sandbox Code Playgroud)

git cygwin

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

在node-gyp rebuild上,npm install jquery失败

我似乎无法在最新版本的npm/node上安装jquery.这是堆栈跟踪:

npm http GET https://registry.npmjs.org/jquery
npm http 304 https://registry.npmjs.org/jquery
npm http GET https://registry.npmjs.org/jsdom
npm http GET https://registry.npmjs.org/htmlparser/1.7.6
npm http GET https://registry.npmjs.org/xmlhttprequest
npm http GET https://registry.npmjs.org/location/0.0.1
npm http GET https://registry.npmjs.org/navigator
npm http 304 https://registry.npmjs.org/jsdom
npm http 304 https://registry.npmjs.org/xmlhttprequest
npm http 304 https://registry.npmjs.org/location/0.0.1
npm http 304 https://registry.npmjs.org/htmlparser/1.7.6
npm http 304 https://registry.npmjs.org/navigator
npm http GET https://registry.npmjs.org/cssom
npm http GET https://registry.npmjs.org/contextify
npm http GET https://registry.npmjs.org/request
npm http 304 https://registry.npmjs.org/contextify
npm http 304 https://registry.npmjs.org/cssom
npm http 304 https://registry.npmjs.org/request
npm http GET https://registry.npmjs.org/bindings
npm http 304 …
Run Code Online (Sandbox Code Playgroud)

jquery node.js npm

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

RabbitMQ 连接空闲超时导致通道泄漏

我将 node-amqp 与 Node.js 结合使用来消耗队列中的消息。我们的管理员有 60 分钟的空闲连接超时,这会导致绑定额外的队列并孤立我之前创建的队列的先前通道。我的日志如下所示,请注意每小时绑定一个额外队列(下一次将是 3 个,然后是 4 个,依此类推):

[app] 2014-08-07T16:15:25.000Z: 2014-08-07T16:15:25.174Z - debug: ConsumerTag: node-amqp-145-0.9590792271774262
[app] 2014-08-07T16:15:24.000Z: 2014-08-07T16:15:24.751Z - debug: AMQP Queue bound successfully.
[app] 2014-08-07T16:15:24.000Z: 2014-08-07T16:15:24.731Z - debug: AMQP Queue bound successfully.
[app] 2014-08-07T16:15:24.000Z: 2014-08-07T16:15:24.344Z - debug: AMQP Queue is subscribing...
[app] 2014-08-07T16:15:24.000Z: 2014-08-07T16:15:24.344Z - debug: AMQP Queue is binding...
[app] 2014-08-07T16:15:23.000Z: 2014-08-07T16:15:23.831Z - debug: AMQP Queue is initializing...
[app] 2014-08-07T15:13:36.000Z: 2014-08-07T15:13:36.933Z - debug: ConsumerTag: node-amqp-145-0.6444592161569744
[app] 2014-08-07T15:13:36.000Z: 2014-08-07T15:13:36.658Z - debug: AMQP Queue bound successfully.
[app] …
Run Code Online (Sandbox Code Playgroud)

amqp rabbitmq node.js node-amqp

5
推荐指数
0
解决办法
3025
查看次数