当前位置:网站首页>Ascinema with asciicast2gif for efficient command line terminal recording
Ascinema with asciicast2gif for efficient command line terminal recording
2022-06-24 15:38:00 【Exclusive rainy days】
Official website address https://asciinema.org/
For programmers , Sometimes you need to share code operations :
Conventional screen recording software shares pain points :
- The video recorded by the screen recording software has a large storage size , And the operation is troublesome , The recording effect is not clear
- Usually you need to start a larger application , System resources occupy a lot
and asciinema Software Focus on command line terminals Recording effect of , It is a terminal screen recording artifact , This time, I felt that it was too late to meet you .
Let's start with a few pictures of the recording effect on the official website :
How to operate it asciinema Tools , I won't go over it , You can refer to GitHub Address description .asciinema/asciinema: Terminal session recorder Be familiar with the usage of various command line parameters .
Pain points
although asciinema great , however cast The format of , Writing Markdown When , Not very general . Although the official website provides some playback schemes , But not very friendly after all .
but … Can only choose Gif such , A more general form .
Solution
Fortunately , There are already great gods on the Internet , Provided will be cast This file format , convert to gif Command line tools for .
asciinema/asciicast2gif: Generate GIF animations from asciicasts (asciinema recordings)
Interested students can download and experience .
because asciicast2gif The installation of depends on a lot of npm Warehouse , Personally, the configuration is not particularly smooth , Therefore, a more easy-to-use Docker Installation mode .
Writing scripts to automate
It is hoped that after each terminal command is recorded , Automatic conversion to gif file . Write a script , After recording , Automatic utilization asciicast2gif The tool translates into gif Format .
#!/bin/bash
rec_date_time=$(date +%F_%H-%M-%S)
asciinema rec ${rec_date_time}.cast
# the next line only needed when you install asciicast2gif by docker
alias asciicast2gif='docker run --rm -v $PWD:/data asciinema/asciicast2gif -S 1'
asciicast2gif -S 1 ${rec_date_time}.cast ${rec_date_time}.gif
If you were a fool , It's just ‘~/.bashrc’ In file , Add an alias rec To execute the above bash
Script . such as :
alias rec='sh /opt/script/auto_rec_asciinema_to_gif.sh'
Final effect
Just input at the terminal rec command , It can realize screen recording and automatic gif Picture conversion capability .

If it helps you , I'll go after you like it ~
边栏推荐
- Golang implements BigInteger large number calculation
- Is it safe for futures companies to open accounts
- Junit5中的参数化测试(Parameterized Tests)指南
- MySQL toolset: the official export tool mysqlpump
- MySQL replication series 6- tables related to replication information
- Phpcms upgrade editor method -- simple and effective
- Es search content top
- Use list
- At? Let's blow the air conditioner together!
- 在Gradle 中对Junit5 测试框架引用
猜你喜欢

He is also a junior test engineer. Why is his salary high? The interview must be brilliant at these points

国产最长寿的热销手机,苹果也不是对手,总算让国产手机找回面子

Intelij 中的 Database Tools可以连接但是无法显示SCHEMA, TABLES

运营商5G用户渗透远远比4G慢,5G的普及还得看中国广电

Wide measuring range of jishili electrometer
Oracle RAC configuration multipathing

Jenkins 镜像无法更新插件中心的3种解决方法

How to generate assembly code using clang in Intel syntax- How to generate assembly code with clang in Intel syntax?

Do you really know the difference between H5 and applet?

熬夜整理出的软件测试【高频】面试题大全(2022最新)
随机推荐
Record the range of data that MySQL update will lock
Universal file online preview project, open source!
还在担心漏测吗?快来使用jacoco统计下代码覆盖率
Poor remote code execution in Alien Swarm
Sequential representation and implementation of linear table (refer to YanWeiMin version)
Use tuples
Intelij 中的 Database Tools可以连接但是无法显示SCHEMA, TABLES
Jenkins 镜像无法更新插件中心的3种解决方法
Use dictionary
Decomposition of Uber dependency injection into dig source code analysis
Istio FAQ: 431 request header fields too large
Is industrial securities reliable? Is it safe to open a securities account?
asciinema 搭配 asciicast2gif 实现高效的命令行终端录制能力
Which account of Dongfang fortune is safer and better
MySQL toolset: the official performance testing tool mysqlslap
Xingxinghai, it is said that the new generation can fight better?
"Industry outlook" analysis of five major trends in China's security video surveillance industry
How do individuals open accounts for stock speculation? Is it safe to open accounts for stock speculation
Multimeter resistance measurement diagram and precautions
【Kubernetes】1