单元格中的值A2
是xxxx
,我想打印它:
Sub Main
Dim oSheet as Object
Dim oCell as Object
oSheet = ThisComponent.CurrentController.getActiveSheet()
oCell = oSheet.getCellRangeByName("A2")
x = oCell.getValue()
print x
End Sub
为什么的结果x
是0,而不是xxxx
?
单元格中的值A2
是xxxx
,我想打印它:
Sub Main
Dim oSheet as Object
Dim oCell as Object
oSheet = ThisComponent.CurrentController.getActiveSheet()
oCell = oSheet.getCellRangeByName("A2")
x = oCell.getValue()
print x
End Sub
为什么的结果x
是0,而不是xxxx
?
显示无线网络接口:
sudo iwconfig | grep wlp4s0
lo no wireless extensions.
enp3s0 no wireless extensions.
nekoray-tun no wireless extensions.
wlp4s0 IEEE 802.11 ESSID:"Redmi_A6F0"
为什么结果不只是一行?
wlp4s0 IEEE 802.11 ESSID:"Redmi_A6F0"
计算实际尺寸的简单公式:
actual size (in inches) = pixels / resolution
如果宽度为 600 像素,分辨率为 300,则尺寸 = 600/300 = 2 英寸。
列出文件的所有元素sample.webp
。
identify -verbose sample.webp
Image:
Filename: sample.webp
Format: WEBP (WebP Image Format)
Mime type: image/webp
Class: DirectClass
Geometry: 514x402+0+0
Units: Undefined
Colorspace: sRGB
Type: TrueColor
Base type: Undefined
Endianness: Undefined
Depth: 8-bit
Channel depth:
red: 8-bit
green: 8-bit
blue: 8-bit
Channel statistics:
Pixels: 206628
Red:
min: 22 (0.0862745)
max: 255 (1)
mean: 247.292 (0.969773)
standard deviation: 29.3655 (0.115159)
kurtosis: 26.7614
skewness: -5.10833
entropy: 0.327231
Green:
min: 23 (0.0901961)
max: 255 (1)
mean: 249.128 (0.976973)
standard deviation: 26.3003 (0.103138)
kurtosis: 31.2312
skewness: -5.52078
entropy: 0.246981
Blue:
min: 20 (0.0784314)
max: 255 (1)
mean: 249.658 (0.979052)
standard deviation: 24.4937 (0.0960539)
kurtosis: 35.2188
skewness: -5.80532
entropy: 0.248523
Image statistics:
Overall:
min: 20 (0.0784314)
max: 255 (1)
mean: 248.693 (0.975266)
standard deviation: 26.7198 (0.104784)
kurtosis: 30.85
skewness: -5.46476
entropy: 0.274245
Rendering intent: Perceptual
Gamma: 0.454545
Chromaticity:
red primary: (0.64,0.33)
green primary: (0.3,0.6)
blue primary: (0.15,0.06)
white point: (0.3127,0.329)
Background color: white
Border color: srgb(223,223,223)
Matte color: grey74
Transparent color: black
Interlace: None
Intensity: Undefined
Compose: Over
Page geometry: 514x402+0+0
Dispose: Undefined
Iterations: 0
Compression: Undefined
Orientation: Undefined
Properties:
date:create: 2024-04-09T05:54:16+00:00
date:modify: 2024-04-09T05:53:45+00:00
signature: 92c4c0125001357b35a6721035c381606c4b03ea9842d2eb5fe726bbeb701601
Artifacts:
filename: sample.webp
verbose: true
Tainted: False
Filesize: 13716B
Number pixels: 206628
Pixels per second: 35.6846MB
User time: 0.010u
Elapsed time: 0:01.005
Version: ImageMagick 6.9.11-60 Q16 x86_64 2021-01-25 https://imagemagick.org
如何获取sample.webp
分辨率信息?
如果用打印机打印在纸张上,图像的实际尺寸是多少(以英寸为单位)?
插入我的 USB 并检查设备管理器,选择General UDisk USB Device
:
我无法获取 USB 的 vid 和 pid 值。
以管理员权限进入cmd:
wmic path CIM_LogicalDevice where "Description like 'USB%'" get /value
Availability=
Caption=USB Mass Storage Device
ClassCode=
ConfigManagerErrorCode=0
ConfigManagerUserConfig=FALSE
CreationClassName=Win32_USBHub
CurrentAlternateSettings=
CurrentConfigValue=
Description=USB Mass Storage Device
DeviceID=USB\VID_ABCD&PID_1234\5&186144F5&0&4
ErrorCleared=
ErrorDescription=
GangSwitched=
InstallDate=
LastErrorCode=
Name=USB Mass Storage Device
NumberOfConfigs=
NumberOfPorts=
PNPDeviceID=USB\VID_ABCD&PID_1234\5&186144F5&0&4
PowerManagementCapabilities=
PowerManagementSupported=
ProtocolCode=
Status=OK
StatusInfo=
SubclassCode=
SystemCreationClassName=Win32_ComputerSystem
SystemName=DESKTOP-IM4RDOM
USBVersion=
我得到了vid值--ABCD和pid值--1234。为什么在设备管理器中取不到它?在什么情况下在设备管理器中取不到vid和pid值?
我系统运行的 Debian 版本中的 bash 版本是:
bash --version|awk 'NR==1'
GNU bash, version 5.1.4(1)-release (x86_64-pc-linux-gnu)
在Eyal Levin 对另一个 Stack Overflow 线程的回答中,它建议这样做:
Example:
$ echo "title\nvalue1\nvalue2\nvalue3" | (read line; echo "$line"; grep value2)
Output:
title
value2
在我的 Bash 控制台中,我运行以下命令:
debian@debian:~$ echo "title\nvalue1\nvalue2\nvalue3" | (read line; echo "$line"; grep value2)
titlenvalue1nvalue2nvalue3
debian@debian:~$
为什么命令在我的操作系统中输出不同的结果?
echo "title\nvalue1\nvalue2\nvalue3" | (read line; echo "$line"; grep value2)
我想打开 google-chrome,但不能:
debian@debian:~$ which google-chrome
/usr/bin/google-chrome
debian@debian:~$ google-chrome
[6605:6605:0713/170233.016537:ERROR:process_singleton_posix.cc(1004)] Failed to create socket directory.
[6605:6605:0713/170233.016697:ERROR:chrome_browser_main.cc(1278)] Failed to create a ProcessSingleton for your profile directory. This means that running multiple instances would start multiple browser processes rather than opening a new window in the existing process. Aborting now to avoid profile corruption.
我找不到实例在哪里?
debian@debian:~$ ps aux |grep google
debian 6648 0.0 0.0 12684 820 pts/0 S+ 17:02 0:00 grep google
debian@debian:~$ ps aux |grep chrome
debian 6651 0.0 0.0 12684 876 pts/0 S+ 17:02 0:00 grep chrome
我应该释放空间吗?
df /
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda1 191293324 73507036 107999460 41% /
安装 mutt 和邮件:
sudo apt-get install mutt
echo "install gentoo" | mutt -s "gentoo installation handbook" -A gentoo.pdf [email protected]
我在我的雅虎电子邮件中找不到电子邮件。检查电子邮件:
sudo cat /var/mail/debian
This message was created automatically by mail delivery software.
A message that you sent could not be delivered to one or more of its
recipients. This is a permanent error. The following address(es) failed:
[email protected]
Mailing to remote domains not supported
--1624330018-eximdsn-1608038189
Content-type: message/delivery-status
Reporting-MTA: dns; debian
Action: failed
Final-Recipient: rfc822;[email protected]
Status: 5.0.0
--1624330018-eximdsn-1608038189
Content-type: text/rfc822-headers
修复设置。
sudo vim /etc/exim4/update-exim4.conf.conf
dc_eximconfig_configtype="internet" # previously, it is "local"
sudo service exim4 restart
再试一次
echo "install gentoo" | mutt -s "gentoo installation handbook" -A gentoo.pdf [email protected]
我的雅虎邮箱里仍然没有电子邮件。
sudo cat /var/mail/debian
Return-path: <debian@debian>
Received: from debian by debian with local (Exim 4.92)
(envelope-from <debian@debian>)
id 1lvWRG-000IZw-A1
for [email protected]; Tue, 22 Jun 2021 10:46:58 +0800
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="1267179262-1624330018=:71419"
Subject: gentoo installation handbook
To: <[email protected]>
X-Mailer: mail (GNU Mailutils 3.5)
Message-Id: <E1lvWRG-000IZw-A1@debian>
From: debian <debian@debian>
Date: Tue, 22 Jun 2021 10:46:58 +0800
X-Exim-DSN-Information: Due to administrative limits only headers are returned
--1624330018-eximdsn-1608038189--
那怎么修呢?
列出所有与音频相关的 PCI 设备:
lspci |grep -i audio
09:00.1 Audio device: Advanced Micro Devices, Inc. [AMD/ATI] Raven/Raven2/Fenghuang HDMI/DP Audio Controller
09:00.5 Multimedia controller: Advanced Micro Devices, Inc. [AMD] Raven/Raven2/FireFlight/Renoir Audio Processor
09:00.6 Audio device: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 10h-1fh) HD Audio Controller
有两种设备:音频控制器,音频处理器。
直接显示声卡文件:
cat /proc/asound/cards
0 [Generic ]: HDA-Intel - HD-Audio Generic
HD-Audio Generic at 0xfccc8000 irq 59
1 [Generic_1 ]: HDA-Intel - HD-Audio Generic
HD-Audio Generic at 0xfccc0000 irq 60
只有两个设备在 lscpi 中将音频控制器标记为声卡,它推断
我发现 vim 的那部分安装了以下命令:
sudo apt install vim
检查路径包含 vim 的所有目录。
sudo find / -name vim
/etc/alternatives/vim
/etc/vim
/var/lib/dpkg/alternatives/vim
/usr/share/bug/vim
/usr/share/cmake-3.13/editors/vim
/usr/share/lintian/overrides/vim
/usr/share/doc/vim
/usr/bin/vim
没有 , 之类的vim/vim81
目录vim/vim81/autoload
。我在我的操作系统上得到了矛盾的信息:
vim --version
VIM - Vi IMproved 8.1 (2018 May 18, compiled Jun 15 2019 16:41:15)
1.脚本名称
进入vim并输入:scriptnames
ex模式,没有显示!
2.定位
locate vim81 |grep autoload
/usr/share/vim/vim81/autoload
/usr/share/vim/vim81/autoload/README.txt
/usr/share/vim/vim81/autoload/RstFold.vim
/usr/share/vim/vim81/autoload/ada.vim
3.ls
ls /usr/share/vim/vim81/autoload
ls: cannot access '/usr/share/vim/vim81/autoload': No such file or directory
我不喜欢 vim82 而不是 vim81,对它们的任何版本都满意,我很遗憾在我安装后它们都不能工作。
我的安装有什么问题?
sudo updatedb
sudo apt remove vim
sudo apt install vim
locate vim81
Nothing output
locate vim82
Nothing output
还是不能安装。正如@harrymc 所说:
uname -a
Linux mydebian 4.19.0-14-amd64 #1 SMP Debian 4.19.171-2 (2021-01-30) x86_64 GNU/Linux
sudo apt-get update
sudo apt-get install vim vim-gtk3
sudo updatedb
现在检查 vim81 或 vim82:
locate vim81
locate vim82
他们什么都不输出,我进入vim
,scriptnames
什么也不显示。
sudo find / -name 'vim'
/etc/alternatives/vim
/etc/vim
/var/lib/dpkg/alternatives/vim
/home/debian/nginx/contrib/vim
/usr/share/bug/vim
/usr/share/cmake-3.13/editors/vim
/usr/share/lintian/overrides/vim
/usr/share/doc/vim
/usr/bin/vim
在我朋友的debian中没有看到这样的目录/usr/share/vim
,也就是说,安装一个brokervim
并安装,重新安装并不能修复我的包管理系统。
有一个特殊的目录/usr/share/lintian/overrides/vim
。
ls /usr/share/lintian/overrides |grep vim
vim
vim-common
vim-gtk3
vim-gui-common
vim-tiny
显示这些文件中的内容。
debian@mydebian:/usr/share/lintian/overrides$ cat vim
# vim.xxx files are alternatives for (g)vim, which has a manpage in vim(-gui)-common
vim binary: binary-without-manpage usr/bin/vim.basic
debian@mydebian:/usr/share/lintian/overrides$ cat vim-common
# Provided by vim (virtual) packages
vim-common binary: desktop-command-not-in-package usr/share/applications/vim.desktop vim
debian@mydebian:/usr/share/lintian/overrides$ cat vim-gtk3
# vim.xxx files are alternatives for (g)vim, which has a manpage in vim(-gui)-common
vim-gtk3 binary: binary-without-manpage usr/bin/vim.gtk3
debian@mydebian:/usr/share/lintian/overrides$ cat vim-gui-common
# Provided by gvim (virtual) packages
vim-gui-common binary: desktop-command-not-in-package usr/share/applications/gvim.desktop gvim
debian@mydebian:/usr/share/lintian/overrides$ cat vim-tiny
# vim.xxx files are alternatives for (g)vim, which has a manpage in vim(-gui)-common
vim-tiny binary: binary-without-manpage usr/bin/vim.tiny
删除所有文件ls /usr/share/lintian/overrides |grep vim
并重新安装?
公钥文件在我的vps上,私钥文件在我的本地电脑上。
/etc/ssh/sshd_config
在我的 vps 中:
PubkeyAuthentication yes
AuthorizedKeysFile .ssh/authorized_keys
每次我可以使用以下命令登录我的 vps private key
:
ssh root@$vps_ip
今天我为 sftp 安装了一个新用户:
groupadd sftp
useradd -g sftp -d /sftp -s /sbin/nologin ipcamera
mkdir -p /sftp/ipcamera/files
chmod 500 /sftp
chmod 700 /sftp/ipcamera/files
chown root:sftp /sftp/ipcamera
chown ipcamera:sftp /sftp/ipcamera/files
echo "ipcamera:w+w_w+w" | chpasswd
vim /etc/ssh/sshd_config
AllowGroups ssh sftp
Match Group sftp
ChrootDirectory /sftp/%u
ForceCommand internal-sftp
PasswordAuthentication yes
在 vps 中重新启动我的 sshd
systemctl restart sshd
ipcamera
然后我可以使用用户及其密码 登录 sftp w+w_w+w
。
sftp ipcamera@$vps_ip
奇怪的事情发生了,我无法使用 ssh 命令登录 vps!
ssh root@$vps_ip
Permission denied (publickey).
为什么添加新的 sftp 用户后无法使用 ssh 登录 vps?
我在Debian中安装了这样的xournalpp:
sudo apt install doxygen
sudo apt install graphviz
sudo dpkg -i xournalpp-1.0.20-hotfix-hotfix-Debian-buster-x86_64.deb
通过进入 menu: office--Xournal++
,我可以运行它。
现在我想按照GitHub 的描述展示它的代码文档:
Finally, type in doxygen in the root directory of the repository.
The documentation can be found in doc/html and doc/latex.
存储库的根目录是什么?
sudo find / -name 'xournalpp'
/usr/share/xournalpp/
/usr/bin/xournalpp/
我试过ls /usr/share/xournalpp/
:
tree /usr/share/xournalpp/ |grep doc
中没有doc/html
或doc/latex
。 /usr/share/xournalpp/
我如何获得xournalpp
's 的文档?
设置用户地图。
sudo ntfsusermap /dev/sdb2
#assign user as www-data
#assign group as www-data
挂载 ntfs分区/dev/sdb2
。/mnt/winntfs
sudo ntfs-3g -o permissions /dev/sdb2 /mnt/winntfs
现在我可以chmod
使用/mnt/winntfs
.
sudo chmod -R 755 /mnt/winntfs/mydoc
ls -al /mnt/winntfs/mydoc
total 38
drwxr-xr-x 1 www-data www-data 4096 Aug 17 20:03 .
drwxrwxrwx 1 root root 4096 Aug 17 20:03 ..
drwxr-xr-x 1 www-data www-data 4096 Aug 17 20:03 analyse
我想让挂载配置在/etc/fstab
.
sudo blkid | grep sdb2
/dev/sdb2: LABEL="winntfs" UUID="284A29774A2942C4" TYPE="ntfs" PARTLABEL="Basic data partition" PARTUUID="292c184b-766f-4036-8fa0-5bcd936b85c2
sudo vim /etc/fstab
UUID=284A29774A2942C4 /mnt/winntfs ntfs-3g rw ,auto , umask=0022 ,permissions 0 0
重新启动并进入我的操作系统,
ls -al /mnt/winntfs/mydoc
total 38
drwxrwxrwx 1 root root 4096 Aug 17 20:03 .
drwxrwxrwx 1 root root 4096 Aug 17 20:03 ..
drwxrwxrwx 1 root root 4096 Aug 17 20:03 analyse
sudo chmod -R 755 /mnt/winntfs/mydoc
ls -al /mnt/winntfs/mydoc
total 38
drwxrwxrwx 1 root root 4096 Aug 17 20:03 .
drwxrwxrwx 1 root root 4096 Aug 17 20:03 ..
drwxrwxrwx 1 root root 4096 Aug 17 20:03 analyse
事实是设置permissions
和无法使用,如何正确编写才能umask=0022
在重新启动后使用?/etc/fstab
chmod
/etc/fstab
chmod
进入文件系统为 ext4 的 debian:
vim /tmp/sphinx.rst
sphinx tutorial
=====================
installation
---------------
::
sudo apt-get install python3-sphinx
create a new project
--------------------------
::
mkdir mydoc
cd mydoc
sphinx-quickstart
显示sphinx.rst
权限:
ls -al sphinx.rst
-rwxrwxrwx 1 debian debian 261 Aug 17 11:54 sphinx.rst
输入绝对路径时可以执行/tmp/sphinx.rst
。
/tmp/sphinx.rst
/tmp/sphinx.rst: line 1: sphinx: command not found
/tmp/sphinx.rst: line 2: ====================================================================: command not found
/tmp/sphinx.rst: line 3: installation: command not found
/tmp/sphinx.rst: line 4: ---------------: command not found
/tmp/sphinx.rst: line 5: ::: command not found
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
python-babel-localedata python3-alabaster python3-babel python3-imagesize
python3-jinja2 python3-markupsafe sphinx-common
Suggested packages:
python-jinja2-doc python3-sphinx-rtd-theme dvipng sphinx-doc
The following NEW packages will be installed:
python-babel-localedata python3-alabaster python3-babel python3-imagesize
python3-jinja2 python3-markupsafe python3-sphinx sphinx-common
0 upgraded, 8 newly installed, 0 to remove and 46 not upgraded.
Need to get 4,408 kB of archives.
After this operation, 23.5 MB of additional disk space will be used.
Do you want to continue? [Y/n]
将其权限更改为644
,即可执行。
sudo chmod 644 sphinx.rst
/tmp/sphinx.rst
bash: /tmp/sphinx.rst: Permission denied
sdb2
是ntfs
格式。
sudo blkid |grep sdb2
/dev/sdb2: LABEL="winntfs" UUID="284A29774A2942C4" TYPE="ntfs" PARTLABEL="Basic data partition" PARTUUID="292c184b-766f-4036-8fa0-5bcd936b85c2"
安装它/mnt/winntfs
:
sudo mount /dev/sdb2 /mnt/winntfs
将分区复制/tmp/sphinx.rst
到分区中。ext4
ntfs
cp /tmp/sphinx.rst /mnt/winntfs
ls -al /mnt/winntfs/sphinx.rst
-rwxrwxrwx 1 root root 261 Aug 17 12:02 /mnt/winntfs/sphinx.rst
sudo chmod 644 /mnt/winntfs/sphinx.rst
ls -al /mnt/winntfs/sphinx.rst
-rwxrwxrwx 1 root root 261 Aug 17 12:02 /mnt/winntfs/sphinx.rst
我的debian无法修改文件的模式,现在重启进入win10,设置权限为read and write
,不包含execute
。
重启后重新进入debian,重新挂载dev/sdb2
,/mnt/winntfs/sphinx.rst
依然可以执行,sphinx.rst
linux下如何设置ntfs分区文件不可执行权限?
sda4
并且sda5
都是ntfs
分区。
sudo blkid |grep ntfs
/dev/sda4: UUID="0042E54842E54350" TYPE="ntfs" PARTUUID="9f1dac15-dcb3-11ea-8492-d66553422507"
/dev/sda5: UUID="C0FC6E55FC6E462E" TYPE="ntfs" PARTUUID="1bb1cb5a-4418-41ce-8210-827072f17a47"
我可以挂载/dev/sda4
。
sudo ntfsusermap /dev/sda4
现在开始安装/dev/sda5
:
sudo ntfsusermap /dev/sda5
输出信息:
This tool will help you to build a mapping of Windows users
to Linux users.
Be prepared to give Linux user id (uid) and group id (gid)
for owners of files which will be selected.
"/dev/sda5" opened
* Scanning "/dev/sda5" (two levels)
* Search for "Documents and Settings" and "Users"
* Search for other directories /
"/dev/sda5" closed
它无法弹出 User
并Group
让我输入,为什么ntfsusermap
不能映射我的操作系统中的所有 ntfs 分区?
/dev/sdb2 安装在/media/debian/WINFAT
.
df /media/debian/WINFAT
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sdb2 24406016 402256 24003760 2% /media/debian/WINFAT
卸载它:
sudo umount /dev/sdb2
用命令重新挂载它
sudo mount /dev/sdb2 /media/debian/WINFAT
mount: mount point /media/debian/WINFAT does not exist
为什么不能用命令重新挂载磁盘?
注意:您可以将鼠标移到鼠标左键上WINFAT
进行挂载。
/dev/sda4
在ntfs文件系统中,并/mnt/winntfs
用ntfsusermap
(最关键的一点)挂载,帖子列出了如何在linux中逐步挂载ntfs。
sudo cp -r mydoc /mnt/winntfs
ls /mnt/winntfs
mydoc
ls /mnt/winntfs/mydoc
analyse build cron
您可以看到我已将 $HOME/mydoc 中的所有内容复制到 /mnt/winntfs/mydoc 中,现在我要删除/mnt/winntfs/mydoc
.
sudo rm -rf /mnt/winntfs/*
rm: cannot remove '/mnt/winntfs/mydoc': Device or resource busy
lsof | grep -i "mydoc"
lsof | grep -i "/mnt/winntfs/mydoc"
我想用 lsof 获取进程 id 号,并用 id 号杀死进程,然后可能删除它,但是lsof
命令什么也得不到,为什么它可以复制某个目录而不是删除它?我该如何删除它?
我正在使用通配符表达式来匹配文件名。
这就是普通的非 root 用户会发生的情况:
debian@MiWiFi-R3-srv:~$ sudo ls /var/log/apache2/*[0-9].gz
ls: cannot access '/var/log/apache2/*[0-9].gz': No such file or directory
这就是我切换到 root 用户sudo su
并尝试相同的命令后发生的情况:
root@MiWiFi-R3-srv:/home/debian# ls /var/log/apache2/*[0-9].gz
/var/log/apache2/access.log.10.gz /var/log/apache2/error.log.10.gz
/var/log/apache2/access.log.11.gz /var/log/apache2/error.log.11.gz
/var/log/apache2/access.log.12.gz /var/log/apache2/error.log.12.gz
为什么这个通配符表达式可以用作root
,但不能用作普通的非 root 用户?