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
[:0000000e] {"level":7,"msg":"HGET Profile:410308145830 Timestamps","name":"sx_redis_pool","time":"2017-06-08T11:38:22+0800"} | |
[:0000000e] {"level":7,"msg":"RPOPLPUSH rq:410308145830:inbox rq:410308145830:cu","name":"sx_redis_pool","time":"2017-06-08T11:38:22+0800"} | |
[:0000000e] {"level":7,"msg":"HGET Profile:410308145830 Daily","name":"sx_redis_pool","time":"2017-06-08T11:38:22+0800"} | |
[:0000000e] {"level":7,"msg":"ZCARD pvp:rank","name":"sx_redis_pool","time":"2017-06-08T11:38:22+0800"} | |
[:0000000e] {"level":7,"msg":"HEXISTS Hero:410308145830 64","name":"sx_redis_pool","time":"2017-06-08T11:38:22+0800"} | |
[:0000000e] {"level":7,"msg":"HEXISTS Hero:410308145830 30","name":"sx_redis_pool","time":"2017-06-08T11:38:22+0800"} | |
[:0000000e] {"level":7,"msg":"HEXISTS Hero:410308145830 65","name":"sx_redis_pool","time":"2017-06-08T11:38:22+0800"} | |
[:0000000e] {"level":7,"msg":"HEXISTS Hero:410308145830 71","name":"sx_redis_pool","time":"2017-06-08T11:38:22+0800"} | |
[:0000000e] {"level":7,"msg":"HEXISTS Hero:410308145830 1"," |
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
[:0000000e] {"level":7,"msg":"allocate 156 by creating new connection","name":"sx_redis_pool","time":"2017-05-28T17:35:45+0800"} | |
[:0000000e] {"level":7,"msg":"HGET block 628426","name":"sx_redis_pool","time":"2017-05-28T17:35:45+0800"} | |
[:0000000e] {"level":7,"msg":"cache 156","name":"sx_redis_pool","time":"2017-05-28T17:35:45+0800"} | |
[:0000000e] {"level":7,"msg":"allocate 156 from pool","name":"sx_redis_pool","time":"2017-05-28T17:35:45+0800"} | |
[:0000000e] {"level":7,"msg":"LRANGE rq:394919237477:current 0 -1","name":"sx_redis_pool","time":"2017-05-28T17:35:45+0800"} | |
[:0000000e] {"level":7,"msg":"RPOPLPUSH rq:394919237477:inbox rq:394919237477:cu","name":"sx_redis_pool","time":"2017-05-28T17:35:45+0800"} | |
[:0000000e] {"level":7,"msg":"RPOPLPUSH rq:394919237477:inbox rq:394919237477:cu","name":"sx_redis_pool","time":"2017-05-28T17:35:45+0800"} | |
[:0000000e] {"level":7,"msg":"RPOPLPUSH rq:394919237477:inbox rq:394919237477:cu","name":"sx_redis_pool","time":"2017-05-28T17:35:45+0800"} | |
[:0000000e] {"level":7,"msg":"HG |
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
[:000000c1] {"name":"agent","level":6,"time":"2017-05-27T16:20:55+0800","msg":"Agent started 511","profile_id":"394919237477","user_id":"628426"} | |
[:000000c1] {"module":"auth","profile_register_date":17311,"func":"login","user_id":"628426","level":6,"time":"2017-05-27T16:20:55+0800","name":"agent","request_status":"OK","profile_nickname":"","profile_last_login_date":17313,"profile_id":"394919237477","profile_server_id":1} | |
[:000000c1] {"module":"account","profile_id":"394919237477","request_duration":0.01,"user_id":"628426","name":"agent","request_status":"OK","time":"2017-05-27T16:20:55+0800","level":6,"args":"{\n data_version = 6461\n}","msg":"request OK"} | |
[:000000c1] {"module":"system","profile_id":"394919237477","request_duration":0.02,"user_id":"628426","name":"agent","request_status":"OK","time":"2017-05-27T16:20:55+0800","level":6,"args":"nil","msg":"request OK"} | |
[:000000c1] {"module":"bags_list","profile_id":"394919237477","request_duration":0,"user_id":"628426","name":"agent","request_status":"OK","ti |
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
# | |
# Sample /etc/sudoers file. | |
# | |
# This file MUST be edited with the 'visudo' command as root. | |
# | |
# See the sudoers man page for the details on how to write a sudoers file. | |
## | |
# Override built-in defaults | |
## |
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
local tconcat = table.concat | |
local tinsert = table.insert | |
local tunpack = table.unpack | |
local INCR = "INCR" | |
local EXISTS = "EXISTS" | |
local DEL = "DEL" | |
local HGETALL = "HGETALL" | |
local HMSET = "HMSET" | |
local HDEL = "HDEL" |
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
14:14:44 lidashuang@3pj code redis-cli -n 1 --bigkeys | |
# Scanning the entire keyspace to find biggest keys as well as | |
# average sizes per key type. You can use -i 0.1 to sleep 0.1 sec | |
# per 100 SCAN commands (not usually needed). | |
[00.00%] Biggest hash found so far 'WarLocation:387206263099' with 2 fields | |
[00.00%] Biggest hash found so far 'Battle:386842949107_101' with 5 fields | |
[00.00%] Biggest hash found so far 'Building:391058870427' with 16 fields |
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 'csv' | |
headers = [:pid, :total_price, :nickname, :last_online_at, :created_at] | |
orders = {} | |
Order.where(app_id: 2, status: Order.statuses['shipped']).find_each(batch_size: 2000) do |o| | |
profile = o.game_profile | |
pid = o.game_profile_internal_key | |
puts pid |
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 'csv' | |
headers = [:id, :user_id, :game_profile_internal_key, | |
:total_price, :provider, :game_server_id, :nickname, :created_at] | |
CSV.open('data.csv', 'w', write_headers: true, headers: headers) do |csv| | |
Order.where(status: Order.statuses['shipped']).find_each(batch_size: 2000) do |o| | |
puts o.id | |
csv << [o.id, o.user_id, o.game_profile_internal_key, o.total_price, o.provider, o.game_server_id, o.game_profile.try(:nickname), o.created_at] |
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
#!/bin/bash | |
host="[email protected] -p 9876" | |
mac_mini="[email protected]" | |
case "$1" in | |
ssh) | |
ssh $host;; | |
code) | |
ssh -A $host -C "cd /vagrant; git pull origin master";; |
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
local skynet = require "skynet" | |
local redis = require "redis" | |
local parse_redis_url = require "redis_url".parse | |
local sort = table.sort | |
local unpack = table.unpack | |
local conf | |
local pool = {} | |
local named = {} |