Category Archives: Tips & Tricks

How to log bash history with syslog

There are two methods to get this thing done. 1. Trap method – drop the following snippet into either the per-user or system-wide bash profile (~/.bash_profile or /etc/profile, respectively) unset HISTSIZE HISTFILESIZE export HISTTIMEFORMAT=’%F %T’ function log2syslog{    declare COMMAND    COMMAND=$(fc -ln -0)    logger -p local1.notice -t bash -i — “${USER}:${COMMAND}”}trap log2syslog DEBUG … Continue reading How to log bash history with syslog

Configuring Postfix as a Gmail Relay

This document describes how to configure postfix to use gmail as relay server on debian squeeze. 1. Install the required package. On the dialog window please select No configuration. 2. Configure postfix relayhost = [smtp.gmail.com]:587 smtp_sasl_auth_enable = yes smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd smtp_sasl_security_options = noanonymous smtp_tls_CAfile = /etc/postfix/cacert.pem smtp_use_tls = yes alias_maps = hash:/etc/aliases inet_interfaces = … Continue reading Configuring Postfix as a Gmail Relay