== Rules == | |
On Infrastructure | |
----------------- | |
There is one system, not a collection of systems. | |
The desired state of the system should be a known quantity. | |
The "known quantity" must be machine parseable. | |
The actual state of the system must self-correct to the desired state. | |
The only authoritative source for the actual state of the system is the system. | |
The entire system must be deployable using source media and text files. |
# Add this line to your Gemfile | |
gem "oa-openid", :require => "omniauth/openid" |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<html> | |
<head> | |
<title>Simple Radar Chart</title> | |
<link rel="stylesheet" href="style.css"/> | |
<script src="http://mbostock.github.com/d3/d3.js?2.5.0"></script> | |
<script src="radar.js"></script> | |
</head><body><h1>Simple Radar Chart</h1> | |
<div id="viz"> | |
</div> |
#!/bin/sh | |
# clonio | |
# replace /home/jsomara/images with where you're copying your image from | |
# usage sudo sh clonio.sh rhel-6.2-base zoidberg | |
# rhel-6-2-base.img is in /home/jsomara/images/rhel-6-2-base.img | |
# zoidberg.img ends up in /home/jsomara/images | |
# thanks to jeckersb | |
virt-clone -o $1 -n $2 -f /home/jsomara/images/$2.img | |
MAC=$(cat /etc/libvirt/qemu/$2.xml | grep 'mac address' | sed -r "s/^[^']+'([^']+)'.*/\1/") |
- Your class can be no longer than 100 lines of code.
- Your methods can be no longer than five lines of code.
- You can pass no more than four parameters and you can’t just make it one big hash.
- When a call comes into your Rails controller, you can only instantiate one object to do whatever it is that needs to be done. And your view can only know about one instance variable.
You can break these rules if you can talk your pair into agreeing with you.
For development, I run Docker containers that start up running sshd. Then I ssh to those machines and do my development work. It works great but finding the host name to ssh into was always a chore. It usually involved something like docker inspect my_container | grep IPAddress
and then copying the address. Very tedious. I'd rather just type ssh root@my_container
. So I did some searching and came up with a solution similar to http://blog.oddbit.com/2013/10/04/automatic-dns-entries-for-libvirt-domains/
What we will do is have incrond create a hosts file every time a container is started or stopped. Then we will set NetworkManager to use dnsmasq and resolve names through that hosts file.
The below instructions work on Fedora 20. For other distributions, you're on your own, but the principles should be the same.
-
Set NetworkManager to use dnsmasq by adding the following under the
[main]
block of /etc/NetworkManager/NetworkManager.conf
dns=dnsmasq
# Original Rails controller and action | |
class EmployeesController < ApplicationController | |
def create | |
@employee = Employee.new(employee_params) | |
if @employee.save | |
redirect_to @employee, notice: "Employee #{@employee.name} created" | |
else | |
render :new | |
end |
A checklist for designing and developing internet scale services, inspired by James Hamilton's 2007 paper "On Desgining and Deploying Internet-Scale Services."
- Does the design expect failures to happen regularly and handle them gracefully?
- Have we kept things as simple as possible?