Skip to content

Latest commit

 

History

History
186 lines (117 loc) · 5.99 KB

presentation.org

File metadata and controls

186 lines (117 loc) · 5.99 KB

‘#+TITLE: Literate Devops

See the Presenter’s Notes for details about each frame.

Literate Programming

  • 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

Literate Programming

What if it was possible?

literate-programming-tangling.png

Org Mode

  • 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

Literate Devops

“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.

Demonstration

The best way to explain literate programming,

is to demonstrate literate programming.

Warning

  • 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

Emphasize Communication

  • 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

Remote Access

Is it Slow?

  • Use a session property:
  • View the session buffer
    hostname -i
        

Remote Access with TRAMP

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

Access Hosts behind Firewalls

Systems in my data center require a bastion AND jump box to get to the host that I want:

tramp-url-1.png

Access Files as Root

One Tramp ‘protocol’ is sudo …

/ssh:minecraft.howardabrams.com|sudo:minecraft.howardabrams.com:/etc/passwd ↑ ↑ Start with New Protocol Protocol

Questions?

Post-presentation Linkage:

Technical Details

literate-programming-tangling.png