Friday 4 December, 2009

Shell script to list all users in /etc/passwd file


No need for grep. awk does it all.

awk -F":" '$7 ~ /\/bin\/bash/ {print $1}' /etc/passwd



Sukhdev S. Jadhav

Friends are like an treasure,so if you want to become rich in your life make as many friends as possible in the life.

Tuesday 8 September, 2009

rsnapshot with rsync howto on Fedora

rsnapshot with rsync howto on Fedora
Simple yet Powerfull for incremental backup.


Required packages,
Rsync
rsnapshot

You can do it for remote servers also.
I have configure it for local files only.
#yum install rsnapshot rsync -y

created backup_root /backup/
mkdir /backup/
Off course it has to be on diffrent hard disk as we are taking backup.
But I created on local disk for testing.

#vim /etc/rsnapshot.conf

Set snapshots root directory:
 snapshot_root	/disk1/backup/ 
Configure backup policy
interval hourly 6       # run 6 times a day means every 4 hour 
interval daily 7        # and everyday and keep for 7 days.
#interval weekly 4
#interval monthly 3

I set it for hourly and weekly only.

Specify local and remote backup directories
Find out comments that read as follows:

 ############################### ### BACKUP POINTS / SCRIPTS ### ############################### 

backup /etc/ localhost/
#backup /usr/local/ localhost/
backup /var/log/ localhost/

Save and close the file.



 Test your config file for errors 
Type the following to test your configuration file for errors
# rsnapshot configtest
Output:

 Syntax OK 

You can also run rsnapshot in a test mode to display its action:
# rsnapshot -t hourly

Run rsnapshot for first time

To run first time, enter:
# rsnapshot hourly


Configure cron job
Edit /etc/cron.d/rsnapshot file to setup backup snapshot job. This is a sample cron file for rsnapshot. The values used correspond to the examples in /etc/rsnapshot.conf. There you can also set the backup points and many other things. To activate this cron file you have to uncomment the lines below.
Feel free to adapt it to your needs.

 0 */4         * * *           root    /usr/bin/rsnapshot hourly 30 3          * * *           root    /usr/bin/rsnapshot daily 0  3          * * 1           root    /usr/bin/rsnapshot weekly 30 2          1 * *           root    /usr/bin/rsnapshot monthly    सुखदेव सोपान जाधव  Sukhdev Sopan Jadhav   "मौसम के साथ साथ बदल जाना चाहिये| खुशीयाँ न हो तो फीर गम से बहल जाना चाहीये|  जीस रौशनी से आँखे खूल न सके | उस रौशनी से दूर निकल जाना चाहिये |" - अब्बास दाना बडौदी | 

Saturday 29 August, 2009

linux file structure

  

Friday 8 May, 2009

Vtiger CRM 5.0.4 - Installation On Fedora 8

Requirements,

System Requirements
* Hardware: Hosted.
* Web Server: Apache 2.0.40 or above.
* Database: MySQL version 4.1.x through 5.1.x.
* PHP:PHP 5.0.x through 5.2.x.
* Web Browser: Firefox 1.5.x and above or Opera 7.21 and above.
* Operating System: RedHat Linux 7.2/8.0/9.0, SuSe 9.0, Debian 3.0/4.0, Mandrake 10.0, or Fedora Core 3/6/9.

Install Dependency Packages
# yum install libpng libpng-devel libjpeg libjpeg-devel freetype freetype-devel zlib-devel xorg-x11-devel openssl-devel krb5-devel imap-2004d

Prerequisites - PHP

Your php.ini must configured with the following parameters:

* safe_mode = Off
* display_errors = On
* file_uploads = On
* register_globals = Off
* max_execution_time = 600
* output_buffering= On
* memory_limit = 32M
* error_reporting = E_WARNING & ~E_NOTICE
* allow_call_time_pass_reference = On
* log_errors = Off
* short_open_tag= On

Install From Source

1. Download http://prdownloads.sourceforge.net/vtigercrm/vtigercrm-5.0.4.tar.gz from the Sourceforge.net.
[root@ds9 vtigercrm]# wget -c http://prdownloads.sourceforge.net/vtigercrm/vtigercrm-5.0.4.tar.gz?download

2. Extract the vtigercrm-5.0.4.tar.gz file into the Apache root directory. Alternately you may extract it in a subdirectory

#tar -zxvf vtigercrm-5.0.4.tar.gz
#chown -R apache:apache www.progresspartners.co.in/vtiger

3.Start a Web Browser and follow the procedure given in the Configuring vtiger CRM Server chapter for completing vTiger CRM installation.
http://www.progresspartners.co.in/vtiger
Follow the Wizard: (ref)

Database Configuration
create database in mysql and enter your database configuration information

Or create database manually in mysql cli.

[root@ds9 www]# mysql -p
mysql> CREATE DATABASE vtigertest DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;

mysql> grant all on vtigertest.* to vtigertest@localhost identified by 'vtigertest';

mysql> quit

Rest is very simple and web based.


Here is my login screen




Post-installation Check List

1. You must have READ/WRITE permissions on the following vtiger CRM folders and Files within those folders:

* PHP Configuration - config.inc.php
* Cache Directory - cache/
* Mail Merge Template Directory -test/wordtemplatedownload/
* Uploads Directory - storage/
* Install Directory - install/
* Installation file -install.php
* Product Image Directory -test/product/
* User Image Directory - test/user/
* Contact Image Directory- test/contact/
* Logo Directory- test/logo/
* Email Templates Directory -modules/Emails/templates/
* User Privileges Directory - user_privileges/
* Smarty Compile Directory - Smarty/templates_c
* Tabdata File Permission - tabdata.php
* ParentTabdata File Permission - parent_tabdata.php
* Smarty Cache Directory - Smarty/cache
* Logs Directory - logs/
* WebMail attachments Directory - modules/Webmails/tmp/

Saturday 25 April, 2009

Installation and Configuration Of Horde on Fedora 10

Step By step Guide to Installation and Configuration Of Horde on Fedora 10

Horde is The Horde Framework provides a common structure and interface for Horde applications (such as IMP, a web-based mail program).

Basicaly I want to try new webmail for cyrus IMAP. So I was in searching for good Webmail application. I tried roundcubemail and atmail also. Both are good in looks but lack in features.

So Friends, Lets start.


1. Prerequisites


apache, php php-imap php-mysql, mysql-server imap(cyrus-imapd) sendmail poppasswd.
Note that This is the prerequisites for my installation.



To install this application you need to have root access on system. off cource.

Open a gnome-terminal ( Kaali Khidaki) my favorite terminal.

switch to root user.

$su -

2. Configure PHP


open /etc/php.ini and edit bellow lines

file_uploads = On
short_open_tag = On


###install horde application and componants. also install turba and kronolith. the address book and calender application along with this.
ingo is The Horde web-based Email Filter Rules Manager
and imp is webmail application.

[root@lp ~]#yum install imp horde kronolith turba ingo -y

It will install few dependamcies also.

3. Configure mysql
Check that mysql is running:
# service mysqld restart

Create the horde database:
# cd /usr/share/horde/scripts/sql/
# vi vim create.mysql.sql #Important#edit the default password
# mysql -p < create.mysql.sql # create the tables

Test to see if you can connect to the database:
# mysql -h localhost -D horde -u horde -p
Exit mysql with the command 'exit'
If you can't connect, look a the throubleshooting guide before continuing


4. Configure Horde config files

Go to:
# cd horde/config

and make a copy of the default configuration files:

Here is my config files fo refence.

[root@lp ~]# cat /etc/horde/conf.php
/* CONFIG START. DO NOT CHANGE ANYTHING IN OR AFTER THIS LINE. */
// $Horde: horde/config/conf.xml,v 1.74.2.69 2008/06/05 09:05:50 jan Exp $
$conf['vhosts'] = false;
$conf['debug_level'] = E_ALL;
$conf['max_exec_time'] = 0;
$conf['compress_pages'] = true;
$conf['umask'] = 077;
$conf['use_ssl'] = 2;
$conf['server']['name'] = $_SERVER['SERVER_NAME'];
$conf['server']['port'] = $_SERVER['SERVER_PORT'];
$conf['urls']['pretty'] = false;
$conf['safe_ips'] = array();
$conf['session']['name'] = 'Horde';
$conf['session']['use_only_cookies'] = true;
$conf['session']['cache_limiter'] = 'nocache';
$conf['session']['timeout'] = 0;
$conf['cookie']['domain'] = $_SERVER['SERVER_NAME'];
$conf['cookie']['path'] = '/horde';
$conf['sql']['phptype'] = false;
$conf['auth']['admins'] = array('Administrator', 'root', 'sukhdev');
$conf['auth']['checkip'] = true;
$conf['auth']['checkbrowser'] = true;
$conf['auth']['alternate_login'] = false;
$conf['auth']['redirect_on_logout'] = false;
$conf['auth']['params']['dsn'] = '{localhost:143/imap/notls}';
$conf['auth']['params']['imapconfig'] = 'dsn';
$conf['auth']['driver'] = 'imap';
$conf['signup']['allow'] = false;
$conf['log']['enabled'] = false;
$conf['log_accesskeys'] = false;
$conf['prefs']['driver'] = 'session';
$conf['alarms']['driver'] = false;
$conf['datatree']['driver'] = 'null';
$conf['group']['driver'] = 'datatree';
$conf['group']['cache'] = false;
$conf['perms']['driver'] = 'datatree';
$conf['share']['no_sharing'] = false;
$conf['share']['any_group'] = false;
$conf['share']['cache'] = false;
$conf['share']['driver'] = 'datatree';
$conf['cache']['default_lifetime'] = 86400;
$conf['cache']['params']['sub'] = 0;
$conf['cache']['driver'] = 'file';
$conf['lock']['driver'] = 'none';
$conf['token']['driver'] = 'none';
$conf['mailer']['params']['sendmail_path'] = '/usr/lib/sendmail';
$conf['mailer']['params']['sendmail_args'] = '-oi';
$conf['mailer']['type'] = 'sendmail';
$conf['mailformat']['brokenrfc2231'] = false;
$conf['vfs']['type'] = 'none';
$conf['sessionhandler']['type'] = 'none';
$conf['sessionhandler']['memcache'] = false;
$conf['problems']['email'] = 'webmaster@example.com';
$conf['problems']['maildomain'] = 'example.com';
$conf['problems']['tickets'] = false;
$conf['problems']['attachments'] = true;
$conf['menu']['apps'] = array();
$conf['menu']['always'] = false;
$conf['menu']['links']['help'] = 'all';
$conf['menu']['links']['options'] = 'authenticated';
$conf['menu']['links']['problem'] = 'all';
$conf['menu']['links']['login'] = 'all';
$conf['menu']['links']['logout'] = 'authenticated';
$conf['hooks']['permsdenied'] = false;
$conf['hooks']['username'] = false;
$conf['hooks']['preauthenticate'] = false;
$conf['hooks']['postauthenticate'] = false;
$conf['hooks']['authldap'] = false;
$conf['hooks']['groupldap'] = false;
$conf['portal']['fixed_blocks'] = array();
$conf['accounts']['driver'] = 'null';
$conf['user']['verify_from_addr'] = false;
$conf['imsp']['enabled'] = false;
$conf['kolab']['enabled'] = false;
$conf['memcache']['enabled'] = false;
/* CONFIG END. DO NOT CHANGE ANYTHING IN OR BEFORE THIS LINE. */



5. Configure Horde for IMP
Edit this files to allow IMP to run under Horde:

Again I am posting my config file here,

[root@lp ~]# cat /etc/horde/imp/conf.php
/* CONFIG START. DO NOT CHANGE ANYTHING IN OR AFTER THIS LINE. */
// $Horde: imp/config/conf.xml,v 1.53.2.33 2008/05/06 17:54:04 slusarz Exp $
$conf['spell']['driver'] = '';
$conf['utils']['gnupg_keyserver'] = array('pgp.mit.edu');
$conf['utils']['gnupg_timeout'] = 10;
$conf['menu']['apps'] = array();
$conf['user']['select_sentmail_folder'] = false;
$conf['user']['allow_resume_all_in_drafts'] = false;
$conf['user']['allow_folders'] = true;
$conf['user']['allow_resume_all'] = false;
$conf['user']['allow_view_source'] = true;
$conf['user']['alternate_login'] = false;
$conf['user']['redirect_on_logout'] = false;
$conf['user']['select_view'] = true;
$conf['server']['server_list'] = 'shown';
$conf['server']['fixed_folders'] = array();
$conf['server']['sort_limit'] = 0;
$conf['server']['cache_folders'] = true;
$conf['server']['token_lifetime'] = 1800;
$conf['server']['cachejs'] = 'none';
$conf['server']['cachecss'] = 'none';
$conf['mailbox']['show_preview'] = false;
$conf['fetchmail']['show_account_colors'] = false;
$conf['fetchmail']['size_limit'] = 4000000;
$conf['msgcache']['use_msgcache'] = false;
$conf['mlistcache']['use_mlistcache'] = false;
$conf['msgsettings']['filtering']['words'] = './config/filter.txt';
$conf['msgsettings']['filtering']['replacement'] = '****';
$conf['spam']['reporting'] = false;
$conf['notspam']['reporting'] = false;
$conf['print']['add_printedby'] = false;
$conf['msg']['prepend_header'] = true;
$conf['msg']['append_trailer'] = true;
$conf['compose']['allow_receipts'] = true;
$conf['compose']['special_characters'] = true;
$conf['compose']['use_vfs'] = false;
$conf['compose']['link_all_attachments'] = false;
$conf['compose']['link_attachments_notify'] = true;
$conf['compose']['link_attachments'] = true;
$conf['compose']['attach_size_limit'] = 0;
$conf['compose']['attach_count_limit'] = 0;
$conf['compose']['reply_limit'] = 200000;
$conf['hooks']['vinfo'] = false;
$conf['hooks']['postlogin'] = false;
$conf['hooks']['postsent'] = false;
$conf['hooks']['signature'] = false;
$conf['hooks']['trailer'] = false;
$conf['hooks']['fetchmail_filter'] = false;
$conf['hooks']['mbox_redirect'] = false;
$conf['hooks']['mbox_icon'] = false;
$conf['hooks']['spam_bounce'] = false;
$conf['hooks']['msglist_format'] = false;
$conf['maillog']['use_maillog'] = true;
$conf['sentmail']['driver'] = 'none';
$conf['tasklist']['use_tasklist'] = true;
$conf['notepad']['use_notepad'] = true;
/* CONFIG END. DO NOT CHANGE ANYTHING IN OR BEFORE THIS LINE. */

Edit /etc/horde/imp/config/servers.php

$servers['imap'] = array(
'name' => "IMAP Server",
'server' => 'localhost',
'protocol' => 'imap/notls',
'port' => 143,
'folders' => 'mail/',
'namespace' => '',
'port' => 143,
'maildomain' => 'localhost',
'smtphost' => 'localhost',
'smtpport' => 25,
'realm' => '',
'preferred' => 'true'
);


Now you can access the webbased admin consol for remaining config.
http://www.example.com/horde

The following links helped me for reference.
http://www.harkness.co.uk/other/imp_webmail_install.html
http://tweenpath.net/2008/12/install-configuration-of-popopasswd-server-on-centos-52/
http://wiki.horde.org/FAQ/Admin?referrer=FAQ#

You might required to install poppasswd also.
download and install poppasswd.
wget http://rpm.razorsedge.org/centos-5/RE/poppassd-1.8.5-3.el5.re.i386.rpm