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
@thaJeztah
thaJeztah / gpg-import-and-export-instructions.md
Created May 14, 2016 00:22 — forked from chrisroos/gpg-import-and-export-instructions.md
Instructions for exporting/importing (backup/restore) GPG keys

Every so often I have to restore my gpg keys and I'm never sure how best to do it. So, I've spent some time playing around with the various ways to export/import (backup/restore) keys.

Method 1

Backup the public and secret keyrings and trust database

cp ~/.gnupg/pubring.gpg /path/to/backups/
cp ~/.gnupg/secring.gpg /path/to/backups/
cp ~/.gnupg/trustdb.gpg /path/to/backups/

or, instead of backing up trustdb...

@thaJeztah
thaJeztah / compose-hooks.sh
Created February 1, 2016 18:28 — forked from dnephin/compose-hooks.sh
Execute a hook in './hooks/<service>/<action>' when that event is received
#!/bin/bash
set -e
function handle_event() {
local entry="$1"
local action=$(echo $entry | jq -r '.action')
local service=$(echo $entry | jq -r '.service')
local hook="./hooks/$service/$action"
if [ -x "$hook" ]; then
"$hook" "$entry"
@thaJeztah
thaJeztah / NamesGenerator.php
Created January 2, 2016 12:53 — forked from jesusgoku/NamesGenerator.php
Port of NameGenerator use for Docker
<?php
namespace JesusGoku;
/**
* NamesGenerator
*
* Port of NameGenerator use for Docker
*
* @author Jesús Urrutia <[email protected]>
@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

@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 / 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 / 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):

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