Skip to content

Instantly share code, notes, and snippets.

/usr/local/bin/nginx:
apt install nginx
VENV=.venv
$(VENV):
virtualenv $(VENV)
$(VENV)/bin/py.test: $(VENV)
$(VENV)/bin/pip install dev_requirements.txt
test: $(VENV)/bin/py.test
$(VENV)/bin/py.test .
SOURCES=$(shell find . -name '*.go')
myapp: $SOURCES
go build -o myapp ./cmd/myapp
func CreateExecutor(cmdType string, cmdCfg CommandConfig) *CommandExecutor {
ce := &CommandExecutor{}
switch cmdType {
case "docker":
ce.Command = CreateDockerCommand(cmdCfg)
case "ssh":
ce.Command = CreateSSHCommand(cmdCfg)
}
type CreateCommand func() []string
type CommandExecutor struct {
CmdString string
Command CreateCommand
}
func (ce *CommandExecutor) defaultCommand() []string {
return []string{"/bin/bash", "-c", ce.CmdString}
}
---
- exec:
cmd: ls -la
- docker:
image: ubuntu
cmd: ls -la
- ssh:
connect: foo.example.com
package main
import (
"encoding/json"
"flag"
"fmt"
"io/ioutil"
"os"
"github.com/ionrock/procs"
@ionrock
ionrock / rspec_failure
Created May 7, 2017 03:29
this makes no sense....
Failure/Error: expect(model).to eq('environment')
expected: "environment"
got: "environemnt"
(compared using ==)
with_items: "{% for host in groups['app'] %}"
- "{{ host }}"
"{% endfor %}"
(defun source-to-elisp (fname)
(with-temp-buffer
(insert-file fname)
(while (re-search-forward "^export \\(.*\\)=\\(.*\\)")
(let ((key (match-string 1))
(value (replace-regexp-in-string "\'\"" "" (match-string 2))))
(if (and key value)
(progn
(setenv key value)))))))