gcc yourfile.c -o test -g
- start gdb with
-tui
flag so that you can see C source file while debuging.
gdb test -tui
- enable assembly next line
#include <linux/module.h> | |
#include <linux/kernel.h> | |
#include <linux/device.h> | |
#include <linux/init.h> | |
#include <linux/fs.h> | |
#include <linux/mm.h> | |
#include <asm/uaccess.h> | |
#define MAX_SIZE (PAGE_SIZE * 2) /* max size mmaped to userspace */ | |
#define DEVICE_NAME "mchar" |
sudo apt update
sudo apt install snapd
sudo reboot
vim ~/.pip/pip.conf, make sure the ~/.pip directory exists. fill pip.conf with:
[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
[install]
trusted-host = https://pypi.tuna.tsinghua.edu.cn
you can replace the tsinghua mirror with any of:
curl -fsSL https://get.docker.com -o get-docker.sh bash get-docker.sh
set ts=4
set softtabstop=4
set shiftwidth=4
set expandtab
set autoindent
set hlsearch
set backspace=2
set autoindent
vim /etc/docker/daemon.json
{
"registry-mirrors": [
"https://ung2thfc.mirror.aliyuncs.com",
"https://registry.docker-cn.com",
"http://hub-mirror.c.163.com",
"https://docker.mirrors.ustc.edu.cn"
]
git config credential.helper store
nohup /Applications/WeChat.app/Contents/MacOS/WeChat > /dev/null 2>&1 &
# copy as many lines as instances you want to open.
nohup /Applications/WeChat.app/Contents/MacOS/WeChat > /dev/null 2>&1 &
# define our own classmethod decorator
class myClassMethod():
# init a Decorator obj, see the Decorator protocol here: https://docs.python.org/3/glossary.html#term-descriptor
def __init__(self,func):
self._func = func
# Decorator obj as an attibute, this method handlers the getattr call.
def __get__(self, obj, obj_type = None):
# warp the original function