Skip to content

Instantly share code, notes, and snippets.

View richardprice's full-sized avatar

Richard Price richardprice

View GitHub Profile
  1. Boot RancherOS with rancher.autologin=tty1
  2. Put cloud-config.yml in /var/lib/rancher/conf/cloud-config.d/
  3. Run the command cloud-init-execute
  4. Check the contents of /home/rancher/.ssh/authorized_keys
  5. Try to login and if it doesn't work, check logging in /var/log/messages
@richardprice
richardprice / 00-cloud-config.yml
Created April 29, 2020 05:41 — forked from janeczku/00-cloud-config.yml
Annotated RancherOS Cloud-init configuration snippets
#cloud-config
# Set the hostname for this machine (takes precedence over hostname assigned by DHCP lease).
hostname: myhost
# Authorize SSH keys for the `rancher` sudoer user
ssh_authorized_keys:
- ssh-rsa AAA...ZZZ example1@rancher
@richardprice
richardprice / cloud-config.yml
Created April 29, 2020 05:40 — forked from janeczku/cloud-config.yml
Example RancherOS configuration
#cloud-config
hostname: host-0815
ssh_authorized_keys:
- ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDA61LSHA7iU+82Z2qypYLx2gB9uHydUOoDON30ceAKl5dSgzShtF5XS5sqABYBMowDcvdkNyUDdt1Druv82iu/scATLFmxTQ8R2XIL33dMO6IpBg0d3WQcU5Xqeor9s5LTpln7F0V+9vaYG/nXqQtnz4PEnZGA+f9ddHuvcDajqKLNTDyriL87E6HAfjNU+1ShI2Qv8Zqhq8rYW0zkn2C+4vVKpgzq8B91R7hSXZwUTU9+bIq3uqTfe/t9/5hFNZEUo/ezV25DFvWDmvKcXt1QRoLxL/NI7h00fEJY7QVh2eevtiA9BdthI2LHx2tm2LoMYHQVZUVljm033xh2UISx
runcmd:
- echo "true" > /home/rancher/provisioned
write_files:
- path: /etc/docker/certs.d/private-registry.internal/ca.crt
package handlers
import (
"encoding/json"
"net/http"
)
type Pageable struct {
Total int
Items interface{}
@richardprice
richardprice / nginx.conf
Created October 11, 2017 09:32 — forked from thockin/nginx.conf
Idea: nginx vanity domain fronting gcr.io
# This is a GCR vanity domain. It aliases our domain to a specific
# bucket in GCR.
# e.g.`docker pull gcr.example.com/foobar` -> gcr.io/my_bucket/foobar
server {
server_name gcr.example.com;
listen 80;
listen 443 ssl;
location = /v2/ {
# If we redirect this, it can detect as unauthorized, but the token
@richardprice
richardprice / 1_kubernetes_on_macOS.md
Created August 17, 2017 06:24 — forked from kevin-smets/1_kubernetes_on_macOS.md
Local Kubernetes setup on macOS with minikube on VirtualBox and local Docker registry

Requirements

Minikube requires that VT-x/AMD-v virtualization is enabled in BIOS. To check that this is enabled on OSX / macOS run:

sysctl -a | grep machdep.cpu.features | grep VMX

If there's output, you're good!

Prerequisites

1. Create the KV config:
docker run traefik \
storeconfig \
--consul \
--consul.prefix="traefik" \
--consul.watch \
--consul.endpoint="CONSUL_IP:8500" \
--consulcatalog=true \
--consulcatalog.endpoint="CONSUL_IP:8500" \
@richardprice
richardprice / .zshrc
Created January 18, 2016 09:49 — forked from jchannon/.zshrc
# Path to your oh-my-zsh installation.
export ZSH=$HOME/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
ZSH_THEME="ducknorris"
# Uncomment the following line to use case-sensitive completion.
@richardprice
richardprice / cacheimplementation.cs
Last active September 2, 2015 18:59 — forked from jchannon/cacheimplementation.cs
Nancy caching using Last-Modified/If-Modified-Since header
public class Cache : ICache
{
private ConcurrentDictionary<string, DateTime> cacheLookup = new ConcurrentDictionary<string,DateTime>();
public Response Get(NancyContext ctx)
{
DateTime lastmodified;
if(ctx.Request.Method == "GET") //Could be POST as well I guess
{
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Net;
namespace EventStoreService
{
public class EventStoreService
{