Skip to content

Instantly share code, notes, and snippets.

@whiteinge
whiteinge / complex_salt_orchestrate.sls
Last active March 20, 2024 15:48
An example of a complex, multi-host Salt Orchestrate state that performs status checks as it goes
# /srv/salt/upgrade_the_app.sls
# Example of a complex, multi-host Orchestration state that performs status checks as it goes.
# Note, this is untested and is meant to serve as an example.
# Run via: salt-run state.orch upgrade_the_app pillar='{nodes: [nodeA, nodeB], version: 123}'
{% set nodes = salt.pillar.get('nodes', []) %}
{% set all_grains = salt.saltutil.runner('cache.grains',
tgt=','.join(nodes), tgt_type='list') %}
{# Default version if not given at the CLI. #}
@pcn
pcn / figwheel-emacs-cider.txt
Created October 27, 2015 04:24 — forked from auramo/figwheel-emacs-cider.txt
figwheel emacs cider stuff
## Using Emacs CIDER as the Figwheel REPL tool
project.clj should have this line:
```
:figwheel { :nrepl-port 7888 }
```
At the defproject-level.
It enables external tools to connect to the Figwheel REPL. To connect
@henrysher
henrysher / reinvent.md
Last active July 9, 2021 07:38
link for reinvent slides
@tbonza2
tbonza2 / gist:20757551443a61254aa6
Last active November 4, 2016 21:39
Saltstack mode for emacs

Saltstack mode for emacs

Earlier today I was looking for a Saltstack mode for emacs. Couldn't find one, so I posted the question on Stack overflow. Somebody had a good suggestion about using yaml-mode because a Sublime Text implementation appeared to be taking this approach.Another person thought that Saltstack's use of jinja templates would make an emacs mode easy enough to configure. These were both helpful ideas so I wanted to implement parts of each.

Reasoning

After looking around, I found that someone had configured an emacs mode for a similar situation. They needed to combine HTML and Python to use Mako templates for a project not involving Saltstack. Since Edx uses Mako t

@shinmuro
shinmuro / mutable-deftype.clj
Last active January 5, 2021 22:10
Clojure deftype that has mutable field and setter method sample.
(defprotocol IEditName
(get-name [this])
(set-name! [this val]))
(deftype PersonName [^:volatile-mutable lname]
IEditName
(get-name [this] (. this lname))
(set-name! [this val] (set! lname val)))
(def pname (PersonName. "hoge"))
@dch
dch / erlang.rb
Last active August 29, 2015 13:56
Install OTP 17.0-rc2 via homebrew: `brew install wxmac && brew install --no-docs --with-dirty-schedulers --time --devel -v https://gist.githubusercontent.com/dch/9267866/raw/erlang.rb`
require 'formula'
# Major releases of erlang should typically start out as separate formula in
# Homebrew-versions, and only be merged to master when things like couchdb and
# elixir are compatible.
class Erlang < Formula
homepage 'http://www.erlang.org'
# Download tarball from GitHub; it is served faster than the official tarball.
url 'https://github.com/erlang/otp/archive/OTP_R16B03-1.tar.gz'
sha1 'b8f6ff90d9eb766984bb63bf553c3be72674d970'
@shellbj
shellbj / vsphere-plugin-mac-change.rb
Created May 31, 2013 15:16
Knife VSphere plugin we use to change the MAC address on the cloned VM's network adapter.
require 'rbvmomi'
class KnifeVspherePlugin
def data=(cplugin_data)
@mac_address = cplugin_data
end
def reconfig_vm(target_vm)
if (!@mac_address)
abort ("MAC address not provided")