Skip to content

Instantly share code, notes, and snippets.

@xiangchu0
xiangchu0 / Makefile
Created April 12, 2017 09:35 — forked from llj098/Makefile
a sample tcp server runs in kernel
obj-m += tcp_svr_sample.o
all:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
clean:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clea
@xiangchu0
xiangchu0 / .Xresources
Last active August 1, 2017 05:50 — forked from Liblor/.Xresources
My .Xresources file. Color Scheme: Dark Tango
!xrdb ~/.Xresources
xterm.locale:true
xterm.utf8: true
xterm*utf8Title:true
xterm*fontMenu*fontdefault*Label:Default
xterm*faceName:xos4 Terminus Regular:antialias=true:pixelsize=12
xterm*faceNameDoublesize:WenQuanYi Micro Hei Mono:pixelsize=12:antialias=true
@xiangchu0
xiangchu0 / xrandr.sh
Created July 28, 2017 05:47 — forked from debloper/xrandr.sh
Add system unrecognized but monitor supported resolution in X
#!/bin/bash
# First we need to get the modeline string for xrandr
# Luckily, the tool `gtf` will help you calculate it.
# All you have to do is to pass the resolution & the-
# refresh-rate as the command parameters:
gtf 1920 1080 60
# In this case, the horizontal resolution is 1920px the
# vertical resolution is 1080px & refresh-rate is 60Hz.
@xiangchu0
xiangchu0 / ignoring_query_to_other_database.txt
Last active August 10, 2017 11:49
ignoring query to other database
Ok, It seems, I had missed the "u" flag for user so accidentally I had input the following command.
mysql -root -p // Faulty connection
Instead of ...
mysql -uroot -p // Correct connection
@xiangchu0
xiangchu0 / pxc-5.7.18-29 install notes
Last active August 16, 2017 03:42
pxc-5.7.18-29 install notes
GRANT ALL PRIVILEGES ON *.* TO root@'%' IDENTIFIED BY 'Cde!@#123'; FLUSH PRIVILEGES;
GRANT ALL PRIVILEGES ON *.* TO sstuser@'%' IDENTIFIED BY 'Cde!@#123'; FLUSH PRIVILEGES;
GRANT ALL PRIVILEGES ON *.* TO sstuser@'localhost' IDENTIFIED BY 'Cde!@#123'; FLUSH PRIVILEGES;
yum -y install libtool ncurses-devel libgcrypt-devel libev-devel \
git scons gcc gcc-c++ openssl check cmake \
asio-devel libaio-devel ncurses-devel readline-devel pam-devel socat \
libaio automake autoconf libtool check-devel curl curl-devel xinetd
@xiangchu0
xiangchu0 / linux-basic-tuning
Last active September 18, 2017 12:50
linux-basic-tuning
# /etc/sysctl.conf
fs.file-max = 200000
vm.swappiness = 10
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_max = 33554432
net.core.wmem_max = 33554432
net.core.rmem_default = 33554432
net.core.wmem_default = 33554432
@xiangchu0
xiangchu0 / mysql-innodb-basic-tuning
Created August 12, 2017 06:08
mysql-innodb-basic-tuning
back_log=1024
connect_timeout=15
skip_name_resolve = on
max_connections = 50000
table_definition_cache = 2000
table_open_cache = 10000
innodb_purge_threads = 4
innodb_read_io_threads = 8
innodb_write_io_threads = 8
@xiangchu0
xiangchu0 / pxc onenode install for debug
Created August 12, 2017 08:54
pxc onenode install for debug
[client]
socket=/go/pxc/data1/mysql.sock
user=root
password=Cde!@#123
[mysqld]
user=mysql
datadir=/go/pxc/data1
socket=/go/pxc/data1/mysql.sock
pid-file=/go/pxc/data1/mysql-node1.pid
port=3316
@xiangchu0
xiangchu0 / mysql-5.7-tuning-parameters
Last active March 8, 2020 13:16
mysql-5.7-tuning-parameters
intel_idle.max_cstate=0 idle=poll quiet cgroup_enable=memory crashkernel=256M intel_pstate=disable
[mysql]
default-character-set=utf8mb4
user = root
password = 123456
port = 3306
socket = /tmp/mysqld.sock
prompt="\u@\h \d>"
@xiangchu0
xiangchu0 / dpdk_16.11.2_lts_install_notes.org
Last active July 10, 2019 06:43
DPDK 16.11.2 (LTS) install notes

dependency develop package

  • CentOS
    yum install -y make gcc gcc-c++ make \
     autoconf automake libtool cmake \
     python python-six libpcap-devel \
     libcap-devel libcap-ng-devel openssl-devel \
     pciutils numactl-devel kernel-devel