|
|\_ app
|...
|\_ docker
| |
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
require 'redis' | |
redis_connection = Redis.new(url: "redis://localhost:6379/0") | |
redis_connection.subscribe("messages") do |on| | |
on.message do |channel, msg| | |
puts "##{channel} - [#{msg}]" | |
end | |
end |
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
单元测试框架 https://www.ruby-toolbox.com/categories/testing_frameworks | |
浏览器测试框架 https://www.ruby-toolbox.com/categories/browser_testing | |
js测试框架 https://www.ruby-toolbox.com/categories/javascript_testing | |
持续集成 https://www.ruby-toolbox.com/categories/continuous_testing |
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
scp a_file x.x.x.x:~/ | |
cat a_file | ssh x.x.x.x "cat - > a_file" | |
tar zcf - dir | ssh x.x.x.x "cat - > dir.tgz" | |
nc -l 8080 > dir.tgz | |
tar zcf - dir | nc x.x.x.x 8080 |
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
require 'socket' | |
host = 'localhost' # web服务器 | |
port = 80 # 默认 HTTP 端口 | |
path = "/data.json" # 想要获取的文件地址 | |
# 这是个 HTTP 请求 | |
request = "GET #{path} HTTP/1.0\r\n\r\n" | |
socket = TCPSocket.open(host,port) # 连接服务器 |
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
server { | |
listen 80; | |
server_name xxx; | |
location / { | |
proxy_set_header Host $host; | |
proxy_set_header X-Forwarded-Host $host; | |
proxy_set_header X-Forwarded-Server $host; | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_buffering on; |
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
vim ~/.gvm/scripts/install | |
GO_SOURCE_URL=https://github.com/golang/go |
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
set nocompatible | |
filetype on | |
syntax on | |
set re=1 | |
set ttyfast | |
set lazyredraw | |
" 设置主题 | |
colorscheme molokai |
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
查看物理cpu个数 | |
cat /proc/cpuinfo |grep "physical id"|sort |uniq|wc -l | |
查看核心数量 | |
grep 'core id' /proc/cpuinfo | sort -u | wc -l | |
cat /proc/cpuinfo | grep "cpu cores" | wc -l |
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
Exception | |
NoMemoryError | |
ScriptError | |
LoadError | |
NotImplementedError | |
SyntaxError | |
SignalException | |
Interrupt | |
StandardError | |
ArgumentError |
NewerOlder