我们在linode上有一个VPS,在gitHub上有代码.我们如何设置,当我们推送到gitHub时,它也会自动推送到我们的linode服务器.我们在linode服务器上使用PHP.
谢谢.
我有以下nginx配置片段:
server {
listen 80;
server_name mydomain.io;
root /srv/www/domains/mydomain.io;
index index.html index.php;
access_log /var/log/nginx/domains/mydomain.io/access.log;
error_log /var/log/nginx/domains/mydomain.io/error.log;
location ~\.php {
try_files $uri =404;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_intercept_errors on;
fastcgi_pass 127.0.0.1:9000;
include /etc/nginx/fastcgi_params;
}
}
Run Code Online (Sandbox Code Playgroud)
首先,如何使服务器块响应both http://www.mydomain.io和http://mydomain.io.其次,如果他们来自http://www.mydomain.io重定向到http://mydomain.io,我想强制.
谢谢.
我有以下HTML:
<div class="server" id="32">
<a>Server Name</a>
<div class="delete-server">X</div>
</div>
Run Code Online (Sandbox Code Playgroud)
我试图这样做,当用户单击它时,server它会打开一个编辑对话框.问题只是做:
$(".server").click(function () {
//Show edit dialog
});
Run Code Online (Sandbox Code Playgroud)
不起作用,因为如果他们点击删除的X,它会打开编辑对话框.如何使整个div server具有除delete-serverdiv 之外的click事件.
我有一个Lessmixin定义为:
.fontStyle(@family, @size, @weight: normal, @style: normal, @color: #ffffff, @letter-spacing: normal) {
font-family: @family;
font-size: @size;
color: @color;
font-weight: @weight;
font-style: @style;
letter-spacing: @letter-spacing;
}
Run Code Online (Sandbox Code Playgroud)
我该如何定义用法:
.fontStyle('NimbusSansNovCon-Reg', 12px, , , , 0.1em);
Run Code Online (Sandbox Code Playgroud)
IE使用的默认值@weight,@style,@color
我正在尝试删除 Kubernetes 集群上的持久卷。我运行了以下命令:
kubectl delete pv pvc-08e65270-b7ce-11e9-ba0b-0a1e280502e2 pvc-08e87826-b7ce-11e9-ba0b-0a1e280502e2 pvc-08ea5f97-b7ce-11e9-ba0b-0a1e280502e2 pvc-08ec1cac-b7ce-11e9-ba0b-0a1e280502e2
Run Code Online (Sandbox Code Playgroud)
然而它显示:
persistentvolume "pvc-08e65270-b7ce-11e9-ba0b-0a1e280502e2" deleted
persistentvolume "pvc-08e87826-b7ce-11e9-ba0b-0a1e280502e2" deleted
persistentvolume "pvc-08ea5f97-b7ce-11e9-ba0b-0a1e280502e2" deleted
persistentvolume "pvc-08ec1cac-b7ce-11e9-ba0b-0a1e280502e2" deleted
Run Code Online (Sandbox Code Playgroud)
但是命令没有退出。所以我CONTROL+C强制退出命令。几分钟后,我跑了:
kubectl get pv
Run Code Online (Sandbox Code Playgroud)
状态为Terminating,但卷似乎没有删除。
如何删除这些持久卷?
使用css3时transform(),position: fixed不适用.我做了一个完全工作的jsFiddle显示问题:http://jsfiddle.net/SR5ka/
首先向下滚动,注意左侧边栏保持固定.现在,单击expand,然后向下滚动,注意左侧边栏现在没有修复.
知道是否有本地css修复此问题?
在ES6中是否可以在严格模式下try{}使用变量const?
'use strict';
const path = require('path');
try
{
const configPath = path.resolve(process.cwd(), config);
}
catch(error)
{
//.....
}
console.log(configPath);
Run Code Online (Sandbox Code Playgroud)
这不能lint因为configPath在范围之外定义.这似乎有用的唯一方法是:
'use strict';
const path = require('path');
let configPath;
try
{
configPath = path.resolve(process.cwd(), config);
} catch(error)
{
//.....
}
console.log(configPath);
Run Code Online (Sandbox Code Playgroud)
基本上,无论如何使用const而不是let这种情况?
关于如何构建重置密码令牌的最佳实践?我在想:
随机17个字符[a-zA-Z0-9] +全局唯一id +随机17个字符[a-zA-Z0-9].
是否有更好的解决方案,或重置密码令牌的行业标准?
running latest version 21当pre标签内容溢出时,我试图让Chrome中的垂直滚动条显示.我不能让垂直滚动条实际显示.
看到这个jsFiddle:http://jsfiddle.net/justink101/2tJmC/
编辑
在Mac上 - OSX
我在我的应用程序中构建了CSRF保护,只需在每个页面加载时生成随机令牌,将其置于会话中,然后将令牌绑定到<body>标记属性,如:
<body data-csrf-token="csrf_GeJf53caJD6Q5WzwAzfy">
Run Code Online (Sandbox Code Playgroud)
然后在每个表单操作或ajax请求中,我只需从body标签中获取令牌并将其发送出去.
除了一个巨大的问题,这很好用.用户正在打开应用程序的多个选项卡,我看到令牌冲突.例如,用户加载第一页并生成令牌,然后他们切换选项卡,加载另一页,生成新令牌.最后,他们切换回第一页并提交格式化操作.这会导致无效的CSRF令牌错误.
重新构建此选项以防止与多个选项卡发生冲突的最佳方法是什么,同时尽可能保证其安全.
只是在登录正确的解决方案时生成单个令牌,而不是在每个页面加载时生成新令牌?
css ×3
javascript ×2
csrf ×1
css3 ×1
deployment ×1
ecmascript-6 ×1
git ×1
github ×1
guid ×1
jquery ×1
kubernetes ×1
less ×1
mixins ×1
nginx ×1
node.js ×1
onclick ×1
overflow ×1
parameters ×1
passwords ×1
php ×1
scrollbar ×1
security ×1
try-catch ×1