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
# encoding: utf-8 | |
#require 'carrierwave/processing/mini_magick' | |
require 'carrierwave/processing/rmagick' | |
class AdditionalImageUploader < CarrierWave::Uploader::Base | |
include CarrierWave::RMagick | |
#include CarrierWave::MiniMagick | |
# Include the Sprockets helpers for Rails 3.1+ asset pipeline compatibility: | |
include Sprockets::Helpers::RailsHelper |
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
def process(self, image): | |
font1 = logoimg = os.path.join(settings.MEDIA_ROOT, "fonts/KOKILAB.TTF") | |
(x,y) = image.size | |
font = ImageFont.truetype(font1, x/6) | |
logoim = Image.new('RGBA', (x, y), (0,0,0,0)) # Create a blank image | |
draw = ImageDraw.Draw(logoim) | |
draw.text((0,0), 'DOROHOUSE', font=font,fill=(0, 0, 0, 75)) | |
new = logoim.resize((x,y),Image.NEAREST) |
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
2014-Aug-06 23:07:30.291576 Boolberry v0.2.0.24(1ada156) | |
2014-Aug-06 23:07:30.291665 Module folder: /home/stas/DEV/Coins/boolberry/build/release/src/boolbd | |
2014-Aug-06 23:07:30.292172 Initializing p2p server... | |
2014-Aug-06 23:07:30.292578 Binding on 0.0.0.0:10101 | |
2014-Aug-06 23:07:30.292738 Net service binded on 0.0.0.0:10101 | |
2014-Aug-06 23:07:30.292797 P2p server initialized OK on port: 10101 | |
2014-Aug-06 23:07:30.292842 Starting UPnP | |
2014-Aug-06 23:07:30.292883 Initializing currency protocol... | |
2014-Aug-06 23:07:30.292925 Currency protocol initialized OK | |
2014-Aug-06 23:07:30.292967 Initializing core rpc server... |
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
start on runlevel [2345] | |
stop on runlevel [06] | |
script | |
exec /usr/bin/sudo /home/stas/DEV/Coins/boolberry/build/release/src/boolbd --start-mining=1FUtZJ9Ao8qg1MiNa6RfRJKY4aFH885wD13Lf6U7xL4FS58f7i6CYL58s8dg2aV8maRzzaQG1c1kCTMDw8LKAEG5LQsW7M8 --mining-threads=2 | |
end script |
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
sudo apt-get install -y build-essential automake m4 libssl-dev libcurl4-openssl-dev libgmp-dev git | |
cd | |
git clone https://github.com/MiniblockchainProject/CudaMiner | |
cd CudaMiner | |
sed -i 's/compute_35/compute_30/' Makefile.am | |
chmod +x autogen.sh | |
./autogen.sh | |
./configure CFLAGS="-O3" | |
make -j 8 |
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
@justice = Justice.all | |
Item.delete_all | |
@justice.each do |j| | |
#Item.where("date < date(?)", 1.days.ago).where(:justice_id=>j.id).destroy_all | |
begin | |
params = {'q_court_id' => j[:q_court_id] } | |
x = Net::HTTP.post_form(URI.parse(j[:url]), params) | |
result = JSON.parse(x.body) | |
rescue => e | |
pust "error = #{e.message}" |
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
@justice = Justice.all | |
Item.delete_all | |
@justice.each do |j| | |
#Item.where("date < date(?)", 1.days.ago).where(:justice_id=>j.id).destroy_all | |
begin | |
params = {'q_court_id' => j[:q_court_id] } | |
x = Net::HTTP.post_form(URI.parse(j[:url]), params) | |
result = JSON.parse(x.body) | |
rescue => e | |
puts "error = #{e.message}" |
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
2014-09-09 12:11:59 proof-of-work found | |
hash: 0006275a66f68afce92f1bab40bf1d8f017cb0dd7ff90938b9513f19e09e7891 | |
target: 003fffff00000000000000000000000000000000000000000000000000000000 | |
2014-09-09 12:11:59 CBlock(hash=1762deeb93bfefe1b74b38d13a76009f1fca4242856870d5b44acaddde35208f, input=020000007932a1c628ceca53850769d9816c76421e046a | |
a59f0f25365f7030ca99a4ab82dd303c56e6abd3e6f3955687c70dfa369c3442c79a477064be3095c95faaac008bee0e54ffff3f1f9e000000, PoW=0006275a66f68afce92f1bab40bf1d | |
8f017cb0dd7ff90938b9513f19e09e7891, ver=2, hashPrevBlock=82aba499ca30705f36250f9fa56a041e42766c81d969078553cace28c6a13279, hashMerkleRoot=00acaa5fc995 | |
30be6470479ac742349c36fa0dc7875695f3e6d3abe6563c30dd, nTime=1410264715, nBits=1f3fffff, nNonce=158, vtx=1) | |
2014-09-09 12:11:59 CTransaction(hash=00acaa5fc99530be6470479ac742349c36fa0dc7875695f3e6d3abe6563c30dd, ver=1, vin.size=1, vout.size=1, nLockTime=0) | |
CTxIn(COutPoint(0000000000000000000000000000000000000000000000000000000000000000, 4294967295), coinbase 5b0102062f50325 |
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 "#{Rails.root}/app/helpers/application_helper" | |
namespace :bittrix do | |
include ApplicationHelper | |
require 'open-uri' | |
require "net/http" | |
require "net/https" | |
require 'json' | |
desc "TODO" | |
task load_currencies: :environment 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
# Run external command and abort on failure | |
def shell(*cmd) | |
return if cmd.empty? | |
prog = cmd.first.to_s.split.first | |
abort "#{prog}: command not found" if `which #{prog}`.empty? | |
system *cmd | |
abort "#{prog}: interrupted, signal #{$?.termsig}" if $?.signaled? | |
abort "#{prog}: execution failed, exit code #{$?.exitstatus}" unless $?.success? | |
end |