For Mac and Windows users, just install Docker Toolbox. It provides what you need to get started, including:
#cloud-config | |
hostname: rancher-os | |
ssh_authorized_keys: | |
- ssh-rsa AAAABBBBBBCCCCCCC... | |
write_files: | |
- path: /opt/rancher/bin/start.sh | |
permissions: 0700 | |
content: | | |
#!/bin/bash | |
# Configure private network on eth1 |
See my GitHub API current rate limits:
curl -sI "https://api.github.com/users/cookbooks/repos" | grep "^X-RateLimit" Any left? curl -sI "https://api.github.com/users/cookbooks/repos" | sed -nr 's/^X-RateLimit-Remaining: (.*)$/\1/p'
Or even simpler:
curl -s "https://api.github.com/rate_limit"
A lot of times you are developing a web application on your own laptop or home computer and would like to demo it to the public. Most of those times you are behind a router/firewall and you don't have a public IP address. Instead of configuring routers (often not possible), this solution gives you a public URL that's reverse tunnelled via ssh to your laptop.
Because of the relaxation of the sshd setup, it's best used on a dedicated virtual machine just for this (an Amazon micro instance for example).
Stop serving assets from your own nginx instance. Instead, let Cloudfront CDN do it for you.
Steps:
- Read http://ryantownsend.co.uk/post/13126016608/cloudfront-cdn-on-rails
- Set up your nginx virtual host according to the snippet I've included in nginx_vhost.conf
- Set up your rails app to use an asset host as described in the article. I've included my config in production.rb
consul-stack: | |
series: trusty | |
services: | |
haproxy: | |
charm: "local:trusty/haproxy" | |
etcd: | |
charm: "local:trusty/etcd" | |
num_units: 3 | |
to: [0, docker, docker] | |
registrator: |
# assumming path to nginx is /etc/nginx/ | |
sudo su | |
cd /etx/nginx | |
mkdir certs_localhost | |
cd certs_localhost | |
# generate self signed certificate, the identifier for it should be localhost | |
openssl req -x509 -newkey rsa:2048 -keyout development.key -out development.crt -days 5000 -nodes | |
cd .. |
# | |
# Shared definition of ruby microservice | |
# | |
microservice: | |
command: "runsvdir /etc/service" | |
environment: | |
PORT: 3000 | |
RAILS_ENV: development | |
SERVICE_PLATFORM: "mia" | |
ports: |
Using the nc command you can scan a port or a range of ports to verify whether a UDP port is open and able to receive traffic. | |
This first command will scan all of the UDP ports from 1 to 65535 and add the results to a text file: | |
$ nc -vnzu server.ip.address.here 1-65535 > udp-scan-results.txt | |
This merely tells you that the UDP ports are open and receive traffic. | |
Perhaps a more revealing test would be to actually transfer a file using UDP. |
# SSL self signed localhost for rails start to finish, no red warnings. | |
# 1) Create your private key (any password will do, we remove it below) | |
$ openssl genrsa -des3 -out server.orig.key 2048 | |
# 2) Remove the password | |
$ openssl rsa -in server.orig.key -out server.key |