在将时间戳转换为秒数、添加一些秒数并将结果转换回时间戳的 bash 脚本中,我从 date 命令中获得了错误的结果。原因如下:
$ dt=$(date '+%s' -u --date="2024-11-25 20:31:00")
$ echo $dt
1732566660
$ date '+%F %T' -u --date="$dt seconds"
2079-10-21 22:33:33
我做错什么了?
在将时间戳转换为秒数、添加一些秒数并将结果转换回时间戳的 bash 脚本中,我从 date 命令中获得了错误的结果。原因如下:
$ dt=$(date '+%s' -u --date="2024-11-25 20:31:00")
$ echo $dt
1732566660
$ date '+%F %T' -u --date="$dt seconds"
2079-10-21 22:33:33
我做错什么了?
我对这一切都不熟悉,了解不多,但使用的代码是split -b 4GB Super Smash Bros Brawl [RSBE01]
,它说split: extra operand "Bros"
,我多次更改代码,通过添加 -、更改大小、删除它说的单词,以及添加/删除文件类型 (wbfs),但我总是得到这个,不知道该怎么做。有人知道如何解决这个问题吗?我花了两天时间在网上寻求帮助。我只是想在我的 Wii 上玩它。更新:我删除了文件名中的所有空格,现在它说Split: cannot open 'SuperSmashBrosBrawl' for reading. No such file exists or directory.
更新 2:问题解决了。谢谢你们的帮助
我正在使用带有 GNOME 桌面环境的 Ubuntu 22.04。
另外,我可以在登录时选择桌面环境/Windows 管理器的其他组合:
除了安装 GNOME 扩展之外,我也喜欢 GNOME,但我注意到在该桌面环境中,我看不到右上角的图标来最小化和最大化窗口。
如果我选择选项 3 或 4,我可以看到图标,但 GNOME 没有最小/最大功能。我该如何解决这个问题?
我正在尝试从 IOS iPad 连接到 Ubuntu 计算机。按照此处的说明(您可以将 iPhone 连接到 Ubuntu 媒体共享吗?)我已经共享了我的用户文档文件夹并连接到它,但当我尝试打开它时,我收到“内容不可用”消息(见屏幕截图)。我在网上读到了一些建议,删除 IOS 上的文件应用程序并再次下载,重新启动 iPad - 但这些都没有改变。有什么想法可能是什么问题吗?
更新 1:
以下是文件内容/etc/samba/smb.conf
。我使用的是 Ubuntu 22.04。我也尝试过从 OSX 连接到 Ubuntu 计算机 - 同样的问题,连接但不显示内容。
# Sample configuration file for the Samba suite for Debian GNU/Linux.
#
#
# This is the main Samba configuration file. You should read the
# smb.conf(5) manual page in order to understand the options listed
# here. Samba has a huge number of configurable options most of which
# are not shown in this example
#
# Some options that are often worth tuning have been included as
# commented-out examples in this file.
# - When such options are commented with ";", the proposed setting
# differs from the default Samba behaviour
# - When commented with "#", the proposed setting is the default
# behaviour of Samba but the option is considered important
# enough to be mentioned here
#
# NOTE: Whenever you modify this file you should run the command
# "testparm" to check that you have not made any basic syntactic
# errors.
#======================= Global Settings =======================
[global]
## Browsing/Identification ###
# Change this to the workgroup/NT-domain name your Samba server will part of
workgroup = WORKGROUP
# server string is the equivalent of the NT Description field
server string = %h server (Samba, Ubuntu)
#### Networking ####
# The specific set of interfaces / networks to bind to
# This can be either the interface name or an IP address/netmask;
# interface names are normally preferred
; interfaces = 127.0.0.0/8 eth0
# Only bind to the named interfaces and/or networks; you must use the
# 'interfaces' option above to use this.
# It is recommended that you enable this feature if your Samba machine is
# not protected by a firewall or is a firewall itself. However, this
# option cannot handle dynamic or non-broadcast interfaces correctly.
; bind interfaces only = yes
#### Debugging/Accounting ####
# This tells Samba to use a separate log file for each machine
# that connects
log file = /var/log/samba/log.%m
# Cap the size of the individual log files (in KiB).
max log size = 1000
# We want Samba to only log to /var/log/samba/log.{smbd,nmbd}.
# Append syslog@1 if you want important messages to be sent to syslog too.
logging = file
# Do something sensible when Samba crashes: mail the admin a backtrace
panic action = /usr/share/samba/panic-action %d
####### Authentication #######
# Server role. Defines in which mode Samba will operate. Possible
# values are "standalone server", "member server", "classic primary
# domain controller", "classic backup domain controller", "active
# directory domain controller".
#
# Most people will want "standalone server" or "member server".
# Running as "active directory domain controller" will require first
# running "samba-tool domain provision" to wipe databases and create a
# new domain.
server role = standalone server
obey pam restrictions = yes
# This boolean parameter controls whether Samba attempts to sync the Unix
# password with the SMB password when the encrypted SMB password in the
# passdb is changed.
unix password sync = yes
# For Unix password sync to work on a Debian GNU/Linux system, the following
# parameters must be set (thanks to Ian Kahan <<[email protected]> for
# sending the correct chat script for the passwd program in Debian Sarge).
passwd program = /usr/bin/passwd %u
passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
# This boolean controls whether PAM will be used for password changes
# when requested by an SMB client instead of the program listed in
# 'passwd program'. The default is 'no'.
pam password change = yes
# This option controls how unsuccessful authentication attempts are mapped
# to anonymous connections
map to guest = bad user
########## Domains ###########
#
# The following settings only takes effect if 'server role = classic
# primary domain controller', 'server role = classic backup domain controller'
# or 'domain logons' is set
#
# It specifies the location of the user's
# profile directory from the client point of view) The following
# required a [profiles] share to be setup on the samba server (see
# below)
; logon path = \\%N\profiles\%U
# Another common choice is storing the profile in the user's home directory
# (this is Samba's default)
# logon path = \\%N\%U\profile
# The following setting only takes effect if 'domain logons' is set
# It specifies the location of a user's home directory (from the client
# point of view)
; logon drive = H:
# logon home = \\%N\%U
# The following setting only takes effect if 'domain logons' is set
# It specifies the script to run during logon. The script must be stored
# in the [netlogon] share
# NOTE: Must be store in 'DOS' file format convention
; logon script = logon.cmd
# This allows Unix users to be created on the domain controller via the SAMR
# RPC pipe. The example command creates a user account with a disabled Unix
# password; please adapt to your needs
; add user script = /usr/sbin/adduser --quiet --disabled-password --gecos "" %u
# This allows machine accounts to be created on the domain controller via the
# SAMR RPC pipe.
# The following assumes a "machines" group exists on the system
; add machine script = /usr/sbin/useradd -g machines -c "%u machine account" -d /var/lib/samba -s /bin/false %u
# This allows Unix groups to be created on the domain controller via the SAMR
# RPC pipe.
; add group script = /usr/sbin/addgroup --force-badname %g
############ Misc ############
# Using the following line enables you to customise your configuration
# on a per machine basis. The %m gets replaced with the netbios name
# of the machine that is connecting
; include = /home/samba/etc/smb.conf.%m
# Some defaults for winbind (make sure you're not using the ranges
# for something else.)
; idmap config * : backend = tdb
; idmap config * : range = 3000-7999
; idmap config YOURDOMAINHERE : backend = tdb
; idmap config YOURDOMAINHERE : range = 100000-999999
; template shell = /bin/bash
# Setup usershare options to enable non-root users to share folders
# with the net usershare command.
# Maximum number of usershare. 0 means that usershare is disabled.
# usershare max shares = 100
# Allow users who've been granted usershare privileges to create
# public shares, not just authenticated ones
usershare allow guests = yes
#======================= Share Definitions =======================
# Un-comment the following (and tweak the other settings below to suit)
# to enable the default home directory shares. This will share each
# user's home directory as \\server\username
;[homes]
; comment = Home Directories
; browseable = no
# By default, the home directories are exported read-only. Change the
# next parameter to 'no' if you want to be able to write to them.
; read only = yes
# File creation mask is set to 0700 for security reasons. If you want to
# create files with group=rw permissions, set next parameter to 0775.
; create mask = 0700
# Directory creation mask is set to 0700 for security reasons. If you want to
# create dirs. with group=rw permissions, set next parameter to 0775.
; directory mask = 0700
# By default, \\server\username shares can be connected to by anyone
# with access to the samba server.
# Un-comment the following parameter to make sure that only "username"
# can connect to \\server\username
# This might need tweaking when using external authentication schemes
; valid users = %S
# Un-comment the following and create the netlogon directory for Domain Logons
# (you need to configure Samba to act as a domain controller too.)
;[netlogon]
; comment = Network Logon Service
; path = /home/samba/netlogon
; guest ok = yes
; read only = yes
# Un-comment the following and create the profiles directory to store
# users profiles (see the "logon path" option above)
# (you need to configure Samba to act as a domain controller too.)
# The path below should be writable by all users so that their
# profile directory may be created the first time they log on
;[profiles]
; comment = Users profiles
; path = /home/samba/profiles
; guest ok = no
; browseable = no
; create mask = 0600
; directory mask = 0700
[printers]
comment = All Printers
browseable = no
path = /var/spool/samba
printable = yes
guest ok = no
read only = yes
create mask = 0700
# Windows clients look for this share name as a source of downloadable
# printer drivers
[print$]
comment = Printer Drivers
path = /var/lib/samba/printers
browseable = yes
read only = yes
guest ok = no
# Uncomment to allow remote administration of Windows print drivers.
# You may need to replace 'lpadmin' with the name of the group your
# admin users are members of.
# Please note that you also need to set appropriate Unix permissions
# to the drivers directory for these users to have write rights in it
; write list = root, @lpadmin
更新2:
以下输出net usershare info --long
:
$ net usershare info --long
[Documents]
path=/home/garrett/Documents
comment=
usershare_acl=Everyone:F,
guest_ok=n
我有一张网卡,我想将两个接口连接到它。一个接口是 DHCP 和mtu: 1500
。另一个接口是静态 IP 和mtu: 9000
。
我该如何通过 进行配置netplan
,或者,如果不可能的话,在 中systemd-networkd
?
我有一台 Brother HLL2390DW 一体式打印机,通过 USB 连接到我的 Kubuntu 22.04 笔记本电脑,使用brother-HLL2390DW-cups-en.ppd
他们的网站。
如果我发出一个,lp file1.pdf
它可以正常工作,但如果我发出一个lp file1.pdf file2.pdf
,打印机会唤醒,但不会打印任何内容。
/var/log/cups/error_log
显示:
W [23/Nov/2024:00:00:28 -0500] Printer drivers are deprecated and will stop working in a future version of CUPS. See https://github.com/OpenPrinting/cups/issues/103
W [23/Nov/2024:02:05:49 -0500] Printer drivers are deprecated and will stop working in a future version of CUPS. See https://github.com/OpenPrinting/cups/issues/103
W [23/Nov/2024:05:17:30 -0500] Printer drivers are deprecated and will stop working in a future version of CUPS. See https://github.com/OpenPrinting/cups/issues/103
E [23/Nov/2024:18:22:58 -0500] [Job 66] Unable to add document to print job.
E [23/Nov/2024:18:46:36 -0500] [Job 67] Unable to add document to print job.
E [23/Nov/2024:18:59:48 -0500] [Job 69] Print job canceled at printer.
W [23/Nov/2024:18:59:48 -0500] [Job 69] Backend returned status 5 (cancel job)
E [23/Nov/2024:19:04:23 -0500] [Job 70] Unable to add document to print job.
E [23/Nov/2024:19:04:31 -0500] [Job 70] Print job canceled at printer.
W [23/Nov/2024:19:04:31 -0500] [Job 70] Backend returned status 5 (cancel job)
$ lpstat -a
Brother_HL_L2390DW_USB not accepting requests since Sat 23 Nov 2024 05:36:03 PM EST -
Rejecting Jobs
BrotherHLL2390D not accepting requests since Sat 02 Nov 2024 08:10:19 PM EDT -
Rejecting Jobs
HLL2390DW accepting requests since Sat 23 Nov 2024 07:12:01 PM EST
另外两个实例来自之前尝试使用以太网转 USB 打印服务器适配器等将打印机连接为网络打印机的情况。(一旦成功,我会就此提出一个单独的问题。)我手动禁用了它们。
我在我的 ubuntu 核心机器上使用 ffmpeg snap 从 ip 摄像机接收视频包并将其作为 mp4 视频文件保存在我的 ubuntu 核心机器上,但是当我尝试使用 ffmpeg 播放视频时,我无法做到这一点,那么在 ubuntu 核心机器上显示视频的正确方法是什么。
我已经尝试过:
是的,我的 ubuntu 核心使用 wayland 与 wpe-kit-kiosk 配合得很好。提前致谢。
我在个人笔记本电脑上安装了 Ubuntu,并连接到酒店 wifi,我之前在同一台电脑上使用 Windows。这个网络是标准的酒店 wifi,您需要以客人身份输入凭据才能访问,但它直接连接,没有任何提示,就像绕过了路由器提示一样。
我的问题是它是如何做到的?它是否检测到了我笔记本电脑的 MAC 地址,然后就认为是我?
我有一台安装了 Ubuntu 24.04 LTS 的笔记本电脑,我正在尝试用最新版本(3.4.8,根据我在互联网上找到的信息,官方 PPA 中不久后将不再提供)替换默认的 Rhythmbox(版本 3.4.7)。我暂时不想使用 Flatpak,而且我也有兴趣学习一次“香肠是如何制作的”。
我已成功完成Rhythmbox GitLab的安装过程。现在我可以使用以下命令从安装目录启动 Rhythmbox:
$ export GSETTINGS_SCHEMA_DIR=$PWD/_install/share/glib-2.0/schemas
$ _install/bin/rhythmbox
我的问题是:如何才能将其转变为标准行为应用程序?基本上,我希望它的行为像 Rhythmbox 的默认版本一样,带有启动器等。
我的猜测(未经证实)是:
usr/bin
)正确的做法是什么?