LinuxTips12

TurnToJPG -->


1. vagrant-libvirt

vagrant 2.2.14版中的一个包依赖BUG导致几乎所有的插件都没法装。解决方案是回归到旧版本的vagrant后安装vagrant-libvirt:

$ sudo pacman -U /var/cache/pacman/pkg/vagrant-2.2.10-2-x86_64.pkg.tar.zst
$ vagrant --version
Vagrant 2.2.10

Install vagrant-libvirt via:

$ vagrant plugin install vagrant-libvirt  --plugin-clean-sources --plugin-source  https://mirrors.tuna.tsinghua.edu.cn/rubygems/ --debug
$ vagrant plugin install vagrant-mutate  --plugin-clean-sources --plugin-source  https://mirrors.tuna.tsinghua.edu.cn/rubygems/ --debug

Examine the installed vagrant plugins:

$ vagrant plugin list
vagrant-libvirt (0.3.0, global)
vagrant-mutate (1.2.0, global)

2. Ignore PKG globally

For ignoring some package in archlinux’s pacman upgrade, do following:

$ sudo vim /etc/pacman.conf
IgnorePkg   = vagrant

Then in next pacman -Syu --noconfirm we will ignore vagrant.

3. Enable dmesg

Enable dmesg for normal user:

# sudo sysctl kernel.dmesg_restrict=0

4. docker.io启动panic

现象: systemctl restart docker报错无法启动,查看原因怀疑是containerd问题,

# journalctl -xeu containerd>kkkk.txt
# cat kkkk.txt

在输出的日志中发现invalid page type: xx: xx问题,此时直接apt-get purge掉所有和docker/containerd相关的包,而后删除/var/lib/containerd目录, 问题得以解决。

5. System Installation Time

Detect the system installation time via:

# ls -lact --full-time /etc |tail

6. disable fedora initial-setup

via:

# systemctl stop initial-setup && systemctl disable initial-setup

7. python3’s SimpleHTTPServer

via:

$ python3 -m http.server 8888

8. curl and tar xzvf

via:

curl www.xxxxx.com/kkk.tar.gz | tar xzvf

9. On install scrot

Missing libgiblib.so.1:

$ find /usr -name libgiblib.so.1 Find this file in the location
/usr/local/lib/libgiblib.so.1 
 $ cat /etc/ld.so.conf View the current library load path to see if this file is included
include ld.so.conf.d/*.conf 
 $ echo "/usr/local/lib" >> /etc/ld.so.conf Add library path 
 $ ldconfig After loading the library file, scrot is used normally. 
 $ scrot --help View scrot help 
Usage : scrot [OPTIONS]... [FILE] 
  Where FILE is the target file for the screenshot. 

10. gnome 3 add hotkey

Via adding hotkey system->settings:

/images/2021_04_12_10_35_48_538x140.jpg

11. Install awesome on centos7

via:

#
# Copy and paste the lines below to install the 64-bit EL 7.x set.
#
BOOTSTRAP_TAR="bootstrap-el7-trunk-x86_64-20200724.tar.gz"
BOOTSTRAP_SHA="478d2e30f150712a851f8f4bcff7f60026f65c9e"

# Download the bootstrap kit to the current directory.
curl -O https://pkgsrc.joyent.com/packages/Linux/el7/bootstrap/${BOOTSTRAP_TAR}

# Verify the SHA1 checksum.
echo "${BOOTSTRAP_SHA}  ${BOOTSTRAP_TAR}" >check-shasum
sha1sum -c check-shasum

# Verify PGP signature.  This step is optional, and requires gpg.
curl -O https://pkgsrc.joyent.com/packages/Linux/el7/bootstrap/${BOOTSTRAP_TAR}.asc
curl -sS https://pkgsrc.joyent.com/pgp/56AAACAF.asc | gpg2 --import
gpg2 --verify ${BOOTSTRAP_TAR}{.asc,}

# Install bootstrap kit to /usr/pkg
sudo tar -zxpf ${BOOTSTRAP_TAR} -C /

## Add paths
#$ PATH=/usr/pkg/sbin:/usr/pkg/bin:$PATH
#$ MANPATH=/usr/pkg/man:$MANPATH

Then use pkgin for installing awesome:

# pkgin -y install awesome

12. Install rdesktop/smplayer

Install rdesktop/smplayer in centos7:

sudo rpm --import http://li.nux.ro/download/nux/RPM-GPG-KEY-nux.ro 
sudo rpm -Uvh http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-1.el7.nux.noarch.rpm    
sudo yum install rdesktop

13. rsync centos 7 repo

via:

# rsync -vrt   rsync://rsync.mirrors.ustc.edu.cn/repo/centos/7/updates/x86_64/ .

14. knoppix ssh

Start sshd via:

# /etc/init.d/ssh start
# passwd root

15. rpm belongs to which repo

via :

$ repoquery -i rpmname

16. sftp with port

via:

sftp -oPort=port_number host_name