Skip to main content

· One min read

Requirements

$ vim --version | grep clipboard

+clipboard +keymap +printer +vertsplit
+eval -mouse_jsbterm -sun_workshop +xterm_clipboard

if clipboard is -, then we need install vim-gtk.

for example, on ubuntu:

$ sudo apt install -y vim-gtk

Settings

vim ~/.vimrc

On macOS and Windows set:

$ set clipboard=unnamed

On Linux set (vim 7.3.74+):

$ set clipboard=unnamedplus

· One min read
  1. install NTP package
# CentOS
$ sudo yum install -y ntp

# Ubuntu
$ sudo apt install -y ntp
  1. Edit ntp.conf
$ vim /etc/ntp.conf
# Add local server
server 192.168.5.104

# Set access restrict
restrict 192.168.5.0 mask 255.255.254.0 notrap

# Set logfile
logfile /var/log/ntpservice.log
  1. Start NTP server
$ ntpd
  1. Verify NTP Server
$ ntpq -p

· 2 min read

虚拟机开启 ifconfig 没有ens33网卡,无法上网,同时 图形化模式 没有有线连接选项,重启NetworkManager没有用

connection ‘ens33‘ is not available on device ens33 because device is strictly unmanaged
  • 查看托管状态
$ nmcli
docker0: disconnected
"docker0"
bridge, 02:42:74:81:0C:62, sw, mtu 1500

ens33: unmanaged
"Intel 82545EM"
ethernet (e1000), 00:0C:29:C7:13:F3, hw, mtu 1500

lo: unmanaged
"lo"
loopback (unknown), 00:00:00:00:00:00, sw, mtu 65536

Use "nmcli device show" to get complete information about known devices and
"nmcli connection show" to get an overview on active connection profiles.

Consult nmcli(1) and nmcli-examples(7) manual pages for complete usage details.
  • 开启托管
$ nmcli n on
$  nmcli
docker0: disconnected
"docker0"
bridge, 02:42:74:81:0C:62, sw, mtu 1500

ens33: unmanaged
"Intel 82545EM"
ethernet (e1000), 00:0C:29:C7:13:F3, hw, mtu 1500

lo: unmanaged
"lo"
loopback (unknown), 00:00:00:00:00:00, sw, mtu 65536

Use "nmcli device show" to get complete information about known devices and
"nmcli connection show" to get an overview on active connection profiles.

Consult nmcli(1) and nmcli-examples(7) manual pages for complete usage details.
  • reference

Connection ‘ens33‘ is not available on device ens33 because device is strictly unmanaged_victoruu的博客-CSDN博客_device is strictly

· One min read

here is mounted directory

  1. stop docker
$ systemctl stop docker
  1. modify container's config
$ cd /var/lib/docker/container/$containerID/

$ vim config.v2.json

# modify MountPoints

$ vim hsotconfig.json

# modify Binds
  1. start docker
$ systemctl start docker
  1. start container
$ docker start $containerID

· One min read

Configure Meld as Default Git Tools

Edit Config File

  • .gitconfig
[merge]
tool = meld
[mergetool "meld"]
# Choose one of these 2 lines
cmd = meld "$LOCAL" "$MERGED" "$REMOTE" --output "$MERGED"
cmd = meld "$LOCAL" "$BASE" "$REMOTE" --output "$MERGED"

Commands for Windows and Linux

  • for Windows
$ git config --global diff.tool meld
$ git config --global difftool.meld.path "C:\Program Files (x86)\Meld\Meld.exe"
$ git config --global difftool.prompt false

$ git config --global merge.tool meld
$ git config --global mergetool.meld.path "C:\Program Files (x86)\Meld\Meld.exe"
$ git config --global mergetool.prompt false
  • For Linux
$ git config --global diff.tool meld
$ git config --global difftool.meld.path "C:\Program Files (x86)\Meld\Meld.exe"
$ git config --global difftool.prompt false

$ git config --global merge.tool meld
$ git config --global mergetool.meld.path "C:\Program Files (x86)\Meld\Meld.exe"
$ git config --global mergetool.prompt false

· One min read
define phead
set $ptr = $arg1
plistdata $arg0
end

document phead
Print the first element of a list. E.g., given the declaration
Glist *datalist;
g_list_add(datalist, "Hello");
view the list with something like
gdb> phead char datalist
gdb> pnext char
gdb> pnext char

This macro defines $ptr as the current pointed-to list struct,
and $pdata as the data in that list element.
end

define pnext
set $ptr = $ptr->next
plistdata $arg0
end

document pnext
You need to call phead first; that will set $ptr.
This macro will step forward in the list, then show the value at
that next element. Give the type of the list data as the only argument.

This macro defines $ptr as the current pointed-to list struct, and
$pdata as the data in that list element.
end

· One min read

dns forward failed

  • Error message:
28-Oct-2022 09:49:09.251 managed-keys-zone: Key 20326 for zone . is now trusted (acceptance timer complete)
28-Oct-2022 09:49:09.490 resolver priming query complete: success
28-Oct-2022 09:49:14.088 chase DS servers resolving 'bdc500.com/DS/IN': 192.168.5.104#53
28-Oct-2022 09:49:15.003 insecurity proof failed resolving 'bdc500.com/A/IN': 192.168.5.104#53
28-Oct-2022 09:50:46.782 connection refused resolving 'bdc500.com/A/IN': 192.168.5.104#53
28-Oct-2022 09:50:51.070 validating bdc500.com/A: got insecure response; parent indicates it should be secure
28-Oct-2022 09:50:51.070 insecurity proof failed resolving 'bdc500.com/A/IN': 192.168.5.104#53
  • Solution

it is because dnssec without key, the simpliest way is :

dnssec-validation no;

· One min read

Method 1

$ sudo apt-get install --download-only <package_name>

All downloaded files will be saved in /var/cache/apt/archives directory.

$ sudo dpkg -i *

Method 2

if we have installed packages already, use the apt-rdepends

$ sudo apt install apt-rdepends

apt download $(apt-rdepends vim | grep -v "^ ")

if we get errors like this

E: Can't select candidate version from package debconf-2.0 as it has no candidate

delete version specified in name like this

$ apt-get download $(apt-rdepends vim | grep -v "^ " | sed 's/debconf-2.0/debconf/g')

Then

$ sudo dpkg -i *