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:
=Navigating= | |
visit('/projects') | |
visit(post_comments_path(post)) | |
=Clicking links and buttons= | |
click_link('id-of-link') | |
click_link('Link Text') | |
click_button('Save') | |
click('Link Text') # Click either a link or a button | |
click('Button Value') |
There is a long standing issue in Ruby where the net/http library by default does not check the validity of an SSL certificate during a TLS handshake. Rather than deal with the underlying problem (a missing certificate authority, a self-signed certificate, etc.) one tends to see bad hacks everywhere. This can lead to problems down the road.
From what I can see the OpenSSL library that Rails Installer delivers has no certificate authorities defined. So, let's go fetch some from the curl website. And since this is for ruby, why don't we download and install the file with a ruby script?
# Template: A.html | |
<html> | |
<head></head> | |
<body> | |
{% block hello %} | |
HELLO | |
{% endblock %} | |
</body> | |
</html> |
# | |
# lib/mongoid/counter_cache.rb | |
# ruby | |
# | |
# Created by Zhang Alex on 2011-06-17. | |
# Copyright 2011 __ZhangHanDong__. All rights reserved. | |
# | |
# =================================== | |
# class Forum | |
# references_many :topics |
Beyond IP Transactions: towards a payment protocol | |
================================================== | |
IP transactions were originally introduced as a first "out-of-band" protocol | |
for negotiating a transaction output's public key. Being inconvenient and | |
insecure, they became obsolete, and recent versions of bitcoin don't support | |
them anymore. | |
The result is that static bitcoin addresses have become the most common way of | |
defining requested payments. This may be fine for anonymous donations, but is not |
require 'faraday' | |
require 'forwardable' | |
module Soup | |
class Agent | |
extend Forwardable | |
def initialize(domain = 'https://www.soup.io/') | |
@agent ||= faraday(domain) | |
end |
module A | |
def self.included(target) | |
v = target.instance_methods.include?(:method_name) | |
puts "in included: #{v}" | |
end | |
def self.append_features(target) | |
v = target.instance_methods.include?(:method_name) | |
puts "in append features before: #{v}" | |
super |
# Raw transaction API example work-through | |
# Send coins to a 2-of-3 multisig, then spend them. | |
# | |
# For this example, I'm using these three keypairs (public/private) | |
# 0491bba2510912a5bd37da1fb5b1673010e43d2c6d812c514e91bfa9f2eb129e1c183329db55bd868e209aac2fbc02cb33d98fe74bf23f0c235d6126b1d8334f86 / 5JaTXbAUmfPYZFRwrYaALK48fN6sFJp4rHqq2QSXs8ucfpE4yQU | |
# 04865c40293a680cb9c020e7b1e106d8c1916d3cef99aa431a56d253e69256dac09ef122b1a986818a7cb624532f062c1d1f8722084861c5c3291ccffef4ec6874 / 5Jb7fCeh1Wtm4yBBg3q3XbT6B525i17kVhy3vMC9AqfR6FH2qGk | |
# 048d2455d2403e08708fc1f556002f1b6cd83f992d085097f9974ab08a28838f07896fbab08f39495e15fa6fad6edbfb1e754e35fa1c7844c41f322a1863d46213 / 5JFjmGo5Fww9p8gvx48qBYDJNAzR9pmH5S389axMtDyPT8ddqmw | |
# First: combine the three keys into a multisig address: | |
./bitcoind createmultisig 2 '["0491bba2510912a5bd37da1fb5b1673010e43d2c6d812c514e91bfa9f2eb129e1c183329db55bd868e209aac2fbc02cb33d98fe74bf23f0c235d6126b1d8334f86","04865c40293a680cb9c020e7b1e106d8c1916d3cef99aa431a56d253e69256dac09ef122b1a9 |