Skip to content

Instantly share code, notes, and snippets.

@SolemnJoker
SolemnJoker / 0-project.md
Last active November 7, 2020 06:43
[c++ 使用mysql]#mysql #c++

如何添加到工程


一、下载mysql connect c 6.0

最新版本整合进大安装包了,6.0以下有单独的client dev mysql connect c 6.0 或者直接apt 安装

sudo apt install libmysqlclient-dev
@SolemnJoker
SolemnJoker / mermaid-时序图.md
Last active June 8, 2021 02:27
[vim tips]#vim

(1) 参与者

传统时序图概念中参与者有角色和类对象之分,但这里我们不做此区分,用参与者表示一切参与交互的事物,可以是人、类对象、系统等形式。中间竖直的线段从上至下表示时间的流逝。

画法:

sequenceDiagram
@SolemnJoker
SolemnJoker / mac_addr.sh
Last active November 7, 2020 06:48
[shell 记录 ] #bash #shell
mac_addr=`ifconfig |grep ether |head -n 1 | grep -o "[a-f0-9A-F]\\([a-f0-9A-F]\\:[a-f0-9A-F]\\)\\{5\\}[a-f0-9A-F]"`
$MAC_ADDR=$mac_addr|sed -e 's/[\:]//g' |tr '[a-z]' '[A-Z]
@SolemnJoker
SolemnJoker / 6_privileges.sql
Last active November 17, 2020 02:46
[mysql privileges] #mysql
use mysql;
select host, user from user;
grant all on uic.* to root@'%' identified by '123456' with grant option;
grant all on falcon_portal.* to root@'%' identified by '123456' with grant option;
grant all on dashboard.* to root@'%' identified by '123456' with grant option;
grant all on graph.* to root@'%' identified by '123456' with grant option;
grant all on alarms.* to root@'%' identified by '123456' with grant option;
flush privileges;

例:

docker inspect -f {{.LogPath}} container_name;

@SolemnJoker
SolemnJoker / alpine-localtime
Last active November 7, 2020 06:48
[dockerfile] #dockerfile #docker
Run sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories && apk update &&\
apk add tzdata && cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
&& echo "Asia/Shanghai" > /etc/timezone \
&& apk del tzdata
@SolemnJoker
SolemnJoker / Makefile
Last active November 7, 2020 06:49
[makefile 记录] #makefile
CC := g++
C_FLAGS := -std=c++14 -Wall -Wextra
BIN := .
SRC := .
INCLUDE := include
LIB := lib
LIBRARIES :=
@SolemnJoker
SolemnJoker / list_dir.py
Last active May 11, 2021 09:07
[python unit] #python
import os
rootdir = "./input_files"
paths = os.listdir(rootdir)
for path in paths:
path = os.path.join(rootdir,path)
if os.path.isfile(path):
#...
@SolemnJoker
SolemnJoker / rbtree.c
Last active November 7, 2020 06:52
[rbtree] c++红黑树 #c++ #算法
#include <stdio.h>
#include <stdlib.h>
#include "rbtree.h"
#define rb_parent(r) ((r)->parent)
#define rb_color(r) ((r)->color)
#define rb_is_red(r) ((r)->color==RED)
#define rb_is_black(r) ((r)->color==BLACK)
@SolemnJoker
SolemnJoker / add_boost.txt
Last active November 7, 2020 06:50
[cmake] #CMakelist #cmake
find_package(Boost REQUIRED COMPONENTS regex filesystem) #要使用的boost库
if(NOT Boost_FOUND)
message("Not found Boost")
endif()
include_directories(${Boost_INCLUDE_DIRS})