Skip to content

Instantly share code, notes, and snippets.

View kemingy's full-sized avatar
☁️
🈚 🌕

Keming kemingy

☁️
🈚 🌕
View GitHub Profile
@kemingy
kemingy / generate_phrase.py
Last active March 26, 2019 05:09
Chinese phrase generator
# http://zhanghonglun.cn/blog/project/%E5%9F%BA%E4%BA%8E%E5%87%9D%E8%81%9A%E5%BA%A6%E5%92%8C%E8%87%AA%E7%94%B1%E5%BA%A6%E7%9A%84%E9%9D%9E%E7%9B%91%E7%9D%A3%E8%AF%8D%E5%BA%93%E7%94%9F%E6%88%90/
import math
from collections import Counter
import plane
class Phrase:
def __init__(self, word):
@kemingy
kemingy / [blog]Blogist.md
Last active March 27, 2019 11:02
Generate blogs from your GitHub Gist.

Hello Blogist

Blogist is a small tool to help you generate your blog from your GitHub Gist.

How to use

blogist --help
usage: blogist [-h] --name NAME [--prefix PREFIX] [--format FORMAT]
 [--dir DIR]
@kemingy
kemingy / TiDB.md
Last active April 8, 2019 11:41
note for TiDB

TiDB

How to store data

Store data

  • memory, RAID, and cluster
  • failure tolerant
  • write speed
  • easy to read

Pros

  • support GPU
  • most famous
  • 5k containers
  • fault tolerant

Cons

Ansible tutorail for Human

What is ansible?

Ansible is a tool for DevOps. It can be used to:

  • define server groups in inventory
  • control a group of servers like localhost
  • setup environments on servers
  • install, update, remove apps
# h1
## h2
### h3
#### h4
##### h5
###### h6
**bold**
__bold__
_italic_
@kemingy
kemingy / TensorFlow-Serving.md
Created July 26, 2019 03:54
Note for TF-Serving

TensorFlow Serving

Features

  • automatically get model inputs/outputs from saved model (requires tf.save)
  • both gRPC and RESTful api
  • different version of models
  • batch inference

Requires

@kemingy
kemingy / systemd.md
Created October 7, 2019 07:39
systemd systemctl

CMD

During current session

# during current session
sudo systemctl start app.service # start a systemd service
sudo systemctl start app
sudo systemctl stop app.service
@kemingy
kemingy / multiprocess_text.py
Created November 13, 2019 08:49
demo for multiprocessing text in python
from multiprocessing import Pool
from time import time, sleep
class TextProcessing:
def __init__(self, input_file, output_file):
self.reader = open(input_file, 'r', encoding='utf-8')
self.writer = open(output_file, 'w', encoding='utf-8')
self.eof = False