Friday, June 9, 2017

Linux - find command

This command will search for all file type with a case insensitive ending of .conf.
find . -type f -iname "*.conf"

This will do the same search however only in the current directory, means it will not recurse through the directory.
find . -maxdepth 1 -type f -iname "*.conf"

This search will search for all file over 50 Kilobytes.  If we replace k with M we get megabytes I suppose (Would it kill you to look up the man page yourself ?).
find . -maxdepth 1 -type f -iname "*.conf" -size +50k

Tuesday, April 25, 2017

GSO, TSO and UFO ethtool for nic

Wonderful article at

Tuesday, March 7, 2017

Shadow file line


Saturday, February 25, 2017

Basic Email server in Ubuntu

Here we will see about the installation of a basic SMTP server on Ubuntu
$ sudo apt-get update
# apt-get update –fix-missing
# apt-get install bind9 dnsutils apache2 php5 postfix dovecot-common dovecot-imapd dovecot-pop3d squirrelmail 
Click okay for Internet Site
Let us cd /etc/bind
# vim named.conf.local  be very careful about the style of quotes it is a normal double quote msword will put curly quotes which will not get interpreted correctly.
zone “” {
                   type master;
                   file “/etc/bind/db.mark”;
zone “” {
                   type master;
                   file “/etc/bind/db.192”;
# cp db.local db.mark
# cp db.127 db.192
# vim db.mark
$TTL 604800
@   IN   SOA (
                                               2     ; Serial
                                    604800     ; Refresh
                                      86400     ; Retry
                                  2419200    ; Expire  
                                     604800 ) ; Negative Cache TTL
@         IN    NS 
@         IN    A   
ns         IN    A   
             IN    MX 10
www   IN    CNAME   ns
mail     IN    CNAME   ns
# vim db.192
$TTL 604800
@   IN   SOA (
                                               1     ; Serial
                                    604800     ; Refresh
                                      86400     ; Retry
                                  2419200    ; Expire  
                                     604800 ) ; Negative Cache TTL
@         IN    NS 
1         IN    PTR

Now we will restart bind9
# invoke-rc.d bind9 restart
Now when we do nslookup we should get the IP of our mail server.
When we do a dig we should get answers from mark.db file of bind9 conf.
Now let us work on the configuration of apache2 configuration file.
# cd /etc/apache2/sites-available/
# ls -l
# cp default mail.conf
# vim mail.conf
Now under VirutalHost directive under ServerAdmin let add the first line and update DocumentRoot
                         ServerAdmin   webmaster@localhost
                         DocumentRoot  /usr/share/squirrelmail
# Change the next Directory line as shown below.

Next we should try to enable that site with # a2ensite mail
Then try to reload apache2 service.
 service apache2 reload
Now let us try to reconfigure postfix
# dpkg-reconfigure postfix
Select Localonly and press Okay
Then for System mail name: “” and press OK.
Then for Root and postmaster don’t give anything and press OK.
Then for other destination to accept mail for change the line to, mark-virtual-machine, localhost.localdomain, , localhost,
Then for “Force synchronous updates on mail queue” press No
Then in Local networks append network
Then leave the mailox size limit at 0 bytes.
Then leave the * for Local address extension character and press Ok.
Then for Internet Protocols to use press all and press OK.

Now let us edit the squirrelmail’s apache configuration file.
# vim /etc/squirrelmail/apache.conf
Go down and uncomment
DocumentRoot /usr/share/squirrelmail
Edit the next line to this
vim.tiny /etc/squirrelmail/config.php
$imapServerAddress      = '';
$smtpServerAddress      = '';
Now let us start editing the Dovecot configuration file.
# vim /etc/dovecot/dovecot.conf
Go to the very bottom of the file and start typing
protocols = imap pop3
#disable_plaintext_auth = no
mail_location = mbox:~/mail:INBOX=/var/mail/%u
#mail_location = maildir: ~/Maildir

Change this line alone in  /etc/postfix/
inet_interfaces =,
Now that all configuration is over let us restart all the processes.
# killall named
# killall apache2
# killall dovecot
# invoke-rc.d bind9 restart
# invoke-rc.d apache2 restart
# invoke-rc.d postfix restart
# invoke-rc.d dovecot restart

Now let us create a couple of users to try logging in as them for email transaction.
# adduser bala1
# adduser bala2

Then the important piece of information is to head to

Monday, January 23, 2017

Shredding a disk securely

shred -vfz -n 10 /dev/sda5

-v: show progress
-f: change permissions to allow writing if necessary
-z: add a final overwrite with zeros to hide shredding
-n: overwrite N times instead of the default (3)

Tuesday, January 17, 2017

Serial Edit on VIM editor

When we need to use serial edit while on vim editor.

The following command will change from lines 3 to 7 all words of dogs in to cats.


Monday, January 16, 2017


Hmmm 5% increase per year

0.05 Per Month Per Year Cumulative
1st Year 23000 276000 276000
2nd Year 24150 289800 565800
3rd Year 25358 304290 870090
4th Year 26625 319505 1189595
5th Year 27957 335480 1525074
6th Year 29354 352254 1877328
7th Year 30822 369866 2247194
8th Year 32363 388360 2635554
9th Year 33981 407778 3043332
10th Year 35681 428167 3471498
11th Year 37465 449575 3921073
12th Year 39338 472054 4393127
13th Year 41305 495656 4888783
14th Year 43370 520439 5409222
15th Year 45538 546461 5955684
16th Year 47815 573784 6529468
17th Year 50206 602473 7131941
18th Year 52716 632597 7764538
19th Year 55352 664227 8428765
20th Year 58120 697438 9126203
21st Year 61026 732310 9858513
22nd Year 64077 768926 10627439
23rd Year 67281 807372 11434811
24th Year 70645 847741 12282552
25th Year 74177 890128 13172679

Thursday, January 12, 2017


This site has wonderful information and I have picked up a few command form it.

To check the contents of a Certificate Request file (csr)
$ openssl req -in server.csr -noout -text

To view the contents of a CA Signed certificate request file (cer)
$ openssl x509 -in server.cer -noout -text