Thursday 21 August 2014

dmidecode Find hardware information

Find hardware information on linux using dmidecode

If you need to know what hardware your computer or server has without having physical access to the machine, you can look it up using a linux command called dmidecode.



root@SysAdmin-Desktop:~# dmidecode --type 1

# dmidecode 2.12
SMBIOS 2.7 present.

Handle 0x0001, DMI type 1, 27 bytes
System Information
 Manufacturer: Gigabyte Technology Co., Ltd.
 Product Name: To be filled by O.E.M.
 Version: To be filled by O.E.M.
 Serial Number: To be filled by O.E.M.
 UUID: 03000200-0400-0500-0006-000700080009
 Wake-up Type: Power Switch
 SKU Number: To be filled by O.E.M.
 Family: To be filled by O.E.M.


There are a lots of options you can use with dmidecode to extract all the information you want. Just take a look at the following list:
Type   Information
----------------------------------------
0   BIOS
1   System
2   Base Board
3   Chassis
4   Processor
5   Memory Controller
6   Memory Module
7   Cache
8   Port Connector
9   System Slots
10   On Board Devices
11   OEM Strings
12   System Configuration Options
13   BIOS Language
14   Group Associations
15   System Event Log
16   Physical Memory Array
17   Memory Device
18   32-bit Memory Error
19   Memory Array Mapped Address
20   Memory Device Mapped Address
21   Built-in Pointing Device
22   Portable Battery
23   System Reset
24   Hardware Security
25   System Power Controls
26   Voltage Probe
27   Cooling Device
28   Temperature Probe
29   Electrical Current Probe
30   Out-of-band Remote Access
31   Boot Integrity Services
32   System Boot
33   64-bit Memory Error
34   Management Device
35   Management Device Component
36   Management Device Threshold Data
37   Memory Channel
38   IPMI Device
39   Power Supply

Tuesday 19 August 2014

SendmailAnalyzer : Mail Log Analyzer

SendmailAnalyzer : E-Mail Log Analyzer


SendmailAnalyzer as is name suggest is a free Sendmail/Postfix log analyzer. It process maillog files and generate dynamic statistics in HTML and graphical output. 

The reports are generated in real time so that it let you know at any moment what is going on your mail servers. It use time (hour, day, month and year views) and cross-linked navigation for easy use.
SendmailAnalyzer is easy to install and highly configurable tool. It also support report for all the major milter or sendmail filters like SpamAssassin, MailScanner, Clamav, Amavis, RBL check, J-ChkMail, etc. SendmailAnalyzer is really helpful for IT reporting.
SendmailAnalyzer can be run on a home dedicated mail server, on multiple enterprise mail servers and on ISP mail servers for free.



This is the most advanced and complete statistics tool dedicated to the great Sendmail MTA & Postfix. It's goal is not to support any kind of MTA or other log format but only being a full featured tool for Sendmail/Postfix users and administrators. 



Features of SendmailAnalyzer




Screenshots :-










Installation of SendmailAnalyzer
 
----------------------------------------------------------------------------------------
1) Stop unwanted Services or settings
----------------------------------------------------------------------------------------
# /etc/init.d/NetworkManager stop
# chkconfig NetworkManager off
Note: Make sure you have configured Network i.e. (IP Address/Netmask/Gateway/DNS)

# vi /etc/sysconfig/selinux
SELINUX=disabled


----------------------------------------------------------------------------------------
2) Open Necessary Ports in iptables
----------------------------------------------------------------------------------------
[root@server ~]#vi /etc/sysconfig/iptables
-A INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT


----------------------------------------------------------------------------------------
3) Install Require Packages and dependencies and verify

----------------------------------------------------------------------------------------

[root@server ~]#yum install perl-ExtUtils-MakeMaker perl-GD-Graph perl-GD-Graph3d make gd libpng
[root@server ~]#yum install httpd
[root@server ~]#yum install make gcc automake zlib-devel bison cmake libtool wget gcc-c++ unzip ncurses-devel openssl-devel pcre-devel libxml2-devel curl-devel gd-devel libxslt-devel
[root@server ~]#yum -y install perl-CPAN


----------------------------------------------------------------------------------------
4) Install Following Perl Module with CPan
----------------------------------------------------------------------------------------

[root@server ~]#cpan
Terminal does not support AddHistory.

cpan shell -- CPAN exploration and modules installation (v1.9402)
Enter 'h' for help.


cpan[1]> install MIME::Base64
cpan[1]> install MIME::QuotedPrint
cpan[1]> install GD::Graph
cpan[1]> install GD::TextUtil
cpan[1]> install GD::Graph::bars3d



----------------------------------------------------------------------------------------
4) Download SendmailAnalyzer Packages Compile
----------------------------------------------------------------------------------------

[root@server ~]#wget http://downloads.sourceforge.net/project/sa-report/sa-report/9.0/sendmailanalyzer-9.0.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fsa-report%2F&ts=1408367748&use_mirror=softlayer-sng
[root@server ~]#tar -zxvf sendmailanalyzer-9.0.tar.gz
[root@server ~]#cd sendmailanalyzer-9.0
[root@server ~]#perl Makefile.PL
[root@server ~]#make && make install


----------------------------------------------------------------------------------------
5) Start SendmailAnalyzer daemon with:
----------------------------------------------------------------------------------------

[root@server ~]#/usr/local/sendmailanalyzer/sendmailanalyzer -f




----------------------------------------------------------------------------------------
6) Modify your httpd.conf to allow access to CGI scripts like follow: & Restart Apache
----------------------------------------------------------------------------------------

[root@server ~]#vi /etc/httpd/conf/httpd.conf

        Alias /sareport /usr/local/sendmailanalyzer/www

        <Directory /usr/local/sendmailanalyzer/www>
            Options ExecCGI
            AddHandler cgi-script .cgi
            DirectoryIndex sa_report.cgi
            Order deny,allow
            Deny from all
            Allow from all
            Allow from ::1
        </Directory>


[root@server ~]#/etc/init.d/httpd restart



----------------------------------------------------------------------------------------
7) Browse SendmailAnalyzer to see the Report
----------------------------------------------------------------------------------------
   
Browse to http://mail.deva.com/sareport/ OR http://IP-OF-Server/sareport/ to ensure that things are working properly.


----------------------------------------------------------------------------------------
8) Setup a cronjob to run sa_cache and restart SendmailAnalyzer daemon after maillog logrotate as follow:
----------------------------------------------------------------------------------------
[root@server ~]#crontab -e

# SendmailAnalyzer log reporting daily cache
0 1 * * * /usr/local/sendmailanalyzer/sa_cache > /dev/null 2>&1
# On huge MTA you may want to have five minutes caching
#*/5 * * * * /usr/local/sendmailanalyzer/sa_cache -a > /dev/null 2>&1













[root@mail ~]# /etc/init.d/crond restart
Stopping crond:      [  OK  ]
Starting crond:      [  OK  ]


Ref Link:http://sareport.darold.net/install.html

 
                    -------------------------

                                                            END
                    -------------------------

Wednesday 13 August 2014

Squirrelmail Install and Configure

 SquirrelMail is a standards-based webmail package written in PHP.
It includes built-in pure PHP support for the IMAP and SMTP protocols,
and all pages render in pure HTML 4.0 (with no JavaScript required)
for maximum compatibility across browsers.
It has very few requirements and is very easy to configure and install.
SquirrelMail has all the functionality you would want from an email client,
including strong MIME support, address books, and folder manipulation.

SquirrelMail is a webmail package written in PHP.
It supports both SMTP and IMAP protocols.
SquirrelMail features cross-platform compatibility since all of its pages render in HTML 4.0.
SquirrelMail requires a web server with PHP to run properly.



----------------------------------------------------------------------------------------
            Install and Configure squirrelmail
----------------------------------------------------------------------------------------

 

Note : I had compile this in Other Location (/opt/
deva_mail_setup/squirrelmail) not on Default Location,
    so before start, u should ready this carefully & do as per your requirement.



Create one directory to store all download required
#mkdir  /softwares
Go to the Directory
#cd  /softwares

Download  squirrelmail tar
#wget http://downloads.sourceforge.net/project/squirreloutlook/squirreloutlook-1.0.3/1.0.3/squirreloutlook-1.0.3.tar.gz

Extract  squirrelmail tar
#tar zxvf squirreloutlook-1.0.3.tar.gz

Move to your config directory, i had move to my config directory
#mv squirreloutlook-1.0.3 /opt/deva_mail_setup/squirrelmail
Go to Your  your squirrelmail Dir
#cd /opt/deva_mail_setup/squirrelmail/config

Change Owner & Group of your squirrelmail Dir )
#chown -R apache.apache /opt/deva_mail_setup/squirrelmail/


# ./conf.pl





>>> We will now include some data from our company to our webmail.

    \B7 Go to option 1 - Organization Preferences:

    \B7 There you can change the name of your organization, add logo, among other options.
    \B7 In option 2, Server Settings, you can modify your domain, and change the smtp to SMTP (option 3). Make sure that in option 2 \93Sub option\94 1 domain name should be your domain.
Domain : yourdomain.com    (will be suffix emailid@yourdomain.com instead of emailed@host.yourdomain.com )
A. Update IMAP Settings : 127.0.0.1:143 (dovecot)
B. Update SMTP Settings : 127.0.0.1:25
    \B7 Go to the Theme option and follow the instruction to set default theme as outlook
    \B7 The option 8 you have the plugins. Just take a look at SQUIRREL website and read about what each plugin does (http://squirrelmail.org/plugins.php).
    \B7 In Option 10 you can change the language.
    \B7 In sub-option 1, change the DEFAULT LANGUAGE to en_US.
    \B7 And finally, option D. Change to dovecot.
## Made the changes, simply save by selecting "S " followed by "Q" to quit.







##### Squirrelmail Apache Configuration #####

#vi /etc/httpd/conf/httpd.conf

### WEBMAIL ###
Alias /squirrelmail /opt/deva_mail_setup/squirrelmail/
<Directory /opt/
deva_mail_setup/squirrelmail/>
Options Indexes
AllowOverride none
DirectoryIndex index.php
Order allow,deny
allow from all
</Directory>




#### Then Restart the Following Services ####

# /etc/init.d/mysqld restart
# /etc/init.d/dovecot restart
# /etc/init.d/postfix restart
# /etc/init.d/httpd restart



Note:: test your configuration by browsing to

http://192.168.1.100/squirrelmail/src/configtest.php

                                 OR
http://Your-Server-IP/squirrelmail/src/configtest.php


----------------------------------------------------------
----------------------------------------------------------

Reset lost root password in Ubuntu 14.04

Reset lost root password in Ubuntu 14.04 

 


Step1: Reset Root Password
- Boot up your Ubuntu machine, and after the BIOS screen, press ESC key. On the GNU GRUB menu, select *Advanced options for Ubuntu





Step2: - On next screen, select select your appropriate recovery mode and press Enter







Step3: - On recovery menu, select ‘root – Drop to root shell prompt’
 






Step4: - From the prompt menu, you need to remount the filesystem to have write permission
 #mount -rw -o remount /

- Now check the user available
 #ls /home/

- Now reset the user password. In my case, its sysadmin
#passwd sysadmin
 
 






Step5: - When done, exit and resume boot