This file contains 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
######################################## | |
# $ tree $HOME/local/etc/TLS | |
# . | |
# |-- CA | |
# | |-- index.txt | |
# | |-- index.txt.attr | |
# | |-- newcerts | |
# | | |-- 01.pem | |
# | | `-- 02.pem | |
# | |-- private |
This file contains 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
extern crate threadpool; | |
extern crate futures; | |
extern crate tokio_core; | |
use std::env; | |
use std::thread; | |
use std::net::SocketAddr; | |
use futures::Sink; | |
use futures::sync::mpsc::{channel, Receiver}; |
This file contains 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
extern crate libc; | |
extern crate threadpool; | |
extern crate futures; | |
extern crate tokio_core; | |
use std::env; | |
use std::net::SocketAddr; | |
// use std::sync::mpsc::{channel, Receiver}; |
This file contains 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
{ | |
"id": 29, | |
"title": "Prometheus - Demo Dashboard", | |
"tags": [ | |
"prometheus", | |
"node", | |
"misc" | |
], | |
"style": "dark", | |
"timezone": "browser", |
This file contains 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
#!/usr/bin/env python | |
# coding: utf-8 | |
import sys | |
reload(sys) | |
sys.setdefaultencoding('utf-8') | |
import os | |
import time |
This file contains 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
# Example YAML to get you started quickly. | |
# Be aware that YAML has indentation based scoping. | |
# Code completion support is available so start typing for available options. | |
swagger: '2.0' | |
# This is your document metadata | |
info: | |
version: "0.0.0" | |
title: <enter your title> |
This file contains 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
# coding: utf-8 | |
"""ANSII Color formatting for output in terminal. (termcolor-1.1.0)""" | |
import os | |
ATTRIBUTES = dict(list(zip(['bold', 'dark', '', 'underline', | |
'blink', '', 'reverse', 'concealed'], | |
list(range(1, 9))))) | |
del ATTRIBUTES[''] |
This file contains 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
# coding: utf-8 | |
import os | |
import time | |
from datetime import datetime, timedelta | |
from pytz import utc, timezone | |
from apscheduler.schedulers.background import BackgroundScheduler | |
from apscheduler.jobstores.sqlalchemy import SQLAlchemyJobStore | |
from apscheduler.executors.pool import ThreadPoolExecutor |
This file contains 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
#!/usr/bin/python | |
# borrowed from https://github.com/lbolla/dotfiles/blob/master/githooks/pre-commit | |
import os | |
import sys | |
import re | |
import subprocess | |
This file contains 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
#coding: utf-8 | |
## 支持中文断句 | |
punctuation = u'\uff02\uff03\uff04\uff05\uff06\uff07\uff08\uff09\uff0a\uff0b\uff0c\uff0d\uff0f\uff1a\uff1b\uff1c\uff1d\uff1e\uff20\uff3b\uff3c\uff3d\uff3e\uff3f\uff40\uff5b\uff5c\uff5d\uff5e\uff5f\uff60\uff62\uff63\uff64\u3000\u3001\u3003\u3008\u3009\u300a\u300b\u300c\u300d\u300e\u300f\u3010\u3011\u3014\u3015\u3016\u3017\u3018\u3019\u301a\u301b\u301c\u301d\u301e\u301f\u3030\u303e\u303f\u2013\u2014\u2018\u2019\u201b\u201c\u201d\u201e\u201f\u2026\u2027\ufe4f\ufe51\ufe54\xb7\uff01\uff1f\uff61\u3002' | |
import re | |
from lxml.html import diff | |
diff.split_words_re = re.compile(r'[^\s%(p)s]+(?:[\s%(p)s]+|$)' % dict(p=punctuation), re.U) |