Skip to content

Instantly share code, notes, and snippets.


Sheng Su d4rkb1ue

Block or report user

Report or block d4rkb1ue

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:4da19a6e3a543d894a48e08ae6b41633
  • What do Etcd, Consul, and Zookeeper do?
    • Service Registration:
      • Host, port number, and sometimes authentication credentials, protocols, versions numbers, and/or environment details.
    • Service Discovery:
      • Ability for client application to query the central registry to learn of service location.
    • Consistent and durable general-purpose K/V store across distributed system.
      • Some solutions support this better than others.
      • Based on Paxos or some derivative (i.e. Raft) algorithm to quickly converge to a consistent state.
      • Centralized locking can be based on this K/V store.
d4rkb1ue /
Created Aug 21, 2018
albert translate 中文 <-> English
# -*- coding: utf-8 -*-
"""Translate text using Google Translate.
Usage: tr <src lang> <dest lang> <text>
Example: tr en fr hello
Check available languages here:"""
import json
import urllib.parse
d4rkb1ue /
Created Jul 25, 2018
Python SimpleHTTPServer: Serve specific directory and send 204 instead of 404 when file not found
# #!/usr/bin/env python2
import posixpath
import argparse
import urllib
import os
from SimpleHTTPServer import SimpleHTTPRequestHandler
from BaseHTTPServer import HTTPServer
class RootedHTTPServer(HTTPServer):
d4rkb1ue /
Last active Oct 13, 2016 — forked from VincentSit/
Usage(On Mac) `sudo -H ./`
# Author : VincentSit
# Copyright (c)
# ---Modified by d4rkb1ue
# Trouble shooting
# `sudo: ./ command not found`
# run `chmod +x`
You can’t perform that action at this time.