Archive for the ‘ shell script ’ Category

How do I make wget work with Squid under UNIX or Linux operating systems?

You need to define the shell variables as follows:

HTTP_PROXY={YOUR-PROXY-Server-IP-HERE}:{YOUR-PROXY-SERVER-Port-Here}
FTP_PROXY={YOUR-PROXY-Server-IP-HERE}:{YOUR-PROXY-SERVER-Port-Here}

Read the rest of this entry

Usually, you do not need to setup an email server under Linux desktop operating system. Most GUI email clients (such as Thunderbird) supports Gmail POP3 and IMAP configurations. But, how do you send mail via the standard or /usr/bin/mail user agents or a shell script? Programs such as sendmail / postfix / exim can be configured as a gmail smarthost but they are largely overkill for this use.

You can use gmail as a smart host to send all messages from your Linux / UNIX desktop systems. You need to use a simple program called ssmtp. It accepts a mail stream on standard input with recipients specified on the command line and synchronously forwards the message to the mail transfer agent of a mailhub for the mailhub MTA to process. Failed messages are placed in dead.letter in the sender’s home directory.
Read the rest of this entry

We talked about some of the benefits of setting up an email server in Linux and how you can use python to send email. Now we are going to look at how you can send email from Perl.
The Code

use Net::SMTP::TLS;
my $mailer = new Net::SMTP::TLS(
‘smtp.gmail.com’,
Hello => ‘smtp.gmail.com’,
Port => 587,
User => ‘username’,
Password=> ‘password’);
$mailer->mail(‘from@domain.com’);
$mailer->to(‘to@domain.com’);
$mailer->data;
$mailer->datasend(“Sent from perl!”);
$mailer->dataend;
$mailer->quit;

Q. How do I configure static IPv6 networking under RHEL 5.x / Fedora / CentOS Linux?
A. Red Hat / CentOS / Fedora RHEL support IPv6 out of box. All you have to do is update two files and turn on networking.
Read the rest of this entry

Our policy and network configuration does not requires IPv6 support in RHEL / CentOS / Fedora Linux. How do I prevent the kernel module from loading at boot time and disable IPv6 networking?
You can easily prevent the kernel module from loading by updating the following two files:

  1. /etc/modprobe.conf – Kernel driver configuration file.
  2. /etc/sysconfig/network – RHEL / CentOS networking configuration file.

Read the rest of this entry