![](https://img-blog.csdnimg.cn/20201014180756757.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Linux
钱德勒宾
玫瑰吸收光芒,大地按捺清香。
展开
-
Centos 关闭密码字典检查
设置密码的时候,有的密无法通过字典检查。可以通过修改:/etc/security/pwquality.conf 文件 关闭字典检查。修改完成之后:但是不建议这么修改。建议你换个密码。原创 2022-01-18 10:49:04 · 2972 阅读 · 0 评论 -
UOS:清空回收站
当清空回收站时,可能会报权限问题使用。此时可以使用root用户执行:gio trash --empty帮助选项:root@adams-PC:~# gio trash --helpgio: 未知选项 --help用法: gio trash [OPTION…] [位置…]将文件或目录移动到回收站。选项: -f, --force 忽略不存在的文件,从不提示 --empty 清空回收站root@adams-PC:~#...原创 2022-01-13 11:06:07 · 839 阅读 · 0 评论 -
debian:根据文件名称,找到对应的包
安装工具:sudo apt install apt-file然后更新缓存信息:sudo apt-file update查找debuild这个文件属于那个包:apt-file search debuild:adams@adams-PC:~/$ apt-file search debuilddevscripts: /usr/bin/cvs-debuild devscripts: /usr/bin/debuilddevscripts: /usr/share/bash-com原创 2021-12-15 16:57:44 · 1365 阅读 · 0 评论 -
Centos8 安装仓库中所有软件包
在空目录中使用命令:yum install *肯定会有软件包冲突,需要加上参数:yum install * --skip-broken如果遇到文件冲突,需要去到软件包缓存目录:/var/cache/dnf/使用rpm -ivh xxx.rpm --replacefiles命令安装有文件冲突的两个包。然后再使用yum install * --skip-broken 命令安装仓库中所有软件包。...原创 2021-12-15 16:49:46 · 1455 阅读 · 0 评论 -
报错:Can‘t locate Debian/Debhelper/Dh_Lib.pm in @INC
执行:dh_quilt_patch 后报错:Can't locate Debian/Debhelper/Dh_Lib.pm in @INC (you may need to install the Debian::Debhelper::Dh_Lib module) (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.28.1 /usr/local/share/perl/5.28.1 /usr/lib/x86_64-linux-g原创 2021-06-29 15:25:35 · 837 阅读 · 0 评论 -
复杂密码随机生成工具
参考链接:https://www.cnblogs.com/klb561/p/9236360.html命令:pwgen1、安装:sudo yum install pwgen2、使用示例:[root@localhost ~]# pwgen zez6Kuoy Phohgee3 ahBa3aew Xiedee2E bae8Ahji Eighida3 Cha9heeD iY0aetaiohghee4I dooth7Wu shaiX3ae ooJoon8p Oewosie1 Iw8meiGh mey5i原创 2021-06-20 14:58:40 · 794 阅读 · 0 评论 -
从rpm中抽取文件
参考链接:https://blog.csdn.net/hshl1214/article/details/104493331 提取源码包以lsof-4.87-6.el7.src.rpm为例,进行说明:[root@localhost test]# lslsof-4.87-6.el7.src.rpm[root@localhost test]# rpm2cpio lsof-4.87-6.el7.src.rpm Error: refusing to output cpio data to a ter原创 2021-06-20 11:12:42 · 1138 阅读 · 0 评论 -
Centos:下载远程仓库中的全部软件包
reposync[root@localhost ~]# reposync --helpCommand: reposync reposync --help Installroot: /Releasever: 8.0cachedir: /var/cache/dnfBase command: reposyncExtra commands: ['reposync', '--help']usage: dnf reposync [-c [config file]] [-q] [-v] [--versi原创 2021-06-16 20:53:29 · 626 阅读 · 0 评论 -
bzip2格式文件解压
有cil文件:[test@localhost test]$ file cil cil: bzip2 compressed data, block size = 500k[test@localhost test]$可以查看到,文件属于bzip2压缩格式。此时直接查看cil文件,会是乱码形式:因为不经常操作bzip2格式的文件,所以查看下有没有相关解压缩命令:[test@localhost test]$ ls /usr/bin/*zip*/usr/bin/bunzip2 /usr原创 2021-05-27 11:34:32 · 1507 阅读 · 0 评论 -
vim-宏录制及其使用
参考链接:https://zhuanlan.zhihu.com/p/68111471需求假设有如下文件目录结构,a中是修改好之后的文件,b中是需要修改的文件。[adams@localhost test]$ lsa b[adams@localhost test]$ tree.├── a│ └── qqq│ └── www│ └── eee│ ├── asdf.ww│ ├── dfdfeyg.原创 2021-04-28 20:13:39 · 2480 阅读 · 0 评论 -
Linux:调试,log中增加时间戳、pid 和ppid
增加时间戳:#include <sys/time.h>struct timeval tv;gettimeofday(&tv,NULL);//毫秒级时间戳g_debug ("tv.tv_sec:%ld, tv.tv_usec:%ld, millisecond:%ld\n", tv.tv_sec, tv.tv_usec, tv.tv_sec*1000+tv.tv_usec/1000); 增加pid ppid:g_debug ("== test == [%s]_[%d] p原创 2021-02-19 20:28:21 · 819 阅读 · 0 评论 -
rpmbuild 忽略成功的部分
参考链接:https://www.cnblogs.com/jing99/p/9672295.html–short-circuit 选项来忽略成功的阶段。例如,若想要(略过更早的阶段)重新从 %install 阶段开始,请执行:rpmbuild -bi --short-circuit program.spec当然,-ba和--short-circuit 一起使用就没有什么意义了。...原创 2021-01-13 14:03:45 · 420 阅读 · 0 评论 -
Linux:Vim一行显示所有内容
参考链接:vi的时候一行特别长,一行内显示不下,怎么办一行显示所有内容:set nowrap原创 2021-01-11 14:17:37 · 2079 阅读 · 1 评论 -
Linux:刻录u盘,格式化u盘
格式化u盘:mkfs.ext4 /dev/sdb[root@localhost tmp]# mkfs.ext4 /dev/sdb mke2fs 1.45.4 (23-Sep-2019)创建含有 7554686 个块(每块 4k)和 1892352 个inode的文件系统文件系统UUID:5bcc6615-fffb-4d2b-a007-2a9c87bdefbe超级块的备份存储于下列块: 32768, 98304, 163840, 229376, 294912, 819200, 884736,原创 2020-12-29 09:05:21 · 427 阅读 · 0 评论 -
Linux:RPM文件触发器
参考链接:File triggershttps://pagure.io/packaging-committee/issue/566https://docs.fedoraproject.org/en-US/packaging-guidelines/Scriptlets/第5章RHEL 8中的新功能Wiki » RPM filetriggers本人对文件触发器的理解:File triggers是一种RPM脚本,在程序包的SPEC文件中定义。 当设定的目录中文件有改动(增加或删除)时,可以运行设定的原创 2020-12-22 11:19:43 · 673 阅读 · 0 评论 -
Linux:关机方式
参考链接:Systemd 入门教程:实战篇只列出笔者本人自己知道的方式。 欢迎大家补充。1、鼠标 点击电源关机键2、init 03、poweroff4、halt5、shutdown -h -now6、sudo systemctl isolate shutdown.target...原创 2020-12-20 22:06:18 · 113 阅读 · 0 评论 -
Error: invalid operands (*UND* and *UND* sections) for `*‘
参考链接:https://www.cnblogs.com/wangjq19920210/p/11347916.htmlhttps://bbs.huaweicloud.com/forum/thread-23178-1-1.html在arm上编译PhantomJS报错:g++ -c -include .pch/Qt5Gui -pipe -O3 -fPIC -fvisibility=hidden -fvisibility-inlines-hidden -std=c++0x -fno-exceptions原创 2020-12-18 22:05:27 · 2350 阅读 · 1 评论 -
Linux:更新 /usr/share/glib-2.0/schemas 目录
参考链接:http://lfsbookja.osdn.jp/BLFS/svn-ja/gnome/gsettings-desktop-schemas.html更新 gsettings 配置文件 命令:glib-compile-schemas /usr/share/glib-2.0/schemas设置 gsettings 的工具:dconf-editor原创 2020-12-18 21:46:57 · 693 阅读 · 0 评论 -
%ldconfig_scriptlets 替换
参考链接:https://fedoraproject.org/wiki/Changes/Removing_ldconfig_scriptlets%ldconfig_scriptlets替换为:%post -p /sbin/ldconfig%postun -p /sbin/ldconfigspec文件应该使用%ldconfig_post,%ldconfig_postun或优选%ldconfig_scriptlets。%post -p /sbin/ldconfig → %ldconfig原创 2020-12-09 18:20:01 · 914 阅读 · 0 评论 -
报错:/usr/include/exiv2/slice.hpp:99:77: error: exception handling disabled, use -fexceptions to enabl
参考链接:https://stackoverflow.com/questions/25025365/cmake-qt-module-disables-exception-handling编译gwenview-4.10.5-3报错:/usr/include/exiv2/slice.hpp:99:77: error: exception handling disabled, use -fexceptions to enable解决方法:--- CMakeLists.txt | 1 + 1 f原创 2020-12-07 10:50:19 · 272 阅读 · 0 评论 -
Error:‘GTimeVal‘ is deprecated: Use ‘GDateTime‘
参考链接:https://tecnocode.co.uk/2019/08/24/gtimeval-deprecation-in-glib-2-61-2/https://developer.gnome.org/glib/stable/glib-Date-and-Time-Functions.html#g-get-real-timehttps://developer.gnome.org/glib/stable/glib-Threads.html#g-cond-wait-untilhttps://peop原创 2020-12-03 15:52:00 · 2045 阅读 · 1 评论 -
GNU C库
https://www.gnu.org/software/libc/manual/html_node/index.html#SEC_Contents原创 2020-12-02 16:28:47 · 251 阅读 · 0 评论 -
Linux: fPIC与 pie 区别
参考链接:https://gcc.gnu.org/onlinedocs/gcc-4.8.0/gcc/Code-Gen-Options.html#Code-Gen-Options-fPIC如果目标机器支持,则生成与位置无关的代码,该代码适用于动态链接并避免对全局偏移表的大小进行任何限制。此选项对m68k,PowerPC和SPARC有所不同。与位置无关的代码需要特殊的支持,因此仅在某些机器上有效。设置此标志后,宏__pic__和__PIC__定义为2。-fpie-fPIE这些选项类似原创 2020-12-01 19:53:38 · 1764 阅读 · 0 评论 -
Linux:查看/修改 启动模式
参考链接:https://itbilu.com/linux/management/4JEzjDV8G.html查看:[root@localhost ~]# systemctl get-defaultmulti-user.target[root@localhost ~]# runlevel N 3[root@localhost ~]# [root@localhost ~]# cat /etc/initinit.d/ inittab [root@localhost ~]# cat /e原创 2020-11-26 17:39:55 · 1049 阅读 · 0 评论 -
Linux: arp -n 命令查看到:HWaddress [incomplete]。
参考链接:https://unix.stackexchange.com/questions/89956/no-mac-corresponding-to-ip-in-arp-table-how-to-troubleshoot解决方法:route add default gw 192.168.1.1忘记截图了。arp -n 命令后,显示HWaddress [incomplete] ,而不是具体的地址。手动加上网关就好了。...原创 2020-11-26 16:38:52 · 5907 阅读 · 1 评论 -
linux 查询当前语言环境
[adams@localhost ~]$ localeLANG=zh_CN.UTF-8LC_CTYPE="zh_CN.UTF-8"LC_NUMERIC="zh_CN.UTF-8"LC_TIME="zh_CN.UTF-8"LC_COLLATE="zh_CN.UTF-8"LC_MONETARY="zh_CN.UTF-8"LC_MESSAGES="zh_CN.UTF-8"LC_PAPER="zh_CN.UTF-8"LC_NAME="zh_CN.UTF-8"LC_ADDRESS="zh_CN.U原创 2020-09-21 08:52:25 · 1666 阅读 · 0 评论 -
rpm:打包学习
参考链接:http://ftp.rpm.org/max-rpm/https://jin-yang.github.io/post/linux-create-rpm-package.htmlhttps://rpm-guide.readthedocs.io/en/latest/rpm-guide.html原创 2020-09-03 09:01:59 · 152 阅读 · 0 评论 -
CentOS8:安装wps
wps 下载地址:https://linux.wps.cn/也可以使用下面命令下载x_64版本的rpm包:wget https://wdl1.cache.wps.cn/wps/download/ep/Linux2019/9615/wps-office-11.1.0.9615-1.x86_64.rpm下载完成后,安装:[adams@localhost ~]$ sudo rpm -Uvh wps-office-11.1.0.9615-1.x86_64.rpm [sudo] adams 的密码:错原创 2020-08-27 13:29:45 · 1742 阅读 · 1 评论 -
Linux:mkisofs参数解析
-b <开机映像文件> 或 -eltorito-boot <开机映像文件> :指定在制作可开机光盘时所需的开机映像文件。mkisofs -v 详细信息-J 生成Joliet目录信息-R 生成Rock Ridge目录信息-T 为不了解长文件名的系统生成翻译表-m repoview 排除文件名称-m boot.iso -e images/efiboot.img -no-emul-boot ..原创 2020-08-20 10:57:52 · 929 阅读 · 0 评论 -
Linux:dnf命令相关
参考链接:https://s0dnf0readthedocs0io.icopy.site/en/latest/command_ref.htmlhttps://zh.fedoracommunity.org/2018/06/09/working-modules-fedora-28.htmlhttps://www.qedev.com/cloud/175613.htmlhttps://www.bookstack.cn/read/openeuler-20.03-lts/Administration-%E4%B原创 2020-08-19 10:47:46 · 314 阅读 · 0 评论 -
Error:Building GCC requires GMP 4.2+, MPFR 3.1.0+ and MPC 0.8.0+
参考链接:https://blog.csdn.net/enson16855/article/details/52205044在编译高版本gcc,执行下面配置命令时,报错如下:adams@adams-pc:~/tmp/gcc/gcc-10.2.0/build$ ../configure --prefix=/usr/local/gcc-10.2.0/ --enable-checking=release --enable-languages=c,c++ --disable-multilibcheckin原创 2020-07-30 19:46:17 · 10636 阅读 · 10 评论 -
Linux:gcc高版本(gcc-10.2.0)编译记录
参考链接:https://www.cnblogs.com/liutongqing/p/11277306.htmlhttps://blog.csdn.net/enson16855/article/details/52205044gcc下载地址:https://ftp.gnu.org/gnu/gcc/此处我们选择gcc-10.2.0 版本进行下载。下载完成后。解压,配置,编译。tar -vxf gcc-10.2.0.tar.xz mkdir buildcd build/../config原创 2020-07-30 09:56:03 · 10010 阅读 · 9 评论 -
Qt:防止程序多开
参考链接:https://www.cnblogs.com/xupeidong/p/11152920.html代码是人家的:QLockFile *lockFile = new QLockFile("temp/appName.app.lock"); if (!lockFile ->tryLock(2000)) { //上锁失败,不能启动 qDebug() << "app is running"; }else{ qDebug() <<转载 2020-07-24 15:43:17 · 384 阅读 · 0 评论 -
Vim:记住上次文件打开位置
参考链接:https://blog.csdn.net/linhai1028/article/details/79745054Vim 版本:adams@adams-pc:~$ vim --versionVIM - Vi IMproved 8.1 (2018 May 18, compiled Apr 15 2020 06:40:31)包含补丁: 1-2269修改者 team+vim@tracker.debian.org编译者 team+vim@tracker.debian.org巨型版本 无图原创 2020-05-27 10:57:19 · 2884 阅读 · 0 评论 -
Linux:Ubuntu系统查看软件所有版本,安装指定版本软件
参考链接:https://www.cnblogs.com/EasonJim/p/7144017.html查看软件所有版本:原创 2020-05-25 23:56:05 · 6368 阅读 · 0 评论 -
Linux:安装PyIDM记录_优麒麟_20.04
参考链接:https://www.linuxidc.com/Linux/2020-02/162467.htm首先安装python3-pip:sudo apt install python3-pip原创 2020-05-25 23:08:47 · 991 阅读 · 0 评论 -
Linux:sudo命令 :在执行命令时保留用户环境
前言:在调用某些脚本时,有可能需要root权限。这就需要在执行脚本时,使用sudo命令。但很尴尬的是,脚本中需要修改当前用户的配置文件。于是导致:不使用sudo命令,无法执行脚本。使用sudo命令,修改的是/root目录下的配置文件。无法修改当前用户的配置文件。通过查看sudo 命令的帮助,解决了上述问题。使用sudo 命令时,加上参数-E[adams@tmp]$ sudo --helpsudo - 以其他用户身份执行一条命令usage: sudo -h | -K原创 2020-05-23 10:36:33 · 1218 阅读 · 0 评论 -
Linux:date命令格式
参考链接:https://www.cnblogs.com/qmfsun/p/4598650.htmldate 命令帮助:adams@adams-pc:~$ date --help用法:date [选项]... [+格式] 或:date [-u|--utc|--universal] [MMDDhhmm[[CC]YY][.ss]]Display the current time in t...原创 2020-04-08 21:36:34 · 340 阅读 · 0 评论 -
linux C :设置/读取 一行内容
c代码:#include <stdio.h>#include <string.h>#include <stdlib.h>#include <errno.h>#include <gtk/gtk.h>#define pri(fmt, ...) do { printf("["__FILE__"][%s]-%d: " ,__FUN...原创 2020-04-02 22:34:21 · 1677 阅读 · 0 评论 -
Linux:C 读取目录下文件
#include <stdio.h>#include <dirent.h>#include <string.h>typedef unsigned char BYTE;typedef unsigned int DWORD;typedef unsigned short WORD;#define pri(fmt, ...) printf("["__F...原创 2020-03-28 10:51:51 · 414 阅读 · 0 评论