Thursday, March 18, 2010

Useful Links in Linux!


First Page for Linux Newcomers


Why Linux ?


Linux Tool ??


Linux Help


Interesting

Interesting Project

PS: Add any more links in the comments!

Thursday, March 4, 2010

Configuring exim4 in Ubuntu to use GMail for SMTP

This blog runs on Blogger and the “comment notifications by email” never worked. Initially I thought it was a Blogger problem and trawled through forum posts looking for a solution. Unable to find one I did something which I should have tried right at the beginning. I tried sending a mail from the server using the ‘mail’ command. Oops !. Exim log(/var/log/exim4/mainlog) give the wonderfully worded message  R=nonlocal: Mailing to remote domains not supported 


Also I wanted to route the mail through GMail SMTP servers since that would improve reliability. Turns out there is an indeed a way to make exim, the default MTA in debain/ubuntu to route all mail through GMail SMTP servers. Second round of trawling the interwebs started I managed to get a working setup without much trouble. But I had to piece together the content from separate sources. Here is how I did it.


Step 1


                          Run dpkg-reconfigure exim4-config



  •  Choose mail sent by smarthost; received via SMTP or fetchmail
  • Type System Mail Name: e.g. company.com
  • Type IP Adresses to listen on for incoming SMTP connections: 127.0.0.1
  • Leave Other destinations for which mail is accepted blank
  • Leave Machines to relay mail for: blank
  • Type Machine handling outgoing mail for this host (smarthost): smtp.gmail.com::587
  • Choose NO, don’t hide local mail name in outgoing mail.
  • Chose NO, don’t keep number of DNS-queries minimal (Dial-on-Demand).
  • Choose mbox
  • Choose NO, split configuration into small files
  • Mail for postmaster. Leaving blank will not cause any problems though it is not recommended



Step 2

  • Open the file /etc/exim4/exim4.conf.template
  • Find the line .ifdef DCconfig_smarthost DCconfig_satellite and add the following in that section

            send_via_gmail:
               driver = manualroute
               domains = ! +local_domains
               transport = gmail_smtp
               route_list = * smtp.gmail.com

  • if you have any other smarthost defined with “domains = ! +local_domains” remove that smarthost.
  • Find the “begin authenticators”. In that section add the following

           gmail_login:
               driver = plaintext
               public_name = LOGIN
               client_send = : yourname@gmail.com : YourGmailPassword

  • Make sure you have no other authenticators with the same public_name (LOGIN). Comment them out if needed (Thanks Cybernazi for reminding me)
  • Find the comment  “transport/30_exim4-config_remote_smtp_smarthost”. In that section add

            gmail_smtp:
               driver = smtp
               port = 587
               hosts_require_auth = $host_address
               hosts_require_tls = $host_address


Step 3

  • Run update-exim4.conf
  • Do /etc/init.d/exim4 restart
  • hat should be it. You can test by using the command line mail client.
  • Run mail user@example.com
  • Give a subject and press enter
  • Type something and press enter
  • Type a single . (dot) and press enter
  • Press enter for a blank CC:

This was on an Ubuntu server. I believe that this instructions will also work on Debain without any need for modifications.



Tuesday, September 1, 2009

Play High End Wibdows Games in LINUX

Normally in Linux, you can't play High End Windows Games. This is the one main reason why most of the users prefer windows as their main OS over Linux. But here is a way to run high-end games on Linux by tweaking your wine installation.
is.

This is How you do it:

If you already have wine installed, remove the existing installation to re-installed the patched version. The patch will inject the 3D mark and openGL features which are necessary for installing high end games.

To Uninstall or Remove Previous version run following code:
(need internet for this)

sudo apt-get remove wine
rm -r ~/.wine
sudo apt-get build-dep wine
sudo apt-get install build-essential checkinstall

Now Getting the new Wine, Patching it and Installing it :

mkdir wine && cd wine
wget http://easynews.dl.sourceforge.net/sourceforge/wine/wine-0.9.50.tar.bz2
tar -xvjf wine-0.9.50.tar.bz2
wget http://bugs.winehq.org/attachment.cgi?id=8548
cp attachment.cgi\?id\=8548 wine-0.9.50/3dmark.diff && cd
wine-0.9.50
patch -p1 < prefix="/usr" sysconfdir="/etc">

Now accept the default settings and when an option will come up to set a description, set one and enter, select the next default. Done!

Setting Up Wine:
First run this code


wineprefixcreate
winecfg

Now get the DirectX 9 DLL files by running the following codes :

mkdir dx9 && cd dx9
wget http://www.m3fe.com/files/d3dx9_34.zip
unzip d3dx9_34.zip
mv d3dx9_34.dll ~/.wine/drive_c/windows/system32/

Now Install the Game with wine :

cd /path to cdrom/
wine setup.exe

To Run The Game Installed:

cd ~/.wine/drive_c/Program\ Files/Game\ Folder/gamename.exe

Now you can start playing. :)

PS:Try not to run game in their highest configuration.


Recovering the Deleted Linux Partition

If you have two OS installed on your computer one is XP/Vista and another one is Linux, and if by some reason, you delete your Linux partition in windows or say your GRUB get corrupted due to some reasons, then if you restart, your system says GRUB ERROR 22. or something similar.

To restore your Linux Partition (along with GRUB :P) boot the computer using a Linux live CD (any)and run this command,

sudo lilo -M /dev/sda mbr

It will recover Linux on your PC. Now you will have both your OS's run's perfectly.

Sunday, May 10, 2009

Linux Kernel 2.6.28.8


Linux Kernel is the essential part of Linux, responsible for resource allocation, low-level hardware interfaces, security, simple communications, and basic file system management.Linux is a clone of the operating system Unix, written from scratch by Linus Torvalds with assistance from a loosely-knit team of hackers across the Net.It aims towards POSIX and Single UNIX Specification compliance.

It has all the features you would expect in a modern fully-fledged Unix, including true multitasking, virtual memory, shared libraries, demand loading, shared copy-on-write executables, proper memory management, and multistack networking including IPv4 and IPv6.


Download:
Linux Kernel 2.6.28.8 (43.0 MB)

Full filesystem backup | ufsdump


ufsdump backs up all files in filesystem, where filesystem represents a special device, or files changed after a certain date, to magnetic tape and ufsrestore is the utility for restoring data backup from a ufsdump. We can use restore interactively to restore certain files or directories.

Below is a quick guide on doing a full backup using ufsdump

Remember to run ufsdump backup on single usermode.
$ init -s

To Dump a backup of the root filesystem issue the following command
$ ufsdump 0uf /path were you want to dump backup/ /

Then Verify your dump
$ ufsrestore tf /path were you dump the backup/file

To Restore your dump | backup
$ ufsrestore rvf /path were you dump the backup/file

Do man ufsdump to find out what other switches is available.


Sendmail | Banner change | Disabling VRFY | EXPN

Here is a quick howto on changing the Sendmail banner (usually to obscure information) and disabling VRFY and EXPN

To change Sendmail's baner just edit /etc/mail/sendmail.cf, make sure to backup before editing it, then look for "SmtpGreetingMessage" and edit the line after "$j" then restart Sendmail, the line below is the default entry in sendmail.cf.

# SMTP initial login message (old $e macro)
O SmtpGreetingMessage=$j Sendmail $v/$Z; $b

First a brief description of VRFY and EXPN before e disable it
  • VRFY permits someone to telnet to your server and verify that an email address is valid. Its purpose is to permit a remote server to check whether a particular email address is valid before sending email.
  • EXPN permits someone to telnet to your server and expand an alias into the list of actual email recipients. For example, if you have an email list called "greyhound-adoption", anyone could "expn greyhound-adoption" and get the list of all the member addresses in "greyhound-adoption".
I have been asked by security people to disable VRFY and EXPN on my servers running Sendmail, anyway to do this just look for "PrivacyOptions" line in your /etc/mail/sendmail.cf, make sure to backup the file first before editing it, then add "novrfy,noexpn" to the line like the sample below, then restart your Sendmail.
# privacy flags
O PrivacyOptions=authwarnings,novrfy,noexpn

Just incase your new to command line, to backup a file just do the command below
$ cp fileyouwanttobackup filenameofbackupfile.datehere

To restart Sendmail, on most Unix and Linux use the following command
$ /etc/init.d/sendmail restart

On Solaris 10, you will need to use svcadm refresh Sendmail service to have sendmail reread teh configuration file.