‘#+TITLE: Literate Devops
See the Presenter’s Notes for details about each frame.
- First invented by Donald Knuth in 1980’s
- Inverted style from “code” peppered with comments
- Emphasize communication to people / team
“Let us change our traditional attitude to the construction of programs. Instead of imagining that our main task is to instruct a computer what to do, let us concentrate rather on explaining to human beings what we want a computer to do.” —Donald Knuth
What if it was possible?
- Great at thought collection and organization
- Love the hyperlinks
- Rich system builds on small, simple parts
- Fully functional literate programming model
- Execute code from within the document
- Weave code from multiple languages
“In the third millennium, does it still make sense to work with text files? Text files are the only truly portable format for files. The data will never get lost.” —Carsten Dominik
“A literate program provides an unambiguous place to start with an unfamiliar code base and a direction to go.” —Shane Celis
- System administration and devops is very unfamiliar
- I felt that structure and clarity would help
- Questions to team-mates required more context/background.
Started applying literate programming to devops.
The best way to explain literate programming,
is to demonstrate literate programming.
- Everything I’m about to show is built into Emacs!
- However, how I show it might not…
- Following is a “day in my life” … I’ll type fast so you don’t have to wait. ☺
- Wrote demo-it to help create these demonstrations (on MELPA)
- M-s h r
- highlight-regexp
- M-s h u
- unhighlight-regexp
- M-s h .
- highlight-symbol-at-point
- yasnippet
- auto inserting text
- Using: org-bullets and org-beautify-theme
- Font: Source Code Pro and Source Sans Pro
- Colors: Sanityinc’s Tomorrow Night
- Modeline: Powerline … all described in my dot-files collection on Github.
- Use expand-region to select section
Or:
C-x n s
for org-narrow-to-subtree - Use org-mime-org-buffer-htmlize to send email (located in org-plus-contrib package)
- Others ox packages export to wikis, chats, Slack, etc.
- Write in past tense
- Use org-mode headers and properties to keep clutter from the source code blocks
- Use a session property:
- View the session buffer
hostname -i
We often have to deal with files on a remote system. These two can be edited as easy as a clicking a hyperlink.
Written as: /goblin.howardabrams.com:website/index.html ↑ ↑ ↑ ↑ Initial slash hostname colon path to file
Systems in my data center require a bastion AND jump box to get to the host that I want:
One Tramp ‘protocol’ is sudo …
/ssh:minecraft.howardabrams.com|sudo:minecraft.howardabrams.com:/etc/passwd ↑ ↑ Start with New Protocol Protocol
Post-presentation Linkage:
- http://howardism.org/Technical/Emacs/literate-devops.html (or: http://bit.ly/1fchhRR) My initial essay that started this presentation
- http://github.com/howardabrams/demo-it Emacs code used to make this demonstration Find it on MELPA: demo-it
- http://github.com/howardabrams/dot-files Contains all my Emacs configuration file