应该很容易....zpool status -l rpool 或zpool status -v
或者我想。
我的问题是我们在 HP DL380 G5 上运行 Solaris 10,我怀疑非本机硬件令人困惑。我们有 2 个 zpool,其中一个由多个磁盘组成。但是,当我运行zpool status -l rpool它时只列出一个磁盘。我们有理由相信磁盘发生故障或已经发生故障并希望将其从 zpool 中删除但无法列出物理磁盘......
我能做什么?
马丁
我设法编写了以下脚本:
#!/bin/bash
#files list
file1=/tmp/1wall_long.txt
file2=/tmp/1wall_test1.txt
file3=/tmp/1wall_test2.txt
file4=/tmp/1wall_test3.txt
file5=/tmp/3mt_long.txt
file6=/tmp/3mt_OpenSpace_test1.txt
file7=/tmp/3mt_OpenSpace_test2.txt
file8=/tmp/3mt_OpenSpace_test3.txt
file9=/tmp/3rooms_test1.txt
file10=/tmp/3rooms_test2.txt
file11=/tmp/3rooms_test3.txt
file12=/tmp/20mt_OpenSpace_test1.txt
file13=/tmp/20mt_OpenSpace_test2.txt
file14=/tmp/20mt_OpenSpace_test3.txt
#script for 1wall_long file
if [ ! -e "$file1" ]; then #check if the file exist
echo "File 1wall_long.txt does not exist" #if not exist print echo output
else
sed -i -e 's/- /-/g' $file1 #remove space on the first 10 values
awk '{print $7}' $file1 > /tmp/1wall_long_S.txt #print the column number 7 and copy the output in a file
rm $file1 …Run Code Online (Sandbox Code Playgroud) 使用 openSUSE 下的 OpenSSL 模块,我可以使用此命令列表发送电子邮件
openssl s_client -starttls smtp -connect smtp.gmail.com:587 -crlf
helo
auth login
(Put base64 encoded username)
(Put base64 encoded password)
mail from:<email>
rcpt to:<email>
Data
From: email
To: email1, email2, .....
Subject:
(Message body goes here)
.
Run Code Online (Sandbox Code Playgroud)
是否有可能一次性执行这样的命令列表?例如脚本?
注意:有一个包含 OpenSSL 模块的嵌入式 Linux 系统,同样的事情将适用于它。
我几乎为这个问题浪费了 1 天的时间。
我有 2 台电脑;1. Windows 作为客户端,10.20.30.20 2. Debian(最新)作为服务器,10.20.30.10
我安装 Dante(SOCKS 代理)并配置/重新启动它。我可以从“1”使用这个 SOCKS 代理(10.20.30.10/1080TCP)。(火狐浏览器,无授权)
所以我将此代理添加到 uTorrent 的连接设置中。代理服务器:类型 = SOCKS5,代理 = 10.20.30.10,端口 = 1080,无身份验证
uTorrent 开始使用我的 SOCKS 代理,但无法连接到 DHT/UDP。uTorrent 建立这些连接(示例);
*65432 = uTorrent's Listening Port
TCP 10.20.30.20:(random)->10.20.30.10:1080 {Yeah, this is what I'm expected!}
UDP 10.20.30.20:65432->10.20.30.10:(random) {Huh?}
Run Code Online (Sandbox Code Playgroud)
由于 uTorrent 生成 UDP 数据包,而 Dante 未打开 UDP 端口,因此 UDP 数据包被服务器忽略(丢弃)。Dante 仅打开 1 个端口(TCP 1080),我不明白为什么 uTorrent 在中继 UDP 时不使用 TCP 协议。
我的问题是: 1. 当询问时,如何强制 Dante 动态打开 UDP 端口?2. 如果“SOCKS5 支持UDP”为真,为什么uTorrent 无法将UDP 发送到TCP 端口?
但丁设置 …
使用以下命令运行 arch linux:
Linux hunchback 3.17.4-1-ARCH #1 SMP PREEMPT Fri Nov 21 21:14:42 CET 2014 x86_64 GNU/Linux
Run Code Online (Sandbox Code Playgroud)
当我运行时:
$ aplay -l
aplay: device_list:268: no soundcards found...
Run Code Online (Sandbox Code Playgroud)
但它被内核检测到:
$ cat /proc/asound/cards
0 [Intel ]: HDA-Intel - HDA Intel
HDA Intel at 0xfebf4000 irq 26
$ cat /proc/asound/card0/codec#0
Codec: Realtek ALC887-VD
Address: 0
AFG Function Id: 0x1 (unsol 1)
Vendor Id: 0x10ec0887
Subsystem Id: 0x10438445
Revision Id: 0x100302
No Modem Function Group found
Default PCM:
rates [0x5f0]: 32000 44100 48000 88200 96000 …Run Code Online (Sandbox Code Playgroud) 我想打印千位分隔符awk's printf。
在 中bash,它非常简单:
> printf "a %'d b \n" 1234567
a 1,234,567 b
> LC_NUMERIC=fr_FR.utf8
> printf "a %'d b \n" 1234567
a 1 234 567 b
Run Code Online (Sandbox Code Playgroud)
有了一个awk程序,它几乎可以工作:
> cat > print.awk
{ printf "a %'d b\n",$1}
> echo 1234567 | awk -f print.awk
a 1,234,567 b
Run Code Online (Sandbox Code Playgroud)
(Locale 好像丢了……)
并在命令行中:
> echo 1234567 | awk '{printf "%d\n",$1;}'
1234567
> echo 1234567 | awk '{printf "%'d\n",$1;}'
> echo 1234567 | awk '{printf "%\'d\n",$1;}'
Run Code Online (Sandbox Code Playgroud)
笔记 …
如何在 MKV 文件中将 hdmv_pgs_subtitle(基于图像)转换为基于文本的字幕?
我已经尝试过,ffmpeg -i in.mkv -c:v copy -c:a copy -c:s mov_text out.mkv但结果出现以下错误:
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Stream #0:1 -> #0:1 (copy)
Stream #0:2 -> #0:2 (hdmv_pgs_subtitle (pgssub) -> mov_text (native))
Error while opening encoder for output stream #0:2 - maybe incorrect > parameters such as bit_rate, rate, width or height
Run Code Online (Sandbox Code Playgroud) 我想使用 shell 脚本 tar 四个包含大量小文件的目录。由于这个脚本执行时间太长,所以我想使用 shell 脚本使这 4 个 tar 命令并行运行,希望我可以更好地利用可用资源。
我目前使用的命令:
tar cf - /ebs/uat/uatappl | gzip -c > /ebs/backup/uatappl.tar.gz
tar cf - /ebs/uat/uatcomn | gzip -c > /ebs/backup/uatcomn.tar.gz
tar cf - /ebs/uat/uatora | gzip -c > /ebs/backup/uatora.tar.gz
tar cf - /ebs/uat/uatdata | gzip -c > /ebs/backup/uatdata.tar.gz
Run Code Online (Sandbox Code Playgroud) 如果我用“at”来安排一些事情,
$ at noon
warning: commands will be executed using /bin/sh
at> echo "Will I be created?" > /tmp/at_test
at> <EOT>
job 12 at Fri Jun 30 12:00:00 2017
Run Code Online (Sandbox Code Playgroud)
如果我在执行时间之前重新启动机器,我的命令会被执行吗?
cron与从文件中安排任务的常规程序不同,是否at将此“信息”存储在某处?
我在我的 bash 脚本中使用了以下 cli ,以便将公钥发送到远程机器
sshpass -p $pass scp /root/.ssh/authorized_keys root@$remote_host:~/.ssh/authorized_keys
Run Code Online (Sandbox Code Playgroud)
但是由于我们想附加来自其他主机的公钥,所以我正在搜索方法 top append
在 bash 中,我知道该选项是使用“>>”,但是如何在我的方法中使用附加?
或者其他解决方案?
bash ×3
shell-script ×2
solaris ×2
alsa ×1
arch-linux ×1
at ×1
audio ×1
awk ×1
cron ×1
debian ×1
ffmpeg ×1
openssl ×1
reboot ×1
scp ×1
socks ×1
software-rec ×1
ssh ×1
ssh-keygen ×1
tar ×1
video ×1