ssh to root in terminal with your server ip
ssh [email protected]
or for ec2 you will need your public key
puts "hello ruby :-)" |
require 'google/api_client' | |
require 'google/api_client/client_secrets' | |
require 'google/api_client/auth/installed_app' | |
class User < ActiveRecord::Base | |
def save_google_credentials(omniauth, params) | |
if omniauth["credentials"]["refresh_token"] | |
self.google_access_token = omniauth["credentials"]["token"] |
#openssl | |
require 'openssl' | |
require 'base64' | |
require "digest" | |
include OpenSSL | |
def aes256_encrypt(key, data) | |
key = Digest::SHA256.digest(key) if(key.kind_of?(String) && 32 != key.bytesize) | |
aes = OpenSSL::Cipher.new('AES-256-CBC') | |
aes.encrypt |
require File.join(File.dirname(__FILE__), "../lib/diffie_hellman") | |
curve = Ecc::Curve.new 324, 1287, 3851 | |
point = Ecc::Point.new 920, 303 | |
server = Ecc::DiffieHellman.new curve, point, 1194 | |
client = Ecc::DiffieHellman.new curve, point, 1759 | |
server_pub = server.computePublicKey() | |
puts "Server Public Key: #{server_pub}" |
# derived from http://h2np.net/tips/wiki/index.php?RubyOpenSSLDigitalSignatureSample | |
require 'openssl' | |
require 'base64' | |
include OpenSSL | |
group_name = 'secp160k1' | |
message = 'test payload aa' | |
puts "=== Generate Key ===" |
ssh to root in terminal with your server ip
ssh [email protected]
or for ec2 you will need your public key
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta name="description" content=""> | |
<meta name="author" content=""> | |
<link rel="shortcut icon" href="assets/ico/favicon.png"> | |
<title>Life Coach Drive</title> |
Create droplet of your liking (ubuntu 12.10 x32)
ssh to root in terminal with your server ip
ssh -i config/onvard.pem [email protected]
Add ssh fingerprint and enter password provided in email
# gem "omniauth" | |
# gem "omniauth-instagram" | |
# gem "instagram" | |
Rails.application.config.middleware.use OmniAuth::Builder do | |
provider :instagram, ENV['INSTAGRAM_KEY'], ENV['INSTAGRAM_KEY'] | |
end | |
Instagram.configure do |config| | |
config.client_id = ENV['INSTAGRAM_KEY'] |
source 'https://rubygems.org' | |
ruby '2.0.0' | |
# we are living on the edge, but to stay save.. keep this updated to the latest stable | |
gem 'rails', '4.0.2' | |
# i like an elephant more than a dolphin :) | |
gem "pg" | |
# mongodb is good for prototyping either it's RDBMS or not | |
gem 'mongoid', github: "mongoid/mongoid" |