小编Don*_*Liu的帖子

无法锁定 ref 'refs/remotes/origin/master'

如果有一些更新,我总是cannot lock ref 'refs/remotes/origin/master'git pull第一次执行时得到。

完整的控制台日志如下。

D:\code\react-native\expo-multi-screen-starter>git pull
error: cannot lock ref 'refs/remotes/origin/master': is at b2459b4d5af42622cba55f9fe47ccd14fbd879bc but expected 76f11048c866cfe3e6570eaacf90db3cb7732723
From github.com:liudonghua123/expo-multi-screen-starter
 ! 76f1104..b2459b4  master     -> origin/master  (unable to update local ref)

D:\code\react-native\expo-multi-screen-starter>git pull
 App.js                                          | 19 ++++-----
 src/navigation/AuthStack.js                     | 14 +++++++
 src/navigation/RootNavigator.js                 | 22 ++++++++++
 src/navigation/TabNavigator.js                  |  4 +-
 src/screens/AuthLoadingScreen.js                | 35 ++++++++++++++++
 src/screens/HomeScreen.js                       | 19 +++++++++
 src/screens/{LoginScreen.js => SignInScreen.js} | 54 ++++++++++++++++++++++---
 7 files changed, 147 insertions(+), 20 deletions(-)
 create mode 100644 src/navigation/AuthStack.js
 create mode …
Run Code Online (Sandbox Code Playgroud)

git

15
推荐指数
5
解决办法
2万
查看次数

获取"无法建立连接.接收端不存在".当内容脚本sendResponse到后台时

我写了一个chrome扩展,popup js会向后台发送一条消息,后台会将消息重定向到内容脚本,经过一些网络请求,结果应该返回后台然后弹出js.

以下是我的代码的一些简化部分.

popup js

$('.porintButton').click(function() {
    switch (this.id) {
        case 'learningPointButton':
            chrome.runtime.sendMessage({ action: 'learning' }, callback);
            processResult();
            break;
    }
    return true;
});
Run Code Online (Sandbox Code Playgroud)

背景js

chrome.runtime.onMessage.addListener((request, sender, sendResponse) => {
    chrome.tabs.query({ active: true, currentWindow: true }, function (tabs) {
        chrome.tabs.sendMessage(tabs[0].id, request, response => {
            if (chrome.runtime.lastError) {
                // If I click learningPointButton, the line will excute, and log 'ERROR:  {message: "Could not establish connection. Receiving end does not exist."}' 
                console.log('ERROR: ', chrome.runtime.lastError);
            } else {
                console.log('The Content Script got the following …
Run Code Online (Sandbox Code Playgroud)

javascript google-chrome google-chrome-extension

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

docker容器中奇怪的文件权限(权限位和用户位上的问号)

我编写了一个 Dockerfile 和 docker-compose.yml 来构建一个结合了 beakerx 和 cling 的自定义镜像,其内容如下。

FROM beakerx/beakerx

MAINTAINER liudonghua123 <liudonghua123@gmail.com>

# not works
#RUN conda install xeus-cling notebook -c QuantStack -c conda-forge -y --quiet

USER root
# install gcc7
RUN add-apt-repository -y ppa:jonathonf/gcc-7.2
RUN apt-get update -y
RUN apt-get install -y gcc-7

# revert to beakerx user
USER beakerx
ARG CLING_FILENAME=cling_2018-09-04_ubuntu16
RUN echo "use ${CLING_FILENAME} for build"
# add the prebuild cling packages
ADD ${CLING_FILENAME}.tar.bz2 /home/beakerx
ENV PATH=/home/beakerx/${CLING_FILENAME}/bin:$PATH
USER root
RUN pip install --upgrade pip
# …
Run Code Online (Sandbox Code Playgroud)

linux file-permissions docker

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

docker容器中文件权限显示很多问号

我写了一个Dockerfile,最后的内容是

RUN echo "root:root" | chpasswd
RUN echo "beakerx:beakerx" | chpasswd
RUN usermod -aG sudo beakerx

RUN echo beakerx | sudo -S chown -R beakerx:beakerx /home/beakerx/.local
RUN echo beakerx | sudo -S find /home/beakerx/.local -type d -exec chmod 755 {} \;
RUN echo beakerx | sudo -S find /home/beakerx/.local -type f -exec chmod 644 {} \;

RUN id
RUN ls -la /home/beakerx/.local
RUN ls -la /home/beakerx/.local/share

USER beakerx

RUN id
RUN ls -la /home/beakerx/.local
RUN ls -la /home/beakerx/.local/share
Run Code Online (Sandbox Code Playgroud)

当我构建这个图像时,它给了我以下错误。

Step …
Run Code Online (Sandbox Code Playgroud)

linux file-permissions docker

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