Skip to content

Instantly share code, notes, and snippets.

@JeffreyVdb
JeffreyVdb / ansible-role-test.sh
Created December 31, 2017 10:19 — forked from geerlingguy/ansible-role-test.sh
Ansible Role Test Shim Script
#!/bin/bash
#
# Ansible role test shim.
#
# Usage: [OPTIONS] ./tests/test.sh
# - distro: a supported Docker distro version (default = "centos7")
# - playbook: a playbook in the tests directory (default = "test.yml")
# - cleanup: whether to remove the Docker container (default = true)
# - container_id: the --name to set for the container (default = timestamp)
# - test_idempotence: whether to test playbook's idempotence (default = true)
@JeffreyVdb
JeffreyVdb / consul.service
Created June 13, 2017 13:24 — forked from yunano/consul.service
/etc/systemd/system/consul.service
[Unit]
Description=consul agent
Requires=network-online.target
After=network-online.target
[Service]
EnvironmentFile=-/etc/sysconfig/consul
Environment=GOMAXPROCS=2
Restart=on-failure
ExecStart=/usr/local/sbin/consul agent $OPTIONS -config-dir=/etc/consul.d

Conventions:

Defining Eloquent model (will assume that DB table named is set as plural of class name and primary key named "id"):

class Shop extends Eloquent {}

Using custom table name

protected $table = 'my_shops';

@JeffreyVdb
JeffreyVdb / 0_reuse_code.js
Created May 22, 2014 18:43
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@JeffreyVdb
JeffreyVdb / postinstall.sh
Last active August 29, 2015 14:01 — forked from evansd/postinstall.sh
Vagrant post box virtual machine installation script
#!/bin/bash
# Setup a debian based vagrant machine
TO_CLEAN_PKGS=()
nullify_free_space() {
echo 'clearing free space'
dd if=/dev/zero of=/EMPTY bs=1M
rm -f /EMPTY
}