Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

This is a demo of how to talk between programs running on a Mac, and programs running under Docker on a VM on the same Mac as installed by Docker Toolbox.

Just add a route to your containers using the VM as the gateway. Demo:

  • on the mac, run Docker Quickstart Terminal from the latest Docker Toolbox. This launches the virtualbox VM, and configures your shell
  • in that shell, figure out the IP address of the VM:
mak@crab 493 ~ $ docker-machine inspect default -f '{{ .Driver.IPAddress }} '
192.168.99.100 
@makuk66
makuk66 / transfer-network-config
Created June 14, 2011 09:25
Notes about using point-to-point links for routing IP addresses in virtual machines
Some experiments, which worked but were eventually not used.
See http://www.greenhills.co.uk/2011/06/10/lxc.html
Now, the next big milestone is to get networking working.
In the config, we told lxc-create to use br0 as the link,
and inside the container we have eth0:
root@thunder:/# brctl show br0
bridge name bridge id STP enabled interfaces
br0 8000.962e6bb72480 no vethP70LNx
FROM ubuntu
RUN echo "deb http://us.archive.ubuntu.com/ubuntu/ precise main universe" >> /etc/apt/source.list
RUN apt-get update
RUN apt-get -y install rsyslog
ADD ./rsyslog.conf /etc/rsyslog.conf
ENTRYPOINT ["/usr/sbin/rsyslogd", "-n"]
@makuk66
makuk66 / todo-example
Created June 14, 2019 19:21
A TODO list example
- [x] Pick the flowers
- [ ] Call John 9303032332
- [x] Cancel cable subscription
- [ ] Book the flight tickets
@makuk66
makuk66 / cloudstack-sethostname.sh
Last active May 24, 2019 16:58
dhclient hook for setting the hostname, updating /etc/hosts, and re-generating ssh keys on Ubuntu. Useful for creating CloudStack templates. See https://issues.apache.org/jira/browse/CLOUDSTACK-4556
#!/bin/sh
# dhclient change hostname script for Ubuntu
# /etc/dhcp/dhclient-exit-hooks.d/sethostname
# logs in /var/log/upstart/network-interface-eth0.log
# for debugging:
echo "sethostname BEGIN"
export
set -x
@makuk66
makuk66 / hung-clienttests.py
Created April 17, 2018 13:34
hung-clienttests
#/usr/bin/python
"""
Match up tests starting and completing to find hung tests
"""
import re
import sys
STARTED_RE = re.compile(r'^.* > .*STARTED$')
PASSED_RE = re.compile(r'^.* > .*PASSED$')
SKIPPED_RE = re.compile(r'^.* > .*SKIPPED$')
FAILED_RE = re.compile(r'^.* > .*FAILED$')

Keybase proof

I hereby claim:

  • I am makuk66 on github.
  • I am makuk66 (https://keybase.io/makuk66) on keybase.
  • I have a public key ASCCjDJ6wHkiF9jfwLeEZd_Ce5EdHo4YeecL5-_gJ3LO2wo

To claim this, I am signing this object:

@makuk66
makuk66 / docker-solr-oneoff.sh
Last active September 18, 2017 10:34
Create a docker solr image for RCs
#!/bin/bash
#
# Script to try out RCs. It's not exactly the same as the full docker-solr
# Dockerfiles, but close.
set -euo pipefail
# URL from command-line.
# If you want to find the latest, go to https://dist.apache.org/repos/dist/dev/lucene/ and click down to the solr tar.gz
@makuk66
makuk66 / solrj.java
Created November 22, 2011 21:32
a simple solrj with basic authentication example
/*
* Simple SolrJ with basic auth example
*
* wget http://apache.mirrors.timporter.net//lucene/solr/3.4.0/apache-solr-3.4.0.tgz
* tar xvzf apache-solr-3.4.0.tgz
*
* CLASSPATH=apache-solr-3.4.0/dist/apache-solr-solrj-3.4.0.jar:apache-solr-3.4.0/dist/solrj-lib/commons-codec-1.4.jar:apache-solr-3.4.0/dist/solrj-lib/commons-httpclient-3.1.jar:apache-solr-3.4.0/dist/solrj-lib/commons-io-1.4.jar:apache-solr-3.4.0/dist/solrj-lib/jcl-over-slf4j-1.6.1.jar:apache-solr-3.4.0/dist/solrj-lib/slf4j-api-1.6.1.jar:.
*
* javac -cp $CLASSPATH solrj.java
* java -cp $CLASSPATH solrj
@makuk66
makuk66 / rsolr-basic-auth.rb
Created November 22, 2011 20:36
a simple Rsolr 1.0.3 example for basic auth
#!/usr/bin/env ruby
#
# A simple Rsolr 1.0.3 example for basic auth
#
# rvm gemset create rsolr-example
# rvm use rsolr-example
# gem install rsolr
require 'rsolr'