Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- сколько игп за месяц по вебманям: IgpTransaction.sum :sum, :conditions => {:state => 'success', :created_at => Time.mktime(2009,3,1)..Time.mktime(2009,3,1).end_of_month.end_of_day}
- сколько рублей за месяц по смс: SmsPay.sum :cost, :conditions => {:status => 1, :created_at => Time.mktime(2009,3,1)..Time.mktime(2009,3,1).end_of_month.end_of_day}
- начисление кредитов за купленный бездеп:
- Purchase.find(:all, :conditions => {:item_version_id => 119}).each do |v|
- po = PokerroomName.find(:first, :conditions => {:pokerroom_id => 19, :name => v.pokerroom_username})
- po.increment!(:credit, 3000) if po
- end
- статистика по игп в покеррумах:
- GrabberTransaction.sum(:igp, :group => :pokerroom_id, :conditions => {:check_time => Time.mktime(2009,3,1)..Time.mktime(2009,3).end_of_month.end_of_day, :status => 1})
- купленных игп:
- PayedContent.sum :sum, :conditions => {:created_at => Time.mktime(2009,3,1)..Time.mktime(2009,3).end_of_month.end_of_day}
- файл в base64:
- ruby -e 'print [IO.read(File.join(Dir.pwd, ARGV[0]))].pack("m")' 054327277260.kwm
- Сумма покупок в магазине:
- Purchase.sum("item_version.price", :conditions => {:created_at => Time.mktime(2009,3,1)..Time.mktime(2009,3).end_of_month.end_of_day}, :include => :item_version)
- Отчет по месяцам по всякому:
- str = ""
- [['Декабрь', 2008, 12], ['Январь', 2009, 1], ['Февраль', 2009, 2], ['Март', 2009, 3]].each do |v|
- title, year, month = v
- str << "\n\nЗа #{title}\n"
- sms = (SmsPay.sum(:cost, :conditions => {:status => 1, :created_at => Time.mktime(year,month,1)..Time.mktime(year,month,1).end_of_month.end_of_day}).to_f / CurrencyRate::rate(:wmr)).round(2)
- str << "Куплено игп по смс: #{sms}\n"
- wm = IgpTransaction.sum(:sum, :conditions => {:state => 'success', :created_at => Time.mktime(year,month,1)..Time.mktime(year,month,1).end_of_month.end_of_day}).round(2)
- str << "Куплено игп за вебмани: #{wm}\n"
- grabbers = GrabberTransaction.sum(:igp, :conditions => {:check_time => Time.mktime(year,month,1)..Time.mktime(year,month).end_of_month.end_of_day, :status => 1}).round(2)
- str << "Получено с покеррумов: #{grabbers}\n"
- payed = PayedContent.sum(:sum, :conditions => {:created_at => Time.mktime(year,month,1)..Time.mktime(year,month).end_of_month.end_of_day}).round(2)
- str << "Купленно видео на сумму: #{payed}\n"
- pur = Purchase.sum("item_versions.price", :conditions => {:created_at => Time.mktime(year,month,1)..Time.mktime(year,month).end_of_month.end_of_day}, :include => :item_version)
- str << "Куплено товаров (включая бездепозитные бонусы): #{pur}\n"
- end
- puts str
- Выборка по бездепам по месяцам
- all_sum = 0
- str = ''
- [['Декабрь', 2008, 11], ['Январь', 2009, 1], ['Февраль', 2009, 2], ['Март', 2009, 3]].each do |date|
- title, year, month = date
- str << "За #{title}\n"
- po_sum = Item.find(:all, :conditions => ['pokerroom_id is not NULL']).inject(0) do |sum, v|
- pokerroom = Pokerroom.find(v.pokerroom_id)
- str_versions = ''
- version_sum = ItemVersion.find(:all, :conditions => {:item_id => v.id}).inject(0) do |sum2, v2|
- count = Purchase.count(:conditions => {:item_version_id => v2.id, :created_at => Time.mktime(year,month,1)..Time.mktime(year,month).end_of_month.end_of_day})
- r = count * v2.price
- if count > 0
- str_versions << "Бонус #{v2.title}: #{count} на сумму #{r} igp\n"
- end
- sum2 + r
- end
- if version_sum > 0
- str << "Покеррум #{pokerroom.title}\n"
- str << str_versions
- str << "Всего в покерруме #{pokerroom.title}: #{version_sum} igp\n\n"
- end
- sum + version_sum
- end
- str << "Всего за месяц: #{po_sum} igp\n\n"
- all_sum += po_sum
- end
- str << "Всего: #{all_sum} igp\n"
- puts str
- Синхронизация видео сервера
- 453 export AWS_ACCESS_KEY_ID=0K0VNTMTHGE66N1T6QG2
- 454 export AWS_SECRET_ACCESS_KEY=6wgEKG3CGoO+jJwzt846dZO4E4Lp6UkmYrz1cG4N
- 455 cd /home/video2/
- 456 s3sync -rdv --progress --no-md5 igc-videos: public/
- Отчет по граббера с разделением на покерруме
- str = ""
- [['Декабрь', 2008, 12], ['Январь', 2009, 1], ['Февраль', 2009, 2], ['Март', 2009, 3]].each do |v|
- title, year, month = v
- str << "За #{title}\n"
- grabbers = GrabberTransaction.sum(:igp, :group => 'pokerroom_id', :conditions => {:check_time => Time.mktime(year,month,1)..Time.mktime(year,month).end_of_month.end_of_day, :status => 1})
- all_sum = grabbers.inject(0){|sum, v| sum + v[1]}
- grabbers.each{|v| str << "С покеррума #{Pokerroom.find(v[0]).title}: #{v[1].round(2)} igp\n"}
- str << "Всего за месяц: #{all_sum.round(2)} igp\n\n"
- end
- puts str
- Конверт в h264
- options="-vcodec libx264 -b 512k -flags +loop+mv4 -cmp 256 \
- -partitions +parti4x4+parti8x8+partp4x4+partp8x8+partb8x8 \
- -me_method hex -subq 7 -trellis 1 -refs 5 -bf 3 \
- -flags2 +bpyramid+wpred+mixed_refs+dct8x8 -coder 1 -me_range 16 \
- -g 250 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -qmin 10\
- -qmax 51 -qdiff 4"
- ffmpeg -y -i "412.avi" -an -pass 1 -threads 2 -vcodec libx264 -b 512k -flags +loop+mv4 -cmp 256 -partitions +parti4x4+parti8x8+partp4x4+partp8x8+partb8x8 -me_method hex -subq 7 -trellis 1 -refs 5 -bf 3 -flags2 +bpyramid+wpred+mixed_refs+dct8x8 -coder 1 -me_range 16 -g 250 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -qmin 10 -qmax 51 -qdiff 4 "testfile.mp4"
- ffmpeg -y -i "412.avi" -acodec libfaac -ar 44100 -ab 96k -pass 2 -threads 2 -vcodec libx264 -b 512k -flags +loop+mv4 -cmp 256 -partitions +parti4x4+parti8x8+partp4x4+partp8x8+partb8x8 -me_method hex -subq 7 -trellis 1 -refs 5 -bf 3 -flags2 +bpyramid+wpred+mixed_refs+dct8x8 -coder 1 -me_range 16 -g 250 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -qmin 10 -qmax 51 -qdiff 4 "testfile.mp4"
Add Comment
Please, Sign In to add comment