小编Eps*_*lon的帖子

在 Powershell 5.1 中与 Base64 相互转换

我找到了一些资源(包括Convert base64 string to file,这实际上是重复的,因为它是我用来构建这个的资源之一),但我似乎无法让它工作。

我有以下代码(粗略地 - 显然它被精简了),我可以根据评论验证该过程的大部分步骤。

$pic = Get-Content 'testpic.png'
# $pic looks like a binary dump.

$picBytes = [System.Text.Encoding]::Unicode.GetBytes($pic)
$ $picBytes is an array of bytes. Quite spammy.

$picEncoded = [Convert]::ToBase64String($picBytes)
# $picEncoded is indeed a Base64 string. Halfway there!

$picDecoded = [Convert]::FromBase64String($picEncoded)
# Also an array of bytes. I'm assuming they're right for now...

$outFile = "pic.png"
[IO.File]::WriteAllBytes($outFile,$picDecoded)
# but I get no output file and no error?
Run Code Online (Sandbox Code Playgroud)

我在这里缺少什么?对于它的价值,我愿意考虑其他解决方案 - 但 Base64 有点重要(因为我将数据存储在脚本中。)

powershell base64 powershell-5.1

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

如何获取整个 Redis 集群的 INFO 状态?

我有一个 6 节点(3 个主节点、3 个辅助节点)集群。我可以使用 INFO 从各个节点获取统计信息(例如 instantaneous_ops_per_second),并且可以使用 CLUSTER INFO 获取有关集群配置的一些信息。

有没有办法从 INFO 获取整个集群的统计信息?使用 -c 开关在集群模式下连接似乎不会改变输出,并且谷歌搜索没有显示任何似乎有用的东西(尽管我至少得到了很多关于一般要监视的东西的提示.. .)

不想使用外部程序来组合统计数据,尽管这是一个明显的解决方案 - 我希望有一些内置于 redis 的东西可以让我查看,例如,每个命令的数量其次整个集群正在处理。

monitoring health-monitoring redis

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