View bitcoin-pay.rb
#!/usr/bin/env ruby | |
require 'open-uri' | |
require 'JSON' | |
require 'digest/sha2' | |
require 'pry' | |
require 'bigdecimal' | |
require 'bitcoin' # Because I need to cheat every now and then | |
# Usage: | |
# gem install pry json ffi ruby-bitcoin |
View digital-ocean-rails.sh
#! /bin/bash | |
# this is a useful little script to setup a rails user, with postgresql, and nginx version of Phusion Passenger on a Digital Ocean droplet | |
# Once run it's ready to recieve a Capistrano deployment. | |
# The best way to run it is ssh root@my_do_host 'bash -s' < digital-ocean-rails.sh | |
set -e -x # die on the first error and send stdout to /var/log/syslog | |
#create a password and save it | |
PWD=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 20 | head -n 1) | |
mkdir -p passwords | |
echo "rails,$PWD" >> passwords/users.txt | |
#create a user called rails and allow them to sudo without a password |