我有一堆(~31GB)以 320kbps/cbr 编码的 mp3 文件,我想将它们全部转换为 mp3 320kbps/vbr,但保留它的标签和文件夹结构,但在另一个主路径中。
我想使用 avconv,但欢迎任何其他想法。
我有一堆(~31GB)以 320kbps/cbr 编码的 mp3 文件,我想将它们全部转换为 mp3 320kbps/vbr,但保留它的标签和文件夹结构,但在另一个主路径中。
我想使用 avconv,但欢迎任何其他想法。
在我的旧主板出现问题后,我将我的 Ubuntu 切换到我的游戏电脑。我的主要问题是:是否有任何理由让我的 AMD HD 7850 在此计算机上运行?
我的主板有 VGA/HDMI 连接器。
任何应用程序、操作系统、Ubuntu 或系统是否会使用 GPU 来处理任何数据?
我有两个大文本文件,checksums_1.txt 和 checksums_2.txt,我想解析这些文件并删除它们之间的重复并将唯一行合并到一个文件中。
每个文件的每一行都有以下结构。
大小、md5、路径
示例:Checksums_1.txt
9565, a4fs614as6fas4fa4s46fsaf1, /mnt/app/1tier/2tier/filename.exe
9565, a4fs614as6fas4fa4s46fsaf1, /mnt/app/1tier/2tier/filename2.exe
示例:Checksums_2.txt
9565, a4fs614as6fas4fa4s46fsaf1, /mnt/temp/1tier/2tier/filename.exe
9565, a4fs614as6fas4fa4s46fsaf1, /mnt/temp/1tier/2tier/filename2.exe
9565, a4fs614as6fas4fa4s46fsaf1, /mnt/temp/1tier/2tier/newfile.exe
checksums_1.txt和checksums_2.txt之间必须要校验的部分在挂载点/mnt/app/和/mnt/temp/之后,换句话说,从每一行的开始到挂载点的结尾/mnt/temp/ 或 /mnt/app/ 将被忽略。
checksums_1.txt 中的数据更为重要,因此如果发现 aa duplicated,则必须将 checksums_1.txt 中的行移动到合并文件中。
Checksums_1.txt 的一部分
1058,b8203a236b4f15316e516165a6546666,/mnt/app/Certificados/ca.crt
2694,8a815adefde4fa0c263e74832b15de64,/mnt/app/Certificados/ca.db.certs/01.pem
136,77bf2e5313dbaac4df76a4b72df2e2ad,/mnt/app/Certificados/ca.db.index
Checksums_2.txt 的一部分
1058,b8203a236b4f1531616318284202c9e6,/mnt/temp/Certificados/ca.crt
3,72b2ac90f7f3ff075a937d6be8fc3dc3,/mnt/temp/Certificados/ca.db.serial
2694,8a815adefde4fa0c263e74832b15de64,/mnt/temp/Certificados/ca.db.certs/01.pem
136,77bf2e5313dbaac4df76a4b72df2e2ad,/mnt/temp/Certificados/ca.db.index
合并文件示例
1058,b8203a236b4f15316e516165a6546666,/mnt/app/Certificados/ca.crt
3,72b2ac90f7f3ff075a937d6be8fc3dc3,/mnt/temp/Certificados/ca.db.serial
2694,8a815adefde4fa0c263e74832b15de64,/mnt/app/Certificados/ca.db.certs/01.pem
136,77bf2e5313dbaac4df76a4b72df2e2ad,/mnt/app/Certificados/ca.db.index
在使用 nohup 放置命令在后台运行时,一些内容出现在终端中。
cp: error reading ‘/mnt/tt/file.txt’: Input/output error
cp: failed to extend ‘/mnt/tt/file.txt’: Input/output error
我想将该内容保存到文件中。
如在 SMART 日志中:
设备日志仅包含最近的五个错误
是否有可能查看启用 SMART 的磁盘的所有记录错误?
smartctl -xall
或者
smartctl -all
上面的两个命令只显示了最后五个,我需要检索有问题的 LBA 以向其写入零并再次检查 SMART。
我有一个用于存储数据的 NTFS 磁盘,在 IDE/SATA 适配器出现问题(正在关闭我的磁盘)后,SMART 显示错误。
我想知道我还需要做什么来检查和修复此磁盘上的任何错误。
我已经使用 fsck 来检查磁盘,但对我来说并不冗长。
andre@PITCAIRN:~$ sudo fsck /dev/sdb1
fsck from util-linux 2.20.1
Mounting volume... OK
Processing of $MFT and $MFTMirr completed successfully.
Checking the alternate boot sector... OK
NTFS volume version is 3.1.
NTFS partition /dev/sdb1 was processed successfully.
聪明的
SMART Attributes Data Structure revision number: 10
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE
1 Raw_Read_Error_Rate 0x000f 115 099 006 Pre-fail Always - 95292924
3 Spin_Up_Time 0x0003 100 100 000 Pre-fail Always - 0
4 Start_Stop_Count 0x0032 097 097 020 Old_age Always - 3419
5 Reallocated_Sector_Ct 0x0033 100 100 036 Pre-fail Always - 0
7 Seek_Error_Rate 0x000f 067 060 030 Pre-fail Always - 5425551
9 Power_On_Hours 0x0032 093 093 000 Old_age Always - 6345
10 Spin_Retry_Count 0x0013 100 100 097 Pre-fail Always - 0
12 Power_Cycle_Count 0x0032 099 099 020 Old_age Always - 1501
183 Runtime_Bad_Block 0x0032 100 100 000 Old_age Always - 0
184 End-to-End_Error 0x0032 100 100 099 Old_age Always - 0
187 Reported_Uncorrect 0x0032 046 046 000 Old_age Always - 54
188 Command_Timeout 0x0032 100 100 000 Old_age Always - 0
189 High_Fly_Writes 0x003a 100 100 000 Old_age Always - 0
190 Airflow_Temperature_Cel 0x0022 062 048 045 Old_age Always - 38 (Min/Max 31/39)
194 Temperature_Celsius 0x0022 038 052 000 Old_age Always - 38 (0 19 0 0 0)
195 Hardware_ECC_Recovered 0x001a 041 022 000 Old_age Always - 95292924
197 Current_Pending_Sector 0x0012 100 100 000 Old_age Always - 20
198 Offline_Uncorrectable 0x0010 100 100 000 Old_age Offline - 20
199 UDMA_CRC_Error_Count 0x003e 200 200 000 Old_age Always - 0
240 Head_Flying_Hours 0x0000 100 253 000 Old_age Offline - 96499325213315
241 Total_LBAs_Written 0x0000 100 253 000 Old_age Offline - 2999278438
242 Total_LBAs_Read 0x0000 100 253 000 Old_age Offline - 866573403
SMART 的错误
SMART Error Log Version: 1
ATA Error Count: 54 (device log contains only the most recent five errors)
CR = Command Register [HEX]
FR = Features Register [HEX]
SC = Sector Count Register [HEX]
SN = Sector Number Register [HEX]
CL = Cylinder Low Register [HEX]
CH = Cylinder High Register [HEX]
DH = Device/Head Register [HEX]
DC = Device Command Register [HEX]
ER = Error register [HEX]
ST = Status register [HEX]
Powered_Up_Time is measured from power on, and printed as
DDd+hh:mm:SS.sss where DD=days, hh=hours, mm=minutes,
SS=sec, and sss=millisec. It "wraps" after 49.710 days.
Error 54 occurred at disk power-on lifetime: 6088 hours (253 days + 16 hours)
When the command that caused the error occurred, the device was active or idle.
After command completion occurred, registers were:
ER ST SC SN CL CH DH
-- -- -- -- -- -- --
40 51 00 ff ff ff 0f Error: UNC at LBA = 0x0fffffff = 268435455
Commands leading to the command that caused the error were:
CR FR SC SN CL CH DH DC Powered_Up_Time Command/Feature_Name
-- -- -- -- -- -- -- -- ---------------- --------------------
60 00 08 ff ff ff 4f 00 10:17:38.985 READ FPDMA QUEUED
60 00 08 ff ff ff 4f 00 10:17:38.983 READ FPDMA QUEUED
60 00 08 ff ff ff 4f 00 10:17:38.971 READ FPDMA QUEUED
60 00 08 ff ff ff 4f 00 10:17:38.970 READ FPDMA QUEUED
60 00 08 ff ff ff 4f 00 10:17:38.970 READ FPDMA QUEUED
Error 53 occurred at disk power-on lifetime: 6088 hours (253 days + 16 hours)
When the command that caused the error occurred, the device was active or idle.
After command completion occurred, registers were:
ER ST SC SN CL CH DH
-- -- -- -- -- -- --
40 51 00 ff ff ff 0f Error: UNC at LBA = 0x0fffffff = 268435455
Commands leading to the command that caused the error were:
CR FR SC SN CL CH DH DC Powered_Up_Time Command/Feature_Name
-- -- -- -- -- -- -- -- ---------------- --------------------
60 00 08 ff ff ff 4f 00 10:17:35.999 READ FPDMA QUEUED
60 00 08 ff ff ff 4f 00 10:17:35.999 READ FPDMA QUEUED
60 00 08 ff ff ff 4f 00 10:17:35.998 READ FPDMA QUEUED
60 00 08 ff ff ff 4f 00 10:17:35.998 READ FPDMA QUEUED
60 00 08 ff ff ff 4f 00 10:17:35.998 READ FPDMA QUEUED
Error 52 occurred at disk power-on lifetime: 6088 hours (253 days + 16 hours)
When the command that caused the error occurred, the device was active or idle.
After command completion occurred, registers were:
ER ST SC SN CL CH DH
-- -- -- -- -- -- --
40 51 00 ff ff ff 0f Error: UNC at LBA = 0x0fffffff = 268435455
Commands leading to the command that caused the error were:
CR FR SC SN CL CH DH DC Powered_Up_Time Command/Feature_Name
-- -- -- -- -- -- -- -- ---------------- --------------------
60 00 08 ff ff ff 4f 00 10:17:29.920 READ FPDMA QUEUED
27 00 00 00 00 00 e0 00 10:17:29.918 READ NATIVE MAX ADDRESS EXT [OBS-ACS-3]
ec 00 00 00 00 00 a0 00 10:17:29.909 IDENTIFY DEVICE
ef 03 45 00 00 00 a0 00 10:17:29.909 SET FEATURES [Set transfer mode]
27 00 00 00 00 00 e0 00 10:17:29.909 READ NATIVE MAX ADDRESS EXT [OBS-ACS-3]
Error 51 occurred at disk power-on lifetime: 6088 hours (253 days + 16 hours)
When the command that caused the error occurred, the device was active or idle.
After command completion occurred, registers were:
ER ST SC SN CL CH DH
-- -- -- -- -- -- --
40 51 00 ff ff ff 0f Error: UNC at LBA = 0x0fffffff = 268435455
Commands leading to the command that caused the error were:
CR FR SC SN CL CH DH DC Powered_Up_Time Command/Feature_Name
-- -- -- -- -- -- -- -- ---------------- --------------------
60 00 08 ff ff ff 4f 00 10:17:27.106 READ FPDMA QUEUED
27 00 00 00 00 00 e0 00 10:17:27.104 READ NATIVE MAX ADDRESS EXT [OBS-ACS-3]
ec 00 00 00 00 00 a0 00 10:17:27.095 IDENTIFY DEVICE
ef 03 45 00 00 00 a0 00 10:17:27.095 SET FEATURES [Set transfer mode]
27 00 00 00 00 00 e0 00 10:17:27.095 READ NATIVE MAX ADDRESS EXT [OBS-ACS-3]
Error 50 occurred at disk power-on lifetime: 6088 hours (253 days + 16 hours)
When the command that caused the error occurred, the device was active or idle.
After command completion occurred, registers were:
ER ST SC SN CL CH DH
-- -- -- -- -- -- --
40 51 00 ff ff ff 0f Error: UNC at LBA = 0x0fffffff = 268435455
Commands leading to the command that caused the error were:
CR FR SC SN CL CH DH DC Powered_Up_Time Command/Feature_Name
-- -- -- -- -- -- -- -- ---------------- --------------------
60 00 08 ff ff ff 4f 00 10:17:24.293 READ FPDMA QUEUED
60 00 08 ff ff ff 4f 00 10:17:24.279 READ FPDMA QUEUED
60 00 08 ff ff ff 4f 00 10:17:24.279 READ FPDMA QUEUED
60 00 08 ff ff ff 4f 00 10:17:24.279 READ FPDMA QUEUED
60 00 08 ff ff ff 4f 00 10:17:24.279 READ FPDMA QUEUED
我正在这个未安装的磁盘上运行扩展自检。
运行脚本时如何声明变量内容?
我知道在运行脚本时可以使用 $1 $2 $3 来设置变量./script.sh this is sparta
,但我没有找到显式设置的方法。
喜欢
./script.sh URL=www.google.com COMMAND=wget
这个有可能?
当我用 Ubuntu 配置任何机器时,我都会设置 lm-sensors 来工作。我已经安装了 Ubuntu 14.04,并且按照官方页面上的说明设置了传感器(我每次都是这样做的)。
好吧,在我通过 12.04 安装 14.04 之前,我会得到所有这些数据:
/etc/mrtg/cfg/mrtg-scripts$ sensors
adt7490-i2c-0-2e
Adapter: SMBus I801 adapter at f000
in0: +1.12 V (min = +0.00 V, max = +3.31 V)
Vcore: +1.09 V (min = +0.00 V, max = +2.99 V)
+3.3V: +3.25 V (min = +2.96 V, max = +3.61 V)
+5V: +5.03 V (min = +4.48 V, max = +5.50 V)
+12V: +11.90 V (min = +0.00 V, max = +15.69 V)
in5: +2.10 V (min = +0.00 V, max = +4.48 V)
fan1: 1312 RPM (min = 0 RPM)
fan2: 0 RPM (min = 0 RPM)
fan3: 0 RPM (min = 0 RPM)
fan4: 0 RPM (min = 0 RPM)
temp1: +38.5°C (low = +5.0°C, high = +65.0°C)
(crit = +70.0°C, hyst = +66.0°C)
M/B Temp: +39.8°C (low = +5.0°C, high = +65.0°C)
(crit = +70.0°C, hyst = +66.0°C)
temp3: +42.2°C (low = +5.0°C, high = +65.0°C)
(crit = +70.0°C, hyst = +66.0°C)
coretemp-isa-0000
Adapter: ISA adapter
Core 0: +59.0°C (high = +74.0°C, crit = +100.0°C)
Core 1: +55.0°C (high = +74.0°C, crit = +100.0°C)
Core 2: +55.0°C (high = +74.0°C, crit = +100.0°C)
Core 3: +57.0°C (high = +74.0°C, crit = +100.0°C)
radeon-pci-0100
Adapter: PCI adapter
temp1: +60.5°C
现在它不显示 adt7490-i2c-0-2e 芯片。
在重新安装 Ubuntu 之前,我更新了 BIOS 以解决我的 DP45SG Intel 主板上的金士顿 1666Mhz 内存模块的问题。
我在BIOS的Hardware Monitoring Health Information里检查过,所有的温度,风扇转速和电压都显示正常。
BIOS 版本:SGP4510H.76A.0125.2010.0121.1927
我在我的 ubuntu 所在的磁盘上删除了错误的分区,我在那里有重要文件,有什么办法可以恢复它们吗?
我正在使用 MRTG 通过此脚本从 ubuntu 服务器 12.04 的传感器中获取数据。
#!/bin/bash
SENSORS=/usr/bin/sensors
UPTIME=$(uptime | awk -F, '{print $3}' )
TEXT="Graphic Card Temperature"
GPCTEMP1=$( ${SENSORS} | grep "temp1" | awk '{print int($3)}' )
# http://people.ee.ethz.ch/~oetiker/webtools/mrtg/reference.html
# "The external command must return 4 lines of output:
# Line 1
# current state of the first variable, normally 'incoming bytes count'
# Line 2
# current state of the second variable, normally 'outgoing bytes count'
# Line 3
# string (in any human readable format), telling the uptime of the target.
# Line 4
# string, telling the name of the target. "
echo ${GPCTEMP1}
echo ${GPCTEMP1}
echo ${UPTIME}
echo ${TEXT}
不幸的是,当我运行传感器时有两个“temp1”有两个名为“temp1”的传感器
/etc/mrtg/cfg/mrtg-scripts$ sensors
adt7490-i2c-0-2e
Adapter: SMBus I801 adapter at f000
in0: +1.12 V (min = +0.00 V, max = +3.31 V)
Vcore: +1.09 V (min = +0.00 V, max = +2.99 V)
+3.3V: +3.25 V (min = +2.96 V, max = +3.61 V)
+5V: +5.03 V (min = +4.48 V, max = +5.50 V)
+12V: +11.90 V (min = +0.00 V, max = +15.69 V)
in5: +2.10 V (min = +0.00 V, max = +4.48 V)
fan1: 1312 RPM (min = 0 RPM)
fan2: 0 RPM (min = 0 RPM)
fan3: 0 RPM (min = 0 RPM)
fan4: 0 RPM (min = 0 RPM)
temp1: +38.5°C (low = +5.0°C, high = +65.0°C)
(crit = +70.0°C, hyst = +66.0°C)
M/B Temp: +39.8°C (low = +5.0°C, high = +65.0°C)
(crit = +70.0°C, hyst = +66.0°C)
temp3: +42.2°C (low = +5.0°C, high = +65.0°C)
(crit = +70.0°C, hyst = +66.0°C)
coretemp-isa-0000
Adapter: ISA adapter
Core 0: +59.0°C (high = +74.0°C, crit = +100.0°C)
Core 1: +55.0°C (high = +74.0°C, crit = +100.0°C)
Core 2: +55.0°C (high = +74.0°C, crit = +100.0°C)
Core 3: +57.0°C (high = +74.0°C, crit = +100.0°C)
radeon-pci-0100
Adapter: PCI adapter
temp1: +60.5°C
我想获取 radeon-pci-0100 的信息,但我该怎么做呢?
这是我使用sensors
grep时的结果
/etc/mrtg/cfg/mrtg-scripts$ sensors | grep "temp1"
temp1: +38.8°C (low = +5.0°C, high = +65.0°C)
temp1: +60.5°C
下面是我为备份我的路由器和 adsl 调制解调器而编写的脚本,有什么想法可以将这个脚本压缩成更少的行吗?
如您所见,每个路由器都有不同的结构。
#!/bin/sh
http_txt="10.0.0.59"
cgi="10.0.0.60"
http="10.0.0.66"
date="$(date +%d-%m-%y)"
dest="/home/yamash/"
archive_file="$dest$date.tgz"
local="$dest$date"
login="admin"
pass="PASSWORD"
mkdir $local
cd "$local"
echo "Iniciando Backup"
for http_txt_for in $http_txt; do
echo "$http_txt_for"
wget --auth-no-challenge --user=$login --password=$pass $http_txt_for/config.dat -O $http_txt_for.dat
done
for cgi_for in $cgi; do
echo "$cgi_for"
wget --user=$login --password=$pass $cgi_for/cgi-bin/export_settings.cgi -O $cgi_for.dat
done
for http_for in $http; do
echo "$http_for"
wget --user=$login --password=$pass $http_for/rom-0 -O $http_for
done
cd ..
tar czf $archive_file $local
#rm -R $archive_file $local
echo "Backup Finalizado"
我的工作需要克隆一些瘦客户端,它们使用 Ubuntu 作为 VMware 客户端的基础,但问题是我们必须使用硬件的 MAC 手动编辑 /etc/vmware/view-mandatory-config 中的行。
view.sslVerificationMode = "3"
view.defaultUser = "CM-d4_85_64_71_58_44"
view.autoConnectDesktop = "TRUE"
view.autoConnectBroker = "TRUE"
view.kioskLogin = "TRUE"
view.nonInteractive = "TRUE"
view.fullScreen = "TRUE"
view.nomenubar = "TRUE"
view.defaultBroker = "viewcs"
我们需要创建一个在启动时自动运行的脚本(1 次并自行删除)并eth0
像上面的配置文件一样获取和传递它的 MAC。
view.defaultUser = "CM-d4_85_64_71_58_44"
我们需要这个,这样我们就可以节省很多时间。
---编辑--- 根据回答,我做了以下脚本,仍然不完整但正在工作。
MAC=$(ifconfig eth0 | grep -o -E '([[:xdigit:]]{1,2}:){5}[[:xdigit:]]{1,2}')
echo "
view.sslVerificationMode = *3*
view.autoConnectDesktop = *TRUE*
view.autoConnectBroker = *TRUE*
view.kioskLogin = *TRUE*
view.nonInteractive = *TRUE*
view.fullScreen = *TRUE*
view.nomenubar = *TRUE*
view.defaultBroker = *viewcs*
view.defaultUser = *CM-${MAC//:/_}*
" > /etc/vmware/view-mandatory-config;
sed -i 's/*/"/g' /etc/vmware/view-mandatory-config
不完整是因为,我不知道如何在文件中打印 ("),所以我使用了 *,在我使用 "sed" 将 * 更改为 (") 之后,它的工作就像一个魅力。
我不知道为什么,但我无法让这个脚本在启动时运行。
首先,我将它设置到 /etc/rc.local 中,但它没有运行。其次,我尝试将其作为@reboot /etc/vmware/MAC.sh 放入 crontab 中,但没有成功。
谢谢你的帮助。