Skip to main content

· One min read

1. coredump limits

  • for this login time
ulimits -c unlimited
  • for the permanent time
vim /etc/security/limits.conf

* soft core unlimited
* hard core unlimited

2. coredump file path

sudo sysctl -w kernel.core_pattern="|/tmp/core_dump_example.py %e"

man core for the details about % part like %e in coredump file name

3. generating coredump

kill -SIGSEGV ${PID}

· One min read
  • use --cap-add=SYS_PTRACE flag when running the container
docker run --cap-add=SYS_PTRACE ...
  • add it to a docker-compose file
version: '3'
services:
your-service:
image: your-image
cap_add:
- SYS_PTRACE

· One min read

yum error message:

[root@31f24739f206 /]# yum File "/usr/bin/yum", line 30 except KeyboardInterrupt, e: ^ SyntaxError: invalid syntax

  • change default python from python3 to python2
alternatives --install /usr/bin/python python /usr/bin/python2 0

· One min read

Enable Non-Root User Access

  1. Enter the command below to create the docker group on the system.
sudo groupadd -f docker
  1. Type the following usermod command to add the active user to the docker group.
sudo usermod -aG docker $USER
  1. Apply the group changes to the current terminal session by typing:
newgrp docker
  1. Check if the docker group is in the list of user groups.
groups

· 2 min read

config

#
# See slapd.conf(5) for details on configuration options.
# This file should NOT be world readable.
#

...

# #开启同步
# overlay syncprov
# #contextCSN 当修改20条时 或者10分钟
# syncprov-checkpoint 20 10
# #session 每次同步数据最大量
# syncprov-sessionlog 1000

slave logs

Feb 17 10:08:20 host-10-213-115-95 bdl[pid=3007515,tid=0xeef7da40]: do_syncrep1: rid=000 starting refresh (sending cookie=rid=000,csn=20230216083743.943082Z#000000#002#000000) Feb 17 10:08:20 host-10-213-115-95 bdl[pid=3007515,tid=0xeef7da40]: do_syncrep2: rid=000 got search entry without Sync State control (dc=sinopec,dc=com) Feb 17 10:08:20 host-10-213-115-95 bdl[pid=3007515,tid=0xeef7da40]: do_syncrepl: rid=000 rc -1 retrying (9 retries left) Feb 17 10:09:20 host-10-213-115-95 bdl[pid=3007515,tid=0xeef7da40]: do_syncrep1: rid=000 starting refresh (sending cookie=rid=000,csn=20230216083743.943082Z#000000#002#000000) Feb 17 10:09:20 host-10-213-115-95 bdl[pid=3007515,tid=0xeef7da40]: do_syncrep2: rid=000 got search entry without Sync State control (dc=sinopec,dc=com) Feb 17 10:09:20 host-10-213-115-95 bdl[pid=3007515,tid=0xeef7da40]: do_syncrepl: rid=000 rc -1 retrying (8 retries left) Feb 17 10:10:20 host-10-213-115-95 bdl[pid=3007515,tid=0xeef7da40]: do_syncrep1: rid=000 starting refresh (sending cookie=rid=000,csn=20230216083743.943082Z#000000#002#000000) Feb 17 10:10:20 host-10-213-115-95 bdl[pid=3007515,tid=0xeef7da40]: do_syncrep2: rid=000 got search entry without Sync State control (dc=sinopec,dc=com) Feb 17 10:10:20 host-10-213-115-95 bdl[pid=3007515,tid=0xeef7da40]: do_syncrepl: rid=000 rc -1 retrying (7 retries left) Feb 17 10:11:20 host-10-213-115-95 bdl[pid=3007515,tid=0xeef7da40]: do_syncrep1: rid=000 starting refresh (sending cookie=rid=000,csn=20230216083743.943082Z#000000#002#000000) Feb 17 10:11:20 host-10-213-115-95 bdl[pid=3007515,tid=0xeef7da40]: do_syncrep2: rid=000 got search entry without Sync State control (dc=sinopec,dc=com) Feb 17 10:11:20 host-10-213-115-95 bdl[pid=3007515,tid=0xeef7da40]: do_syncrepl: rid=000 rc -1 retrying (6 retries left) Feb 17 10:12:20 host-10-213-115-95 bdl[pid=3007515,tid=0xeef7da40]: do_syncrep1: rid=000 starting refresh (sending cookie=rid=000,csn=20230216083743.943082Z#000000#002#000000) Feb 17 10:12:20 host-10-213-115-95 bdl[pid=3007515,tid=0xeef7da40]: do_syncrep2: rid=000 got search entry without Sync State control (dc=sinopec,dc=com) Feb 17 10:12:20 host-10-213-115-95 bdl[pid=3007515,tid=0xeef7da40]: do_syncrepl: rid=000 rc -1 retrying (5 retries left)

Solutions

uncomment overlay syncprov on master

#开启同步
overlay syncprov
#contextCSN 当修改20条时 或者10分钟
syncprov-checkpoint 20 10
#session 每次同步数据最大量
syncprov-sessionlog 1000

· One min read
#define SYSCALL_DEFINE(name) static inline long SYSC_##name
#define SYSCALL_DEFINE0(name) asmlinkage long sys_##name(void)
#define SYSCALL_DEFINE1(name, ...) SYSCALL_DEFINEx(1, _##name, __VA_ARGS__)
#define SYSCALL_DEFINE2(name, ...) SYSCALL_DEFINEx(2, _##name, __VA_ARGS__)
#define SYSCALL_DEFINE3(name, ...) SYSCALL_DEFINEx(3, _##name, __VA_ARGS__)
#define SYSCALL_DEFINE4(name, ...) SYSCALL_DEFINEx(4, _##name, __VA_ARGS__)
#define SYSCALL_DEFINE5(name, ...) SYSCALL_DEFINEx(5, _##name, __VA_ARGS__)
#define SYSCALL_DEFINE6(name, ...) SYSCALL_DEFINEx(6, _##name, __VA_ARGS__)


/*
* Example
*/

/**
* sys_sched_setparam - set/change the RT priority of a thread
* @pid: the pid in question.
* @param: structure containing the new RT priority.
*/
SYSCALL_DEFINE2(sched_setparam, pid_t, pid, struct sched_param __user *, param)
{
return do_sched_setscheduler(pid, -1, param);
}

#define SYSCALL_DEFINE(name) static inline long SYSC_##name
#define SYSCALL_DEFINE0(name) asmlinkage long sys_##name(void)
#define SYSCALL_DEFINE1(name, ...) SYSCALL_DEFINEx(1, _##name, __VA_ARGS__)
#define SYSCALL_DEFINE2(name, ...) SYSCALL_DEFINEx(2, _##name, __VA_ARGS__)
#define SYSCALL_DEFINE3(name, ...) SYSCALL_DEFINEx(3, _##name, __VA_ARGS__)
#define SYSCALL_DEFINE4(name, ...) SYSCALL_DEFINEx(4, _##name, __VA_ARGS__)
#define SYSCALL_DEFINE5(name, ...) SYSCALL_DEFINEx(5, _##name, __VA_ARGS__)
#define SYSCALL_DEFINE6(name, ...) SYSCALL_DEFINEx(6, _##name, __VA_ARGS__)


/*
* Example
*/

/**
* sys_sched_setparam - set/change the RT priority of a thread
* @pid: the pid in question.
* @param: structure containing the new RT priority.
*/
SYSCALL_DEFINE2(sched_setparam, pid_t, pid, struct sched_param __user *, param)
{
return do_sched_setscheduler(pid, -1, param);
}

· 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