This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
####################################################### | |
# for android: | |
####################################################### | |
# https://developer.android.com/studio/command-line/variables?hl=zh-cn | |
export ANDROID_SDK_ROOT="$HOME/sdk/android" | |
# | |
export PATH=$PATH:$ANDROID_SDK_ROOT/emulator | |
export PATH=$PATH:$ANDROID_SDK_ROOT/tools |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 镜像安装被墙的包: | |
install.gopm: | |
go get -u github.com/gpmgo/gopm | |
# 镜像安装: | |
install.goland: | |
gopm get -u -v golang.org/x/tools/internal/fastwalk | |
gopm get -u -v golang.org/x/tools/internal/module | |
gopm get -u -v golang.org/x/tools/internal/gopathwalk | |
# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"log" | |
"net/http" | |
) | |
// 静态资源 web 服务器: | |
// - 适用纯静态资源的 docs 服务 | |
// - 普通文件服务器: mp3/txt 等 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from kafka import KafkaConsumer, KafkaProducer | |
SERVERS = ['localhost:9092', ] | |
def consume(): | |
c = KafkaConsumer("topic1", group_id='group1', bootstrap_servers=SERVERS) | |
for msg in c: | |
print("consume:", msg) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from kafka import KafkaConsumer, KafkaProducer | |
# pip install kafka-python | |
SERVERS = ['localhost:9092', ] | |
def produce(): | |
p = KafkaProducer(bootstrap_servers=SERVERS) |