haskell中是否有一个函数用于纪元时间,以秒/毫秒为单位?
也许类似于java的东西
System.currentTimeMillis();
Run Code Online (Sandbox Code Playgroud)
编辑:as Int或Integer?
Git的选项卡自动完成对于小型项目非常有用,但我目前正在开发两个使用git的大项目,而这些项目比无用更糟糕.比方说,每当我键入时,git add forms<tab>git需要20秒或更长时间才能找到文件(在本例中为forms.py),在这个时间段内,我无法在终端中执行任何其他操作.有没有办法关闭自动完成功能,或以某种方式使其更快?
我使用命令:docker run --rm -it govim bash -l运行docker图像,但它不显示颜色输出.如果我source ~/.bash_profile或bash -l再次运行,输出将正确输出颜色.
我正试图在本地运行我的第一个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) 是否有一个简单的kubectl命令来获取kubeconfig文件(包含集群+上下文+用户)并将其合并到〜/ .kube/config文件中作为附加上下文?
我刚创建了一个新的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文件为空白.
我有一个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 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,并password在docker push命令?
所以,在Haskell中,执行此操作非常简单:
data Foo = Bar | Baz
deriving (Read, Show)
Run Code Online (Sandbox Code Playgroud)
这很棒,但我希望能够将一些数据作为字符串从Haskell传递给Elm语言.语言足够相似,如果我有一个Haskell实现的Read,我可以轻松地将它转换为Elm.
问题是,当我使用派生时,该函数会自动生成,但我实际上无法看到它的作用.
我想知道,有没有办法自动生成解析和显示使用Read和Show的代码,这样我才能真正看到代码本身?
我使用带有标记的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)