我在我的Ubuntu 11.04 x64笔记本电脑上安装了XAMPP for Linux(版本1.7.4).然后我在我的htdocs文件夹中创建了一个链接到我的项目文件夹:
$pwd
/opt/lampp/htdocs
$sudo ln -s /home/petra/projects/webapp webapp
$ls -al
drwxr-xr-x 4 nobody root 4096 2011-08-18 11:58 .
drwxr-xr-x 18 root root 4096 2011-01-25 15:33 ..
lrwxrwxrwx 1 root root 26 2011-08-18 11:42 webapp -> /home/petra/projects/webapp
Run Code Online (Sandbox Code Playgroud)
当我在浏览器中打开webapp时http://localhost/webapp
,它只显示"403 Access Forbidden".错误日志说:
$tail -f /opt/lampp/logs/error_log
[Thu Aug 18 11:43:15 2011] [error] [client 127.0.0.1] Symbolic link not allowed or link target not accessible: /opt/lampp/htdocs/webapp
Run Code Online (Sandbox Code Playgroud)
这是httpd.conf.奇怪的是,FollowSymLinks
选项已经定义(默认).
在XAMPP论坛上有一个类似的问题,但我认为似乎没有人关注它了.
有谁知道如何解决这个问题?
我正在尝试将我的代码推送到github,但几乎每次我都遇到这个错误
error: RPC failed; result=28, HTTP code = 0
fatal: The remote end hung up unexpectedly
fatal: The remote end hung up unexpectedly
Run Code Online (Sandbox Code Playgroud)
这太烦人了.谁知道如何解决这个问题?
更新我用Google搜索后,我读到运行git config --global http.postBuffer 524288000
可以解决问题.但即使在我执行该命令后,我仍然遇到了问题.
我在使用S3FS时遇到问题.我正在使用
ubuntu@ip-x-x-x-x:~$ /usr/bin/s3fs --version
Amazon Simple Storage Service File System 1.71
Run Code Online (Sandbox Code Playgroud)
我有装在密码文件/usr/share/myapp/s3fs-password
与600
许可.
我成功安装了S3存储桶.
sudo /usr/bin/s3fs -o allow_other -opasswd_file=/usr/share/myapp/s3fs-password -ouse_cache=/tmp mybucket.example.com /bucket
Run Code Online (Sandbox Code Playgroud)
我已经user_allow_other
启用了/etc/fuse.conf
当我尝试在存储桶中创建文件时,root
它正常工作.
ubuntu@ip-x-x-x-x:~$ sudo su
root@ip-x-x-x-x:/home/ubuntu# cd /bucket
root@ip-x-x-x-x:/bucket# echo 'Hello World!' > test-`date +%s`.txt
root@ip-x-x-x-x:/bucket# ls
test-1373359118.txt
Run Code Online (Sandbox Code Playgroud)
我检查了存储桶mybucket.example.com
的内容,文件已成功创建.
但是我在/bucket
以不同的用户身份写入目录时遇到了困难.
root@ip-x-x-x-x:/bucket# exit
ubuntu@ip-x-x-x-x:~$ cd /bucket
ubuntu@ip-x-x-x-x:/bucket$ echo 'Hello World!' > test-`date +%s`.txt
-bash: test-1373359543.txt: Permission denied
Run Code Online (Sandbox Code Playgroud)
我拼命想尝试777
一下test-1373359118.txt
.我可以写入文件
ubuntu@ip-x-x-x-x:/bucket$ sudo chmod 777 test-1373359118.txt …
Run Code Online (Sandbox Code Playgroud) 尝试在自己的房屋中构建Docker映像时,我发现了一个奇怪的问题,尽管我不确定它是否与浏览器相关,或者仅与网络相关。
所以这就是我得到的。我试图在Dockerfile中运行此命令。
RUN apt-get update -qq && \
apt-get install -y build-essential \
libpq-dev \
postgresql-client
Run Code Online (Sandbox Code Playgroud)
等待片刻后,该过程会输出类似以下内容的内容。
W: Failed to fetch http://deb.debian.org/debian/dists/jessie/InRelease
W: Failed to fetch http://deb.debian.org/debian/dists/jessie-updates/InRelease
W: Failed to fetch http://security.debian.org/dists/jessie/updates/InRelease
W: Failed to fetch http://deb.debian.org/debian/dists/jessie/Release.gpg Temporary failure resolving 'deb.debian.org'
W: Failed to fetch http://security.debian.org/dists/jessie/updates/Release.gpg Temporary failure resolving 'security.debian.org'
W: Failed to fetch http://deb.debian.org/debian/dists/jessie-updates/Release.gpg Temporary failure resolving 'deb.debian.org'
W: Some index files failed to download. They have been ignored, or old ones used instead.
Run Code Online (Sandbox Code Playgroud)
奇怪的是,如果我在办公室网络中尝试过此操作,则不会发生这种情况。然后,如果我尝试绑定到手机数据网络,也不会发生这种情况。
我尝试http://deb.debian.org/debian/dists/jessie/InRelease
在浏览器中打开,它显示404。我尝试通过多个网络使用Tor浏览器,它也显示404。
docker映像基于 …
我还在试图弄清楚如何在递归的AJAX调用中使用jQuery延迟对象.我有这样的代码
function request(page, items){
//building the AJAX return value for JSFiddle dummy AJAX endpoint
var ret = {
totalPage: 10,
currentPage: page,
items: []
};
for (var i = page; i < (page + 5); i++){
ret.items.push(i);
}
//calling the AJAX
$.ajax({
url: '/echo/json/',
method: 'POST',
dataType: 'json',
data: {
delay: 1,
json: JSON.stringify(ret)
},
success: function(data){
if (data.currentPage <= data.totalPage){
var filtered = data.items.filter(function(el){
return el % 2 == 1;
});
var newitems = items.concat(filtered);
console.dir(newitems);
request(data.currentPage + 1, …
Run Code Online (Sandbox Code Playgroud) 我正在尝试使用CSS attr()
来改变伪:before
元素的背景颜色.
<ul>
<li data-color="#ff0000">R</li>
<li data-color="#00ff00">G</li>
<li data-color="#0000ff">B</li>
</ul>
Run Code Online (Sandbox Code Playgroud)
这是CSS
ul {
list-style: none;
}
li:before {
background-color: attr(data-color, color);
content: "";
display: inline-block;
height: 10px;
width: 10px;
}
Run Code Online (Sandbox Code Playgroud)
但是before元素根据data-color
属性不显示背景颜色.
但是当我添加这个CSS时
li:after {
content: attr(data-color);
}
Run Code Online (Sandbox Code Playgroud)
的:after
元件示出了data-color
属性内容作为内容.
这是JS小提琴http://jsfiddle.net/b7Rve/
我做错了什么?
UPDATE
我刚刚color
在Mozilla开发人员文档中重读过.它说这种color
类型是实验性的.我想我仍然需要等到它被释放.
我想用跟踪器替换HTML电子邮件中的所有链接.据我所知,有这个EVENT_BEFORE_SEND
事件.所以我创建了一些可以像下面这样使用的行为
$mailer = \Yii::$app->mailer;
/* @var $mailer \yii\mail\BaseMailer */
$mailer->attachBehavior('archiver', [
'class' => \app\MailTracker::class
]);
Run Code Online (Sandbox Code Playgroud)
这是MyTracker
班级的内容.
class MailTracker extends Behavior {
public function events() {
return [
\yii\mail\BaseMailer::EVENT_BEFORE_SEND => 'trackMail',
];
}
/**
* @param \yii\mail\MailEvent $event
*/
public function trackMail($event) {
$message = $event->message;
$htmlOutput = $this->how_do_i_get_the_html_output();
$changedOutput = $this->changeLinkWithTracker($htmlOutput);
$message->getHtmlBody($changedOutput);
}
}
Run Code Online (Sandbox Code Playgroud)
现在的问题是\yii\mail\BaseMailer
没有提供在发送之前获取HTML输出的方法.
这该怎么做?
UPDATE
我能做到这一点的唯一方法是通过这种黑客方式.
/* @var $message \yii\swiftmailer\Message */
if ($message instanceof \yii\swiftmailer\Message) {
$swiftMessage = $message->getSwiftMessage();
$r = new …
Run Code Online (Sandbox Code Playgroud) 我正在尝试使用Facebook Marketing API和Facebook Python Business SDK创建自动 Facebook 广告。到目前为止,我成功地发布了新的活动和广告集,但是当我尝试创建广告创意时,它返回消息“应用程序没有能力进行此 API 调用。”。
Message: Call was not successful
Method: POST
Path: https://graph.facebook.com/v3.0/act_xxxxxx/adcreatives
Params: //XXX
Status: 400
Response:
{
"error": {
"message": "(#3) Application does not have the capability to make this API call.",
"code": 3,
"fbtrace_id": "xxxxxx",
"type": "OAuthException"
}
}
Run Code Online (Sandbox Code Playgroud)
我的用户令牌权限有ads_management
和ads_read
,应用程序也有ads_reads
和ads_management
。
还有什么我想念的吗?
我如何静态输出PHP内置服务器?
我试过了
php -S 127.0.0.1:80 -t public/ > /dev/null
Run Code Online (Sandbox Code Playgroud)
但它仍然输出
[Thu Jun 11 13:08:53 2015] 127.0.0.1:60963 [200]: /
Run Code Online (Sandbox Code Playgroud) 我目前正在我的团队构建的 Android 代码库中设置 Jacoco。我在 Android 方面没有太多经验,但我之前已经在 Spring Boot 代码库中设置了 Jacoco,以便我可以跟踪 Sonarqube 中的测试覆盖率。但我在 Android 代码库中遇到了困难。
\n所以目录布局看起来像这样
\nMyApp/\n\xe2\x94\x9c\xe2\x94\x80 app/\n\xe2\x94\x82 \xe2\x94\x9c\xe2\x94\x80 build/\n\xe2\x94\x82 \xe2\x94\x9c\xe2\x94\x80 src/\n\xe2\x94\x82 \xe2\x94\x9c\xe2\x94\x80 build.gradle.kts\n\xe2\x94\x9c\xe2\x94\x80 buildSrc/\n\xe2\x94\x82 \xe2\x94\x9c\xe2\x94\x80 build.gradle.kts\n\xe2\x94\x9c\xe2\x94\x80 modules/\n\xe2\x94\x82 \xe2\x94\x9c\xe2\x94\x80 module1/\n\xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x9c\xe2\x94\x80 src/\n\xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x9c\xe2\x94\x80 build.gradle.kts\n\xe2\x94\x82 \xe2\x94\x9c\xe2\x94\x80 module2/\n\xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x9c\xe2\x94\x80 src/\n\xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x9c\xe2\x94\x80 build.gradle.kts\n\xe2\x94\x9c\xe2\x94\x80 build.gradle.kts\n\xe2\x94\x9c\xe2\x94\x80 gradle.properties\n\xe2\x94\x9c\xe2\x94\x80 gradlew\n\xe2\x94\x9c\xe2\x94\x80 settings.gradle.kts\n
Run Code Online (Sandbox Code Playgroud)\n我尝试添加jacoco
到MyApp/build.gradle.kts
.
plugins {\n id(Dependencies.Plugins.androidApplication) version Dependencies.Versions.androidAppplication apply false\n id(Dependencies.Plugins.androidLibrary) version Dependencies.Versions.androidLibrary apply false\n id(Dependencies.Plugins.hilt) version Dependencies.Versions.hilt apply false\n id(Dependencies.Plugins.openApi) version Dependencies.Versions.openApi\n id(Dependencies.Plugins.kotlinAndroid) version Dependencies.Versions.kotlinAndroid apply …
Run Code Online (Sandbox Code Playgroud)