在 Ubuntu 20.04 上,我的 gedit 3.36.2 版本带有一个用于查找和替换的正则表达式复选框,无需安装任何插件即可开箱即用。使用哪种正则表达式风格?
qwr's questions
在使用 apt 卸载程序并将其重新安装到另一个位置(例如,使用 snap 的 pypy)后,从命令行报告运行程序bash: /usr/bin/pypy: No such file or directory
,但which pypy
正确地给出了/snap/bin/pypy
. 如何让 shell 识别新的安装位置?
我正在使用 mkusb 创建启动盘(USB 驱动器)。mkusb 给了我一个使用 grub4win.img.xz 的选项:
dus-live 12.2.8 cannot install 'grub-pc' in installed systems in UEFI mode.
'grub-pc' is used to make persistent live drives bootable in BIOS mode.
Instead you can use 'grub4win.img.xz', an image with the grub content.
Minimum 8 GB: You need a drive (USB pendrive or memory card) with
at least 8 GB because the image is expanded to 7.744 GB (to allow for
undersized 8 GB drives).
Do you want to use 'grub4win.img.xz'? (y/N)
完成后:
Cannot install grub for BIOS mode from an installed system in UEFI mode.
The created system should work in UEFI mode,
if the ISO file is made for UEFI mode (Windows 8-10 64-bit).
If you use 'grub4win.img.xz', it should work in BIOS mode too.
我的系统已经在 UEFI 中禁用了安全启动。那我需要这个吗?
对于简单的任务,我使用 GNOME 文件 (Nautilus) 来复制文件而不是 rsync。我尝试挖掘我不熟悉的源nautilus-file-operations.ccp
,并且我假设它使用自己的自定义实现(不是)进行错误处理和report_copy_progress
?我不知道实际的系统调用发生在哪里。
使用configure
, 以以下消息结尾:
./configure: line 38: sort: No such file or directory
./configure: line 35: sed: No such file or directory
我有一个 WD Passport 1TB 外置硬盘驱动器,ddrescue 在驱动器完全停止读取之前设法保存了 95%。
恢复的数据存储为recovery.img
.
$ mmls recovery.img
DOS Partition Table
Offset Sector: 0
Units are in 512-byte sectors
Slot Start End Length Description
000: Meta 0000000000 0000000000 0000000001 Primary Table (#0)
001: ------- 0000000000 0000002047 0000002048 Unallocated
002: 000:000 0000002048 1953458175 1953456128 NTFS / exFAT (0x07)
但是我无法将图像挂载为 NTFS:
$ sudo mount -t ntfs recovery.img /mnt
NTFS signature is missing.
Failed to mount '/dev/loop11': Invalid argument
The device '/dev/loop11' doesn't seem to have a valid NTFS.
Maybe the wrong device is used? Or the whole disk instead of a
partition (e.g. /dev/sda, not /dev/sda1)? Or the other way around?
$ sudo ntfsfix recovery.img
Mounting volume... NTFS signature is missing.
FAILED
Attempting to correct errors... NTFS signature is missing.
FAILED
Failed to startup volume: Invalid argument
NTFS signature is missing.
Trying the alternate boot sector
Unrecoverable error
Volume is corrupt. You should run chkdsk.
chkdsk recovery.img
在我的 Windows 机器上说文件名无效。
我还尝试使用Ubuntu DataRecovery 文档中描述的偏移量(2048 * 512):
$ sudo mount -t ntfs -o loop,force,offset=1048576 recovery.img /mnt
Failed to read last sector (1953456126): Invalid argument
HINTS: Either the volume is a RAID/LDM but it wasn't setup yet,
or it was not setup correctly (e.g. by not using mdadm --build ...),
or a wrong device is tried to be mounted,
or the partition table is corrupt (partition is smaller than NTFS),
or the NTFS boot sector is corrupt (NTFS size is not valid).
Failed to mount '/dev/loop11': Invalid argument
The device '/dev/loop11' doesn't seem to have a valid NTFS.
Maybe the wrong device is used? Or the whole disk instead of a
partition (e.g. /dev/sda, not /dev/sda1)? Or the other way around?
testdisk[ List ]
文件确实有效,所以我会尝试从那里复制。但如果可能的话,我想安装。
关于我现在应该尝试什么的任何想法?
编辑:kpartx 的结果,使用此处列出的说明:
$ sudo kpartx -l recovery.img
loop11p1 : 0 1953456128 /dev/loop11 2048
$ sudo kpartx -a recovery.img
device-mapper: resume ioctl on loop11p1 failed: Invalid argument
create/reload failed on loop11p1
如果视频标题为“5/12”,则使用%(title)s
会生成“5_12”。有没有办法在文件名中保留特殊字符?我会接受像“5%2F12”这样的东西。
或者,如果有一种快速方法可以只从播放列表中下载视频名称-e
(或者-j
似乎一次只下载一个视频),我也会接受。
--get-title
一次为播放列表制作一个视频。事实上,在使用--download-archive
的时候,所有的名字都被打印出来了,尽管有额外的文字。
Cheese 识别出我的网络摄像头。输出v4l2-ctl --list-devices
:
HD WebCam (usb-0000:00:14.0-7):
/dev/video0
但是,ARToolKit5 无法识别相机并输出 SMPTE 彩条。不确定这是 GStreamer 还是 ARToolKit 的东西。输出:
$ sudo ./simpleTest
Using video configuration ''.
Using default video config.
libARvideo: GStreamer 0.10.36
libARvideo: GStreamer pipeline is READY!
libARvideo: GStreamer negotiated [email protected]
libARvideo: allocating 230400 bytes
libARvideo: GStreamer pipeline is PAUSED.
Image size (x,y) = (320,240)
*** Camera Parameter ***
--------------------------------------
SIZE = 320, 240
Distortion factor: k1=0.1147807688, k2=-0.5208189487, p1=-0.0002069871, p2=-0.0040593124
fx=337.085815, fy=316.949043, x0=159.148895, y0=118.950233, s=0.993923
339.14696 0.00000 159.14890 0.00000
0.00000 318.88706 118.95023 0.00000
0.00000 0.00000 1.00000 0.00000
--------------------------------------
我已经尝试在 env 变量中使用这些字符串ARTOOLKIT5_VCONF
: -device=LinuxV4L
, -device=GStreamer
, -device=Linux1394Cam
. 关于如何让相机被识别的任何帮助?
运行fsck.fat /dev/block/mmcblk0p1
,我的故障 SD 卡的设备,我得到这个:
fsck.fat 3.0.28 (2015-05-16)
Read 512 bytes at 0:Input/output error
这是否意味着文件永久不可读?
运行fsck
返回以下内容:
e2fsck: Attempt to read block from filesystem resulted in short read while trying to open /dev/mmcblk0p1
Could this be a zero-length partition?
ddrescue
无法保存任何东西。输出df
:
Filesystem 1K-blocks Used Available Use% Mounted on
udev 4002028 0 4002028 0% /dev
tmpfs 805008 9496 795512 2% /run
/dev/sda5 176456296 55779936 111689840 34% /
tmpfs 4025024 598760 3426264 15% /dev/shm
tmpfs 5120 4 5116 1% /run/lock
tmpfs 4025024 0 4025024 0% /sys/fs/cgroup
/dev/sda1 98304 51376 46928 53% /boot/efi
tmpfs 805008 92 804916 1% /run/user/1000
/dev/mmcblk0p1 15343104 13967392 1375712 92% /media/qwr/9016-4EF8
更新:情况变得奇怪了。在我的 Windows 机器上,似乎整个 SD 卡都是可读的。但是,复制文件非常慢,偶尔会恢复到正常传输速度。我设法复制了我主要追求的文件(我上次备份后拍摄的照片),但在某个时间点之后,无论我等待多长时间,Windows Explorer 都不会继续复制。
我回到 Ubuntu,令我惊讶的是,fsck.fat
实际上运行成功了。运行它几次会给出以下组合:Has a large number of bad entries. (128/133)
, Free cluster summary wrong (42991 vs. really 43267)
, Orphaned long file name part
, Contains a free cluster (144584). Assuming EOF.
,Start does point to root directory. Deleting dir.
ddrescue
现在运行良好,所以我暂时让它继续运行。
奇怪的是,它看起来像是休眠和非休眠,或者暂停和恢复,等待可能会让 Ubuntuddrescue
拯救相当多的东西。