packer: virtualbox

Vagrantvagrant init hashicorp/precise64vagrant upvagrant destroy -f Generate Packerfind ~/.vagrant.d/ -name '*ovf' -ls | grep hashicreate ex001.jsonsee belowfix "source_path" to ovf file to match your systempacker validate ex001.jsonpacker build ex001.jsonvagrant box add my-box-001 --force Test mkdir test001cd test001vagrant initin generated "Vagrantfile", change 1st line to 2nd line = "base" = "my-box-001"vagrant upvagrant sshcat /var/tmp/welcome.txtshould say, "welcome001"vagrant destroy -f Cleanup vagrant box remove my-box-001 --forcevagrant box remove hashicorp/precise64 --force
  "builders": [{
      "type": "virtualbox-ovf",
      "source_path": "<path to your home dir>/.vagrant.d//boxes/hashicorp-VAGRANTSLASH-precise64/1.1.0/virtualbox/box.ovf",
      "ssh_username": "vagrant…

end is nigh: serverless

"For a small company focused on rapid growth, the last thing we wanted to deal with was disk space and memory management, logging agents, security patches, operating system updates, and other traditional server management processes."


def recursive_countdown(x):
    print('Countdown: ' + str(x))
    if x == 1:
        return 1
        return recursive_countdown(x - 1)


def recursive_fib(x):
    #print('Fib: ' + str(x))
    if x in [0, 1]:
        return x
        return (recursive_fib(x - 1) + recursive_fib(x -2 ))

# this algo can be easily improved if answers are indexed


Python: sort by value then key

No idea yet how this works, or why. >>> d = {'apple': 7, 'banana': 3, 'almond': 7, 'peach': 4, 'beetroot': 3} >>> sorted(d.iteritems(), key=lambda(k, v): (-v, k)) [('almond', 7), ('apple', 7), ('peach', 4), ('banana', 3), ('beetroot', 3)]

Basic Ansible in 10 mins

"site.yml" fileplaybook containing"roles" that will be applied to individual host groups / "hosts"how the hosts will be accessedand by what user to run asPuppet equivalent is "nodes.pp""hosts" fileuse real/local DNS hostname to define which hosts are in which hostgroupsexample: webserver1, webserver2, haproxy1, haproxy2, mongo1, mongo2some variables like "port" can be added too"group-vars" directorykey/value pairs to use when generating output from template filesfiles named identically to hostgroup names defined in "hosts" filethese are more in-line in Puppet, and less controllable/flexible"roles" directoryPuppet equivalents are "modules"/"classes"directories arbitrarily named to match "roles" in site.ymle.g. "tomcat", "common", "mongod""templates" directoryfiles with variables that are resolved using "group-vars" key…

Keeping up with Hashicorp's Vault

To retrieve secrets, employees replace plaintext secrets with a call to Secrets Manager APIs, eliminating the need to hard-code secrets in source code or update configuration files and redeploy code when secrets are rotated.