du -hs * | sort -h -r | head -100n
brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/master/Formula/yank.rb
du -hs * | sort -h -r | head -100n
brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/master/Formula/yank.rb
#/usr/bin/env python | |
import re | |
import sys | |
from xml.dom.minidom import parseString | |
_xml_re = re.compile('>\n\s+([^<>\s].*?)\n\s+</', re.DOTALL) | |
def pretty_xml_old(xml_str, indent=" "): | |
xml_re = _xml_re | |
# avoid re-prettifying large amounts of xml that is fine |
brew install youtube-dl ffmpeg
youtube-dl -x --audio-format mp3 --proxy socks5://127.0.0.1:1086 <yotube_url>
分布式系统的核心是分布式通信,而传统上开发一套支持上千台规模集群,可靠性非常高的分布式通信框架,需要不少的精力投入。而在多数情景下,我们(特别是时间宝贵的OP)并不是非常关注技术实现的细节,而是希望有一套成熟、轻量、可靠性高、使用方便而且易于调试的分布式通信框架,可以直接使用,从而把时间放在具体业务逻辑上。
在PyCon 2012大会上,dotcloud公司开源了一套基于ZeroMQ和MessagePack的分布式通信框架(或者说是协议+Python实现)。该框架因为基于ZeroMQ,使用方法是RPC,所以被命名为ZeroRPC。ZeroRPC的特点在其官网的介绍中一目了然[1]:
ZeroRPC is a light-weight, reliable and language-agnostic library for distributed communication between server-side processes.
http://www.typescriptlang.org/play/index.html
curl -LOk https://github.com/denoland/deno/releases/download/v0.1.2/deno_linux_x64.gz gzip -d deno_linux_x64.gz
{ | |
"keymaps": { | |
"0": { "type": "scroll.home" }, | |
":": { "type": "command.show" }, | |
"o": { "type": "command.show.open", "alter": false }, | |
"O": { "type": "command.show.open", "alter": true }, | |
"t": { "type": "command.show.tabopen", "alter": false }, | |
"T": { "type": "command.show.tabopen", "alter": true }, | |
"w": { "type": "command.show.winopen", "alter": false }, | |
"W": { "type": "command.show.winopen", "alter": true }, |
# log4j.configuration=log4j.properties Use this system property to specify the name of a Log4J configuration file. If not specified, the default configuration file is log4j.properties. | |
# log4j.rootCategory=priority [, appender]* | |
# Set the default (root) logger priority. log4j.logger.logger.name=priority Set the priority for the named logger and all loggers hierarchically lower than, or below, the named logger. logger.name corresponds to the parameter of LogFactory.getLog(logger.name), used to create the logger instance. Priorities are: DEBUG, INFO, WARN, ERROR, or FATAL. | |
#Log4J understands hierarchical names, enabling control by package or high-level qualifiers: log4j.logger.org.apache.component=DEBUG will enable debug messages for all classes in both org.apache.component and org.apache.component.sub. Likewise, setting log4j.logger.org.apache.component=DEBUG will enable debug message for all 'component' classes, but not for other Jakarta projects. | |
# log4j.appender.appender.Threshold=priority | |
log4j.rootCatego |
import org.slf4j.LoggerFactory | |
import org.slf4j.bridge.SLF4JBridgeHandler | |
import java.util.logging.Logger | |
class MyLog { | |
private Logger logger = Logger.getLogger("jul") | |
private org.slf4j.Logger log = LoggerFactory.getLogger(MyLog.class); | |
void log() { | |
SLF4JBridgeHandler.removeHandlersForRootLogger() |
import java.util.concurrent.ForkJoinPool | |
println ForkJoinPool.commonPool().getParallelism() | |
def l = Arrays.asList("A","B","C","D") | |
// def l = new LinkedList<String>(["B","A","C"]) | |
println Runtime.getRuntime().availableProcessors() | |
def l = Arrays.asList("B","A","C") | |
def r = l.stream().parallel().filter { e -> e != "B" } .findAny() | |
def s = l.stream().parallel().filter { it != "B"}.findFirst() | |
println l | |
println r.get() | |
println s.get() |