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
select | |
concat( | |
BIT_AND(1054420290, 255) | |
, concat('.' | |
, concat(BIT_AND(floor(BIT_OR(1054420290, 255) / 256), 255) | |
, concat('.' | |
, BIT_AND(floor(BIT_OR(1054420290, 65535) / 65536), 255) | |
, concat('.' | |
, BIT_AND(floor(BIT_OR(1054420290, 16777215) / 16777216), 255) | |
))))) |
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
(for i in `find ./ -type f`; do export version=`head -c 100 $i | strings | awk '/^4\.[0-9]+/'`; echo "$i:$version"; done;) > /tmp/cache_versions.txt |
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
%% get config at runtime | |
rpc:call(node(), application, get_all_env, [bitcask]). | |
%% set config at runtime for a node | |
rpc:call(node(), application, set_env, [bitcask, merge_window, always]). | |
%% get config for all nodes in a cluster | |
rpc:multicall(application, get_all_env, [bitcask]). | |
%% set config for all nodes in a cluster | |
rpc:multicall(application, set_env, [bitcask, merge_window, always]). |
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' | |
require 'timeout' | |
while true | |
Dir.glob('/home/ubuntu/applications/xx/shared/sockets/*.sock').each do |socket| | |
instance = $1 if socket =~ /([^\/]+)\.sock$/ | |
s = nil | |
begin | |
Timeout.timeout(0.5) do |
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
AWS.config({ | |
:access_key_id => 'xxxxx', | |
:secret_access_key => 'xxxxx', | |
}) | |
bucket_name = 'xxxxx' | |
s3 = AWS::S3.new() | |
bucket = s3.buckets[bucket_name] |
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
p `cat /proc/#{Process.pid}/status | grep VmRSS` | |
"VmRSS:\t 30256 kB\n" | |
100_000.times {String.public_instance_methods} | |
GC.start | |
p `cat /proc/#{Process.pid}/status | grep VmRSS` | |
"VmRSS:\t 625820 kB\n" |
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
ruby redis_keys.rb zipmap | |
redis-cli info | grep used_memory_human | |
used_memory_human:18.54M | |
ruby redis_keys.rb hash | |
redis-cli info | grep used_memory_human | |
used_memory_human:69.92M | |
ruby redis_keys.rb plain | |
redis-cli info | grep used_memory_human |