AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / user-856659

abu-ahmed al-khatiri's questions

Martin Hope
abu-ahmed al-khatiri
Asked: 2023-05-30 18:12:08 +0800 CST

如何在别名的数组中打印“`”和“%”字符?

  • 7

我的键盘按钮有问题,我已经更换了 3 次键盘。我暂时将 printf 用于某些文本编辑器。我需要在别名上使用颜色打印数组中的“`”和“%”字符,根本不起作用。
基本上在 bash 中是这样的:

printf "[%c%c%c]\n", '`', '`', '%';

输出 :

[``%]

我试试这个:

alias key='printf "\n\033[33m= "[ %c%c%c~+ |\ ]\n\n", '`', '`', '%'" '

在别名上我得到这个错误:

]nn, , %: command not found

别名上的格式字符应该是什么?

提前致谢。

bash
  • 2 个回答
  • 453 Views
Martin Hope
abu-ahmed al-khatiri
Asked: 2022-01-13 04:43:18 +0800 CST

如何将 .img.gz 压缩的磁盘映像解压缩为 .img?

  • 0

可能这是重复的,我无法从搜索引擎中找到相关信息。我如何将文件提取.img.gz到.img文件中?

我将文件归档为 .img.xz 和 .img.gz。xz-utils我可以使用或unxz从这种方式提取.img.xz ,但我无法找到ungz我的矿工在哪里。

提前致谢。

disk-image
  • 1 个回答
  • 2038 Views
Martin Hope
abu-ahmed al-khatiri
Asked: 2018-12-26 02:05:18 +0800 CST

如何为 python 脚本创建一个新的 Cron 作业来更新 mysql?

  • 1

我是设置 Cron 工作的新手。

我有一个我的应用程序 python 的前缀目录,我/usr/local/lib/python2.7/dist-packages/prewikka已经为我的应用程序 python 提供了新环境PYTHONPATH=$prefix/lib/python2.7/dist-packages/prewikka:$prefix/bin/prewikka-httpd

我已经手动创建了一个数据库 MySQL:

mysql> DESC Prewikka_Crontab;
+----------+--------------+------+-----+---------+-------+
| Field    | Type         | Null | Key | Default | Extra |
+----------+--------------+------+-----+---------+-------+
| id       | varchar(255) | YES  |     | NULL    |       |
| name     | varchar(255) | NO   | PRI | NULL    |       |
| userid   | varchar(255) | YES  |     | NULL    |       |
| ext_type | varchar(255) | NO   |     | NULL    |       |
| ext_id   | varchar(255) | YES  |     | NULL    |       |
| base     | varchar(255) | NO   |     | NULL    |       |
| runcnt   | varchar(255) | YES  |     | NULL    |       |
| schedule | varchar(255) | NO   |     | NULL    |       |
| enabled  | tinyint(11)  | YES  |     | 1       |       |
| error    | varchar(255) | YES  |     | NULL    |       |
+----------+--------------+------+-----+---------+-------+
10 rows in set (0.00 sec)

如果我启动prewikka-crontab,则不会出现任何输出。当我启动时prewikka-httpd,我总是得到输出:

...
File "/usr/local/lib/python2.7/dist-packages/prewikka/history.py", line 102, in <module>
    crontab.schedule("search_history", N_("Search history deletion"), "0 * * * *", _regfunc=history._history_cron, enabled=True)
  File "/usr/local/lib/python2.7/dist-packages/prewikka/crontab.py", line 240, in schedule
    self._init_system_job(ext_type, name, schedule, enabled, _regfunc)
  File "/usr/local/lib/python2.7/dist-packages/prewikka/database.py", line 91, in inner
    ret = func(self, *args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/prewikka/crontab.py", line 154, in _init_system_job
    self.add(name, schedule, ext_type=ext_type, enabled=enabled)
  File "/usr/local/lib/python2.7/dist-packages/prewikka/crontab.py", line 219, in add
    return self.update(None, name=name, schedule=schedule, user=user, ext_type=ext_type, ext_id=ext_id, enabled=enabled)
  File "/usr/local/lib/python2.7/dist-packages/prewikka/crontab.py", line 209, in update
    return env.db.getLastInsertIdent()
RuntimeError: could not retrieve last insert ID

因为我的客户端到服务器端没有事件调度程序,我如何开始使用 Cron 作业?

提前致谢。

python mysql cron
  • 1 个回答
  • 1075 Views
Martin Hope
abu-ahmed al-khatiri
Asked: 2018-12-02 04:59:40 +0800 CST

第一次如何为 Bionic 配置 Prewikka?

  • 2

我试图安装Prewikka一个基于仿生 Web 界面的安全信息和事件管理系统包。

我按照终端上的说明进行操作,当我开始设置Prewikka软件包时,会出现确认信息:

在此处输入图像描述

我从不提供为Prewikka数据库配置密码,我尝试在站点文档上查找,但我找不到任何问题。

我怎么知道我的Prewikka密码dbconfig-common?因为我在之前的说明中选择了dbconfig-common数据库作为默认值,见下文!

在此处输入图像描述

编辑#1

Prewikka 的开发者说,至于 Prelude,我们选择使用 dbconfig-common,给管理员密码,输入 DB 密码。在此文档上用于与 Prelude Manager 集成,因此我dbconfig-common在前面的说明中选择。当我阅读 Prelude Developer 的所有文档时,我忘记为我的 Prewikka! 创建一个数据库!哦,那是我的假。而这一刻,我得到了一些我不明白的错误!但是我在确认密码时仍然有点困惑,我必须在 Prewikka 的 MySQL 数据库或 Prelude 的 DBConfig-Common 之间输入密码?

编辑#2

此刻,我得到了一些我不理解并且对我来说真的很复杂的错误!当我打开 Prewikka 的默认端口时,出现错误:

在此处输入图像描述

在我的终端上出现:

$ sudo prewikka-httpd
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/prewikka/database.py", line 59, in inner
    ret = func(self, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/prewikka/database.py", line 489, in __init__
    dh.apply()
  File "/usr/lib/python3/dist-packages/prewikka/database.py", line 74, in inner
    ret = func(self, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/prewikka/database.py", line 424, in apply
    self._apply()
  File "/usr/lib/python3/dist-packages/prewikka/database.py", line 91, in inner
    ret = func(self, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/prewikka/database.py", line 415, in _apply
    [ update.apply() for update in self.list() ]
  File "/usr/lib/python3/dist-packages/prewikka/database.py", line 415, in <listcomp>
    [ update.apply() for update in self.list() ]
  File "/usr/lib/python3/dist-packages/prewikka/database.py", line 87, in inner
    return func(self, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/prewikka/database.py", line 221, in apply
    self.run()
  File "/usr/lib/python3/dist-packages/prewikka/sql/install.py", line 72, in run
    """)
  File "/usr/lib/python3/dist-packages/prewikka/database.py", line 211, in query
    self.db.query(q)
  File "/usr/lib/python3/dist-packages/prewikka/database.py", line 547, in query
    return preludedb.SQL.query(self, sql)
RuntimeError: All parts of a PRIMARY KEY must be NOT NULL; if you need NULL in a key, use UNIQUE instead

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/prewikka/main.py", line 277, in process
    response = self._process_static(webreq) or self._process_dynamic(webreq)
  File "/usr/lib/python3/dist-packages/prewikka/main.py", line 244, in _process_dynamic
    self._prewikka_init_if_needed()
  File "/usr/lib/python3/dist-packages/prewikka/main.py", line 134, in _prewikka_init_if_needed
    raise self._prewikka_initialized
  File "/usr/lib/python3/dist-packages/prewikka/main.py", line 122, in _prewikka_init_if_needed
    env.db = database.Database(env.config.database)
  File "/usr/lib/python3/dist-packages/prewikka/database.py", line 873, in __new__
    return MySQLDatabase(config)
  File "/usr/lib/python3/dist-packages/prewikka/database.py", line 61, in inner
    raise DatabaseError(message=text_type(e))
prewikka.database.DatabaseError: All parts of a PRIMARY KEY must be NOT NULL; if you need NULL in a key, use UNIQUE instead

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.6/wsgiref/handlers.py", line 137, in run
    self.result = application(self.environ, self.start_response)
  File "/bin/prewikka-httpd", line 62, in application
    return wsgi.application(environ, start_response)
  File "/usr/lib/python3/dist-packages/prewikka/web/wsgi.py", line 161, in application
    core.process(WSGIRequest(environ, start_response))
  File "/usr/lib/python3/dist-packages/prewikka/main.py", line 280, in process
    response = err.respond()
  File "/usr/lib/python3/dist-packages/prewikka/error.py", line 106, in respond
    return self._html_respond()
  File "/usr/lib/python3/dist-packages/prewikka/error.py", line 90, in _html_respond
    from prewikka import baseview
  File "/usr/lib/python3/dist-packages/prewikka/baseview.py", line 27, in <module>
    from prewikka import error, history, hookmanager, resource, response, template, utils, view
  File "/usr/lib/python3/dist-packages/prewikka/history.py", line 102, in <module>
    crontab.schedule("search_history", N_("Search history deletion"), "0 * * * *", _regfunc=history._history_cron, enabled=True)
  File "/usr/lib/python3/dist-packages/prewikka/crontab.py", line 240, in schedule
    self._init_system_job(ext_type, name, schedule, enabled, _regfunc)
  File "/usr/lib/python3/dist-packages/prewikka/database.py", line 91, in inner
    ret = func(self, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/prewikka/crontab.py", line 152, in _init_system_job
    res = env.db.query("SELECT 1 FROM Prewikka_Crontab WHERE ext_type=%s AND userid IS NULL", ext_type)
  File "/usr/lib/python3/dist-packages/prewikka/database.py", line 547, in query
    return preludedb.SQL.query(self, sql)
RuntimeError: Table 'prewikka.Prewikka_Crontab' doesn't exist
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/prewikka/database.py", line 59, in inner
    ret = func(self, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/prewikka/database.py", line 489, in __init__
    dh.apply()
  File "/usr/lib/python3/dist-packages/prewikka/database.py", line 74, in inner
    ret = func(self, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/prewikka/database.py", line 424, in apply
    self._apply()
  File "/usr/lib/python3/dist-packages/prewikka/database.py", line 91, in inner
    ret = func(self, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/prewikka/database.py", line 415, in _apply
    [ update.apply() for update in self.list() ]
  File "/usr/lib/python3/dist-packages/prewikka/database.py", line 415, in <listcomp>
    [ update.apply() for update in self.list() ]
  File "/usr/lib/python3/dist-packages/prewikka/database.py", line 87, in inner
    return func(self, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/prewikka/database.py", line 221, in apply
    self.run()
  File "/usr/lib/python3/dist-packages/prewikka/sql/install.py", line 72, in run
    """)
  File "/usr/lib/python3/dist-packages/prewikka/database.py", line 211, in query
    self.db.query(q)
  File "/usr/lib/python3/dist-packages/prewikka/database.py", line 547, in query
    return preludedb.SQL.query(self, sql)
RuntimeError: All parts of a PRIMARY KEY must be NOT NULL; if you need NULL in a key, use UNIQUE instead

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/prewikka/main.py", line 277, in process
    response = self._process_static(webreq) or self._process_dynamic(webreq)
  File "/usr/lib/python3/dist-packages/prewikka/main.py", line 244, in _process_dynamic
    self._prewikka_init_if_needed()
  File "/usr/lib/python3/dist-packages/prewikka/main.py", line 134, in _prewikka_init_if_needed
    raise self._prewikka_initialized
  File "/usr/lib/python3/dist-packages/prewikka/main.py", line 122, in _prewikka_init_if_needed
    env.db = database.Database(env.config.database)
  File "/usr/lib/python3/dist-packages/prewikka/database.py", line 873, in __new__
    return MySQLDatabase(config)
  File "/usr/lib/python3/dist-packages/prewikka/database.py", line 61, in inner
    raise DatabaseError(message=text_type(e))
prewikka.database.DatabaseError: All parts of a PRIMARY KEY must be NOT NULL; if you need NULL in a key, use UNIQUE instead

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.6/wsgiref/handlers.py", line 137, in run
    self.result = application(self.environ, self.start_response)
  File "/bin/prewikka-httpd", line 62, in application
    return wsgi.application(environ, start_response)
  File "/usr/lib/python3/dist-packages/prewikka/web/wsgi.py", line 161, in application
    core.process(WSGIRequest(environ, start_response))
  File "/usr/lib/python3/dist-packages/prewikka/main.py", line 280, in process
    response = err.respond()
  File "/usr/lib/python3/dist-packages/prewikka/error.py", line 106, in respond
    return self._html_respond()
  File "/usr/lib/python3/dist-packages/prewikka/error.py", line 90, in _html_respond
    from prewikka import baseview
  File "/usr/lib/python3/dist-packages/prewikka/baseview.py", line 27, in <module>
    from prewikka import error, history, hookmanager, resource, response, template, utils, view
  File "/usr/lib/python3/dist-packages/prewikka/history.py", line 102, in <module>
    crontab.schedule("search_history", N_("Search history deletion"), "0 * * * *", _regfunc=history._history_cron, enabled=True)
  File "/usr/lib/python3/dist-packages/prewikka/crontab.py", line 240, in schedule
    self._init_system_job(ext_type, name, schedule, enabled, _regfunc)
  File "/usr/lib/python3/dist-packages/prewikka/database.py", line 91, in inner
    ret = func(self, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/prewikka/crontab.py", line 152, in _init_system_job
    res = env.db.query("SELECT 1 FROM Prewikka_Crontab WHERE ext_type=%s AND userid IS NULL", ext_type)
  File "/usr/lib/python3/dist-packages/prewikka/database.py", line 547, in query
    return preludedb.SQL.query(self, sql)
RuntimeError: Table 'prewikka.Prewikka_Crontab' doesn't exist

编辑#3

我试图从这个问题开始,他解决了以下问题:

  • 删除 Prewikka 数据库
  • 重新创建 Prewikka 数据库
  • 重试运行 Prewikka

但这对我不起作用,我还使用了上面提到的Howto 指令:https ://www.prelude-siem.org/projects/prelude/wiki/InstallingPackageUbuntu 。所以我错过了什么伙计们?

希望任何人都可以帮助我!,在此先感谢。

package-management apt 18.04
  • 1 个回答
  • 517 Views
Martin Hope
abu-ahmed al-khatiri
Asked: 2018-10-26 02:43:51 +0800 CST

E: Depends 的损坏包:python3 (>= 3.6.6-1~)

  • 0

我试图更新/升级我的apt,我从python3依赖中得到错误。

当我更新/升级时:

praz@abuahmed:~$ APTGET
Ign:1 http://dl.google.com/linux/chrome/deb stable InRelease
Hit:2 http://dl.google.com/linux/chrome/deb stable Release                                                        
Hit:3 http://ppa.launchpad.net/noobslab/apps/ubuntu bionic InRelease                                                                                 
Hit:4 https://desktop-download.mendeley.com/download/apt stable InRelease                                                                            
Hit:5 http://id.archive.ubuntu.com/ubuntu bionic InRelease                                     
Get:6 http://security.ubuntu.com/ubuntu bionic-security InRelease [83,2 kB]
Get:8 http://id.archive.ubuntu.com/ubuntu bionic-updates InRelease [88,7 kB]         
Hit:9 http://id.archive.ubuntu.com/ubuntu bionic-proposed InRelease                              
Fetched 172 kB in 3s (52,7 kB/s)
Reading package lists... Done
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
The following packages have been kept back:
  python3-distutils python3-gdbm python3-lib2to3
0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.

当我升级该软件包时:

praz@abuahmed:~$ sudo apt-get upgrade python3-distutils python3-gdbm python3-lib2to3
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 python3-distutils : Depends: python3 (>= 3.6.6-1~) but 3.6.5-3ubuntu1 is to be installed
 python3-gdbm : Depends: python3 (>= 3.6.6-1~) but 3.6.5-3ubuntu1 is to be installed
 python3-lib2to3 : Depends: python3 (>= 3.6.6-1~) but 3.6.5-3ubuntu1 is to be installed
E: Broken packages

当我检查我的 apt 政策时

praz@abuahmed:~$ sudo apt-cache policy python3-distutils python3-gdbm python3-lib2to3
python3-distutils:
  Installed: 3.6.5-3
  Candidate: 3.6.7-1~18.04
  Version table:
     3.6.7-1~18.04 500
        500 http://id.archive.ubuntu.com/ubuntu bionic-proposed/main amd64 Packages
        500 http://id.archive.ubuntu.com/ubuntu bionic-proposed/main i386 Packages
 *** 3.6.5-3 500
        500 http://id.archive.ubuntu.com/ubuntu bionic/main amd64 Packages
        500 http://id.archive.ubuntu.com/ubuntu bionic/main i386 Packages
        100 /var/lib/dpkg/status
python3-gdbm:
  Installed: 3.6.5-3
  Candidate: 3.6.7-1~18.04
  Version table:
     3.6.7-1~18.04 500
        500 http://id.archive.ubuntu.com/ubuntu bionic-proposed/main amd64 Packages
 *** 3.6.5-3 500
        500 http://id.archive.ubuntu.com/ubuntu bionic/main amd64 Packages
        100 /var/lib/dpkg/status
python3-lib2to3:
  Installed: 3.6.5-3
  Candidate: 3.6.7-1~18.04
  Version table:
     3.6.7-1~18.04 500
        500 http://id.archive.ubuntu.com/ubuntu bionic-proposed/main amd64 Packages
        500 http://id.archive.ubuntu.com/ubuntu bionic-proposed/main i386 Packages
 *** 3.6.5-3 500
        500 http://id.archive.ubuntu.com/ubuntu bionic/main amd64 Packages
        500 http://id.archive.ubuntu.com/ubuntu bionic/main i386 Packages
        100 /var/lib/dpkg/status

我尝试使用 Synaptic 使用Mark All Upgrades&& Edit+ Fix Broken Packages&&修复它Reload,这将在状态部分显示一个 apt upgradable 列表,并尝试Mark For Upgrade在每个需要升级的包上进行,但我没有选择解决这个问题。

package-management upgrade apt 18.04
  • 1 个回答
  • 1570 Views
Martin Hope
abu-ahmed al-khatiri
Asked: 2018-08-08 02:24:37 +0800 CST

如何修复 Snapd dpkg 错误?

  • 4

当我sudo apt-get update && sudo apt-get upgrade为我的新内核做这个清晨时4.4.0-131-generic。我收到我的 snapd 错误。

Setting up snapd (2.34.2~14.04) ...  
Failed to enable unit: Unit file snapd.autoimport.service does not exist.
dpkg: error processing package snapd (--configure):
subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of snapd-xdg-open:
snapd-xdg-open depends on snapd (= 2.34.2~14.04); however:
Package snapd is not configured yet.

dpkg: error processing package snapd-xdg-open (--configure):
dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
                                                                                                          Errors were encountered while processing:
 snapd
 snapd-xdg-open
E: Sub-process /usr/bin/dpkg returned an error code (1)

我不知道我是怎么做的,我试过 sudo dpkg -a --configure && sudo apt purge snapd* && sudo apt-get remove snapd*

这对我没有解决!我也尝试清除我的 Ubuntu 上的所有缓存并重新安装 snapd,它没有修复。

package-management upgrade dpkg apt
  • 1 个回答
  • 4422 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何运行 .sh 脚本?

    • 16 个回答
  • Marko Smith

    如何安装 .tar.gz(或 .tar.bz2)文件?

    • 14 个回答
  • Marko Smith

    如何列出所有已安装的软件包

    • 24 个回答
  • Marko Smith

    无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗?

    • 25 个回答
  • Martin Hope
    Flimm 如何在没有 sudo 的情况下使用 docker? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    Ivan 如何列出所有已安装的软件包 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    La Ode Adam Saputra 无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗? 2010-11-30 18:12:48 +0800 CST
  • Martin Hope
    David Barry 如何从命令行确定目录(文件夹)的总大小? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher “以下软件包已被保留:”为什么以及如何解决? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford 如何删除 PPA? 2010-07-30 01:09:42 +0800 CST

热门标签

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve