Skip to content

Instantly share code, notes, and snippets.

View bfgits's full-sized avatar

Simon bfgits

  • Shenzhen
View GitHub Profile
@bfgits
bfgits / my.cnf
Created April 24, 2019 09:03
mysql5.7配置文件模板
# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/5.7/en/server-configuration-defaults.html
# 以下模板是mysql5.7参照配置,差异配置属性请参照下行关键字 #diff: ,所有配置参数统一使用"-"
[mysql]
# CLIENT #
port = 3306
socket=/var/lib/mysql/mysql.sock
default-character-set = utf8mb4
@bfgits
bfgits / editorconfig
Created January 14, 2019 02:40
EditorConfig is awesome: https://EditorConfig.org
# EditorConfig is awesome: https://EditorConfig.org
# top-most EditorConfig file
root = true
# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true
# Matches multiple files with brace expansion notation
@bfgits
bfgits / nano2vim
Created November 26, 2018 05:36
How to change visudo editor from nano to vim?
sudo update-alternatives --config editor
@bfgits
bfgits / ubuntu-aliyun-docker-mirrors
Created November 26, 2018 05:33
Ubuntu18.04安装docker-ce(阿里源)
apt-get update
apt-get -y install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL http://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | sudo apt-key add -
add-apt-repository "deb [arch=amd64] http://mirrors.aliyun.com/docker-ce/linux/ubuntu $(lsb_release -cs) stable"
apt-get -y update
apt-get -y install docker-ce
@bfgits
bfgits / kubeadm-install-offline.md
Created October 30, 2018 03:45 — forked from jgsqware/kubeadm-install-offline.md
Offline Kubeadm install

On master and nodes

Pull images form internet access laptop

docker pull gcr.io/google_containers/kube-apiserver-amd64:v1.5.0
docker pull gcr.io/google_containers/kube-controller-manager-amd64:v1.5.0
docker pull gcr.io/google_containers/kube-proxy-amd64:v1.5.0
docker pull gcr.io/google_containers/kube-scheduler-amd64:v1.5.0
docker pull weaveworks/weave-npc:1.8.2
docker pull weaveworks/weave-kube:1.8.2
@bfgits
bfgits / 导航
Last active June 22, 2018 08:49
导航
我有个导航的升级软件需要下载,看看帮我下载一下,谢谢[Tongue][Tongue][Tongue]
链接:http://pan.baidu.com/s/1kVcK4XT 密码:bkoj
以前的文件备份一下格式化卡
上面的链接先下载到电脑,不可以直接下到卡里,容易造成文件下载丢失或者不完整
下载后的三个文件夹复制到卡里
(三个文件夹共计6.72G)
操作完后要激活码拍照,这边提供给您激活即可
@bfgits
bfgits / s3-to-es-lamba.py
Created October 18, 2017 11:12 — forked from s-fujimoto/s3-to-es-lamba.py
Import Elasticsearch from ELB access log for AWS Lambda Function
##################################################
### Elasticsearch host name
ES_HOST = "search-******************.ap-northeast-1.es.amazonaws.com"
### Elasticsearch prefix for index name
INDEX_PREFIX = "awslogs"
#################################################
### ELB access log format keys
ELB_KEYS = ["timestamp", "elb", "client_ip", "client_port", "backend_ip", "backend_port", "request_processing_time", "backend_processing_time", "response_processing_time", "elb_status_code", "backend_status_code", "received_bytes", "sent_bytes", "request_method", "request_url", "request_version", "user_agent"]
@bfgits
bfgits / read_log.py
Created August 15, 2017 06:29
reading a log file continuously
#!/usr/bin/env python
#-*- coding: UTF-8 -*-
# Date: 7/26/17
# License Type: GNU GENERAL PUBLIC LICENSE, Version 3
import os, sys, time
name = "/var/log/shadowsocks.log"
current = open(name, "r")
@bfgits
bfgits / qq.txt
Created August 11, 2017 12:05
qq旋风下载
http://www.lvyoubbs.com/home.php?mod=space&uid=4&do=blog&id=6711309
@bfgits
bfgits / migrate-redis.py
Created August 4, 2017 06:39 — forked from thomasst/migrate-redis.py
Migrate Redis data on Amazon ElastiCache
"""
Copies all keys from the source Redis host to the destination Redis host.
Useful to migrate Redis instances where commands like SLAVEOF and MIGRATE are
restricted (e.g. on Amazon ElastiCache).
The script scans through the keyspace of the given database number and uses
a pipeline of DUMP and RESTORE commands to migrate the keys.
Requires Redis 2.8.0 or higher.