Friday, July 4, 2014

Extract an iso file in Linux using command line

Extract an iso file on terminal in Linux

Run following command
sudo mount -o loop "/path/of/iso/file.iso" /mnt
Example :
sudo mount -o loop "/home/user/Downloadsubuntu-12.04.3-desktop-i386.iso" /mnt


Now the iso file contents will be mounted in /mnt
You can copy them anywhere.
sudo cp -r /mnt /your/desired/destination/directory
Example :
sudo cp -r /mnt /home/user/Documents/files


If you do not want to use command line, you can extract it using Archive Manager.
Right click on the iso file and select "Extract here'.
If you have Archive manager, you can mount it using Archive Mounter and files will be opened as separate drive.


Monday, June 2, 2014

Postfix - Change Sender's email address from root

When you send mail using Postfix through command line or similar way, it shows sender's e-mail address root@domain-name. You do not want this and you want your defined email should be visible in recipient's mailbox. Follow the steps.

Add following line in the file /etc/postfix/main.cf 
smtp_generic_maps = hash:/etc/postfix/generic
Now edit the file /etc/postfix/generic, if it is not there, create it.
Add your 'from address' and 'the address you want to be seen in place of from address' in this file.
Example :
root@domain.com linuxamination@gmail.com
user1@domain.com linuxamination@gmail.com
You can define different mail addresses for each user of Linux. 
Now Run following commands in terminal.
postmap /etc/postfix/generic
and
service postfix restart
Now it displays linuxamination@gmail.com as sender, when I send mail as a root or user1.
echo "content-of-the-mail" | mail -s "subject-of-the-mail" "recipient@mail-address.com" 

Cannot find autoconf. Please check your autoconf installation and the $PHP_AUTOCONF environment variable ERROR: `phpize' failed

Install autoconf on your Linux system.

If you are using Debian or Ubuntu, Run
sudo apt-get install autoconf
If you are using CentOS or RHEL or fedora, Run 
sudo yum install autoconf