我想生成我的 4096 位装甲GPG私钥的二维码。关键是如此之大,程序似乎因为它的大小而失败。qrencode
$ gpg --export-secret-keys --armor > ~/private.key
$ ./qrencode -o test.png < ~/private.key
Run Code Online (Sandbox Code Playgroud)
结果:
无法对输入数据进行编码:数值结果超出范围
我怎样才能做到这一点?是否有可以处理非常大的 GPG 密钥的 qrencode 替代程序?我想按照这个 security.SE 问题的建议将其打印在纸上。
@geruetzel 和 @cuonglm 的评论正在解决我的问题的这个版本。
简而言之:我想systemd
用脚本写日记。
printf "%s\n%s\n%s\n" CODE_FILE=/etc/zsh/zprofile CODE_LINE=31 MESSAGE="could not read /etc/dircolors" | logger --journald
Run Code Online (Sandbox Code Playgroud)
不起作用。当我执行那个确切的代码(或任何其他带有打印等的变体)时,日志 ( journalctl --full --all --no-pager -n 10
) 中什么也没有发生。
这里有什么问题?
stdbool.h 通常定义为:
#define false 0
#define true 1
Run Code Online (Sandbox Code Playgroud)
而 unix 程序false
- 只有一个不成功的状态代码,被定义为:
int
main(int argc, char *argv[])
{
return (1);
}
Run Code Online (Sandbox Code Playgroud)
为完整起见,unix 程序的定义true
是:
int
main(int argc, char *argv[])
{
return (0);
}
Run Code Online (Sandbox Code Playgroud)
很明显,它与false
stdbool.h中的值完全相反。我使用了OpenBSD的版本,因为 coreutils 的版本更冗长
使这些不同的历史原因是什么?
我的 中有很多函数bashrc
,但是对于新创建的函数,我经常忘记函数的名称。
例如,当我在我的中定义了这个函数时.bashrc
:
function gitignore-unstaged
{
### Description:
# creates a gitignore file with every file currently not staged/commited.
# (except the gitingore file itself)
### Args: -
git ls-files --others | grep --invert-match '.gitignore' > ./.gitignore
}
Run Code Online (Sandbox Code Playgroud)
我想要另一个函数来打印函数的定义,如:
$ grepfunctions "gitignore"
function gitignore-unstaged
{
### Description:
# creates a gitignore file with every file currently not staged/commited.
# (except the gitingore file itself)
### Args: -
git ls-files --others | grep --invert-match '.gitignore' > ./.gitignore …
Run Code Online (Sandbox Code Playgroud) 是否有现有的解决方案可以对dict的输出进行着色以提高其可读性?我知道我可以使用手动为输出着色tput
,但我希望有更好的解决方案。
(我不想在 GUI 中使用它)
我正在编写自己的密码管理器,我希望它严格符合 POSIX 标准。为了简化:我有这个文件,file.csv
:
mastodon;password2
bla;test
test;test
posteo;tewtasdwqrr
Run Code Online (Sandbox Code Playgroud)
基本上,我想要一个带有两个参数的函数:它应该从第一列和该行中选择第一个参数,它应该用第二个参数替换第二列条目。
例如:f "bla" "etewtw"
将最后一个条目的密码更改为etewtw
.
我尝试使用 awk,它也有一定效果:
awk -F ";" -v acc="bla" -v newpw="etewtw" \
'$1 ~ acc { $2=newpw; print $1";"$2 } END {print;} ' file.csv
Run Code Online (Sandbox Code Playgroud)
基本上,newpw
如果第一列与acc
参数匹配,我尝试将第二列设置为参数。更改流后,我想打印完整的流,这不起作用。以上显然不是正确的解决方案,但我不知道如何解决。
输出是:
bla;etewtw
posteo;tewtasdwqrr
Run Code Online (Sandbox Code Playgroud)
所以还挺成功的,条目被改了(至少在流中,但实际上改文件并不困难)。
但是,会出现两个问题:
输出中缺少条目。即mastodon;password2
和test;test
。我希望那些 a) 保持在同一条线上,b) 保持不变。
如果我想改变最后一行,总是错误的。例如,如果我awk -F ";" -v acc="posteo" -v newpw="test" '$1 ~ acc { $2=newpw; print $1";"$2 } END {print;} '
改为使用,结果是:
posteo;test
posteo test …
Run Code Online (Sandbox Code Playgroud) 我有带有静态 ip 地址预设的 ip 摄像头。我怎么知道它的ip使用linux?
我将相机直接连接到我的笔记本电脑。
我的系统是
Linux machine 3.5.7-gentoo #2 SMP
ifconfig eth0
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet6 fe80::21e:ecff:fe18:854f prefixlen 64 scopeid 0x20<link>
ether 00:1e:ec:18:85:4f txqueuelen 1000 (Ethernet)
RX packets 35839 bytes 2150340 (2.0 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 1084 bytes 145354 (141.9 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
Run Code Online (Sandbox Code Playgroud)