Skip to content

Instantly share code, notes, and snippets.

View qct's full-sized avatar
🐛
Making bugs

qct

🐛
Making bugs
View GitHub Profile
@ryssroad
ryssroad / sei-2.json
Created July 22, 2022 08:23
ping.pub sei2
{
"chainId": "atlantic-1",
"chainName": "sei-testnet",
"rpc": "https://sei-api.theamsolutions.info",
"rest": ["http://161.97.82.203:26457","http://158.101.209.61:12657"],
"bip44": {
"coinType": "505"
},
"coinType": "505",
"bech32Config": {
object "Contract" {
code {
datacopy(0, dataoffset("runtime"), datasize("runtime"))
return(0, datasize("runtime"))
}
object "runtime" {
code {
if iszero(calledByOwner()) { revert(0, 0) }
switch selector()
case 0x00 {
@premchalmeti
premchalmeti / .zshrc
Last active May 11, 2022 13:29
My zsh profile
# Path to your oh-my-zsh configuration.
export ZSH=$HOME/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
#export ZSH_THEME="robbyrussell"
export ZSH_THEME="gnzh"
@raftheunis87
raftheunis87 / eslint-prettier-typescript
Last active January 26, 2023 16:55
ESLint with airbnb and Prettier for Typescript
1) install dependencies:
yarn add @typescript-eslint/eslint-plugin @typescript-eslint/parser eslint eslint-config-airbnb-typescript eslint-config-prettier eslint-plugin-import eslint-plugin-jsx-a11y eslint-plugin-prettier eslint-plugin-react eslint-plugin-react-hooks prettier --dev
2) create .eslintrc.js file:
```
module.exports = {
parser: "@typescript-eslint/parser", // Specifies the ESLint parser
extends: [
@sanchezzzhak
sanchezzzhak / clickhouse-get-tables-size.sql
Created January 18, 2018 13:43
clickhouse get tables size
SELECT table,
formatReadableSize(sum(bytes)) as size,
min(min_date) as min_date,
max(max_date) as max_date
FROM system.parts
WHERE active
GROUP BY table
@tanchao90
tanchao90 / my.cnf
Last active November 30, 2019 21:36
mysql-5.7.19 customized config file
# The MySQL database server configuration file.
#
# You can copy this to one of:
# - "/etc/mysql/my.cnf" to set global options,
# - "~/.my.cnf" to set user-specific options.
#
# One can use all long options that the program supports.
# Run program with --help to get a list of available options and with
# --print-defaults to see which it would actually understand and use.
#

kafka 集群安全认证配置

本文主要介绍下 kafka 0.10.0 版如何实现sasl/plain认证机制及权限控制

kafka安全机制

kakfa 的安全机制主要分为两部分:

  • 身份认证(Authentication): 对客户端的身份进行认证
  • 权限控制(Authorization): 对topic级别的权限进行控制

kafka 身份认证

kafka 目前支持 SSL,SASL(Kerberos),SASL(PLAIN) 三种认证机制。

@lukechilds
lukechilds / get_latest_release.sh
Created August 9, 2016 19:43
Shell - Get latest release from GitHub
get_latest_release() {
curl --silent "https://api.github.com/repos/$1/releases/latest" | # Get latest release from GitHub api
grep '"tag_name":' | # Get tag line
sed -E 's/.*"([^"]+)".*/\1/' # Pluck JSON value
}
# Usage
# $ get_latest_release "creationix/nvm"
# v0.31.4
@ryerh
ryerh / tmux-cheatsheet.markdown
Last active April 18, 2024 18:06 — forked from MohamedAlaa/tmux-cheatsheet.markdown
Tmux 快捷键 & 速查表 & 简明教程

注意:本文内容适用于 Tmux 2.3 及以上的版本,但是绝大部分的特性低版本也都适用,鼠标支持、VI 模式、插件管理在低版本可能会与本文不兼容。

Tmux 快捷键 & 速查表 & 简明教程

启动新会话:

tmux [new -s 会话名 -n 窗口名]

恢复会话:

@mattes
mattes / check.go
Last active April 4, 2024 22:40
Check if file or directory exists in Golang
if _, err := os.Stat("/path/to/whatever"); os.IsNotExist(err) {
// path/to/whatever does not exist
}
if _, err := os.Stat("/path/to/whatever"); !os.IsNotExist(err) {
// path/to/whatever exists
}