start new:
tmux
start new with session name:
tmux new -s myname
// | |
// Regular Expression for URL validation | |
// | |
// Author: Diego Perini | |
// Created: 2010/12/05 | |
// Updated: 2018/09/12 | |
// License: MIT | |
// | |
// Copyright (c) 2010-2018 Diego Perini (http://www.iport.it) | |
// |
(require 'font-lock) | |
(defvar thrift-mode-hook nil) | |
(add-to-list 'auto-mode-alist '("\\.thrift\\'" . thrift-mode)) | |
(defvar thrift-indent-level 2 | |
"Defines 2 spaces for thrift indentation.") | |
;; syntax coloring |
############################################################################ | |
# _ | |
# | |_ _ __ ___ _ ___ __ | |
# | __| '_ ` _ \| | | \ \/ / | |
# | |_| | | | | | |_| |> < | |
# \__|_| |_| |_|\__,_/_/\_\ | |
# | |
# Cheatsheets: | |
# https://devhints.io/tmux | |
# `property not found` issue: |
sudo aptitude -y install nginx | |
cd /etc/nginx/sites-available | |
sudo rm default | |
sudo cat > jenkins | |
upstream app_server { | |
server 127.0.0.1:8080 fail_timeout=0; | |
} | |
server { | |
listen 80; |
# Documentation for HAProxy | |
# http://code.google.com/p/haproxy-docs/w/list | |
# http://haproxy.1wt.eu/download/1.2/doc/architecture.txt | |
# NOTES: | |
# open files limits need to be > 256000, use ulimit -n to set (on most POSIX systems) | |
global | |
log 127.0.0.1 local0 | |
log 127.0.0.1 local1 notice |
(ns clj-gunzip.core | |
(:require [clojure.java.io :as io]) | |
(:require [clojure.string :as str]) | |
(:import java.util.zip.GZIPInputStream | |
java.util.zip.GZIPOutputStream)) | |
(defn gunzip | |
"Writes the contents of input to output, decompressed. | |
input: something which can be opened by io/input-stream. |
Latency Comparison Numbers (~2012) | |
---------------------------------- | |
L1 cache reference 0.5 ns | |
Branch mispredict 5 ns | |
L2 cache reference 7 ns 14x L1 cache | |
Mutex lock/unlock 25 ns | |
Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
Compress 1K bytes with Zippy 3,000 ns 3 us | |
Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |
public class StreamUtil<T>{ | |
public static <T> Stream<T> ofIterable(Iterable<T> iter){ | |
Iterator<T> iterator = iter.iterator(); | |
Stream.Builder<T> builder = Stream.builder(); | |
while(iterator.hasNext()){ | |
builder.add(iterator.next()); | |
} |