How to Record and Share a Terminal Session

     

A while ago I had shared instructions on “How to Share a Terminal Window Online”. This is great for live support. Today I’m sharing instructions on how to record your terminal session, and not only share it, but also allow users to copy and paste text from the playback video. The installation could not be easier. And to show how great this utility is, I’m showing the instructions using a “video” recorded with “showterm”.


How to Create A Prompt With Timeout in Bash

     

Here’s a quick function that will display a prompt with timeout in a bash script: _myCountdownFunction () { echo -e "Hit \"Ctrl+c\" to quit or \"Enter\" to continue... \c" cnt=5 while (( cnt >= 0 )) ; do if (( cnt < 9 )) ; then echo -e "\b\b${cnt}s\c" elif (( cnt == 9 )) ; then echo -e "\b\b\b ${cnt}s\c" elif (( cnt <= 99 )) ; then echo -e "\b\b\b\b ${cnt}s\c" elif (( cnt < 999 )) ; then echo -e "\b\b\b\b${cnt}s\c" fi read -t 1 my_reply (( $?


How to Create a Quick Web Server

     

Have you ever had the need to create a web server to perform a test? Well, here are a few quick options on how to do this. Got Netcat? If you have Netcat on the server (which is pretty easy to get), then you can do this. Example 1: Display the date and the text “It works” nc -kl 10001 -c 'echo -e "HTTPS/1.1 200 OK\r\n\r\n$(date)\r\n\r\nIt works"' Example 2: Display an index.