Create droplet of your liking (ubuntu 12.10 x32)
ssh to root in terminal with your server ip
ssh root@123.123.123.123
Add ssh fingerprint and enter password provided in email
| <!-- a story is an item that exists in a list that leads into its own. An active story is one that is meant to be interacted with, whereas an inactive story is just for display --> | |
| <article class="story [storyObjectType] [in]active" href="[storyController]/view/[storyId]"> | |
| <!-- Optional: Appropriate avatar item for story (user photo, task time etc.) the thing that identifies the story in a quick glance --> | |
| <div class="story-avatar"> | |
| <!-- img or time or div or span --> | |
| </div> | |
| <div class="story-content"> | |
| <div class="story-content-wrapper"> | |
| <header class="story-content-header"> |
| class Controller | |
| include LazyLoad | |
| def show | |
| @model = Model.find(...) | |
| respond_to do |format| | |
| format.html do | |
| @html_specific_data = Model.find(...) | |
| end |
| # ============================================================ | |
| # PluginName v0.0.0 | |
| # http://URL | |
| # ============================================================ | |
| # Copyright 2012 The Beans Group | |
| # | |
| # Licensed under the Apache License, Version 2.0 (the "License"); | |
| # you may not use this file except in compliance with the License. | |
| # You may obtain a copy of the License at | |
| # |
| Latency Comparison Numbers (~2012) | |
| ---------------------------------- | |
| L1 cache reference 0.5 ns | |
| Branch mispredict 5 ns | |
| L2 cache reference 7 ns 14x L1 cache | |
| Mutex lock/unlock 25 ns | |
| Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
| Compress 1K bytes with Zippy 3,000 ns 3 us | |
| Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
| Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |
| newpg=9.6.1 # set to new PG version number | |
| oldpg=`pg_config --version | cut -d' ' -f2` | |
| # PG 96. upgrades the readline to v7, which breaks anything linked against readline v6, like ruby via ruby-build. | |
| # I *think* this should prevent it from installing v7. But if weird shit happens with various rubies, | |
| # you'll have to reinstall them. | |
| brew pin readline | |
| # Stop current Postgres server | |
| brew services stop postgresql |
| -- show running queries (pre 9.2) | |
| SELECT procpid, age(clock_timestamp(), query_start), usename, current_query | |
| FROM pg_stat_activity | |
| WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%' | |
| ORDER BY query_start desc; | |
| -- show running queries (9.2) | |
| SELECT pid, age(clock_timestamp(), query_start), usename, query | |
| FROM pg_stat_activity | |
| WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' |
| sudo add-apt-repository ppa:pitti/postgresql | |
| sudo apt-get update | |
| sudo apt-get install postgresql-9.2 postgresql-server-dev-9.2 postgresql-contrib-9.2 | |
| sudo su -l postgres | |
| psql -d template1 -p 5433 | |
| CREATE EXTENSION IF NOT EXISTS hstore; | |
| CREATE EXTENSION IF NOT EXISTS "uuid-ossp"; | |
| service postgresql stop | |
| /usr/lib/postgresql/9.2/bin/pg_upgrade -b /usr/lib/postgresql/9.1/bin -B /usr/lib/postgresql/9.2/bin -d /var/lib/postgresql/9.1/main/ -D /var/lib/postgresql/9.2/main/ -O "-c config_file=/etc/postgresql/9.2/main/postgresql.conf" -o "-c config_file=/etc/postgresql/9.1/main/postgresql.conf" |
| class Primes: | |
| """Get primes, fast. Eat lots of memory""" | |
| @staticmethod | |
| def list_all_up_to(ceiling): | |
| """Creates a list of prime numbers up to the ceiling""" | |
| limit = int((ceiling - 1) / 2) | |
| prime_map = [True] * limit | |
| list_of_primes = [2] | |
| index = 0 |
| # config/initializers/source_maps.rb | |
| if Rails.env.development? | |
| module CoffeeScript | |
| class SourceMapError < StandardError; end; | |
| class << self | |
| def compile script, options | |
| script = script.read if script.respond_to?(:read) |