Hard Disk Performance Testing

To check read speed you can use the following command

hdparm -Tt /dev/sda1

 Timing cached reads:   25292 MB in  2.00 seconds = 12664.26 MB/sec
 Timing buffered disk reads: 432 MB in  3.01 seconds = 143.56 MB/sec

Here 12664.26 MB/sec & 143.56 MB/sec are the read speeds.

DD command will give the write speed of hard drives

dd if=/dev/zero of=/tmp/output bs=1024 count=4096k conv=fdatasync; rm -f /tmp/output
4194304+0 records in
4194304+0 records out
4294967296 bytes (4.3 GB) copied, 165.193 s, 26.0 MB/s

Here 26.0 MB/s is the write speed.

Hope this helps!

Ubuntu Passwordless and Public Key Authentication

1. Need to generate a local public key file from client machine

# ssh-keygen -t dsa 

( from client machine)

2. Copy the file to the server

# scp ~/.ssh/id_dsa.pub user@linuxfreaks.in:/home/user

3. Login to the server and add the key to authorized_keys file

# cat id_dsa.pub >> .ssh/authorized_keys

4. Delete the original file you copied

# rm -r id_dsa.pub

All done, now just ssh to the server. It will login without the password.

Note : Passwordless authentication is a big security risk.

Add swap on CentOS and Ubuntu Linux

1. Create a swap file.

dd if=/dev/zero of=/mnt/swapfile bs=1024 count=4096k

This will create a 4GB of swap file which can be used for 8GB server.

2. Change the file to swap partition.

mkswap /mnt/swapfile

3. Enable swap

swapon /mnt/swapfile

4. Verify swap partition.

swapon -s

NOTE: All the above operations need to be done with a sudo user or by root.

Zimbra & Sendgrid SMTP Setup

All the operations need to be done as a Zimbra user.

1. Point a domain to an SMTP server

zmprov ms mail.example.com zimbraMtaRelayHost smtp.sendgrid.net

2. Add SMTP authentication for smtp relay server

echo smtp.sendgrid.net username:password > /opt/zimbra/conf/relay_password

3. Export it to postfix

postmap hash:/opt/zimbra/conf/relay_password

4. Check the credentials are saved properly

postmap -q smtp.sendgrid.net /opt/zimbra/conf/relay_password

5. Setup SASL to use smtp relay authentication Continue reading Zimbra & Sendgrid SMTP Setup