Skip to content

Instantly share code, notes, and snippets.

View paladiy's full-sized avatar

Olexander Paladiy paladiy

  • Railsware LLC
  • Ukraine
View GitHub Profile
@paladiy
paladiy / empty.csv
Created May 31, 2020 10:36
empty.csv
We couldn’t find that file to show.
@paladiy
paladiy / gist:02c333cb214162bb1466
Last active June 23, 2018 17:59
unicredit xml to csv
require "xmlsimple"
def transactions(filename)
data = XmlSimple.xml_in(filename)
data["LIST_G_CLIENT"][0]['G_CLIENT'][0]['LIST_G_ACC_CURR'][0]['G_ACC_CURR'][0]['LIST_G_TRANS_CARD'][0]['G_TRANS_CARD'][1]['LIST_G_TRANS_DETAILS'][0]['G_TRANS_DETAILS']
end
fields = %w(TRANS_DATE_XML TRANS_AMOUNT TRANS_CURR ACC_AMOUNT TRANS_DETAILS )
puts fields.join(", ")
grep "REDIS_WRITE" loaderNG_log-*
I0828 00:27:35.443131 8712 redisworkstrategy.cpp:89] REDIS_WRITE: performing RPUSH production:load_data_61208_337870 {"duration":0,"timestamp":1377649655,"clients":0,"requests":0,"resp_1xx":0,"resp_2xx":0,"resp_3xx":0,"resp_4xx":0,"resp_5xx":0,"other_errors":0,"timeout_errors":0,"appl_delay_points":0,"appl_delay_2xx_points":0,"appl_delay":0,"appl_delay_2xx":0,"data_in":0,"data_out":0,"data_in_sum":0,"data_out_sum":0,"summary_data":false}
I0828 00:27:42.072911 8712 redisworkstrategy.cpp:89] REDIS_WRITE: performing RPUSH production:load_data_61208_337870 {"duration":7,"timestamp":1377649662,"clients":500,"requests":500,"resp_1xx":0,"resp_2xx":0,"resp_3xx":0,"resp_4xx":0,"resp_5xx":0,"other_errors":0,"timeout_errors":0,"appl_delay_points":0,"appl_delay_2xx_points":0,"appl_delay":0,"appl_delay_2xx":0,"data_in":0,"data_out":1022,"data_in_sum":0,"data_out_sum":1022,"summary_data":false}
I0828 00:27:47.075333 8712 redisworkstrategy.cpp:89] REDIS_WRITE: performing RPUSH productio
{"keys": ["k1"], "values": ["123"]}
@paladiy
paladiy / pivotal_grep.rb
Created April 13, 2012 18:17
Grep git log for delivery title and description
#!/usr/bin/env ruby
require 'optparse'
require 'ostruct'
def parse_logs(logs)
logs.map do |record|
array = record.scan(/(.+) \[#(\d+)\] (.+)/).first
next unless array
require 'rubygems'
require 'aws/s3'
require 'optparse'
require 'logger'
options = {}
OptionParser.new do|opts|
options[:access_key_id] = ''
opts.on( '-a KEY', '--access_key_id KEY', 'access key id is KEY' ) do |key|
options[:access_key_id] = key
end