{"id":893,"date":"2011-04-26T17:29:24","date_gmt":"2011-04-26T17:29:24","guid":{"rendered":"http:\/\/judepereira.com\/blog\/?p=893"},"modified":"2011-04-26T17:36:44","modified_gmt":"2011-04-26T17:36:44","slug":"coloured-varlogmessages-at-tty12","status":"publish","type":"post","link":"https:\/\/judepereira.com\/blog\/coloured-varlogmessages-at-tty12\/","title":{"rendered":"Coloured \/var\/log\/messages at tty12"},"content":{"rendered":"<p>Reading logs could never become any more easier, at just a keystroke, you have your logs displayed where you want, in some fancy colour. They look great too.<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/judepereira.com\/blog\/wp-content\/uploads\/cclm.png\" class=\"highslide-image\" onclick=\"return hs.expand(this);\" alt=\"CCZE colourized logs\"><img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/judepereira.com\/blog\/wp-content\/uploads\/cclm.png\" alt=\"CCZE colourized logs\" \/><\/a><\/p>\n<p>TTY&#8217;s can be accessed by pressing Alt + Ctrl + F[1 &#8211; 12] simultaneously. In the following, you&#8217;ll get a decent, colourized log display of \/var\/log\/messages when you press Alt + Ctrl + F12<\/p>\n<p>First install <a href=\"http:\/\/freshmeat.net\/projects\/ccze\/\" alt=\"CCZE Home\">ccze<\/a>, most distributions have it in their repositories. CCZE is a robust and modular log colorizer with plugins for apm, exim, fetchmail, httpd, postfix, procmail, squid, syslog, ulogd, vsftpd, xferlog, and more. It brightens up the log view.<\/p>\n<p>To quickly test it, try tail -f var\/log\/messages | ccze -A<\/p>\n<p>The -A switch prevents ccze from starting itself in a curses window.<\/p>\n<p>Create a file cclm in \/usr\/local\/bin(you have to be root to be able to do so), with the following contents:<br \/>\n[sourcecode lang=bash]<br \/>\n#!\/bin\/sh<br \/>\nfile=&amp;amp;quot;\/var\/log\/messages&amp;amp;quot;<br \/>\nwhere=&amp;amp;quot;\/dev\/tty12&amp;amp;quot;<br \/>\ntail -f $file | ccze -A &amp;amp;gt;&amp;amp;gt; $where<br \/>\n[\/sourcecode]<br \/>\nAdd the following line to \/etc\/inittab<br \/>\n<strong>c12:123456:respawn:\/sbin\/agetty -n -l \/usr\/local\/bin\/cclm 38400 tty12 linux<\/strong><br \/>\nThat&#8217;s all that there is to be done, either reboot to get it working, or execute the following in a terminal with privileges:<br \/>\n[sourcecode lang=bash]\/sbin\/agetty -n -l \/usr\/local\/bin\/cclm 38400 tty12 linux[\/sourcecode]<\/p>\n<p>This can be used on any ttys&#8217;. The most obvious ones to use would be tty8 to tty12.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Reading logs could never become any more easier, at just a keystroke, you have your logs displayed where you want, in some fancy colour. They look great too. TTY&#8217;s can be accessed by pressing Alt + Ctrl + F[1 &#8211; 12] simultaneously. In the following, you&#8217;ll get a decent, colourized log display of \/var\/log\/messages when [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[52,11,10],"tags":[177,176,181,182,178,179,180],"class_list":["post-893","post","type-post","status-publish","format-standard","hentry","category-code","category-gen-sab-fed","category-linux","tag-ccze","tag-coloured-log","tag-display-log-on-tty","tag-gentoo-tty-log-messages","tag-syslog","tag-syslog-colour","tag-tty12-log"],"aioseo_notices":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/pqtyx-ep","jetpack-related-posts":[{"id":289,"url":"https:\/\/judepereira.com\/blog\/sabayon-four-oh\/","url_meta":{"origin":893,"position":0},"title":"Sabayon fOuR oH","author":"Jude Pereira","date":"June 16, 2009","format":false,"excerpt":"Based on Gentoo, Sabayon 4.1, tells me: Great performance with less RAM(though you need like 1GB RAM for it to work well enough). Package Management System is absolutely fantastic, with it's new \"Entropy\". Totally the perfect distribution. A fine distribution for the newbie or the expert. This is what a\u2026","rel":"","context":"In &quot;gnu linux&quot;","block_context":{"text":"gnu linux","link":"https:\/\/judepereira.com\/blog\/category\/linux\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":694,"url":"https:\/\/judepereira.com\/blog\/visual-basic-6-revisited-linux-wine\/","url_meta":{"origin":893,"position":1},"title":"visual basic 6 revisited &#8211; linux &#8211; wine","author":"Jude Pereira","date":"August 5, 2010","format":false,"excerpt":"Earlier this year, I had written an article on running Visual Basic 6 on linux under wine, this is an update for it, the prior one is deprecated Getting Visual Basic 6 to work on linux is pretty easy, not much trouble, all the basic things work, as of what\u2026","rel":"","context":"In &quot;another snippet | code&quot;","block_context":{"text":"another snippet | code","link":"https:\/\/judepereira.com\/blog\/category\/code\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":903,"url":"https:\/\/judepereira.com\/blog\/usrlocalbinwaitpid\/","url_meta":{"origin":893,"position":2},"title":"\/usr\/local\/bin\/waitpid","author":"Jude Pereira","date":"April 26, 2011","format":false,"excerpt":"A quick script to wait for a certain pid, then once that quits, execute a command. You may ask, why not just do command1 && command2 ? Well, if command1 exits with a non-zero exit status value, command2 will not get executed. Hence, I've brewed a quick script for this\u2026","rel":"","context":"In &quot;another snippet | code&quot;","block_context":{"text":"another snippet | code","link":"https:\/\/judepereira.com\/blog\/category\/code\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1830,"url":"https:\/\/judepereira.com\/blog\/ios-mac-ipsec\/","url_meta":{"origin":893,"position":3},"title":"How to tunnel all traffic from your iOS device to your own server via IPSec","author":"Jude Pereira","date":"May 11, 2018","format":false,"excerpt":"TL;DR: A DigitalOcean droplet, strongSwan, and a custom Configuration Profile for iOS routes all the traffic from my iPhone via my droplet. Why? Just because I can. Note: This setup does not require you to download Apple Configurator and switch your iPhone into Supervised mode (we will create a configuration\u2026","rel":"","context":"In &quot;gnu linux&quot;","block_context":{"text":"gnu linux","link":"https:\/\/judepereira.com\/blog\/category\/linux\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/judepereira.com\/blog\/wp-content\/uploads\/Screen-Shot-2018-05-10-at-20.34.32-1024x134.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/judepereira.com\/blog\/wp-content\/uploads\/Screen-Shot-2018-05-10-at-20.34.32-1024x134.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/judepereira.com\/blog\/wp-content\/uploads\/Screen-Shot-2018-05-10-at-20.34.32-1024x134.png?resize=525%2C300&ssl=1 1.5x"},"classes":[]},{"id":1855,"url":"https:\/\/judepereira.com\/blog\/nginx-ingress-helm-k8s-rbac\/","url_meta":{"origin":893,"position":4},"title":"Installing the Nginx Ingress Controller via Helm to a K8s cluster with RBAC enabled","author":"Jude Pereira","date":"October 1, 2018","format":false,"excerpt":"A lot of posts describe how to do this, but are fairly outdated, and do not mention the last supported K8s version. Here's a tried and tested way to do so via Helm. This has been tested on GKE, with the Kubernetes master version\u00a01.9.7-gke.6: Create the service account for Tiller\u2026","rel":"","context":"In &quot;another snippet | code&quot;","block_context":{"text":"another snippet | code","link":"https:\/\/judepereira.com\/blog\/category\/code\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1881,"url":"https:\/\/judepereira.com\/blog\/nrf52840-flash-s340\/","url_meta":{"origin":893,"position":5},"title":"nRF52840 &#8211; flashing the s340 v6.1.1 SoftDevice","author":"Jude Pereira","date":"July 12, 2019","format":false,"excerpt":"This post is a work in progress (WIP). The result of this experiment is a success. I have flashed my SparkFun nRF52840 mini, and I'm able to run the bicycle combined speed & cadence sensor example. Before we begin, \u00a0a big hats off to\u00a0Charles, who brought support for the SparkFun\u2026","rel":"","context":"In &quot;hardware&quot;","block_context":{"text":"hardware","link":"https:\/\/judepereira.com\/blog\/category\/hardware\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/judepereira.com\/blog\/wp-json\/wp\/v2\/posts\/893","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/judepereira.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/judepereira.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/judepereira.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/judepereira.com\/blog\/wp-json\/wp\/v2\/comments?post=893"}],"version-history":[{"count":9,"href":"https:\/\/judepereira.com\/blog\/wp-json\/wp\/v2\/posts\/893\/revisions"}],"predecessor-version":[{"id":902,"href":"https:\/\/judepereira.com\/blog\/wp-json\/wp\/v2\/posts\/893\/revisions\/902"}],"wp:attachment":[{"href":"https:\/\/judepereira.com\/blog\/wp-json\/wp\/v2\/media?parent=893"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/judepereira.com\/blog\/wp-json\/wp\/v2\/categories?post=893"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/judepereira.com\/blog\/wp-json\/wp\/v2\/tags?post=893"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}