Skip to content

Instantly share code, notes, and snippets.

View baiwfg2's full-sized avatar
😍

Lewis Chan baiwfg2

😍
View GitHub Profile
@baiwfg2
baiwfg2 / mysql-5.5.20_863a73b80b-add-rollback-seg_and-trx-undo-dicTable.diff
Last active March 17, 2024 12:14
mysql-5.5.20_863a73b80b-add-rollback-seg_and-trx-undo-dicTable
/*
从 https://github.com/bluethinking/InnoSQL/blob/master/src/innosql_5.5.20_trx_undo.patch 借鉴而来,
但经验证原repo 下的patch有些语法问题,不能直接在mysql 5.5.20 下直接应用。
改造成如下已经查看 `innodb_trx_rollback_segment` 和 `innodb_trx_undo`
对以下内容直接使用 git apply 即可。
我在ubuntu 12, gcc 4.6.3 上编译mysql 5.5.20,高版本会有很多warning as error
*/
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
@baiwfg2
baiwfg2 / setup-mongo-cluster.sh
Created June 3, 2020 11:16
A script that launches a mongo cluster quickly
#!/bin/bash
set -e
# Script used to automate mongo cluster setup locally
#
# sirchen 2019.11.10
if [ $# -lt 2 ]; then
echo "$0 <cmd> <bin root absolute dir>"
@baiwfg2
baiwfg2 / CMakeLists.txt
Created September 29, 2018 12:42
How to use add_custom_target and add_custom_command correctly in cmake
# References:
# https://cmake.org/cmake/help/latest/command/add_custom_target.html
# https://samthursfield.wordpress.com/2015/11/21/cmake-dependencies-between-targets-and-files-and-custom-commands/
# https://gist.github.com/socantre/7ee63133a0a3a08f3990
# https://stackoverflow.com/questions/24163778/how-to-add-custom-target-that-depends-on-make-install
# https://stackoverflow.com/questions/30719275/add-custom-command-is-not-generating-a-target
# https://stackoverflow.com/questions/26024235/how-to-call-a-cmake-function-from-add-custom-target-command
# https://blog.csdn.net/gubenpeiyuan/article/details/51096777
cmake_minimum_required(VERSION 3.10)
@baiwfg2
baiwfg2 / do-not-move-lvalue-reference.cc
Created March 8, 2018 11:36
identify some subtle effect on copy or move of std::move(lvalue reference) and const
#include <iostream>
#include <string>
using namespace std;
struct X {
public:
X(string s): _s(s) { cout << "x ctor\n"; }
X(X&& x): _s(std::move(x._s)) { cout << "x move ctor\n"; } //define this will implicitly delete the copy ctor
//X(const X& x): _s(x._s) { cout << "x copy ctor\n"; }
@baiwfg2
baiwfg2 / shell-manual.sh
Created July 5, 2017 06:02
shell-manual.sh
shell实例手册
0说明{
手册制作: 雪松
更新日期: 2013-12-06
欢迎系统运维加入Q群: 198173206 # 加群请回答问题
请使用"notepad++"打开此文档,"alt+0"将函数折叠后方便查阅
请勿删除信息,转载请说明出处,抵制不道德行为。
@baiwfg2
baiwfg2 / change_vtt_to_srt.cc
Created April 27, 2017 02:41
change vtt format to srt format in order to be loaded by player
#include <iostream>
#include <string>
#include <fstream>
#include <thread>
#include <regex>
#include <cstdio>
using namespace std;
int main(int argc,char* argv[])
@baiwfg2
baiwfg2 / my-doxyfile
Last active December 26, 2016 06:50
Doxyfile
# Doxyfile 1.8.11
# This file describes the settings to be used by the documentation system
# doxygen (www.doxygen.org) for a project.
#
# All text after a double hash (##) is considered a comment and is placed in
# front of the TAG it is preceding.
#
# All text after a single hash (#) is considered a comment and will be ignored.
# The format is: