{"id":25,"date":"2011-04-17T15:32:00","date_gmt":"2011-04-17T15:32:00","guid":{"rendered":"http:\/\/mattdturner.com\/wordpress\/?p=25"},"modified":"2015-05-18T09:16:52","modified_gmt":"2015-05-18T15:16:52","slug":"etcmotd-formatting","status":"publish","type":"post","link":"http:\/\/mattdturner.com\/wordpress\/2011\/04\/etcmotd-formatting\/","title":{"rendered":"\/etc\/motd Formatting"},"content":{"rendered":"<p><span style=\"line-height: 24px;\"><span style=\"font-family: inherit;\">It is good practice to announce server maintenance dates and scheduled downtime dates many days prior to the actual downtime. The easiest way to ensure that all users become aware of the scheduled downtime is to place an alert in \/etc\/motd.<\/span><\/span><\/p>\n<p>For those of you that don\u2019t know, \/etc\/motd is the file that gets printed to the screen when a user first logs into the system.<\/p>\n<p>However, in the case of our server (possibly most servers), users tend to ignore the contents of motd since it very rarely changes. In order to attract the attention of any user that logs into the system, I have begun adding formatting (bold, underline, colors, etc) to the motd file on our server.<\/p>\n<p>Formatting can be easily added to any motd using ANSI codes. For example, below is a copy of a sample maintenance announcement for our server:<\/p>\n<div class=\"indented\" style=\"margin-bottom: -50px; margin-top: 5px; padding-left: 50px; padding-right: 50px;\"><span style=\"font-family: inherit;\"> <\/span><\/div>\n<p><span style=\"font-family: inherit;\"><br \/>\n<\/span><\/p>\n<div class=\"separator\" style=\"clear: both; text-align: center;\"><a style=\"margin-left: 1em; margin-right: 1em;\" href=\"http:\/\/1.bp.blogspot.com\/-6VSZK_sHdO4\/TatqGaXAHuI\/AAAAAAAAACQ\/DTb7m4xxVRM\/s1600\/maintenance.gif\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/1.bp.blogspot.com\/-6VSZK_sHdO4\/TatqGaXAHuI\/AAAAAAAAACQ\/DTb7m4xxVRM\/s400\/maintenance.gif\" border=\"0\" alt=\"\" width=\"400\" height=\"40\" \/><\/a><\/div>\n<p><span style=\"font-family: inherit;\"> Notice that the text \u201cServer Maintenance\u201d is what first got your attention. This is because of the different color, bold text, and blinking text (blinking text is not supported in IE, Chrome, and Safari).<br \/>\n<\/span><br \/>\n<a name=\"more\"><\/a><span style=\"font-family: inherit;\"><br \/>\nBelow is a list of some of the formatting commands i use, as well as the corresponding displayed text. Note that the ^[ that appears often in purple in the below images is the escape character. To insert this character, within VIM press\u00a0and hold ctrl + &#8216;v&#8217; and then press escape.<br \/>\n<\/span><\/p>\n<table style=\"text-align: left; width: 500px;\" border=\"\u201c0\u201d\" cellspacing=\"2\" cellpadding=\"2\">\n<tbody>\n<tr>\n<td style=\"text-align: center; vertical-align: top; width: 225px;\">\n<table class=\"tr-caption-container\" style=\"margin-left: auto; margin-right: auto; text-align: center;\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\">\n<tbody>\n<tr>\n<td style=\"text-align: center;\"><a style=\"margin-left: auto; margin-right: auto;\" href=\"http:\/\/4.bp.blogspot.com\/--IDubAImnc4\/TatqFgDzBvI\/AAAAAAAAACI\/Hu2uozS7bRQ\/s1600\/ansi_code.png\"><img decoding=\"async\" src=\"http:\/\/4.bp.blogspot.com\/--IDubAImnc4\/TatqFgDzBvI\/AAAAAAAAACI\/Hu2uozS7bRQ\/s1600\/ansi_code.png\" border=\"0\" alt=\"\" \/><\/a><\/td>\n<\/tr>\n<tr>\n<td class=\"tr-caption\" style=\"text-align: center;\">Command<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/td>\n<td style=\"text-align: center; vertical-align: top; width: 209px;\">\n<table class=\"tr-caption-container\" style=\"margin-left: auto; margin-right: auto; text-align: center;\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\">\n<tbody>\n<tr>\n<td style=\"text-align: center;\"><a style=\"margin-left: auto; margin-right: auto;\" href=\"http:\/\/4.bp.blogspot.com\/-y3zVGn6aUk4\/TatqGIyScuI\/AAAAAAAAACM\/d5rAoMc8hi8\/s1600\/ansi_output.gif\"><img decoding=\"async\" src=\"http:\/\/4.bp.blogspot.com\/-y3zVGn6aUk4\/TatqGIyScuI\/AAAAAAAAACM\/d5rAoMc8hi8\/s1600\/ansi_output.gif\" border=\"0\" alt=\"\" \/><\/a><\/td>\n<\/tr>\n<tr>\n<td class=\"tr-caption\" style=\"text-align: center;\">Output<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<div class=\"zemanta-pixie\" style=\"margin-top: 10px; height: 15px;\"><a class=\"zemanta-pixie-a\" title=\"Enhanced by Zemanta\" href=\"http:\/\/www.zemanta.com\/\"><img decoding=\"async\" class=\"zemanta-pixie-img\" style=\"border: none; float: right;\" src=\"http:\/\/img.zemanta.com\/zemified_e.png?x-id=5618cb07-c18b-4c17-84b5-d88f74161e32\" alt=\"Enhanced by Zemanta\" \/><\/a><\/div>\n","protected":false},"excerpt":{"rendered":"<p>It is good practice to announce server maintenance dates and scheduled downtime dates many days prior to the actual downtime. The easiest way to ensure that all users become aware of the scheduled downtime is to place an alert in \/etc\/motd. For those of you that don\u2019t know, \/etc\/motd is the file that gets printed [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[3,64,11],"tags":[66,68,50,69,67,65,48,26],"class_list":["post-25","post","type-post","status-publish","format-standard","hentry","category-command-line","category-linux-2","category-mac","tag-file-server","tag-format","tag-linux","tag-mac-2","tag-motd","tag-servers","tag-unix","tag-vim-2","no-thumb"],"_links":{"self":[{"href":"http:\/\/mattdturner.com\/wordpress\/wp-json\/wp\/v2\/posts\/25"}],"collection":[{"href":"http:\/\/mattdturner.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/mattdturner.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/mattdturner.com\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/mattdturner.com\/wordpress\/wp-json\/wp\/v2\/comments?post=25"}],"version-history":[{"count":4,"href":"http:\/\/mattdturner.com\/wordpress\/wp-json\/wp\/v2\/posts\/25\/revisions"}],"predecessor-version":[{"id":540,"href":"http:\/\/mattdturner.com\/wordpress\/wp-json\/wp\/v2\/posts\/25\/revisions\/540"}],"wp:attachment":[{"href":"http:\/\/mattdturner.com\/wordpress\/wp-json\/wp\/v2\/media?parent=25"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/mattdturner.com\/wordpress\/wp-json\/wp\/v2\/categories?post=25"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/mattdturner.com\/wordpress\/wp-json\/wp\/v2\/tags?post=25"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}