This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# To use set the follow alias in your .bash_profile or .bashrc | |
# and then save this file as ~.motd, and chmod +x on it. | |
# | |
# alias clear='clear && ([ -x ~/.motd ] && ~/.motd || true) || ([ -f ~/.motd ] && cat ~/.motd)' | |
# | |
# Copyright (c) 2018 Maxwell Bloch, MIT licensed | |
# | |
echo `df -h ~ | xargs echo | cut -d' ' -f12` used, `df -h ~ | xargs echo | cut -d' ' -f11` free on \$HOME |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// RFC3164 https://www.ietf.org/rfc/rfc3164.txt (obsolete) | |
var regex_rfc3164 = /([A-Z][a-z][a-z]\s{1,2}\d{1,2}\s\d{2}[:]\d{2}[:]\d{2})\s([\w][\w\d\.@-]*)\s(.*)$/; | |
// RFC5424 https://www.ietf.org/rfc/rfc3164.txt | |
var regex_rfc5424 = /(?:(\d{4}[-]\d{2}[-]\d{2}[T]\d{2}[:]\d{2}[:]\d{2}(?:\.\d{1,6})?(?:[+-]\d{2}[:]\d{2}|Z)?)|-)\s(?:([\w][\w\d\.@-]*)|-)\s(.*)$/; | |
// valid string for regex test | |
var msg_rfc3164 = "<34>Oct 11 22:14:15 mymachine su: 'su root' failed for lonvick on /dev/pts/8"; | |
var msg_rfc5424 = "<34>1 2003-10-11T22:14:15.003Z mymachine.example.com su - ID47 - BOM'su root' failed for lonvick on /dev/pts/8"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# rsyslog configuration file | |
# For more information see /usr/share/doc/rsyslog-*/rsyslog_conf.html | |
# If you experience problems, see http://www.rsyslog.com/doc/troubleshoot.html | |
#### MODULES #### | |
# The imjournal module bellow is now used as a message source instead of imuxsock. | |
$MaxMessageSize 12k | |
$ModLoad imuxsock # provides support for local system logging (e.g. via logger command) |