Skip to content

Instantly share code, notes, and snippets.

View webdev's full-sized avatar
💭
Exploring Awesomenesss

George Blazer webdev

💭
Exploring Awesomenesss
  • San Francisco, CA
View GitHub Profile
type loggingResponseWriter interface {¬
+ ▸ http.ResponseWriter¬
+ ▸ Status() int¬
+ ▸ Size() int¬
+ }¬
+ ¬
func Log(handler http.Handler) http.Handler {¬
▸ return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {¬
~ ¬
~ ▸ ▸ logger := &loggingResponseWriter{w: w}¬
@webdev
webdev / gist:e3398cde0c2895f2fe66
Created October 16, 2014 20:05
Cat file into container
docker run --rm -i --volumes-from ssh -w /root/.ssh busybox sh -c 'cat > id_rsa.pub' < ~/.ssh/id_rsa
@webdev
webdev / gist:ee2889756adb8c89e53e
Last active August 29, 2015 14:06
Dind (plugin container pattern)
docker run -p 8080:8080 -v /data/jenkins:/var/jenkins_home -v /var/run/docker.sock:/var/run/docker.sock -v $(which docker):$(which docker) --privileged -u root jenkins
# Use user `root`

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"
#!/usr/bin/env ruby
require 'rubygems'
require 'bundler'
require 'fileutils'
require 'net/http'
require 'net/https'
require 'uri'
TMP_DIR = "/tmp/gems"

I just had to set up Jenkins to use GitHub. My notes (to myself, mostly):

Detailed Instructions

For setting up Jenkins to build GitHub projects. This assumes some ability to manage Jenkins, use the command line, set up a utility LDAP account, etc. Please share or improve this Gist as needed.

Install Jenkins Plugins

RUN mkdir -p /var/log/supervisor
RUN apt-get install -y supervisor
ADD supervisord.conf /etc/supervisor/conf.d/supervisord.conf
supervisor.conf
[supervisord]
nodaemon=true
root@prod-mysql-10:/var/lib/mysql/backup# !482
innobackupex --use-memory=500M --ibbackup xtrabackup_51 --apply-log .
InnoDB Backup Utility v1.5.1-xtrabackup; Copyright 2003, 2009 Innobase Oy
and Percona LLC and/or its affiliates 2009-2013. All Rights Reserved.
This software is published under
the GNU GENERAL PUBLIC LICENSE Version 2, June 1991.
IMPORTANT: Please check that the apply-log run completes successfully.
@webdev
webdev / stub.go
Created November 4, 2013 23:47 — forked from ClayShentrup/stub.go
package main
import (
"fmt"
"reflect"
"time"
)
func main() {
stubPrototype := func(in []reflect.Value) []reflect.Value {
import "unused"
// This declaration marks the import as used by referencing an
// item from the package.
var _ = unused.Item // TODO: Delete before committing!