当前位置:网站首页>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 ~
边栏推荐
- Use dictionary
- Actual combat | a tortuous fishing counteraction
- Why is the blackmail virus that shut down half of America's energy system terrible? Interpretation of authoritative reports
- Service visibility and observability
- leetcode 139. Word break word split (medium)
- asciinema 搭配 asciicast2gif 实现高效的命令行终端录制能力
- QTreeWidget作为单例模式以dll返回的两个问题
- Design of vga/lcd display controller system based on FPGA (Part 2)
- Sequential representation and implementation of linear table (refer to YanWeiMin version)
- Jenkins的便捷式安装
猜你喜欢

运营商5G用户渗透远远比4G慢,5G的普及还得看中国广电
Redis consistency hash and hash slot
Step by step introduction to sqlsugar based development framework (9) -- Realizing field permission control with WinForm control

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

国产芯片的赶超,让美国手机芯片龙头高通害怕了,出招应对竞争
Bitmap of redis data structure

如何扩展aws主机上的磁盘空间
An accident caused by a MySQL misoperation, and the "high availability" cannot withstand it!

Linux记录-4.22 MySQL5.37安装(补充)

【C语言刷题——Leetcode12道题】带你起飞,飞进垃圾堆
随机推荐
【Prometheus】6. Prometheus and kubernetes (incomplete)
Hardware security threats of cloud infrastructure
Oracle RAC configuration multipathing
Jenkins 镜像无法更新插件中心的3种解决方法
The first in China! Tencent cloud key management system passes password application verification test
【Prometheus】5. Alertmanager alarm (incomplete)
Use list
A series of problems caused by IPVS connection reuse in kubernetes
Use tuples
Typescript raw data type
手机同花顺股票开户安全吗!
Do you really know the difference between H5 and applet?
How about stock online account opening and account opening process? Is it safe to open an account online?
Security Analysis on mining trend of dogecoin, a public cloud
From practical teaching to competition exercise, Tencent experts personally teach Ti-One platform operation strategy!
Cvpr2022 | domaine compact adaptable
[sdx62] wcn685x IPA registration failure analysis and solution
A full set of tutorials for interviewers from Android manufacturers teach you: prepare for the interview and get the offer smoothly!
Design of CAN bus controller based on FPGA (Part 2)
CIA security model - use PGP to describe privacy and integrity of network security CIA model