wiki'd

by JoKeru

Test IMAP Server

[cc lang="bash"]
\$ telnet imap.jokeru.ro 143
or
\$ openssl s_client -connect imaps.jokeru.ro:993 -quiet

01 LOGIN test@jokeru.ro password
01 OK LOGIN Ok.

02 LIST "" *
* LIST (\HasNoChildren) "." "INBOX.Drafts"
* LIST (\Marked \HasChildren) "." "INBOX"
* LIST (\HasNoChildren) "." "INBOX.Sent"
* LIST (\HasNoChildren) "." "INBOX.Junk"
* LIST (\HasNoChildren) "." "INBOX.Trash"
02 …

DKIM-milter on CentOS

[cc lang='bash']
\$ yum repolist -> get distribution

http://fedoraproject.org/wiki/EPEL -> get rpm link

\$ rpm -Uvh http://dl.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm
\$ yum repolist | grep epel
\$ yum install dkim-milter

\$ vi /etc/mail/dkim-milter/dkim-filter.conf
\$ chkconfig dkim-milter on
\$ /etc/init.d/dkim-milter start
[/cc …

Test file events using Inotify

[cc lang="bash"]
\$ vi notifier.c
\$ gcc notifier.c -o notifier
\$ ./notifier
file: test-touch, event: 0x00000100
file: test-touch, event: 0x00000020
file: test-touch, event: 0x00000004
file: test-touch, event: 0x00000008
[/cc]

[cc lang="bash"]
\$ touch /tmp/test-touch
\$ grep '0x00000100' /usr/include/sys/inotify.h
#define IN_CREATE 0x00000100 /* Subfile was created. */
\$ grep '0x00000020' …

3proxy - Free Proxy Server

[cc lang="bash"]
\$ apt-get install make gcc -y
\$ cd /usr/src/
\$ wget http://3proxy.ru/0.6.1/3proxy-0.6.1.tgz
\$ tar -xzf 3proxy-0.6.1.tgz
\$ cd 3proxy-0.6.1
\$ make -f Makefile.Linux
\$ cp src/3proxy /usr/local/bin/

\$ mkdir /etc/3proxy
\$ mkdir /var/log/3proxy
\$ vi …

RoundRobin OutGoing SMTP IP Address

[cc lang="bash"]
\$ iptables -t nat -F
\$ iptables -t nat -I POSTROUTING -m state --state NEW -p tcp --dport 25 -o eth0 -m statistic --mode nth --every 1 -j SNAT --to-source 10.20.30.41
\$ iptables -t nat -I POSTROUTING -m state --state NEW -p tcp --dport 25 -o eth0 …

Dovecot POP3S Server

[cc lang='bash']
\$ yum install dovecot

\$ cd /etc/dovecot/
\$ vi dovecot.conf
\$ vi dovecot.pass

\$ service dovecot restart
\$ netstat -tulnp | grep dovecot
tcp 0 0 10.20.30.40:995 0.0.0.0:* LISTEN 24996/dovecot

\$ openssl s_client -connect 10.20.30.40:995
user root@jokeru.ro
pass …

Unbound DNS Resolver

[cc lang='bash']
\$ rpm -ihv http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-5.noarch.rpm
\$ yum install unbound

\$ vi /etc/unbound/unbound.conf

\$ cd /etc/unbound/
\$ wget ftp://FTP.INTERNIC.NET/domain/named.cache

\$ vi /etc/init.d/unbound - add mount / unmount to start / stop

\$ mkdir -p /var/lib …

Juniper Olive

Windows 7 Ultimate SP1
VirtualBox-4.1.8-75467-Win
Free BSD 4.11-RELEASE-i386-miniinst
jinstall-10.4R5.5-domestic-signed

http://sleepyrich.blogspot.com/2010/03/preparing-virtualbox-and-freebsd-for.html

http://sleepyrich.blogspot.com/2010/03/juniper-olive-on-sun-virtualbox.html