Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to make this "action-packed, random data" being echoed in a terminal?

OK, this isn't really a question to achieve anything practical, but still it is a serious question and I hope it will be taken seriously and mods won't punish me for this :)

I'm sure majority of you have seen some good action movie, where CIA or FBI or hackers or any other "pc nerds" are "retrieving some information" and when they actually show their screens/monitors/desktops, there is a lot of random data being displayed and it's just so thrilling :D

So, we're shooting a movie and I need to reconstruct such a scene. My OS is ubuntu 10.10.

I think i've read somewhere on the internet once that shell can actually be recorded and then played back, but I'm not sure how it worked.

Basically, any script/program/code/solution which does the trick is very well welcome.

If there's anyone who could come up with a solution, it would be so cool!

Let's make this fun, shall we?

BOUNTY EDIT: Still need some more ideas, so I'm offering a bounty for the best new upcoming idea.

like image 779
Frantisek Avatar asked Mar 15 '11 01:03

Frantisek


People also ask

How do I stop something from running in terminal?

Use Ctrl + Break key combo. Press Ctrl + Z .

What commands are used to clear up the terminal?

You can use Ctrl+L keyboard shortcut in Linux to clear the screen. It works in most terminal emulators. If you use Ctrl+L and clear command in GNOME terminal (default in Ubuntu), you'll notice the difference between their impact.


1 Answers

There's a utility call script (ironically) that does what you're talking about. It can even record timing data so the playback is done at the same rate the original actions were performed.

To start recording and capture timing data:

$ script -t script.out 2>timing.out

When you're finished, enter exit.

To replay the recorded session including the original timing:

$ scriptreplay timing.out script.out

Edit:

You can simulate typing or slow dialup data transmission using the pv utility. The command below will output the file at 37 characters per second (roughly approximating a 300 baud modem).

pv -q -L 37 somefile

Here's another idea:

hexdump -C /dev/urandom | pv -q -L 1200

This gives Matrix-like output on the screen:

#!/bin/bash
printf "\e[32m\n"
while :
do
    for i in {1..16}
    do
        ((r = $RANDOM % 2))
        if (($RANDOM % 5 == 1))
        then
            if (($RANDOM % 4 == 1))
            then
                v+="\e[1m $r   "
            else
                v+="\e[2m $r   "
            fi
        else
            v+="     "
        fi
    done
    printf "$v\n"
    v=""
done
like image 67
Dennis Williamson Avatar answered Oct 21 '22 15:10

Dennis Williamson