这对某些人来说可能是一个非常简单的问题:)
我在Amazon EC2上创建了一个新的linux实例,并且作为其中一部分下载了.pem文件以允许我进入SSH.
当我试图ssh:
ssh -i myfile.pem <public dns>
Run Code Online (Sandbox Code Playgroud)
我有:
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: UNPROTECTED PRIVATE KEY FILE! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions 0644 for 'amazonec2.pem' are too open.
It is recommended that your private key files are NOT accessible by others.
This private key will be ignored.
bad permissions: ignore key: amazonec2.pem
Permission denied (publickey).
Run Code Online (Sandbox Code Playgroud)
在这篇文章之后我尝试chmod +600 pem文件,但现在当我ssh我得到:
Permission denied (publickey).
Run Code Online (Sandbox Code Playgroud)
我在这里做的男生错误是什么?.pem文件位于我的主文件夹中(在osx中).它的权限如下所示:
-rw-------@ 1 mattroberts staff 1696 19 Nov 11:20 amazonec2.pem
Run Code Online (Sandbox Code Playgroud) authentication permissions ssh amazon-ec2 amazon-web-services
使用twitter bootstrap(2),我有一个带导航栏的简单页面,在里面container我想添加一个100%高度的div(到屏幕底部).我的css-fu生锈了,我无法解决这个问题.
简单的HTML:
<body>
<div class="navbar navbar-fixed-top">
<!-- Rest of nav bar chopped from here -->
</div>
<div class="container fill">
<div id="map"></div> <!-- This one wants to be 100% height -->
</div>
</body>
Run Code Online (Sandbox Code Playgroud)
目前的CSS:
#map {
width: 100%;
height: 100%;
min-height: 100%;
}
html, body {
height: 100%;
}
.fill {
min-height: 100%;
}
Run Code Online (Sandbox Code Playgroud)
我已按照下面的建议为填充类添加了高度.但是,问题在于我在主体上添加了一个填充顶部以考虑顶部的固定导航栏.这会影响"map"div的100%高度,这意味着会添加一个滚动条 - 如下所示:http://jsfiddle.net/S3Gvf/2/有谁能告诉我如何修复?
我正在查看backbone.js截屏视频中的优秀peepcode演示代码.在其中,骨干代码全部包含在传递jQuery对象的匿名函数中:
(function($) {
// Backbone code in here
})(jQuery);
Run Code Online (Sandbox Code Playgroud)
在我自己的骨干代码中,我只是将我的所有代码都包装在jQuery DOM'ready'事件中:
$(function(){
// Backbone code in here
});
Run Code Online (Sandbox Code Playgroud)
第一种方法的优点是什么?这样做会创建一个匿名函数,然后立即执行jQuery对象作为函数参数传递,有效地确保$是jQuery对象.这是唯一的一点 - 保证jQuery绑定到'$'还是有其他理由这样做?
如果我通过移动设备捕获所有touchend事件:
$(document.body).bind('touchend', function (e) {
var touch = e.touches[0]; // doesnt work
...
Run Code Online (Sandbox Code Playgroud)
我需要从e参数中获取touch.screenX,touch.screenY,touch.clientX和touch.clientX.我见过的所有例子都表明e.touches将是一个集合,你可以通过触摸细节获得e.touches[0].在我对ipad的测试中,e.touches总是未定义的.我没有使用任何jquery插件.
还尝试了e.targetTouches,这也是未定义的.
有人可以帮忙吗?
我正在尝试msdeploy安装和设置.我已经在Web服务器上安装了远程服务,但我的所有测试都给了我一个401 unauthorised error.服务器是Windows 2008 R2.
我正在测试一个非常简单的msdeploy命令:
msdeploy -verb:dump -source:contentPath=c:\inetpub\wwwroot\MyApp,computerName=<IP HERE>,userName=Domain\msdeploy,password=MyPassword
Run Code Online (Sandbox Code Playgroud)
而错误:
Error: Object of type 'contentPath' and path 'c:\inetpub\wwwroot\MonApp' cannot be created.
Error: Remote agent (URL http://<IP HERE>/MSDEPLOYAGENTSERVICE) could not be contacted. Make sure the remote agent service is installed and started on the target computer.
Error: An unsupported response was received. The response header 'MSDeploy.Response' was '' but 'v1' was expected.
Error: The remote server returned an error: (401) Unauthorized.
Error count: 1.
Run Code Online (Sandbox Code Playgroud)
我创建了一个名为msdeploy的用户,并将其添加到服务器上的本地管理员组.
我检查过: …
iis visual-studio-2010 msdeploy msdeployserviceagent webdeploy
我正在尝试用msbuild构建一个csproj项目,但是它有各种奇怪的问题抱怨没有找到nuget.targets.
我使用MSbuild运行最简单的命令行构建:
Msbuild Project.csproj
Run Code Online (Sandbox Code Playgroud)
这可以在我的普通dev文件夹中工作,但在另一个文件夹位置,它会因以下错误而失败:
error MSB4019: The imported project "C:\BuildAgent\work\CableSense\.nuget\nuget.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
该路径(C:\BuildAgent\work\CableSense\.nuget\nuget.targets)实际上是错误的并且在工作之后丢失了一个文件夹(work\somefolder\cablesense),但我不知道为什么.更奇怪的是,如果我构建另一个项目,这是解决方案的一部分,那么这是有效的,它只是这个项目.
csproj指定nuget.targets文件的位置,如下所示:
<Import Project="$(SolutionDir)\.nuget\nuget.targets" />
Run Code Online (Sandbox Code Playgroud)
SolutionDir的定义如下:
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
Run Code Online (Sandbox Code Playgroud)
这与其他有效的项目相同.有任何想法吗?
我正在查看VS2010中的数据库项目,我的想法是我想要一些东西来跟踪数据库模式(在源代码控制中)以及生成"新安装"脚本和更改脚本的能力.
当我创建一个新的数据库项目向导并导入我现有的数据库模式时,它将不会"构建".我收到错误:
SQL03006:用户:[scanner]有一个未解析的对Login [scanner]的引用.
生成此错误的SQL:
CREATE USER [scanner] FOR LOGIN [scanner];
用户"scanner"是我导入的数据库中定义的登录名.我不知道它给我带来了什么,谷歌也没有多大的投入.有任何想法吗?
我创建了一个简单的指令,显示<table>我正在创建的排序列标题.
ngGrid.directive("sortColumn", function() {
return {
restrict: "E",
replace: true,
transclude: true,
scope: {
sortby: "@",
onsort: "="
},
template: "<span><a href='#' ng-click='sort()' ng-transclude></a></span>",
link: function(scope, element, attrs) {
scope.sort = function () {
// I want to call CONTROLLER.onSort here, but how do I access the controller scope?...
scope.controllerOnSort(scope.sortby);
};
}
};
});
Run Code Online (Sandbox Code Playgroud)
以下是一些正在创建的表头的示例:
<table id="mainGrid" ng-controller="GridCtrl>
<thead>
<tr>
<th><sort-column sortby="Name">Name</sort-column></th>
<th><sort-column sortby="DateCreated">Date Created</sort-column></th>
<th>Hi</th>
</tr>
</thead>
Run Code Online (Sandbox Code Playgroud)
因此,当单击排序列时,我想在我的网格控制器上触发onControllerSort函数..但是我被卡住了!到目前为止,我能够做到这一点的唯一方法是为每个<sort-column>添加"onSort"的属性并引用指令中的那些:
<sort-column onSort="controllerOnSort" sortby="Name">Name</sort-column>
Run Code Online (Sandbox Code Playgroud)
但这并不是很好,因为我总是想调用controllerOnSort,所以为每个指令管道都有点难看.如何在指令中执行此操作而不需要在HTML中使用不必要的标记?如果有帮助,指令和控制器都在同一模块中定义.
我有一个表,在左栏中我想为行添加一个指标.我正在使用跨度来渲染指示器,但我无法获得跨度来占据整个高度:
<table>
<tr>
<td style="padding:0px;"><span style="height:100%; width:5px; background-color:pink;"> </span></td>
<td>Some content</td>
<td>Some more content</td>
</tr>
</table>
Run Code Online (Sandbox Code Playgroud)
该表的填充为15px,因此对于指示器col,我删除了填充,并将跨度设置为高度:100%:
td {padding:15px;}
table {background-color: yellow;}
Run Code Online (Sandbox Code Playgroud)
这个小提琴显示它当前正在运行 - 粉红条需要跨越包含td的整个高度.
我该怎么做呢?请注意,我不能设置对TD代替跨度的造型,因为会与该渲染(它抵消了其他问题border-bottom的的th行,如果我这样做).
如何从当前文件夹中获取文件?
我有一个名为sql_parser.rb包含类的文件.我想将它包含在同一个文件夹中的另一个文件中,所以我使用了:
require 'sql_parser'
Run Code Online (Sandbox Code Playgroud)
当我从该文件夹运行时失败:
LoadError: no such file to load -- sql_parser
Run Code Online (Sandbox Code Playgroud)
我尝试在存在此文件的文件夹中使用IRB并从那里要求它,但是遇到了同样的问题.
css ×2
javascript ×2
jquery ×2
.net ×1
amazon-ec2 ×1
angularjs ×1
backbone.js ×1
height ×1
html ×1
iis ×1
msbuild ×1
msdeploy ×1
nuget ×1
permissions ×1
require ×1
ruby ×1
sql-server ×1
ssh ×1
touch ×1
touch-event ×1
webdeploy ×1