Friday, July 31, 2009

Telnet +POP and SMTP Commands for send and retrieving mails

Telnet - POP Commands

To access your mailbox you need 4 things:

  • An active internet connection
  • The address of your pop mail server
  • Your username
  • Your password

The first thing to do is to open a connection from your computer to your mail server.
telnet pop.yourdomain.com 110 (default port is 110)
You should receive a reply like:
Trying ???.???.???.???...
Connected to pop.yourdomain.com
Escape character is '^]'.
+OK ready

Then log in:
USER username (yousrusername eg: username@yourdomain.com)

This should give you:
+OK Password required for userName.

Now give your password:
PASS passW0rd
+OK logged in.

To see a list of your emails awaiting collection use the
LIST command, this will also show you the id number of your messages (e.g. 1 or 2 etc.)
To view the contents of an email type
RETR + the id number of the message (e.g RETR 1).
To delete a message use
DELE + the id number of the message (e.g DELE 1).
To leave your mailbox and close the connection use
QUIT

Telnet - SMTP Commands

To access your mailbox you will need 3 things.

  • An active internet connection
  • The address of a mail server capable of relaying for you - usually provided by your dialup provider
  • A valid email address

The first thing to do is to open a connection from your computer to your mail server.
telnet smtp.yourdomain.com 25
You should receive a reply like:
Trying ???.???.???.???...
Connected to smtp.yourdomain.com.
Escape character is '^]'.

You will then need to delcare where you are sending the email from:
HELO smtp.yourdomain.com - dont worry too much about your local domain name although you really should use your exact fully qualified domain name as seen by the outside world the mail server has no choice but to take your word for it as of RFC822-RFC1123.
This should give you:
250 mail.domain.ext Hello smtp.yourdomain.com [loc.al.i.p], pleased to meet you

Now give your email address:
MAIL FROM: username@smtp.yourdomain.com
Should yeild:
250 2.1.0 smtp.yourdomain.com... Sender ok

Now give the recipients address:
RCPT TO: username@smtp.yourdomain.com
Should yeild:
250 2.1.0 user@smtp.yourdomain.com... Recipient ok


To start composing the message issue the command DATA

If you want a subject for your email type Subject:-type subject here- then press enter twice (these are needed to conform to RFC 882)

You may now proceed to type the body of your message (e.g. hello username@ smtp.yourdomain.com from username@smtp.yourdomain.com)

To tell the mail server that you have completed the message enter a single "." on a line on it's own.
The mail server should reply with: 250 2.0.0 ???????? Message accepted for delivery

You can close the connection by issuing the QUIT command.
The mailserver should reply with something like:221 2.0.0 smtp.yourdomain.com closing connection
Connection closed by foreign host.



Thursday, July 23, 2009

HOW TO INSTALL AND CONFIGURE TRAC WITH APACHE AND SVN

# rpm -ivh http://apt.sw.be/packages/rpmforge-release/rpmforge-release-0.3.6-1.el4.rf.i386.rpm
# yum install httpd subversion mod_python mod_dav_svn
# yum --enablerepo=rpmforge install trac
Instantiating svn:

# mkdir /var/www/svn
# svnadmin create /var/www/svn/project
Initial svn import:

# mkdir -p /tmp/newsvn/{trunk,tags,branches}
# svn import /tmp/newsvn file:///var/www/svn/project -m "Initial import"
# chown -R apache /var/www/svn/project
# chmod -R go-rwx /var/www/svn/project
Instantiating trac:

# mkdir /var/www/trac
# trac-admin /var/www/trac/project initenv
# mkdir /var/www/{.python-eggs,passwd}
# htpasswd -c /var/www/passwd/.htpasswd
# touch /var/www/passwd/svnauthz
# chgrp -R apache /var/www/trac/project
# chown -R apache /var/www/trac/project/{attachments,db,log,plugins}
# chown -R apache /var/www/{.python-eggs,passwd}
# chmod -R o-rwx /var/www/{trac/project,.python-eggs,passwd}
# chmod g+w /var/www/trac/project/conf/trac.ini
Install trac plugins:

# wget http://peak.telecommunity.com/dist/ez_setup.py
# python ez_setup.py
# easy_install http://svn.edgewall.com/repos/trac/sandbox/webadmin/
# easy_install http://trac-hacks.org/svn/accountmanagerplugin/0.10
# easy_install http://trac-hacks.org/svn/svnauthzadminplugin/0.10
trac.ini conf setup:

[trac]
default_charset=UTF-8
authz_file = /var/www/passwd/svnauthz

[components]
acct_mgr.admin.accountmanageradminpage = enabled
acct_mgr.api.accountmanager = enabled
acct_mgr.htfile.htpasswdstore = enabled
acct_mgr.web_ui.accountmodule = enabled
acct_mgr.web_ui.loginmodule = enabled
trac.web.auth.loginmodule = disabled
webadmin.* = enabled
svnauthz.* = enabled

[account-manager]
password_file = /var/www/passwd/.htpasswd
password_store = HtPasswdStore
Apache trac conf setup:

Alias /trac /var/www/trac

SetHandler mod_python
PythonInterpreter main_interpreter
PythonHandler trac.web.modpython_frontend
PythonOption TracEnvParentDir /var/www/trac
PythonOption TracUriRoot /trac
SetEnv PYTHON_EGG_CACHE /var/www/.python-eggs

#
# AuthType Basic
# AuthName 'Trac Server'
# AuthUserFile /var/www/passwd/.htpasswd
# Require valid-user
#

Apache subversion conf setup:


DAV svn
SVNParentPath /var/www/svn

# Limit write permission to list of valid users.
#
# Require SSL connection for password protection.
# SSLRequireSSL

AuthType Basic
AuthName 'Authorization Realm'
# Trac .htpasswd file used so users will be the same for both
AuthUserFile /var/www/passwd/.htpasswd
Require valid-user
AuthzSVNAccessFile /var/www/passwd/svnauthz
#


Trac privileges:

# trac-admin /var/www/trac/project permission add admins TRAC_ADMIN
# trac-admin /var/www/trac/project permission add admins
# trac-admin /var/www/trac/projectname permission remove anonymous TICKET_CREATE TICKET_MODIFY etc...
# track-admin /var/www/trac/project permission add devs BROWSER_VIEW CHANGESET_VIEW FILE_VIEW LOG_VIEW \
MILESTONE_CREATE MILESTONE_VIEW REPORT_CREATE REPORT_MODIFY REPORT_SQL_VIEW REPORT_VIEW \
ROADMAP_VIEW SEARCH_VIEW TICKET_APPEND TICKET_CHGPROP TICKET_CREATE TICKET_MODIFY \
TICKET_VIEW TIMELINE_VIEW WIKI_CREATE WIKI_MODIFY WIKI_VIEW

Monday, July 6, 2009

Make Your Internet Connection Pay for Itself | Daily Cup of Tech

Make Your Internet Connection Pay for Itself | Daily Cup of Tech

Sunday, July 5, 2009

The Software-RAID HOWTO: RAID setup

The Software-RAID HOWTO: RAID setup

Software Raid | Raid Arrays | mdadm on Linux

Software Raid | Raid Arrays | mdadm on Linux

Quick HOWTO : Ch26 : Linux Software RAID - Linux Home Networking

Quick HOWTO : Ch26 : Linux Software RAID - Linux Home Networking

Setting up RAID - Linux StepByStep

Setting up RAID - Linux StepByStep: "Setting up software RAID"

Saturday, July 4, 2009

Howto Backup PostgreSQL Databases Server With pg_dump command

Howto Backup PostgreSQL Databases Server With pg_dump command

Howto Backup PostgreSQL Databases Server With pg_dump command
by LinuxTitli

Generally, I like to work with MySQL but some time my work force me to work with PostgreSQL database server.
Recently I had received a request to backup PostgreSQL databases as one of our client want to format and reinstall RHEL server.
PostgreSQL is a one of the robust, open source database server. Like MySQL database server, it provides utilities for creating a backup.
Step # 1: Login as a pgsql user
Type the following command:
$ su - pgsql
Get list of database(s) to backup:
$ psql -l
Step # 2: Make a backup using pg_dump
Backup database using pg_dump command. pg_dump is a utility for backing up a PostgreSQL database. It dumps only one database at a time. General syntax:
pg_dump databasename > outputfile
Task: dump a payroll database
Type the following command
$ pg_dump payroll > payroll.dump.outTo restore a payroll database:
$ psql -d payroll -f payroll.dump.outOR$ createdb payroll
$ psql payroll However, in real life you need to compress database:$ pg_dump payroll | gzip -c > payroll.dump.out.gzTo restore database use the following command:$ gunzip payroll.dump.out.gz
$ psql -d payroll -f payroll.dump.outHere is a shell script for same task:
#!/bin/bash
DIR=/backup/psql
[ ! $DIR ] && mkdir -p $DIR || :
LIST=$(psql -l | awk '{ print $1}' | grep -vE '^-|^List|^Name|template[0|1]')
for d in $LIST
do
pg_dump $d | gzip -c > $DIR/$d.out.gz
done
Another option is use to pg_dumpall command. As a name suggest it dumps (backs up) each database, and preserves cluster-wide data such as users and groups. You can use it as follows:$ pg_dumpall > all.dbs.outOR$ pg_dumpall | gzip -c > all.dbs.out.gzTo restore backup use the following command:
$ psql -f all.dbs.out postgresReferences:
• PostgreSQL documentation : Backup and Restore chapter