我正在使用最小的nixos VM映像.
根据:https://nixos.org/nixos/manual/index.html#sec-x11
我只需要添加这些行(/etc/nixos/configuration.nix据推测)
services.xserver.enable = true;
services.xserver.desktopManager.xfce.enable = true;
Run Code Online (Sandbox Code Playgroud)
一旦我执行sudo nixos-rebuild switch并安装xinit nix-env -i xinit,并执行startx我得到一个错误:
hostname: Unknown host
xauth: file /home/demo/.serverauth.2821 does not exist
Run Code Online (Sandbox Code Playgroud) 所以根据https://aws.amazon.com/blogs/aws/amazon-ebs-update-new-elastic-volumes-change-everything/
我应该能够在不停机的情况下“动态”增加卷大小。但是我不明白这怎么可能?
我可以调整卷的大小,但我仍然需要卸载卷以调整文件系统分区的大小。如果此卷是根卷,我将不得不将其取下才能卸载它。
我错过了什么?
我正在学习基本的Haskell,所以我可以配置Xmonad,我遇到了这段代码:
newKeys x = myKeys x `M.union` keys def x
Run Code Online (Sandbox Code Playgroud)
现在我明白了M.union反引号的含义和含义.这就是我解释它的方式:
newKeys(x) = M.union(myKeys(x),???)
Run Code Online (Sandbox Code Playgroud)
我不知道该怎么做keys def x.是keys(def(x))吗?还是keys(def,x)?或者是def某种其他关键字?
是的,这里有一个类似的线程:Test if a variable is set in bash when using "set -o nounset"
然而,有这么多不同的答案,它不是特别清楚。
以下是否足以测试变量是否已设置且不为空?
#!/bin/bash
set -o nounset
if [[ ! -z "${EXAMPLE-}" ]]; then
echo "Variable is defined and is not empty..."
fi
Run Code Online (Sandbox Code Playgroud) 如何123 :: Integer从字符串中检索值,如123_使用任何与正则表达式相关的Haskell库?
import Text.Regex.Posix
let (_,_,_,[sectionKey]) = ("123_") =~ ("(\\d+)_" :: String) :: (String, String, String, [Int])
Run Code Online (Sandbox Code Playgroud)
我已经尝试了以上(使用https://hackage.haskell.org/package/regex-posix库),产生的错误是:
• No instance for (RegexContext
Regex [Char] (String, String, String, [Int]))
arising from a use of ‘=~’
• In the expression:
("123_") =~ ("(\\d+)_" :: String) ::
(String, String, String, [Int])
In a pattern binding:
(_, _, _, [sectionKey])
= ("123_") =~ ("(\\d+)_" :: String) ::
(String, String, String, [Int])
Run Code Online (Sandbox Code Playgroud)
这是一个简化的案例,我正在寻找一种能够提供正则表达式兼容解决方案的解决方案.
我如何从Python中执行Haskell等效操作?
>>> "this is a test".find("test")
10
Run Code Online (Sandbox Code Playgroud)
编辑:基本上我有一些文字,例如:"这是一个测试".现在我有一个我想在该文本中找到的字符串,例如:"test".如何在"这是一个测试"中找到"测试"的字符偏移?
我错误地从错误的文件中创建了一个密钥:
gcloud kms encrypt --plaintext-file=keys/staging-access-chris \
--ciphertext-file=id_rsa.enc \
--location=global --keyring="$keyRing" --key=bitbucket
Run Code Online (Sandbox Code Playgroud)
如何更新/编辑此条目?我是否需要更改文件名及其所有引用,或者是否需要更少工作的解决方案?
根据https://nixos.org/nixpkgs/manual/#ssec-unpack-phase我可以使用 zip 文件作为“源”。
with import <nixpkgs> {};
stdenv.mkDerivation {
name = "test-environment";
nativeBuildInputs = [ unzip ];
buildInputs = [ unzip ];
src = "./x.zip";
}
Run Code Online (Sandbox Code Playgroud)
nix-build
these derivations will be built:
/nix/store/431i1riasgh2hjs5rd9azfh0ssjlg7qj-test-environment.drv
building '/nix/store/431i1riasgh2hjs5rd9azfh0ssjlg7qj-test-environment.drv'...
unpacking sources
unpacking source archive ./x.zip
unzip: cannot find or open ./x.zip, ./x.zip.zip or ./x.zip.ZIP.
unzip: cannot find or open ./x.zip, ./x.zip.zip or ./x.zip.ZIP.
do not know how to unpack source archive ./x.zip
builder for '/nix/store/431i1riasgh2hjs5rd9azfh0ssjlg7qj-test-environment.drv' failed with exit code 1
error: build …Run Code Online (Sandbox Code Playgroud) kube-apiserver 未运行
/var/log/kube-apiserver.log 有以下内容:
Flag --address has been deprecated, see --insecure-bind-address instead.
Run Code Online (Sandbox Code Playgroud)
这些值存储/配置在哪里?
我的意思是来自我的 kops 配置,我现在已经修改了。但我无法反映这些变化:
kops rolling-update cluster
Using cluster from kubectl context: uuuuuuuuuuuuuuuuuuuuuu
Unable to reach the kubernetes API.
Use --cloudonly to do a rolling-update without confirming progress with the k8s API
error listing nodes in cluster: Get https://api.uuuuuuuuuu/api/v1/nodes: dial tcp eeeeeeeeeeeeeee:443: connect: connection refused
Run Code Online (Sandbox Code Playgroud) 如何导出单个 kubectl 上下文?
我当前的 kubectl 配置文件定义了多个上下文,尝试将单个上下文与其他上下文隔离将是繁琐的手动过程。
这是支持的吗?