Typically, this is how you'd connect to Redis:
Redis.new(url: ENV["REDIS_URL"])
Where REDIS_URL
uses the following format:
production: | |
adapter: postgresql | |
encoding: unicode | |
sslmode: require | |
url: postgres://user:password@host:port/db |
Author: Michael van Rooijen (@mrrooijen)
DISCLAIMER: I am a programmer, not a sysadmin in my day-to-day life. I provide this guide simply as a self-reference, and as a way to contribute to the community of developers. The main motivation for writing this guide is because of the lack of properly written guides/tutorials. They were either out-dated, inaccurate, in a non-English language or simply too vague to understand (at least for me, as a programmer and not a sysadmin).
I hope this guide helps getting you up and running with your own collection of VPS's on your own Dedicated Server over at Hetzner.de.
Requirements:
# Guide | |
# Configure the essential configurations below and do the following: | |
# | |
# Repository Creation: | |
# cap deploy:repository:create | |
# git add . | |
# git commit -am "initial commit" | |
# git push origin master | |
# | |
# Initial Deployment: |
# Downloads MongoDB Version 1.2.2 to the Home Dir | |
# Extracts it and moves the contents into the /var/mongodb folder | |
# Creates a symlink from /var/mongodb/mongod to /usr/local/sbin | |
cd ~/ | |
wget http://downloads.mongodb.org/linux/mongodb-linux-x86_64-1.2.2.tgz | |
tar -xf mongodb-linux-x86_64-1.2.2.tgz | |
mkdir -p /var/mongodb | |
mv mongodb-linux-x86_64-1.2.2/* /var/mongodb/ | |
ln -nfs /var/mongodb/bin/mongod /usr/local/sbin |
#! /bin/sh | |
email="me@example.com" | |
domains="example.com,*.example.com" | |
cloudflare_email="me@example.com" | |
cloudflare_api_key="me-api-key" | |
# END CONFIG | |
brew install certbot |
70 EUR | Case | BitFenix Prodigy (White) | http://azerty.nl/0-1831-527460/bitfenix-prodigy.html | |
20 EUR | Fan Front | BitFenix Spectre 230mm (Black) | http://www.informatique.nl/444497/bitfenix-spectre-pro-bff-lpro-23030w-rp.html | |
15 EUR | Fan Rear | BitFenix Spectre 140mm (Black) | http://www.informatique.nl/444490/bitfenix-spectre-pro-bff-lpro-140225w-rp.html | |
24 EUR | Fan Top | BitFenix Spectre 120mm (Black) x2 | http://www.informatique.nl/444486/bitfenix-spectre-pro-bff-lpro-12025w-rp.html | |
35 EUR | Fan Controller | BitFenix Recon | http://azerty.nl/0-1087-520155/bitfenix-recon-fancontroller.html | |
182 EUR | Motherboard | ASUS P8Z77-I Deluxe (Blue) | http://azerty.nl/producten/product_detail/4924/510802/asus-p8z77-i-deluxe-moederbord-mini-itx-lga1155-socket-z77-usb-3-0-802-11a-b-g-n-bluetooth-gigabit-ethernet-in |
UPDATE pg_database SET datistemplate = FALSE WHERE datname = 'template1'; | |
DROP DATABASE template1; | |
CREATE DATABASE template1 WITH TEMPLATE = template0 ENCODING = 'UNICODE'; | |
UPDATE pg_database SET datistemplate = TRUE WHERE datname = 'template1'; | |
\c template1 | |
VACUUM FREEZE; | |
UPDATE pg_database SET datallowconn = FALSE WHERE datname = 'template1'; |
require "active_record" | |
namespace :db do | |
db_config = YAML::load(File.open('config/database.yml')) | |
db_config_admin = db_config.merge({'database' => 'postgres', 'schema_search_path' => 'public'}) | |
desc "Create the database" | |
task :create do | |
ActiveRecord::Base.establish_connection(db_config_admin) |
#!/bin/bash | |
# OpenVPN Installer | |
# | |
# This installer was designed to work with Ubuntu 14.04. It installs | |
# an OpenVPN server, generates an associated OpenVPN client configuration file, | |
# configures a firewall, and enables automatic security updates. | |
# | |
# Once the installer finishes, the `/root/client.ovpn` file will have been generated. | |
# Download this file to your local machine and open it in an OpenVPN client and you'll |