I've been trying to understand how to setup systems from
the ground up on Ubuntu. I just installed redis
onto
the box and here's how I did it and some things to look
out for.
To install:
[Unit] | |
Description=Apache Flink | |
[Service] | |
Type=forking | |
User=ec2-user | |
ExecStart=/home/ec2-user/flink/bin/start-cluster.sh | |
ExecStop=-/home/ec2-user/flink/bin/stop-cluster.sh | |
Restart=always | |
require 'neo4j' | |
class Show < Neo4j::Rails::Model | |
property :show_name, type: String, index: :exact | |
has_n :booked_bands | |
end | |
#I have another model, band.rb | |
class Band < Neo4j::Rails::Model |
class ETLJob | |
include Sidekiq::Worker | |
sidekiq_options :queue => :ETLTasks, :backtrace => true, :retry => false | |
def perform(control_file) | |
ETL::Engine.init({:execution_dbname=>"etl_execution_prod"}) | |
ETL::Engine.process("#{Dir.pwd}/control/#{control_file}.ctl") | |
end | |
end |
-- show running queries (pre 9.2) | |
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query | |
FROM pg_stat_activity | |
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%' | |
ORDER BY query_start desc; | |
-- show running queries (9.2) | |
SELECT pid, age(clock_timestamp(), query_start), usename, query | |
FROM pg_stat_activity | |
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' |
L1 cache reference 0.5 ns || 5.0 × 10^-10 seconds | |
Branch mispredict 5 ns || 5.0 × 10^-9 seconds | |
L2 cache reference 7 ns || 7.0 × 10^-9 seconds | |
Mutex lock/unlock 25 ns || 2.5 × 10^-8 seconds | |
Main memory reference 100 ns || 1.0 × 10^-7 seconds | |
Compress 1K bytes with Zippy 3,000 ns || 3.0 × 10^-6 seconds | |
Send 2K bytes over 1 Gbps network 20,000 ns || 2.0 × 10^-5 seconds | |
Read 1 MB sequentially from memory 250,000 ns || 0.00025 seconds | |
Round trip within same datacenter 500,000 ns || 0.00050 seconds | |
Disk seek 10,000,000 ns || 0.01 seconds |
sudo apt-get install openjdk-6-jre-headless | |
curl -O http://dist.neo4j.org/neo4j-community-1.5.M02-unix.tar.gz | |
tar -xf neo4j-community-1.5.M02-unix.tar.gz | |
rm neo4j-community-1.5.M02-unix.tar.gz | |
neo4j-community-1.5.M02/bin/neo4j start |
set :test_log, "logs/capistrano.test.log" | |
namespace :deploy do | |
before 'deploy:update_code' do | |
puts "--> Running tests, please wait ..." | |
unless system "bundle exec rake > #{test_log} 2>&1" #' > /dev/null' | |
puts "--> Tests failed. Run `cat #{test_log}` to see what went wrong." | |
exit | |
else | |
puts "--> Tests passed" |
connection = Faraday::Connection.new('http://example.com') do |builder| | |
builder.request :url_encoded # for POST/PUT params | |
builder.adapter :net_http | |
end | |
# same as above, short form: | |
connection = Faraday.new 'http://example.com' | |
# GET | |
connection.get '/posts' |