Wednesday, March 27, 2013

Setup Email Server in Ubuntu


  • Install ssmtp Install ssmtpsudo apt-get install ssmtp
    Install mail Util sudo apt-get install mailutils
  • Edit the ssmtp config file : gksu gedit /etc/ssmtp/ssmtp.conf
  • Enter this in the file:
    root=username@gmail.com
    mailhub=smtp.gmail.com:465
    rewriteDomain=gmail.com
    AuthUser=username
    AuthPass=password
    FromLineOverride=YES
    UseTLS=YES
  • Enter the email address of the person who will receive your email:
    ssmtp recepient_name@gmail.com
  • Now enter this:
    To: recipient_name@gmail.com
    From: username@gmail.com
    Subject: Sent from a terminal!

    Your content goes here. Lorem ipsum dolor sit amet, consectetur adipisicing.
  • To send the emailCtrl + D

You can also save the text mentioned in Point 5 into a text file and send it using:
ssmtp recipient_name@gmail.com < filename.txt
"mater" | mail -s 'Process snapshot' psramkumar@gmail.com

Start synergy on boot in Ubuntu?


For newer version of Ubuntu that use lightdm.
I have successfully done the following for running the synergy client for the login screen, andafter I login. It is much simpler than the other answers, IMHO.
edit /etc/lightdm/lightdm.conf as root.
sudo vi /etc/lightdm/lightdm.conf
add the following line to the bottom of the file.
greeter-setup-script=/usr/bin/synergyc 
restart lightdm. (it is better to do this from a terminal or ssh session)
sudo /etc/init.d/lightdm restart
it works good in 12.10 for me

Thursday, March 14, 2013

Ubuntu User Permission


There are two ways to do this: set the directory to "world" writable or create a new group for the two users and make the directory writeable to that group.
Obviously making it world writeable is a Bad Thing, so the second option is preferable.
Users in Linux can belong to more than one group. In this case you want to create a brand new group, let's call it tomandruser:
sudo groupadd tomandruser
Now that the group exists, add the two users to it:
sudo usermod -a -G install user1
sudo usermod -a -G install user2
Now all that's left is to set the permissions on the directory:
sudo chgrp -R tomandruser /path/to/the/directory
sudo chmod -R 770 /path/to/the/directory
Now only members of the tomandruser group can read, write, or execute anything within the directory. Note the -R argument to the chmod and chgrp commands: this tells them to recurse into every sub directory of the target directory and modify every file and directory it finds.
You may also want to change 770 to something like 774 if you want others to be able to read the files,775 if you want others to read and execute the files, etc. Group assignment changes won't take effect until the users log out and back in.


sudo apt-get install curl libcurl3 libcurl3-dev php5-curl
After installing libcurl you should restart the web server with following command,
sudo /etc/init.d/apache2 restart