41
<emphasis>update-motd:</emphasis> is used to automatically update the MOTD via <application>cron</application>.
47
The <application>update-motd</application> utility has several options to further customize the MOTD:
53
<emphasis>--disable:</emphasis> prevents automatic updates of the MOTD. Using this option creates the
54
<filename>/var/lib/update-motd/disabled</filename> file, which if present stops <application>update-motd</application>
55
from modifying <filename>/etc/motd</filename>.
60
<emphasis>--enable:</emphasis> enables the automatic MOTD updates. If <filename>/var/lib/update-motd</filename>
61
is present it will be removed.
66
<emphasis>--force:</emphasis> does a one time update of <filename>/etc/motd</filename>, overriding <application>update-motd</application>
67
if it has been disabled.
72
<emphasis>d, hourly, weekly, monthly:</emphasis> option will run the scripts in <filename>/etc/update-motd.d/</filename> (default),
73
<filename>/etc/update-motd.d/hourly</filename>, <filename>/etc/update-motd.d/weekly</filename>, or
74
<filename>/etc/update-motd.d/monthly</filename> respectively.
80
<application>update-motd</application> executes the scripts in <filename>/etc/update-motd.d</filename> in order based on the number
81
prepended to the script. Separate <application>cron</application> scripts execute every ten minutes, hourly, weekly, and monthly
82
running the corresponding scripts in <filename>/etc/update-motd.d</filename>. The output of the scripts is written to
83
<filename>/var/run/update-motd/</filename>, keeping the numerical order, then concatenated with
84
<filename>/etc/motd.tail</filename> and written to <filename>/etc/motd</filename>.
41
<emphasis>update-notifier-common:</emphasis> is used to automatically update the MOTD via <application>pam_motd</application> module.
47
<application>pam_motd</application> executes the scripts in <filename>/etc/update-motd.d</filename> in order based on the number
48
prepended to the script. The output of the scripts is written to <filename>/var/run/motd</filename>, keeping the numerical order,
49
then concatenated with <filename>/etc/motd.tail</filename>.
149
Next, create a symlink to <filename>/etc/update-motd.d/60-local-weather</filename>:
114
Next, create a symlink to <filename>/etc/update-motd.d/98-local-weather</filename>:
153
<command>sudo ln -s /usr/local/bin/local-weather /etc/update-motd.d/60-local-weather</command>
118
<command>sudo ln -s /usr/local/bin/local-weather /etc/update-motd.d/98-local-weather</command>
158
Finally, update the MOTD:
123
Finally, exit the server and re-login to view the new MOTD.
162
<command>sudo update-motd</command>
168
129
You should now be greeted with some useful information, and some information about the local weather that may not be
169
130
quite so useful. Hopefully the <application>local-weather</application> example demonstrates the flexibility of
170
<application>update-motd</application>.
131
<application>pam_motd</application>.
304
<sect1 id="screen-profiles" status="review">
305
<title>Screen Profiles</title>
265
<sect1 id="byobu" status="review">
308
269
One of the most useful applications for any system administrator is <application>screen</application>. It allows the execution
309
270
of multiple shells in one terminal. To make some of the advanced <application>screen</application> features more
310
user friendly, and provide some useful information about the system, the <application>screen-profiles</application> package was
271
user friendly, and provide some useful information about the system, the <application>byobu</application> package was
315
When executing <application>screen</application> for the first time you will be presented with the
316
<application>screen-profiles-helper</application> menu. This menu will allow you to:
276
When executing <application>byobu</application> pressing the <emphasis>F9</emphasis> key will bring up the
277
<application>Configuration</application> menu. This menu will allow you to:
320
281
<listitem><para>View the Help menu</para></listitem>
282
<listitem><para>Change Byobu's background color</para></listitem>
283
<listitem><para>Change Byobu's foreground color</para></listitem>
284
<listitem><para>Toggle status notifications</para></listitem>
321
285
<listitem><para>Change the key binding set</para></listitem>
322
<listitem><para>Change screen profiles</para></listitem>
323
286
<listitem><para>Change the escape sequence</para></listitem>
324
<listitem><para>Create new screen windows</para></listitem>
287
<listitem><para>Create new windows</para></listitem>
325
288
<listitem><para>Manage the default windows</para></listitem>
326
<listitem><para>Install screen by default at login</para></listitem>
289
<listitem><para>Byobu currently does not launch at login (toggle on)</para></listitem>
330
293
The <emphasis>key bindings</emphasis> determine such things as the escape sequence, new window, change window, etc. There
331
are two key binding sets to choose from <emphasis>common</emphasis> and <emphasis>none</emphasis>. If you wish to use the
294
are two key binding sets to choose from <emphasis>f-keys</emphasis> and <emphasis>screen-escape-keys</emphasis>. If you wish to use the
332
295
original key bindings choose the <emphasis>none</emphasis> set.
336
The Ubuntu <application>screen-profiles</application> provide a menu which displays the Ubuntu release, processor information,
337
memory information, and the time and date. The effect is similar to a desktop menu. When a profile is selected it will be
338
symlinked to <filename>~/.screenrc</filename>. The <application>select-screen-profile</application> utility can also be used
339
to change profiles, in a terminal enter:
343
<command>select-screen-profile -s ubuntu-light</command>
347
The <emphasis>plain</emphasis> profile will change <application>screen</application> back to the defaults, which does not include
348
the information menu at the bottom.
352
Using the <emphasis>"Install screen by default at login"</emphasis> option will cause screen to be executed any time a terminal is opened.
353
Changes made to <application>screen</application> are on a per user basis, and will not affect other users on the system.
357
One difference when using screen is the <emphasis>scrollback</emphasis> mode. If you are using one of the Ubuntu profiles press the
358
<emphasis>F7</emphasis>, or <emphasis>Ctrl+a+[</emphasis> if not, to enter scrollback mode. Scrollback mode allows you to navigate
299
<application>byobu</application> provides a menu which displays the Ubuntu release, processor information,
300
memory information, and the time and date. The effect is similar to a desktop menu.
304
Using the <emphasis>"Byobu currently does not launch at login (toggle on)"</emphasis> option will cause <application>byobu</application>
305
to be executed any time a terminal is opened. Changes made to <application>byobu</application> are on a per user basis, and will not
306
affect other users on the system.
310
One difference when using byobu is the <emphasis>scrollback</emphasis> mode. Press the
311
<emphasis>F7</emphasis> key to enter scrollback mode. Scrollback mode allows you to navigate
359
312
past output using <emphasis>vi</emphasis> like commands. Here is a quick list of movement commands:
367
320
<listitem><para><emphasis>0</emphasis> - Move to the beginning of the current line</para></listitem>
368
321
<listitem><para><emphasis>$</emphasis> - Move to the end of the current line</para></listitem>
369
322
<listitem><para><emphasis>G</emphasis> - Moves to the specified line (defaults to the end of the buffer)</para></listitem>
370
<listitem><para><emphasis>C-u</emphasis> - Scrolls a half page up</para></listitem>
371
<listitem><para><emphasis>C-b</emphasis> - Scrolls a full page up</para></listitem>
372
<listitem><para><emphasis>C-d</emphasis> - Scrolls a half page down</para></listitem>
373
<listitem><para><emphasis>C-f</emphasis> - Scrolls the full page down</para></listitem>
374
323
<listitem><para><emphasis>/</emphasis> - Search forward</para></listitem>
375
324
<listitem><para><emphasis>?</emphasis> - Search backward</para></listitem>
376
325
<listitem><para><emphasis>n</emphasis> - Moves to the next match, either forward or backword</para></listitem>