Skip to content

Instantly share code, notes, and snippets.

View thaJeztah's full-sized avatar
🐳
Reviewing da peee-aaaaarrs

Sebastiaan van Stijn thaJeztah

🐳
Reviewing da peee-aaaaarrs
View GitHub Profile
#!/bin/bash -eu
#
# @description Get containers info and stats using the Docker Remote API
# @deps curl, jq
# @usage docker-stats.sh host-42 101.0.0.42
DOCKER_HOSTNAME=$1
DOCKER_IP=$2
DOCKER_PORT=2376
CERT_DIR=~/.docker/machines/.client

Configuring Boot2Docker to use NFS on an OSX based machine

  • To improve the speed of Boot2Docker drastically, you will want to set it up to use NFS.
  • You will need to do the following once on your host machine:
    • Add this to /etc/exports on your mac

      # BOOT2-DOCKER-BEGIN
      /Users 192.168.59.103 -alldirs -mapall=501:20
      # BOOT2-DOCKER-END
      
#!/bin/bash
# Repro case for https://github.com/docker/docker/issues/783
cat << EOF > Dockerfile
FROM ubuntu:14.04
# Create and change permissions in a single step (layer)
RUN mkdir -m 700 /single-layer && chmod 777 /single-layer
@thaJeztah
thaJeztah / pr.md
Last active August 29, 2015 14:15 — forked from piscisaureus/pr.md

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = [email protected]:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@thaJeztah
thaJeztah / gist:62dc9d655e8e836414f7
Created January 28, 2015 21:11
MySQL 5.6.22 logs
Running mysql_install_db ...
2015-01-28 21:08:47 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2015-01-28 21:08:47 12 [Note] InnoDB: Using atomics to ref count buffer pool pages
2015-01-28 21:08:47 12 [Note] InnoDB: The InnoDB memory heap is disabled
2015-01-28 21:08:47 12 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2015-01-28 21:08:47 12 [Note] InnoDB: Memory barrier is not used
2015-01-28 21:08:47 12 [Note] InnoDB: Compressed tables use zlib 1.2.7
2015-01-28 21:08:47 12 [Note] InnoDB: Using Linux native AIO
2015-01-28 21:08:47 12 [Note] InnoDB: Using CPU crc32 instructions
2015-01-28 21:08:47 12 [Note] InnoDB: Initializing buffer pool, size = 128.0M
@thaJeztah
thaJeztah / Dockerfile
Created January 15, 2015 16:18
Alternative Dockerfile
FROM ubuntu:trusty
MAINTAINER Paul Bowsher <[email protected]>
RUN apt-get update && apt-get install -y -q \
build-essential \
git \
libssl-dev \
libsqlite3-dev \
nodejs \
ruby-dev \
@thaJeztah
thaJeztah / gist:2bead9762a7c9df6dee4
Created December 21, 2014 13:37
default packages in debian:wheezy
dpkg --get-selections
apt							install
base-files					install
base-passwd					install
bash						install
bsdutils					install
coreutils					install
dash						install
debconf						install

debconf-i18n install

@thaJeztah
thaJeztah / docker-examples.md
Last active October 11, 2024 12:20
Some docker examples

Commit, clone a container

To 'clone' a container, you'll have to make an image of that container first, you can do so by "committing" the container. Docker will (by default) pause all processes running in the container during commit to preserve data-consistency.

For example;

docker commit --message="Snapshot of my container" my_container my_container_snapshot:yymmdd
setenv SSH_ENV $HOME/.ssh/environment
if [ -n "$SSH_AGENT_PID" ]
ps -ef | grep $SSH_AGENT_PID | grep ssh-agent > /dev/null
if [ $status -eq 0 ]
test_identities
end
else
if [ -f $SSH_ENV ]
. $SSH_ENV > /dev/null
@thaJeztah
thaJeztah / gist:ace613f8433ac888ea41
Created November 15, 2014 16:21
New regex (JSON API V2)

New regex (JSON API V2)

Quick evaluation of the regex as proposed in moby/moby#9015 and mentioned in moby/moby#8961 (comment)

NOTE 1; The actual regex is [a-z0-9]+(?:[._-][a-z0-9]+)*. I left out the ?:, because that only distracts here and is to make the group 'non-capturing'