Hacker News new | past | comments | ask | show | jobs | submit login
Doitlive, a tool for live presentations in the terminal (doitlive.readthedocs.io)
180 points by robin_reala on Oct 9, 2017 | hide | past | favorite | 58 comments



I've used this before and it works well, but I can only kind-of recommend it.

If you are doing a presentation at some large conference where people will not be interrupting you with questions as you do your presentation, then I would recommend it. HOWEVER most of us do presentations to smaller more informal groups: coworkers, local coding meetups, etc. In those situations people are more likely to interrupt you and ask you something that would normally be doable IF you weren't running a script

So, IF you're going to use this in an interruptable situation I would strongly recommend mentioning BEFORE you start, that you are executing the commands live, but that you're using an interactive script to do it so that you don't screw anything up. Otherwise you look like a fraud when someones like "what about X" and you're all ... "well yes, but i can't do that right now because while it looks like I've been typing these commands, in reality I've been deceiving you and can't break out of this script or everything goes awry... but yes i could do that.... if i wasn't pretending i was actually typing this stuff." And yes, I'm speaking from experience, although i used different words. It's really awkward. Don't do it.


It seems to me that this could be improved with a few handy shortcuts.

Because it is actually running your commands in an actual interpreter, executing unplanned commands is only a problem because you can't input it. Having a few keystrokes to go back, edit/enter a command, go to line N, would make this problem disappear.

Or do it the other way, and have a keystroke insert the next line from your script. Like Ctrl-R, but at the speed of my typing.


Yeah, I made the original hack for a lightning talk after seeing playerpiano for Python (I wanted something similar but for bash). I wanted to show a terminal session, wanted to talk as I did it, and didn't wanted to get distracted by typos. For a lightning talk, there is no time for questions and you need to go "quickly" through the material.

My use case for doitlive really is lightning talks.


If you're having trouble visualizing what this does: https://www.youtube.com/watch?v=u4_UhFloISY


Thanks! I don't understand why screenshots are missing for most of the stuff I see everyday. We just don't have the time to install everything and then see how is the interface.


Comment on youtube:

>How does Jordi type commands so quickly?

I did wonder while watching the video if I would have thought the same thing if I wasn't coming from this thread. It was a little too subtle I guess.


I've wondered if the gimmick distracts people from the presentation. It's a comfortable way for me to present the talk, but maybe it's not so good for the people following along.


I speak at conferences/developer meetups on a regular basis, and this is intriguing.

I have two primary concerns:

1) When you’re doing a live presentation, making the occasional mistake is not only expected, it helps prove that what you’re doing is really live. With a tool like this, everything might be TOO perfect. Might have to start incorporating intentional flubs into the script to make things authentic.

2) I haven’t tried this out yet, but I wonder what happens when something goes wrong. I’ve had too many live situations impacted by some unforeseen thing. Forgot to clean up the working directory last time I ran the demo, or who knows what. I’d want to have the ability to take over the controls if needed.

And of course, the antidote to #2 is having very carefully planned repeatable steps with a “cleanup” at the beginning or end to prep for the next time around.

All said, very cool, and I’ll be trying this soon.

Edit: Downvotes, really?


The problem is while presenting my IQ is 20 points lower. I suppose this holds for many people. There are too many presentations on youtube which spend minutes just fixing typos.

I agree a few seem authentic but soon it just feels like a waste of time — and break in the flow of presentation.


I'm not sure about the 20 points number, the effect feels much larger. Perhaps if you simultaneously apply a 20% penalty to hand-eye coordination, balance, facial expressions, typing skills, enunciation, penmanship, memory/recall, creativity, etc. you could accurately represent my skill as a human being while presenting.


It's a truth universally acknowledged, that a man in possession of a keyboard is guaranteed to spot spelling errors and trivial errors absolutely last of everyone watching.


I think a nice workaround for this is to use something like a Jupyter Notebook (which also has bash support). You have all the commands pre-entered and you can step through as necessary.

If you need to add something because of an audience question you can just insert a new cell.

It looks live and in my opinion better than faffing in a terminal.

You also have the bonus of being able to provide the notebook to your audience after the talk (or they can follow along with you).


Yeah, I absolutly agree with you there. There’s no doubt in my mind that this is valuable. I’ve had plenty of moments where the brain->finger->keyboard connection just fails under the pressure of a live demo.


> The problem is while presenting my IQ is 20 points lower.

I swear I've said these exact words.


> I’d want to have the ability to take over the controls if needed.

^C and <esc> do interrupt the playback and print 'Aborted!' to stdout.

>Might have to start incorporating intentional flubs into the script to make things authentic

Unfortunately, flubs give a bit away by showing the temp file that's being run:

  $ datl
  /tmp/tmpzygMVj: line 4: datl: command not found
I also tried inserting some ^H backspaces in the script. It almost looks like it will work (shows the backspace and correction), then spits out "/tmp/tmp2qhBos: line 4: $'datl\be': command not found"


There's nothing wrong with doing things perfectly; mention you're using a script to avoid the demo effect if need be. Tools like this will really help speed up your presentation, especially if you're not too fast a typer.

Also for cleanup, wrap this command in its own shell script; for example:

    #!/bin/bash
    rm -rf temp || true
    doitlive session.sh


I don't think you need the "|| true" there.


Unfortunately, there is always something that can (and likely will) go wrong. You will always need a "fail gracefully" option.


I wrote one of these hackertypery-presenters a while back:

https://gist.github.com/bazzargh/a267b97a52f7a1f70c46

some slight differences; doitlive drives recording for you; I used ttyrec, so you get some more natural typing, like me editing the command line. I set it up so events within 20ms are fired by a single keypress; this makes for quicker typing in the replay while letting you insert natural gaps between commands. NB if your command output is slow, you'll need to type to make it replay, which is a bit weird.

The other thing is, I used this to intersperse the 'demo' portions with slides (the slides were just 'echo some text|figlet' recordings). In order to support multiple files like this, at the end of each recording, you need to press 'return' to move forward; but also, you can press backspace to go back to the start of the current script, or if at the start of a script, backspace again will jump to the start of the previous one.


Interesting, but isn't this kind of the opposite of "do it live"? I would think "lip synch" would be a better name for it.

I've done a couple of live presentations in my career (in fact I just did one last Friday). I think they're great for audiences, when the circumstances permit. People connect to the physicality of the typing in a way that looking at some screenshots just doesn't provide.


Well, it runs the commands live. With whatever bash environment you have at the moment you run it. And you can type at whatever speed you want, so there is a certain liveness to it.


This looks like great fun - I speak at conferences, and I can tell you that my next demo is going to involve coding with my elbows, feet, and probably butt.


I prefer using asciicinema. It's perfectly OK to use a recording but no need to hide it.


I like making recordings too, but they are annoying to update/recreate when the expected output changes.

I found spielbash[1] recently which helps you automate asciinema recordings... though it was a bit broken and I ended up forking it and re-writing most of it [2] and adding a bunch of new features.

There's probably a way to merge the two ideas and have a way to automate live demos as well as have a mode that just spits out a asciinema recording.

[1] https://github.com/redhat-cip/spielbash [2] https://github.com/justinazoff/spielbash


Nice! I'm glad you posted.

I forked spielbash in order to add an option that lets it read `cloud-init`[1] YAML as input, and also noticed there were opportunities to improve the original. Will see if I can jump over to your fork.

[1] http://cloudinit.readthedocs.io/en/latest/


It's not recording the effects of the commands being run. It only records the commands, so each command is run live.


I am an introvert, like a lot of coders, and having to give a presentation in front of a live audience, and in addition, writing code (or doing demo) at the same time, is a LOT of pressure. It's hard enough to try to remember what I need to say, and my mind would sometimes go blank, sometimes trying to remember what I did wrong when there's unexpected error or forgetting a function name or parameters, etc.

It might also useful for for screencast recording / Youtube tutorial. Bisqwit has his own tool, running on DOS, that does something similar, which mimics him typing code on the editor. (https://www.youtube.com/watch?v=5Da6ZyQJjE0)


I really like bisqwit presentations and videos, often mindblowing. However i really dont see the point of scripting typing code. For command-line like here sure why not. But for code there is no point. If I'd much rather see blocks of code copy pasted and explained orally or just going through existing code - maybe several versions more and more complex - with someone explaining it. I don't see the value of some c++ code being typed very fast and accelerated.


Very cool indeed. Nit: I think the page can use some cool gifs showing off how the tool is used. Gifs are worth thousand words.


Done!


I saw this a few hours ago and here it is in Emacs:

https://github.com/narendraj9/dot-emacs/blob/master/packages...

:)

I haven't implemented the next-position function for shell yet.


I have always used http://man7.org/linux/man-pages/man1/scriptreplay.1.html

How is this different/better?


It looks like this one only outputs when you type on the keys - you have direct control over the replay speed, rather than having it play back at the speed you 'recorded' at with scriptreplay.

Reminds me of hackertyper: http://hackertyper.com/


Oh I did always love hackertyper. I suppose I'm convinced.


Run `doitlive` with `-s 3` to show off your turbo hacker skills :D


Can't not think of that one news anchor yelling "do it live" with a bunch of expletives.



That was awkward.


F* it! We'll do it live!


It was Bill O'Reilly, not a news anchor.


Was trying not to name him. And didn't know what exactly he was supposed to be when he was yelling on screen.


I mostly bring this up because one of the really corrosive aspects of Fox News is the fact that they have so many non-news programs even though they're all on a "News" channel.


I agree that it's worth making this distinction whenever this comes up. Thank you.


Pundits on a news channel is absolutely standard across cable news channels.


How many of them have "News" in the name? CNN is the only one I can think of, and they brand themselves as the acronym.


also needs a nod to https://github.com/rfk/playitagainsam which comes with a javascript player that can be embedded in presentations.

Love the effect with a clickety keyboard ;)


I've used https://github.com/jaspervdj/patat for the same purpose in the past. Nice to see there are more options.


First thing I wondered was, "How does this compare to asciinema?"

First difference seems to be that do it live allows manual control of progressing through the session where as asciinema doesn't.

What else?


asciinema actually records output, this relies on the environment being exactly as it was the first time you ran it. If one command fails or has different output, other things might not work.

This also cannot follow cli sessions. If you open, say, a REPL, you're on your own.

That said, I would love for asciinema to get some "type to progress" capabilities.


nit: i don't think the session files should have the .sh file extension, since they aren't executable shell scripts.


They're not? Looks like an executable script to me (in a simple demo script), it's just missing the `#!/bin/bash` header. Might be an idea to add that.

But giving it its own extension might be a good idea either way.


it looks like doitlive supports inline python blocks. having these in your session file would causing a parsing error if you tried to run it as an executable script.


No it's missing #!/usr/bin/doitlive ;)


Is there any demo (screenshot or video) somewhere?


I've added a gif to the docs and the README.


Ha ha this is pretty awesome!


In one word: neat.


Word quota exceeded. Please correct your message ;).




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: