$ sudo bash -c "$(curl -s https://gist.githubusercontent.com/zulhfreelancer/0b87a274686cb4d98b8144e116c5117c/raw)"
#!/bin/bash | |
# This script will automatically set up a single node Flynn Cluster on your linux box | |
# Fresh Flynn install with domain provided by the xip.io service | |
# Tested with Base Image: Ubuntu 14.04 x64 @ DigitalOcean droplet | |
# @date 16 Nov 2015 | |
# @author Edu Wass (eduwass at gmail com) | |
echo '---- START SETUP ----' |
This is a semi-quick key/value store I put together for a quick way to store temporary data related to what's in my database, in a reliable way. For example, I'm using it to keep track of where a hourly and a daily crontask that processes statistics left off, so it can resume only processing and summarizing new data on the next run.
Code quality most likely is not great, but it works. And I will update this gist as I update my project.
The settings table has two columns, a key
and a value
column. The value
column is serialized, so you can technically store almost anything in there. Memcache is also used as a caching layer to minimize database calls.
This is a semi-quick key/value store I put together for a quick way to store temporary data related to what's in my database, in a reliable way. For example, I'm using it to keep track of where a hourly and a daily crontask that processes statistics left off, so it can resume only processing and summarizing new data on the next run.
Code quality most likely is not great, but it works. And I will update this gist as I update my project.
The settings table has two columns, a key
and a value
column. The value
column is serialized, so you can technically store almost anything in there. Memcache is also used as a caching layer to minimize database calls.
ruby '2.2.0' | |
source 'https://rubygems.org' | |
... | |
gem 'font-awesome-rails' |
# initialization file (not found) |
module ActiveRecordMarshalable | |
def marshal_dump | |
[attributes, self.association_cache, instance_variable_get(:@new_record)] | |
end | |
def marshal_load data | |
send :initialize, data[0] | |
instance_variable_set :@association_cache, data[1] | |
instance_variable_set :@new_record, data[2] | |
end |
curl get.pow.cx/uninstall.sh | sh | |
curl get.pow.cx | sh | |
scutil --dns | |
sudo touch /etc/resolver/dev | |
sudo pfctl -f /etc/pf.conf | |
sudo pfctl -e | |
touch ~/.pow/rails |
// PATTERN 1: DEFINE A GLOBAL | |
// foo.js | |
foo = function () { | |
console.log('foo!'); | |
} | |
// app.js | |
require('./foo.js'); | |
foo(); |
# create a mongo app | |
flynn create --remote "" mongo | |
# create a release using the latest (at the time of writing) Docker MongoDB image | |
flynn -a mongo release add -f config.json "https://registry.hub.docker.com?name=mongo&id=216d9a0e82646f77b31b78eeb0e26db5500930bbd6085d5d5c3844ec27c0ca50" | |
# scale the server to one process. This may time out initially as the server pulls the image, but watch "flynn -a mongo ps" and it should come up. | |
flynn -a mongo scale server=1 | |
# mongo should now be running in the cluster at mongo.discoverd:27017 |