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
  • thaJeztah
  • Netherlands
  • 12:20 (UTC +02:00)
  • X @thaJeztah
View GitHub Profile
@thaJeztah
thaJeztah / docker-compile.pl
Last active August 29, 2015 14:02 — forked from mpasternacki/docker-compile.pl
Perl script to build a Docker image from Dockerfile that creates the image in a single layer, without any intermediate images. Needs JSON CPAN module (available as `libjson-perl` Debian/Ubuntu package). Usage: run the script in the directory that contains a Dockerfile. More details in a blog post: http://3ofcoins.net/2013/09/22/flat-docker-images/
#!/usr/bin/env perl
use feature 'switch';
use strict;
use warnings;
use Data::Dumper;
use File::Basename;
use File::Copy;
use File::Path qw/make_path/;
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 / 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 = git@github.com: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:

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 <dreamcat4@gmail.com>
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 (mattdr@google.com)

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