Change network driver for ESX(i) guest OS to VMXNET

Hello,

On the VMWare ESXi server you can specifiy your network card driver when adding a network device to your virtual machine, but once installed you cannot change it through the GUI. So here are a few steps to make the change simple:

  1. Login to ESXi server through your terminal
  2. Go to your VM folder
  3. Connect to your VM and shut it down.
  4. Open your VM .vmx file with vi
  5. Look for the line ethernetX.virtualDev (X: interface number)
  6. Change this value to vmxnet or vmxnet3
  7. ​Save file and restart your virtual machine

Remark:
Usually you need to install the vm with another driver because vmxnet is not installed on an operating system per default. Before you can use the driver you must install VMWare Tools. It is important that you shut down the VM otherwise your modified .vmx file will be overwritten.

 

Clean shell history when logging out

Hello,

There is a simple way of deleting bash's history at the logout. First create a file called .bash_logout in your user home directory and use the clear-command to clear the screen and the history-command to remove the history. Here is how it's done:

open file:
# vim ~/.bash_logout

add this to the file:
rm -f ~/.bash_history
clear
history -c

Save and exit the file. Done 😉

The -c parameter deletes all history. If you want to delete the session hisotry only use -r instead.

Fight spam with sendmail (CentOS5/RHEL5)

Hello,

Sendmail is a very often used MTA (Mail Transfer Agent) on unix platforms. It implements configurations to do realtime blocklist checks with lists from spamhaus.org or spamcop.net or any other blocklist. Open your /etc/mail/sendmail.mc and add following two lines to it:

FEATURE(`enhdnsbl', `sbl.spamhaus.org', `"554 Rejected " $&{client_addr} " – see http://www.spamhaus.org/sbl/"')dnl
FEATURE(`enhdnsbl', `bl.spamcop.net', `"554 Rejected " $&{client_addr} " – see http://www.spamcop.net/bl.shtml"')dnl

Please remember to put them after this line:
include(`/usr/lib/opcenter/sendmail/install/popauth.m4')

If you do not, the sendmail.cf compilation will fail with an error. Well now it's time to compile our config file, so type this:

# m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf

and restart the mail server with

# service sendmail restart

The advantage of this method is that the email is rejected before it enters the server so it saves bandwidth and cpu ressources. I personnally disabled the blocklist checking in MailScanner after using this because i found no need for it anymore.

There are also a few config options i found useful:

throttle connections to servers which sent out email to more than 10 invalid adresses:
define(`confBAD_RCPT_THROTTLE', `10')dnl

replace smtp welcome message with a custom string (hides sendmail verison):
define(`confSMTP_LOGIN_MSG', `<Your custom string here> MTA, local time is $b')dnl