<commit_before>#!/bin/bash
#
# This script is designed to run as a cron.hourly job
# Script should grab the output from the uptime command and then parse
# the results into information to be inserted into /etc/motd
#

# Output File (default is /etc/motd)
out_file="/etc/motd"


echo "-------------------------------------------------------------------------------

$(hostname | figlet)
-------------------------------------------------------------------------------

CPU:            Intel(R) Xeon(R) CPU            3060  @ 2.40GHz
                Intel(R) Xeon(R) CPU            3060  @ 2.40GHz
Memory		$(free -m | grep Mem: | awk '{print $3"/"$2}') MB
Users:		$(uptime | cut -d, -f3)
System $(sar | tail -n 1)
-------------------------------------------------------------------------------" > $out_file<commit_msg>adding dynamic cpuinfo, fixing field alignment and more useful comments<commit_after>#!/bin/bash
#
# This script is designed to run as a cron.hourly job
# Script requires two packages. On Fedora/Redhat these packages are called
# "sysstat" and "figlet". They might be different on your platform.
# This script creates /etc/motd by passing the hostname through figlet to 
# generate a fancy graphic of the name. It then gets the CPU info from
# /proc/cpuinfo, memory statistics from the `free` command, user statistics
# from the `uptime` command and System stats from the `sar` command.
#
# The CPU, Memory, Users and System fields appear misaligned in echo but they
# should print out correctly. You can adjust if necessary but I suggest leaving
# them as they are.

# Output File (default is /etc/motd)
out_file="/etc/motd"


echo "-------------------------------------------------------------------------------

$(hostname | figlet)
-------------------------------------------------------------------------------

CPU:$(cat /proc/cpuinfo | awk -F: '/model name/ {print "\011""\011""\011"$2}')
Memory:	 		 $(free -m | grep Mem: | awk '{print $3"/"$2}') MB
Users:		       $(uptime | cut -d, -f3)
System:			 $(sar | tail -n 1)
-------------------------------------------------------------------------------" > $out_file
{'fraction_non_alphanumeric': 0.3139643861293346, 'fraction_numerical': 0.01499531396438613, 'mean_word_length': 1.4710648148148149, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '851673', 'n_tokens_mistral': 577, 'n_tokens_neox': 539, 'n_words': 223}