Skip to content

Instantly share code, notes, and snippets.

#! /bin/bash
set -eo pipefail
for container in $(docker ps --no-trunc --all --quiet --filter status=exited); do
docker rm $container
done
for image in $(docker images -q -f "dangling=true"); do
docker rmi $image

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 
Different handling of `hh`:
groovy:000> import java.text.SimpleDateFormat
===> java.text.SimpleDateFormat
groovy:000> parser=new SimpleDateFormat("EEE MMM d hh:mm:ss yyyy Z")
===> java.text.SimpleDateFormat@fee3c270
groovy:000> parser.parse("Wed Sep 30 17:14:25 2015 -0700")
===> Thu Oct 01 01:14:25 BST 2015
groovy:000> parser2=new SimpleDateFormat("EEE MMM d HH:mm:ss yyyy Z")
===> java.text.SimpleDateFormat@87bd4670

I used ssldump on OSX and got a lot of "unknown value" for ciphers:

1 1  0.1727 (0.1727)  C>S  Handshake
      ClientHello
        Version 3.1 
        cipher suites
        Unknown value 0xc009
        Unknown value 0xc013
 Unknown value 0x2f
# quick and dirty script to split the output of "git log" into separate files for Fusion to index.
writer=None
with open('gitlog', 'r') as f:
for line in f:
if line.startswith('commit '):
(word, commit) = line.strip().split(' ')
if writer != None:
writer.close()
writer = open('data/' + commit + '.txt', 'w')
writer.write(line)
--- venv/lib/python2.7/site-packages/github/CommitStatus.py.orig 2016-07-26 15:14:41.131180197 +0000
+++ venv/lib/python2.7/site-packages/github/CommitStatus.py 2016-07-26 15:52:54.506709022 +0000
@@ -70,6 +70,13 @@
return self._state.value
@property
+ def context(self):
+ """
+ :type: string
+ """
#!/bin/bash
#
# A helper script to initialise a custom SOLR_HOME.
# For example:
#
# mkdir mysolrhome
# sudo chown 8983:8983 mysolrhome
# docker run -it -v $PWD/mysolrhome:/mysolrhome -e SOLR_HOME=/mysolrhome solr
#
@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

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 / 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$')