小编Sil*_*der的帖子

Git post-receive hook无效

我们使用带有中央仓库的git(使用Gitosis).我已经创建了一个post-receive挂钩,只要将更改推送到中央存储库,就会生成一封发送到dev邮件列表的电子邮件,并从git repo中的文档文件夹生成文档.

因此,在~git /我有一个目录,我们称之为'a',其中包含git repo的克隆.后接收挂钩看起来像:

#!/bin/bash
cd ~git/repositories/a.git
. ~git/post-receive-email &> /dev/null
( cd ~git/a && git pull &> ~git/pull_log.log && php ~git/a/scripts/generate_markdown_documentation.php &> ~git/doc_log.log )
Run Code Online (Sandbox Code Playgroud)

电子邮件脚本正在运行,但文档生成却没有.pull_log.log的内容是:

fatal: Not a git repository: '.'
Run Code Online (Sandbox Code Playgroud)

这让我觉得它没有改变到上面脚本第5行的正确目录.我错了吗?我怎样才能让它发挥作用?

编辑:我已按照回复中的建议更新了post-receive hook.该脚本现在是:

#!/bin/bash
function die {
  echo "$*" >&2; exit 1
}

function checkgit {
  [ -d "$1/.git" ] || die "$1 could not possibly be a git repo; $1/.git is not a dir"
}


cd ~git/repositories/a.git
. ~git/post-receive-email &> /dev/null
( set -x
checkgit …
Run Code Online (Sandbox Code Playgroud)

git bash gitosis githooks git-post-receive

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

Nginx + fastcgi截断问题

我使用fastcgi接口运行一个Django站点到nginx.但是,某些页面正在被截断(即页面源只是停止,有时在标记的中间).我该如何解决这个问题(让我知道需要哪些额外信息,我会发布)

细节:

我正在使用flup,并使用以下命令生成fastcgi服务器:

python ./manage.py runfcgi umask=000 maxchildren=5 maxspare=1 minspare=0 method=prefork socket=/path/to/runfiles/django.sock pidfile=/path/to/runfiles/django.pid
Run Code Online (Sandbox Code Playgroud)

nginx配置如下:

# search and replace this: {project_location}
pid /path/to/runfiles/nginx.pid;
worker_processes  2;
error_log /path/to/runfiles/error_log;
events {
    worker_connections  1024;
    use epoll;
}
http {
    # default nginx location
    include        /etc/nginx/mime.types;
    default_type    application/octet-stream;
    log_format main
        '$remote_addr - $remote_user [$time_local] '
            '"$request" $status $bytes_sent '
        '"$http_referer" "$http_user_agent" '
        '"$gzip_ratio"';
    client_header_timeout  3m;
    client_body_timeout    3m;
    send_timeout           3m;
    connection_pool_size        256;
    client_header_buffer_size    1k;
    large_client_header_buffers    4 2k;
    request_pool_size        4k;
    output_buffers   4 32k;
    postpone_output  1460;
    sendfile        on; …
Run Code Online (Sandbox Code Playgroud)

python django fastcgi nginx

10
推荐指数
3
解决办法
5466
查看次数

如何对编译器进行反向工程?

我有一个编译器,可以为未记录的VM编译未记录的字节码.我希望能够编译到同一个VM,但我不知道如何去做这个.我该如何学习呢?有没有人发表过他们做同样事情的日志或期刊?

编辑:我忽略了提到这是LEGO Mindstorms 的RobotC 3.0编译器.在任何人提出别的建议之前,我都知道关于nXc和类似项目的所有内容,而且他们不是一个选择,因为我正在帮助一个FIRST FTC机器人团队,只允许使用RobotC或LabView.

对于那些建议我以编译器语言为目标的人,我还没有这样做,因为我希望固件会暴露出编译器未公开的某些硬件功能,因为我想要比RobotC允许的更多自定义内存管理.

compiler-construction reverse-engineering

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