Skip to content

Instantly share code, notes, and snippets.

View futeng's full-sized avatar

Teng Fu futeng

View GitHub Profile
@futeng
futeng / getHostInfo.sh
Created January 26, 2021 00:57
[Get basic info from Linux OS ] Get Basic from Linux OS like OS version, cpu nums, mem, ie. #host
#!/bin/bash
# Title: Show HOST basic informations
# Author: tydic.com
# Date: 2017/05/21
# 1. 内核
#echo "Core: "`uname -a`
KERNAL=`uname -r`
# 2. 操作系统
#echo "OS: "`head -n 1 /etc/issue`
@futeng
futeng / get_all_in_pulsar.sh
Created January 14, 2021 01:21
[Get all objects list in Pulsar] Get tanents, ns, topics and topic stats in Pulsar. #pulsar #shellfor
#!/usr/bin/env bash
#
# Copyright futeng@tydic.com
# May 7, 2020
#
# 脚本:get-all.sh
# 功能:获取 Pulsar 集群所有租户、命名空间、topic 和 topics stats 信息
# 位置:Pulsar安装主目录子目录执行,或者配置 PULSAR_ADMIN 变量
# 执行:sh get-all.sh
@futeng
futeng / get_ledgers.sh
Created January 14, 2021 01:18
[Get ledgers] Get current ledgers and their topics #pulsar #shellfor
#!/usr/bin/env bash
#
# Copyright futeng@tydic.com
# May 7, 2020
#
# 脚本:get-ledgers.sh
# 功能:获取当前现存所有 ledger 及其对应的 topic 信息
# 位置:Pulsar安装主目录的子目录执行,或者配置 PULSAR_ADMIN 变量
# 执行:sh get-ledgers.sh
@futeng
futeng / download_cdh_repo.sh
Created January 14, 2021 01:15
[Download CDH and CM install packages] Using axel download CDH and CM install packages. Need manaully take an https list. #download #cdh #shellfor
#!/usr/bin/env bash
#
# Copyright futeng@tydic.com
# May 9, 2020
#
# 脚本:download-cdh-cm.sh
# 功能:从 CDH 网站使用 axel 多线程下载介质
# 位置:任意目录执行
# 执行:脚本硬编码了,需要包含一个 list 文件(都是 http 链接)。可根据实际情况稍加修改。
@futeng
futeng / basic_kafka_test.sh
Created January 14, 2021 01:02
[basic kafka status test] test kafka when doubt the status #kafka #test #status
#!/usr/bin/env bash
#
# Copyright futeng@tydic.com
# Jul 24, 2020
#
# NAME: testKafka.sh
# FUNC: 测试 Kafka 安装的正确性
# POSI: 任意目录
# EXEC: sh basic_kafka_test.sh
@futeng
futeng / basic_hive_test.sh
Last active January 14, 2021 00:46
[basic hive status test] using beeline to connect hive when doubt the status #hive #test #status
#!/usr/bin/env bash
#
# Copyright futeng@tydic.com
# Jul 24, 2020
#
# NAME: testHive.sh
# FUNC: 测试 Hive 安装的正确性
# EXEC: 任意目录 sh testHive.sh
# 配置 beeline 连接串
### 操作步骤
```shell
# 卸载 `/home` 分区
umount /home
## 已删除中间步骤
# resize2fs -p
 /dev/mapper/VolGroup-LogVol01
# 查看磁盘
df -h
```
#!/bin/bash
# name: getMySQLGroupReplicationScripts.sh
# author: ifuteng@gmail.com
# date : 2017/05/23
wget https://gist.githubusercontent.com/futeng/bd45c448564a57df14b5cceac88986eb/raw/89841b03849b45012649ff187bedeabdaf52d66c/mgr-init.sh
wget https://gist.githubusercontent.com/futeng/d8addf661006cd64fcd653a7baa68583/raw/c30bd9545a0a89176f86f1f0f22d4bad8b3f4089/create_rpl_user.sql
wget https://gist.githubusercontent.com/futeng/c41642cfadd8421ff8d0d0bba020a13b/raw/214d37ad875232de766920cec25f2e42e93d8a94/my3308.cnf
wget https://gist.githubusercontent.com/futeng/251c4d1beac3c065aebf899919882304/raw/a5c0ec95f58dc1b63d8cdb69316548ec8ce4b013/my3307.cnf
wget https://gist.githubusercontent.com/futeng/c9276efd8370b6c53e05e9e4c8c7a961/raw/1b2bcfdfcf5eef831d48aeaebf7661d84622e2c9/my3306.cnf
#!/bin/bash
# Name : mgr-start.sh
if [ -z $1 ]; then
echo "port should not be empty!"
exit 1
fi
# Init MySQL
/usr/local/mysql/bin/mysqld --defaults-file=/data/mysql/mysql_$1/my$1.cnf --initialize-insecure
[client]
port = 3306
socket = /tmp/mysql3306.sock
[mysql]
prompt = mysql [\d]>
default_character_set = utf8
no-auto-rehash
[mysqld]