Skip to content

Instantly share code, notes, and snippets.

View profesor79's full-sized avatar
:octocat:
creating new.... ideas?

Grzegorz Bernas profesor79

:octocat:
creating new.... ideas?
View GitHub Profile
@maxwellb
maxwellb / .motd
Created December 20, 2018 21:47
clear-motd
#!/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
@miticojo
miticojo / syslog_rfc_regex.js
Created September 3, 2016 08:32
Regex for SYSLOG format RFC3164 and RFC5424
// 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";
@holybit
holybit / rsyslog.conf
Last active June 16, 2020 08:23
rsyslog splitting large messages on local socket with logger
# 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)