Never been to CodeSnippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world (or not, you can keep them private!)

Record terminal sessions with ttyrec (See related posts)

See ttyrec: a tty recorder and man script (alternative)

export PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
export IFS=$' \t\n'

cd ~/Desktop
curl -L -O http://0xcc.net/ttyrec/ttyrec-1.0.8.tar.gz
tar -xzf ~/Desktop/ttyrec-1.0.8.tar.gz
cd ttyrec-1.0.8
make


# create /usr/local/bin
/usr/bin/sudo /bin/mkdir -p /usr/local/bin
/usr/bin/sudo /usr/sbin/chown root:wheel /usr/local /usr/local/bin
/usr/bin/sudo /bin/chmod 0755 /usr/local /usr/local/bin

# copy ttyrec, ttyplay and ttytime to /usr/local/bin
/usr/bin/sudo /bin/cp -i ~/Desktop/ttyrec-1.0.8/ttyrec /usr/local/bin
/usr/bin/sudo /bin/cp -i ~/Desktop/ttyrec-1.0.8/ttyplay /usr/local/bin
/usr/bin/sudo /bin/cp -i ~/Desktop/ttyrec-1.0.8/ttytime /usr/local/bin

ls -l /usr/local/bin/{ttyrec,ttyplay,ttytime}


ttyrec -h     # usage: ttyrec [-u] [-e command] [-a] [file]

ttyrec -a ~/Desktop/session.tty

echo hello world 1
ls
exit


ttyplay ~/Desktop/session.tty -s2


ttyrec -a ~/Desktop/session.tty

echo hello world 2
ls -l
exit


ttyplay ~/Desktop/session.tty -s2
[+]     # speed up playback


ttytime ~/Desktop/session.tty


gzip ~/Desktop/session.tty
gunzip < ~/Desktop/session.tty.gz | ttyplay


You need to create an account or log in to post comments to this site.