Skip to content

Instantly share code, notes, and snippets.

View xgz123's full-sized avatar
🎯
Focusing

xgz123 xgz123

🎯
Focusing
View GitHub Profile
@xgz123
xgz123 / README.md
Created August 19, 2018 12:23 — forked from tombigel/README.md
How to Change Open Files Limit on OS X and macOS Sierra (10.8 - 10.12)

How to Change Open Files Limit on OS X and macOS

This text is the section about OS X Yosemite (which also works for macOS Sierra) from https://docs.basho.com/riak/kv/2.1.4/using/performance/open-files-limit/#mac-os-x

The last time i visited this link it was dead (403), so I cloned it here from the latest snapshot in Archive.org's Wayback Machine https://web.archive.org/web/20170523131633/https://docs.basho.com/riak/kv/2.1.4/using/performance/open-files-limit/

Mac OS X

To check the current limits on your Mac OS X system, run:

function dc_trace_cmd() {
local parent=`docker inspect -f '{{ .Parent }}' $1` 2>/dev/null
declare -i level=$2
echo ${level}: `docker inspect -f '{{ .ContainerConfig.Cmd }}' $1 2>/dev/null`
level=level+1
if [ "${parent}" != "" ]; then
echo ${level}: $parent
dc_trace_cmd $parent $level
fi
}
const ips = require('os').networkInterfaces()
const result = []
Object.keys(ips).forEach(function (ifname) {
ips[ifname].forEach(function (iface) {
if ('IPv4' !== iface.family || iface.internal !== false) {
// skip over internal (i.e. 127.0.0.1) and non-ipv4 addresses
return;
}
-- mysql 5.7.21 Homebrew
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
@xgz123
xgz123 / client.go
Created May 30, 2018 10:25 — forked from jordanorelli/client.go
rpc server example in go
package main
import (
"bufio"
"log"
"net/rpc"
"os"
)
func main() {
Hex Opacity Values
100% — FF
95% — F2
90% — E6
85% — D9
80% — CC
75% — BF
70% — B3
65% — A6
#maches http/https/www
r"(https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s\<]{2,}|www\.[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s\<]{2,}|https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9]\.[^\s\<]{2,}|www\.[a-zA-Z0-9]\.[^\s\<]{2,})"
// Copyright 2004 Erik Arvidsson. All Rights Reserved.
//
// This code is triple licensed using Apache Software License 2.0,
// Mozilla Public License or GNU Public License
//
///////////////////////////////////////////////////////////////////////////////
//
// Licensed under the Apache License, Version 2.0 (the "License"); you may not
// use this file except in compliance with the License. You may obtain a copy
// of the License at http://www.apache.org/licenses/LICENSE-2.0
@xgz123
xgz123 / vimrc
Last active April 21, 2017 11:28
execute pathogen#infect()
syntax on
filetype plugin indent on
set ruler
set laststatus=2
set number
set tabstop=2
set shiftwidth=0
@xgz123
xgz123 / regexp.js
Created March 7, 2017 02:21
收集
// hello,