Mail BPi

#apt-get install postfix
#apt-get install bsd-mailx

#cat /etc/postfix/main.cf
mydestination =
inet_interfaces = loopback-only
relayhost = mail.upcmail.cz:25
sender_canonical_maps = hash:/etc/postfix/sender_canonical
recipient_bcc_maps = hash:/etc/postfix/recipient_bcc
smtp_generic_maps = hash:/etc/postfix/generic
smtp_header_checks = regexp:/etc/postfix/smtp_header_checks

#cat /etc/aliases
root: root@steflovi.cz

# newaliases
/etc/mail/aliases: 1 aliases, longest 17 bytes, 21 bytes total

RAMlog

sudo apt-get update
sudo apt-get upgrade
sudo wget http://www.tremende.com/ramlog/download/ramlog_2.0.0_all.deb
sudo dpkg -i ramlog_2.0.0_all.deb
sudo reboot
sudo reboot

# cd /tmp/
# sudo apt-get install lsof
# wget http://www.tremende.com/ramlog/download/ramlog-2.0.0.tar.gz
# tar -xvf ramlog-2.0.0.tar.gz
# cd ramlog-2.0.0
# cp -a ramlog /etc/init.d/ramlog
# cp -a ramlog.8.gz /usr/share/man/man8/ramlog.8.gz
# cp -a ramlog.cron /etc/cron.daily #or to other dir based on your need
# cp -a ramlog.logrotate /etc/logrotate.d/ramlog
# cp -a ramlog.conf /etc/default/ramlog
# /etc/init.d/ramlog getlogsize

eJabberd MySQL

# Instalace serveru
apt-get install ejabberd

# Doinstalovat potrebne baliky
apt-get install erlang-nox erlang-tools erlang-dev subversion

# Provedeme check out
mkdir /tmp/mysql
cd /tmp/
svn checkout http://svn.process-one.net/ejabberd-modules/mysql/trunk/ mysql

cd mysql
./build.sh

cd /tmp/mysql/ebin/
cp *.bean /usr/lib/ejabberd/ebin/

# Konfigurace MySQL
cd /usr/share/doc/ejabberd/examples
gunzip -d mysql.sql.gz

AWK a apostrofy

Apostrofy v AWK jsou zastoupeny znakem \047

cat tabulky_sql | grep INSERT | awk ‘{ print “insert into dbo.count_of_tables values ( \047” $3 “\047 , ( select count(*) from KOOCPP3.dbo.”$3 “), GETDATE() );” }’

– tento zápis ze skriptu na tvorbu tabuldek vytvoří nad každou tabulkou count a uloží saktuálním datumem do tabulky.