Asciinema

evil0x00(43)
Published in
#cn
Words
372
Reading
2 min
Listen
Play
9y

前言:上次分享这个项目 有妹纸说很炫但是不会使用,这是详细中文教程

Asciinema-Player的安装与使用

1.png

0x01 注册

注册非常简单使用邮箱登录,QQ邮箱就行 ,输入邮箱会给你发送验证链接,点击收到的链接就能注册成功

4.png

0x02 安装使用(Kali Ubuntu)

在Kali上的安装

安装很简单:直接git源码 python3运行就ok了

git clone https://github.com/asciinema/asciinema.git
cd asciinema

运行:

python3 -m asciinema --version

如下图

6.png

python3 -m asciinema rec

停止录制 是键入exit 或者直接 ctrl + d

录制完毕之后会提示你是否上传到网站还是保存到本地

asciinema: recording finished
asciinema: press <enter> to upload to asciinema.org, <ctrl-c> to save locally

https://asciinema.org/a/U4xnPw7lRs8ROn4zyBvBP6lee

输入enter上传到服务器 这是测试结果
https://asciinema.org/a/U4xnPw7lRs8ROn4zyBvBP6lee

ubuntu上的安装
   81  sudo apt-add-repository ppa:zanchey/asciinema
   82  sudo apt-get update
   83  sudo apt-get install asciinema
   84  history

简单三步

7.png

-h查看如何使用

8.png

测试一下播放 简直完美 不用在图形化界面 直接终端下

asciinema play https://asciinema.org/a/7lw94ys68gsgr1yzdtzwijxm4

alt

另一个异常有效的 asciinema 特点是时光微调,下面的敕令将按键的时光距离缩短为 0.2 秒:

$ asciinema rec -w 0.2

也可以这样

$ wget -q -O steam_locomotive.json https://asciinema.org/a/7lw94ys68gsgr1yzdtzwijxm4.json 
$ asciinema play steam_locomotive.json 

将视频嵌入 HTML

asciinema 还带有一个自力的 JavaScript 播放器。这意味者你可以很轻易的在你的网站上分享终端会话记录。下面,应用一段简单的 index.html 代率攀来解释这个办法。起首,下载所有须要的器械:

$ cd /tmp/ 
$ mkdir steam_locomotive 
$ cd steam_locomotive/ 
$ wget -q -O steam_locomotive.json https://asciinema.org/a/7lw94ys68gsgr1yzdtzwijxm4.json 
$ wget -q https://github.com/asciinema/asciinema-player/releases/download/v2.4.0/asciinema-player.css 
$ wget -q https://github.com/asciinema/asciinema-player/releases/download/v2.4.0/asciinema-player.js 

之后,创建一个新的包含下面这些内容的 /tmp/steam_locomotive/index.html 文件:

html> 
<head> 
  <link rel="stylesheet" type="text/css" href=http://os.51cto.com/art/201705/"./asciinema-player.css"
/> 
</head> 
<body> 
  <asciinema-player src=http://os.51cto.com/art/201705/"./steam_locomotive.json" cols="80" rows="24"> 
  <script src=http://os.51cto.com/art/201705/"./asciinema-player.js"> 
</body> 
</html>     

就ok了