Skip to content

Instantly share code, notes, and snippets.

@tetheredge
tetheredge / subcommand.go
Last active February 19, 2016 02:43 — forked from iamralch/subcommand.go
flag package: subcommand example
package main
import (
"flag"
"fmt"
"os"
)
func main() {
askCommand := flag.NewFlagSet("ask", flag.ExitOnError)

Docker Container/Image Basics

This is a basic step by step intro to working with Docker containers and Images. You should be able to follow along with your installation of docker, but be sure to change IDs/naming schemes according to your use case.

The goal of this exercise is to create a base image from the ubuntu base image that has both the jre and htop installed.

Start up an ubuntu container to modify, install htop, then exit.

docker run -t -i ubuntu /bin/bash

Get the ID of the container you just modified.

Building a new Base Image

Practical documentation on how to create a new base image.

Pick a Base Image to work on.

First we'll want to identify what image we are going to use as our base image to modify is.

In this example our previous base image is old-oca-bastion.

Define a Goal

We have been tasked with doing the following:

Migrating Docker Storage....

Stop Docker Service

rdocker-cli.rb restart_docker_service IP

Copy all the things!

require 'minitest/mock'
require 'minitest/unit'
require 'date'
MiniTest::Unit.autorun
class TestMailPurge < MiniTest::Unit::TestCase
class MailPurge
def initialize(imap)
@imap = imap
// includes bindings for fetching/fetched
var PaginatedCollection = Backbone.Collection.extend({
initialize: function() {
_.bindAll(this, 'parse', 'url', 'pageInfo', 'nextPage', 'previousPage');
typeof(options) != 'undefined' || (options = {});
this.page = 1;
typeof(this.perPage) != 'undefined' || (this.perPage = 10);
},
fetch: function(options) {
#include <cstdint>
#include <arpa/inet.h>
/** Returns the IPv4 broadcast address for a given subnet.
*
* Assuming host is little endian.
* Assuming your host is Linux :)
*
* subtracting 1 from the return will yield last usable host address.
*