This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| default: &default | |
| adapter: redis | |
| url: redis://localhost:6379/1 | |
| development: | |
| <<: *default | |
| test: | |
| <<: *default |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| magnum cluster-show k8s-cluster | |
| +--------------------+------------------------------------------------------------+ | |
| | Property | Value | | |
| +--------------------+------------------------------------------------------------+ | |
| | status | CREATE_COMPLETE | | |
| | uuid | cff82cd0-189c-4ede-a9cb-2c0af6997709 | | |
| | stack_id | 7947844a-8e18-4c79-b591-ecf0f6067641 | | |
| | status_reason | Stack CREATE completed successfully | | |
| | created_at | 2016-05-26T17:45:57+00:00 | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # You'll need a container OS like Fedora Atomic first | |
| wget https://fedorapeople.org/groups/magnum/fedora-atomic-latest.qcow2 | |
| openstack image create fedora-atomic-latest --disk-format "qcow2" --public \ | |
| --container-format 'bare' \ | |
| --file 'fedora-atomic-latest.qcow2' \ | |
| --property os_distro=fedora-atomic | |
| # Use your own keypair name in place of 'kp' | |
| magnum cluster-template-create --name='k8s-cluster-template' --image-id='fedora-atomic-latest' \ | |
| --keypair-id='kp' --external-network-id='public' --master-flavor-id='m1.small' \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # On a Ubuntu 14.04 server | |
| sudo apt-get update | |
| sudo apt-get upgrade -y | |
| sudo apt-get install -y git | |
| sudo mkdir -p /opt/stack | |
| sudo chown $USER /opt/stack | |
| git clone https://git.openstack.org/openstack-dev/devstack /opt/stack/devstack | |
| cd /opt/stack/devstack | |
| git checkout stable/newton |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Fixnum | |
| def prime? | |
| /^.?$|^(..+?)\1+$/ !~ '1'*self | |
| end | |
| end | |
| 0.prime? #=> false | |
| 1.prime? #=> false | |
| 2.prime? #=> true | |
| 3.prime? #=> true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module BinaryTree | |
| class Node | |
| attr_reader :element | |
| attr_accessor :left, :right | |
| def initialize(e=nil) | |
| @element = e | |
| end | |
| def traverse |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| clouds: | |
| datacentred: | |
| auth: | |
| username: YOUR_USERNAME | |
| password: YOUR_PASSWORD | |
| project_name: YOUR_PROJECT_NAME | |
| auth_url: https://compute.datacentred.io:5000/v2.0/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Rails.configuration.log_level = :info | |
| ActiveRecord::Base.logger = Logger.new(STDOUT) | |
| # run your code |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| server { | |
| listen 443 ssl http2; | |
| server_name awesomehost.ninja; | |
| ssl_certificate /path/to/server.crt; | |
| ssl_certificate_key /path/to/server/key | |
| ssl_client_certificate /path/to/client-ca.crt; | |
| ssl_verify_client optional; | |
| location /secret { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class ApplicationController < ActionController::Base | |
| def no_layout? | |
| params.keys.include?('no_layout') | |
| end | |
| end |