小编Chr*_*ski的帖子

得到时间作为国际

haskell中是否有一个函数用于纪元时间,以秒/毫秒为单位?

也许类似于java的东西

System.currentTimeMillis();
Run Code Online (Sandbox Code Playgroud)

编辑:as IntInteger

haskell

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

git的ZSH自动完成需要花费大量时间,我可以将其关闭或优化吗?

Git的选项卡自动完成对于小型项目非常有用,但我目前正在开发两个使用git的大项目,而这些项目比无用更糟糕.比方说,每当我键入时,git add forms<tab>git需要20秒或更长时间才能找到文件(在本例中为forms.py),在这个时间段内,我无法在终端中执行任何其他操作.有没有办法关闭自动完成功能,或以某种方式使其更快?

git bash zsh git-bash zsh-completion

24
推荐指数
4
解决办法
9838
查看次数

Docker bash提示符不显示颜色输出

我使用命令:docker run --rm -it govim bash -l运行docker图像,但它不显示颜色输出.如果我source ~/.bash_profilebash -l再次运行,输出将正确输出颜色.

Bash提示图像

我的bash_profile和bash_prompt

linux bash shell docker

24
推荐指数
3
解决办法
2万
查看次数

kubectl获取pods - kubectl获取pods - 状态ImagePullBackOff

我正试图在本地运行我的第一个kubernetes pod.我运行以下命令(从这里):

export ARCH=amd64
docker run -d \
    --volume=/:/rootfs:ro \
    --volume=/sys:/sys:ro \
    --volume=/var/lib/docker/:/var/lib/docker:rw \
    --volume=/var/lib/kubelet/:/var/lib/kubelet:rw \
    --volume=/var/run:/var/run:rw \
    --net=host \
    --pid=host \
    --privileged \
    gcr.io/google_containers/hyperkube-${ARCH}:${K8S_VERSION} \
    /hyperkube kubelet \
        --containerized \
        --hostname-override=127.0.0.1 \
        --api-servers=http://localhost:8080 \
        --config=/etc/kubernetes/manifests \
        --cluster-dns=10.0.0.10 \
        --cluster-domain=cluster.local \
        --allow-privileged --v=2
Run Code Online (Sandbox Code Playgroud)

然后,我试图运行以下内容:

kubectl create -f ./run-aii.yaml
Run Code Online (Sandbox Code Playgroud)

运行aii.yaml:

apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: aii
spec:
  replicas: 2
  template:
    metadata:
      labels:
        run: aii
    spec:
      containers:
      - name: aii
        image: aii
        ports:
        - containerPort: 5144
        env:
        - name: …
Run Code Online (Sandbox Code Playgroud)

docker kubernetes

24
推荐指数
6
解决办法
5万
查看次数

一行kubectl命令将配置文件与〜/ .kube/config合并?

是否有一个简单的kubectl命令来获取kubeconfig文件(包含集群+上下文+用户)并将其合并到〜/ .kube/config文件中作为附加上下文?

kubernetes

24
推荐指数
5
解决办法
7244
查看次数

git status未在新文件夹中显示新文件

我刚创建了一个新的git repo,/我在文件test.txt夹中创建了一个新文件,test_fold以便该文件的路径是test_fold\test.txt.然后我跑了git status.这是输出,它找到文件夹而不是文件.为什么不告诉我有一个新文件test_fold

$ git status
On branch master

Initial commit

Untracked files:
  (use "git add <file>..." to include in what will be committed)

        .gitignore
        test_fold/

nothing added to commit but untracked files present (use "git add" to track)
Run Code Online (Sandbox Code Playgroud)

.gitignore文件为空白.

git

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

如何将50%的CPU资源分配给docker容器?

我有一个4核CPU,我想将50%的CPU资源分配给一个docker容器.
阅读docker-run手册和config.go源代码后.
我还是不知道如何使用该-c, --cpu-shares=0选项.

docker run -c 0.5 -i -t ubuntu /bin/bash
Run Code Online (Sandbox Code Playgroud)

要么

docker run -c 2 -i -t ubuntu /bin/bash
Run Code Online (Sandbox Code Playgroud)

docker

22
推荐指数
3
解决办法
6万
查看次数

如何在docker push上指定用户名和密码?

嗨,我正在努力 docker push

[docker-simple-httpserver]# docker push myregistry/simplehttpserver:latest
The push refers to a repository [myregistry/simplehttpserver] (len: 1)
Sending image list
FATA[0000] Error: Status 403 trying to push repository simplehttpserver: "{\"error\": \"Unauthorized updating repository images\"}" 
Run Code Online (Sandbox Code Playgroud)

是有我的方式来指定username,并passworddocker push命令?

docker docker-registry

22
推荐指数
5
解决办法
6万
查看次数

如何在Haskell中自动生成(并查看代码)Read and Show

所以,在Haskell中,执行此操作非常简单:

data Foo = Bar | Baz
    deriving (Read, Show)
Run Code Online (Sandbox Code Playgroud)

这很棒,但我希望能够将一些数据作为字符串从Haskell传递给Elm语言.语言足够相似,如果我有一个Haskell实现的Read,我可以轻松地将它转换为Elm.

问题是,当我使用派生时,该函数会自动生成,但我实际上无法看到它的作用.

我想知道,有没有办法自动生成解析和显示使用Read和Show的代码,这样我才能真正看到代码本身?

serialization parsing haskell typeclass deriving

21
推荐指数
2
解决办法
861
查看次数

如何在不崩溃docker容器的情况下重启apache2?

我使用带有标记的php docker容器作为基础:

php:5.6-apache
Run Code Online (Sandbox Code Playgroud)

当我尝试重新启动容器内的apache2时,容器停止:

root@phalconapp:/var/www/html# service apache2 restart
Restarting web server: apache2Terminated
root@phaclonapp:/var/www/html#
me@myLocalComputer:
Run Code Online (Sandbox Code Playgroud)

如何在不停止容器的情况下重启apache2?

在将更改放入dockerfile之前,我想要使用容器并自定义它.我想安装一些扩展并让他们工作我需要重新启动apache才能使更改生效.

这是日志文件:

Attaching to dltasklight_phlaconapp_1
phlaconapp_1 | AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.17.0.2. Set the 'ServerName' directive globally to suppress this message
phlaconapp_1 | AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.17.0.2. Set the 'ServerName' directive globally to suppress this message
phlaconapp_1 | [Mon May 30 10:19:24.556154 2016] [mpm_prefork:notice] …
Run Code Online (Sandbox Code Playgroud)

php apache docker docker-compose

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