Skip to content

Instantly share code, notes, and snippets.

git config credential.helper store

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"
 ]
set ts=4
set softtabstop=4
set shiftwidth=4
set expandtab
set autoindent

set hlsearch
set backspace=2
set autoindent

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:

@alvendarthy
alvendarthy / how to install bpftrace on raspberry pi.md
Last active February 24, 2022 15:48
how to install bpftrace on raspberry pi
  1. install snap
sudo apt update
sudo apt install snapd
  1. reboot system
sudo reboot
  1. install snap core
@alvendarthy
alvendarthy / debug assembly with gdb.md
Last active February 23, 2022 10:28
debug assembly with gdb

compile with debug

gcc yourfile.c -o test -g

debug

  1. start gdb with -tui flag so that you can see C source file while debuging.
gdb test -tui
  1. enable assembly next line
@alvendarthy
alvendarthy / mmap_zcopy
Created February 23, 2022 09:41 — forked from laoar/mmap_zcopy
an example of kernel space to user space zero-copy via mmap, and also the comparing mmap with read/write
#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"