Skip to content

Instantly share code, notes, and snippets.

@kevinbin
kevinbin / ndb_mgmd.sh
Created January 20, 2014 03:25
MySQL Cluster ndb_mgmd process init start script
#!/bin/bash
# chkconfig: 345 99 30
# description: ndb_mgmd start/stop script
### BEGIN INIT INFO
# Provides: ndb_mgmd start/stop
# Required-Start: $local_fs $network $remote_fs
# Required-Stop: $local_fs $network $remote_fs
# Default-Start: 3 4 5
{
"Name":"tpcc1-ali-jd",
"Failover":false,
"Orders":[],
"Type":"synchronous",
"Tasks":[
{
"Type":"Src",
"NodeId":"90f3cd4d-7997-7b1b-cd99-e2c4d05c69e1",
"Config":{
@kevinbin
kevinbin / gist:e6ff4cb43024be43b2326cfd784202d8
Created June 20, 2020 03:09
centos 7 gcc4.8 upgrade 5.0
cat <<EOF > /etc/yum.repos.d/fedora.repo
[warning:fedora]
name=fedora
mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-23&arch=$basearch
enabled=1
EOF
yum -y update gcc gcc-c++
@kevinbin
kevinbin / PostgreSQL Dashboard.json
Last active November 9, 2021 06:22
PostgreSQL Dashboard View
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": "-- Grafana --",
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
@kevinbin
kevinbin / ibd2sql.py
Last active September 4, 2022 05:11
Parsing MySQL 8.0 ibd2sdi json output
#!/usr/bin/env python3
import json
import sys
# not support list partition type
# only support default Btree index, no other index types tested
# only gb* latin1 utf8mb3 utf8mb4
char_collate = {
248:["gb18030","gb18030_chinese_ci"],249:["gb18030","gb18030_bin"],250:["gb18030","gb18030_unicode_520_ci"],24:["gb2312","gb2312_chinese_ci"],86:["gb2312","gb2312_bin"],28:["gbk","gbk_chinese_ci"],87:["gbk","gbk_bin"],
@kevinbin
kevinbin / scsi.sh
Created June 1, 2024 12:20
scsi test
#!/bin/bash
persist_tool='mpathpersist'
register() {
local key=$1
local disk=$2
echo "register:$disk "
$persist_tool -o -I -S $key -d $disk
}
unregister() {