Author : admin. In this post, I will shortly explain how a picture of a command running in console or terminal in GNU / Linux can be made

Similar documents
Intro to R. Professor Clayton Nall h/t Thomas Leeper, Ph.D. (University of Aarhus) and Teppei Yamamoto, Ph.D. (MIT) June 26, 2014

Activant Acclaim. Using smit and p21adm. AIX suite: course 3 of 3

Run Time Tester Requirements Document

The academic basis of SNE

Getting Started for Unix platforms

File No WORLD TRADE CENTER TASK FORCE INTERVIEW FIREFIGHTER MIKE ZECHEWYTZ. Interview Date: December 5, Transcribed by Nancy Francis

VMMC Installation Guide (Windows NT) Version 2.0

GridMAT-MD: A Grid-based Membrane Analysis Tool for use with Molecular Dynamics

Free ecosystem for medical imaging

Cortex Gateway 2.0. Administrator Guide. September Document Version C

Avaya G450 Branch Gateway, R6.2 Voluntary Product Accessibility Template (VPAT)

Identifying or Verifying the Number of Factors to Extract using Very Simple Structure.

Getting Started for Windows

Selected Proceedings of ALDAcon SORENSON IP RELAY Presenter: MICHAEL JORDAN

LING 581: Advanced Computational Linguistics. Lecture Notes March 20th

Customer Guide to ShoreTel TAPI- VoIP Integrations. March

Helping Your Asperger s Adult-Child to Eliminate Thinking Errors

User s Manual for ProCAT

THE GALLAUDET DICTIONARY OF AMERICAN SIGN LANGUAGE FROM HARRIS COMMUNICATIONS

Coach Zak Boisvert has put together some notes on the coaching philosophy of

RAPID INTERPRETATION OF ECGS IN EMERGENCY MEDICINE: A VISUAL GUIDE BY JENNIFER L MARTINDALE MD, DAVID F.M. BROWN MD

Fall 2016 Health Behavior Diary Template

User s Manual for Eclipse(AccuCap)

DICOM Conformance Statement

Instructions for the ECN201 Project on Least-Cost Nutritionally-Adequate Diets

LING/C SC 581: Advanced Computational Linguistics. Lecture 7 Jan 31 st

Growing Flight Software Hands-On Experience: cfs and Educational Outreach

A Woman Like You: Stories Of Women Recovering From Alcoholism And Addiction By Rachel V.

Content Part 2 Users manual... 4

Marshall High School Psychology Mr. Cline Unit One AA. What is Psychology?

I LOVE HIM, HE LOVES ME NOT. I LOVE HIM, HE LOVES ME NOT: How I Left a Codependent Relationship

Voluntary Product Accessibility Template (VPAT)

In this chapter, you will learn about the requirements of Title II of the ADA for effective communication. Questions answered include:

Avaya G450 Branch Gateway, Release 7.1 Voluntary Product Accessibility Template (VPAT)

ShoreTel Trunk Side Integration Guide

SANAKO Lab 100 STS USER GUIDE

Requirements for Maintaining Web Access for Hearing-Impaired Individuals

Function Well Personalised Health & Fitness Training Systems. All Rights Reserved

University of Toronto. Final Report. myacl. Student: Alaa Abdulaal Pirave Eahalaivan Nirtal Shah. Professor: Jonathan Rose

Symantec ESM Agent for IBM AS/400 Installation Guide. Version: 6.5

Avaya IP Office 10.1 Telecommunication Functions

Avaya IP Office R9.1 Avaya one-x Portal Call Assistant Voluntary Product Accessibility Template (VPAT)

Note: This document describes normal operational functionality. It does not include maintenance and troubleshooting procedures.

Clay Tablet Connector for hybris. User Guide. Version 1.5.0

Computer Applications: An International Journal (CAIJ), Vol.3, No.1, February Mohammad Taye, Mohammad Abu Shanab, Moyad Rayyan and Husam Younis

WORDS APTLY SPOKEN BY MOOREHEAD BOB DOWNLOAD EBOOK : WORDS APTLY SPOKEN BY MOOREHEAD BOB PDF

Sanako Lab 100 STS USER GUIDE

SAM WHEREUPON, ANNIE MAY HARRIS, HAVING FIRST BEEN. 11 A. That' s right. 13 A. That' s right.

Fujitsu LifeBook T Series TabletPC Voluntary Product Accessibility Template

SECOND TRADITION SKIT

Subliminal Programming

How to Conduct an Unemployment Benefits Hearing

Avaya one-x Communicator for Mac OS X R2.0 Voluntary Product Accessibility Template (VPAT)

Communications Accessibility with Avaya IP Office

USER GUIDE FOR MATLAB BASED HEARING TEST SIMULATOR GUI FOR CLINICAL TESTING

ATLAS OF CHINESE TONGUE DIAGNOSIS (2ND EDITION) BY BARBARA KIRSCHBAUM

Interact-AS. Use handwriting, typing and/or speech input. The most recently spoken phrase is shown in the top box

BBC LEARNING ENGLISH 6 Minute English Smokers to face one more ban

CIS192 Python Programming

Tvheadend - Bug #3769 Truncated EPG

David Trickey Consultant Clinical Psychologist & Trauma Specialist, Anna Freud National Centre for Children and Families

CrystalPM - AOA MORE Integration and MIPS (CQM) Tutorial

Exercises: Differential Methylation

How Immunisations work in Best Practice?

Kofax VRS. Installation Guide

ECDC HIV Modelling Tool User Manual

ProSafe-RS System Test Reference

NERVE ACTION POTENTIAL SIMULATION version 2013 John Cornell

Flat Belly Fix Review

COURSE LISTING. Courses Listed. Training for Database & Technology with Administration in SAP Hybris Commerce. 17 August 2018 (04:00 BST) Einsteiger

Symantec ASC-090. ASC IT Compliance

Avaya 3904 Digital Deskphone Voluntary Product Accessibility Template (VPAT)

DUNG NGUYEN - October 28, 2013 Recross-Examination by Ms. Gutierrez. MS. LOGAN: Thank you, Judge. KATHLEEN MCKINNEY,

COURSE LISTING. Courses Listed. Training for Cloud with SAP Hybris in Commerce for System Administrators. 26 September 2018 (22:37 BST) Einsteiger

Instructions for Use Audiometric Data Interface

TRAINING MANUAL. VIDEO Camera, Probe and Lightsource OTOSCOPES.

A Quick-Start Guide for rseqdiff

Cohen and the First Computer Virus. From: Wolfgang Apolinarski

The innovative intercom solution

OpenCount 100 Call Data Recording in the OpenCom 100 Communications System

Prof. Michel Jadoul Cliniques universitaires St-Luc Université Catholique de Louvain Brussels, Belgium. Slide 1

IT S A WONDER WE UNDERSTAND EACH OTHER AT ALL!

Planning and Hosting Accessible Webinars

Institute of Marine Research

Video Captioning Workflow and Style Guide Overview

Water Fitness During Your Pregnancy By Jane Katz

1. Automatically create Flu Shot encounters in AHLTA in 2 mouse clicks. 2. Ensure accurate DX and CPT codes used for every encounter, every time.

Working Together To Outrun Cancer

Depression. Northumberland, Tyne and Wear NHS Trust (Revised Jan 2002) An Information Leaflet

User Guide V: 3.0, August 2017

A Historical Introduction to the Philosophy of Mind. Lily Trapkin Intro to Philosophy November 2013

The Birth. of Jesus....in Signed English

Contents. Important Notes. Standard Formats. Premium Formats. Expandable Unit Guidelines. In-banner Video Guidelines. Takeovers. HTML 5 Specifications

Smoking Cessation Strategies for the 21st Century

RDCONT A system for diabetes blood glucose data management

Captioning Your Video Using YouTube Online Accessibility Series

GET LEAN STAY LEAN FAT-LOSS STARTER GUIDE. getleanstaylean.uk

Transcription:

How to make screenshot in /dev/tty console on GNU / Linux - Taking picture JPEG / PNG snapshot of text console in systems without graphical environment Author : admin I'm used to making picture screenshots in GNOME desktop environment. As I've said in my prior posts, I'm starting to return to my old habits of using console ttys for regular daily jobs in order to increase my work efficiency. In that manner of thoughts sometimes I need to take a screenshot of what I'm seeing in my physical (TTY consoles) to be able to later reuse this. I did some experimenting and this is how this article got born. In this post, I will shortly explain how a picture of a command running in console or terminal in GNU / Linux can be made Before proceeding to the core of the article, I will say few words on ttys as I believe they might be helpful someone. The abbreviation of tty comes after TeleTYpewritter phrase and is dating back somewhere near the 1960s. The TTY was invented to help people with impaired eyesight or hearing to use a telephone like typing interface. In Unix / Linux / BSD ttys are the physical consoles, where one logs in (typing in his user/password). There are physical ttys and virtual vtys in today *nixes. Today ttys, are used everywhere in a modern Unixes or Unix like operating system with or without graphical environments. Various Linux distributions have different number of physical consoles (TTYs) (terminals connected to standard output) and this depends mostly on the distro major contributors, developers or surrounding OS community philosophy. Most modern Linux distributions have at least 5 to 7 physical ttys. Some Linux distributions like Debian for instance as of time of writting this, had 7 active by default physical consoles. Adding 3 more ttys in Debian / Ubuntu Linux is done by adding the following lines in /etc/inittab: 7:23:respawn:/sbin/getty 38400 tty7 8:23:respawn:/sbin/getty 38400 tty8 9:23:respawn:/sbin/getty 38400 tty9 On some Linux distributions like Fedora version 9 and newer ones, new ttys can no longer be added via /etc/inittab,as the RedHat guys changed it for some weird reason, but I guess this is too broad issue to discuss... In graphical environments ttys are called methaphorically "virtual". For instance in gnome-terminal or while connecting to a remote SSH server, a common tty naming would be /dev/pts/8 etc. 1 / 7

tty command in Linux and BSDs can be used to learn which tty, one is operating in. Here is output from my tty command, issued on 3rd TTY (ALT+F3) on my notebook: noah:~# tty /dev/tty3 A tty cmd output from mlterm GUI terminal is like so: hipo@noah:~$ tty/dev/pts/9 Now as mentioned few basic things on ttys I will proceed further to explain how I managed to: a) Take screenshot of a plain text tty screen into.txt file format b) take a (picture) JPG / PNG screenshot of my Linux TTY consoles content 1. Take screenshot of plain text tty screen into a plain (ASCII).txt file: To take a screenshot of tty1, tty2 and tty3 text consoles in a txt plain text format, cat + a standard UNIX redirect is all necessery: noah:~# cat /dev/vcs1 > /home/hipo/tty1_text_screenshot.txt noah:~# cat /dev/vcs2 > /home/hipo/tty2_text_screenshot.txt noah:~# cat /dev/vcs3 > /home/hipo/tty3_text_screenshot.txt This will dump the text content of the console into the respective files, if however you try to dump an ncurses library like text interactive interfaces you will end up with a bunch of unreadable mess. In order to read the produced text 'shots' onwards less command can be used... noah:~# less /home/hipo/tty1_text_screenshot.txt noah:~# less /home/hipo/tty2_text_screenshot.txt noah:~# less /home/hipo/tty3_text_screenshot.txt 2. Take picture JPG / PNG snapshot of Linux TTY console content To take a screenshot of my notebook tty consoles I had to first install a "third party program" snapscreenshot. There is no deb / rpm package available as of time of writting this post for the 4 major desktop linux distributions Ubuntu, Debian, Fedora and Slackware. 2 / 7

Hence to install snapscreenshot,i had to manually download the latest program tar ball source and compile e.g.: noah:~# cd /usr/local/src noah:/usr/local/src# wget -q http://bisqwit.iki.fi/src/arch/snapscreenshot-1.0.14.3.tar.bz2 noah:/usr/local/src# tar -jxvvvf snapscreenshot-1.0.14.3.tar.bz2... noah:/usr/local/src# cd snapscreenshot-1.0.14.3 noah:/usr/local/src/snapscreenshot-1.0.14#./configure && make && make install Configuring... Fine. Done. make. make: Nothing to be done for `all'. if [! "/usr/local/bin" = "" ]; then mkdir --parents /usr/local/bin 2>/dev/null; mkdir /usr/local/bin 2>/dev/null; \ for s in snapscreenshot ""; do if [! "$s" = "" ]; then \ install -c -s -o bin -g bin -m 755 "$s" /usr/local/bin/"$s";fi;\ done; \ fi; \ if [! "/usr/local/man" = "" ]; then mkdir --parents /usr/local/man 2>/dev/null; mkdir /usr/local/man 2>/dev/null; \ for s in snapscreenshot.1 ""; do if [! "$s" = "" ]; then \ install -m 644 "$s" /usr/local/man/man"`echo "$s" sed 's/.*\.//'`"/"$s";fi;\ done; \ fi By default snapscreenshot command is made to take screenshot in a tga image format, this format is readable by most picture viewing programs available today, however it is not too common and not so standartized for the web as the JPEG and PNG. Therefore to make the text console tty snapshot taken in PNG or JPEG one needs to use ImageMagick's convert tool. The convert example is also shown in snapscreenshot manual page Example section. To take a.png image format screenshot of lets say Midnight Commander interactive console file manager running in console tty1, I used the command: noah:/home/hipo# snapscreenshot -c1 -x1 > ~/console-screenshot.tga && convert ~/consolescreenshot.tga console-screenshot.png 3 / 7

Note that you need to have read/write permissions to the /dev/vcs* otherwise the snapscreenshot will be unable to read the tty and produce an error: hipo@noah:~/desktop$ snapscreenshot -c2 -x1 > snap.tga && convert snap.tga snap.pnggeometry will be: 1x2Reading font.../dev/console: Permission denied To take simultaneous picture screenshot of everything contained in all text consoles, ranging from tty1 to tty5, issue: noah:/home/hipo# snapscreenshot -c5 -x1 > ~/console-screenshot.tga && convert ~/consolescreenshot.tga console-screenshot.png Here is a resized 480x320 pixels version of the original screenshot the command produces: 4 / 7

5 / 7

Storing a picture shot of the text (console) screen in JPEG (JPG) format is done analogously just the convert command output extension has to be changed to jpeg i.e.: noah:/home/hipo# snapscreenshot -c5 -x1 > ~/console-screenshot.tga && convert ~/consolescreenshot.tga console-screenshot.jpeg I've also written a tiny wrapper shell script, to facilitate myself picture picture taking as I didn't like to type each time I want to take a screenshot of a tty the above long line. Here is the wrapper script I wrote: #!/bin/sh ### Config #.tga produced file name output_f_name='console-screenshot.tga'; # gets current date cur_date=$(date +%d_%m_%y sed -e 's/^ *//'); # png output f name png_f_name="console-screenshot-$cur_date.png"; ### END Config snapscreenshot -c$arg1 -x1 > $output_f_name && convert $output_f_name $png_f_name; echo "Output png screenshot from tty1 console produced in"; echo "$PWD/$png_f_name"; /bin/rm -f $output_f_name; You can also download my console-screenshot.sh snapscreenshot wrapper script here The script is quite simplistic to use, it takes just one argument which is the number of the tty you would like to screenshot. To use my script download it in /usr/local/bin and set it executable flag: noah:~# cd /usr/local/bin noah:/usr/local/bin# wget -q http://www.pc-freak.net/~bshscr/console-screenshot.sh noah:/usr/local/bin# chmod +x console-screenshot.sh Onwards to use the script to snapshot console terminal (tty1) type: noan:~# console-screenshot.sh 6 / 7

Powered by TCPDF (www.tcpdf.org) Walking in Light with Christ - Faith, Computing, Diary I've made also mirror of latest version of snapscreenshot-1.0.14.3.tar.bz2 here just in case this nice little program disappears from the net in future times. 7 / 7