This file contains hidden or 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' | |
sock = UDPSocket.new() | |
sock.bind('', 8125) | |
p sock | |
while true do | |
p sock.recvfrom(2000) | |
end | |
sock.close |
This file contains hidden or 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 'openssl' | |
require 'base64' | |
# calibrate numbers to get 1s or 10s in solo | |
N = 48 | |
DATA_SIZE = 600_000 | |
workers_N = 2 | |
# prepare static data set | |
DATA_ARR = N.times.map do |n| |
This file contains hidden or 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
# Debian 10 | |
aws ec2 describe-images \ | |
--region us-east-1 \ | |
--owners 136693071363 \ | |
--filters 'Name=name,Values=debian-10-amd64-*' \ | |
--query 'sort_by(Images, &CreationDate)[-1].[ImageId,Name,CreationDate]' \ | |
--output text | |
## |
This file contains hidden or 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
# Usage: redis-cli publish message hello | |
require 'sinatra' | |
require 'redis' | |
conns = [] | |
get '/' do | |
erb :index | |
end |