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
# 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

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 -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
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.com
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters
* Source: https://core.trac.wordpress.org/browser/tags/3.9/src/wp-includes/query.php
*/
$args = array(
@thaJeztah
thaJeztah / Dockerfile
Last active August 29, 2015 14:21 — forked from dreamcat4/Dockerfile
FROM ubuntu-debootstrap:14.04
MAINTAINER dreamcat4 <[email protected]>
ENV _clean="rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*"
ENV _apt_clean="eval apt-get clean && $_clean"
# Install s6-overlay
ENV s6_overlay_version="1.10.0.0"
ADD https://github.com/just-containers/s6-overlay/releases/download/v${s6_overlay_version}/s6-overlay-amd64.tar.gz /tmp/
RUN tar zxf /tmp/s6-overlay-amd64.tar.gz -C / && $_clean

Docker Registry API V1 walkthrough

Matthew Riley ([email protected])

This document summarizes the interactions between the Docker client and the Docker Hub during push and pull commands through version 1 of the registry API. It was compiled to aid in writing a compatible registry server implementation after the existing API documentation proved occasionally incomplete or inaccurate.

Behavior and code links were as of Docker v1.2.0.

docker {push|pull} H:P/R[:T]
Host, Port, Repository ([namespace/]image), Tag

@thaJeztah
thaJeztah / windows-volume-regex.md
Last active September 10, 2015 22:55
Quick testing of regexes for Windows volumes

Quick 'n dirty testing regexes for Windows volumes

See docker issue moby/moby#16140

This regex captures Windows paths nicely;

^[a-zA-Z]:(\\[^\:\\]+)*\\?$

And long paths (e.g. \\?\C:\Program files (x86)\notepad.exe):

@thaJeztah
thaJeztah / Monaco for Powerline.otf
Last active September 18, 2015 14:33 — forked from baopham/Monaco for Powerline.otf
Patched font Monaco for OSX Vim-Powerline
@thaJeztah
thaJeztah / two_factor_ssh.md
Created December 24, 2015 21:02 — forked from sankage/two_factor_ssh.md
Two Factor Authentication for ssh

Simple Two-Factor SSH Authentication

Posted on September 23 2011 by Richard Taylor (@moomerman)

In a two-part post I'm going to show you some tricks you can do with SSH logins. This post covers setting up two-factor SSH authentication with the Google Authenticator app.

I was recently getting some servers in shape so I can pass the Payment Card Industry standards questionnaire and one requirement was two-factor authentication access to the server. I queried whether SSH key + passphrase was acceptable but didn't get a clear answer so I figured I'd explore setting up another authentication factor myself, plus it piqued my interest.

After a bit of research I found it was possible using a PAM module but it doesn't work along with SSH key authentication (only password authentication) and I only use SSH key logins for my servers.

The magic

@thaJeztah
thaJeztah / gist:65a3e551521a26b7957c
Created December 24, 2015 21:19 — forked from tr3buchet/gist:5105747
yubikey OR private key ssh authentication on debian

the grand idea

I like public key auth. I feel safer using them instead of a username and password login. But, I might not have my private key with me at a time where I need access.

I started using yubikey with LastPass and since I have it always on my keychain, I decided to find more ways to make use of it.

I wasn't originally aware, but if you pass a private key to ssh and sshd is configured to accept a key, it appears pam isn't used. Your authorized keys are checked and you are logged in. If you don't pass a private key, ssh falls back to the more standard un*x style login found in /etc/pam.d/sshd. This is where we'll add the yubikey pam. I am currently unaware of a way to use both public key auth and yubikey for login.

These steps worked for me on debian squeeze/wheezy.

more info at the yubico-pam github repo