venerdì 29 marzo 2013


My new website:


COS-MET snc was born in Vicenza as a company manufacturing and marketing of plastering machines.

The constant presence in the market by our company, allowed to mature and increase the technical skills that distinguish today. During more than ten years of activity, the company has dealt with many problems typical of the construction industry, always managing to provide high quality products and services geared towards the specific needs of the customer, adapting their methods with time and its instruments development according to the evolution of technology.

Using national and international partners, COS-MET snc provides customers a quality solution at low cost.

Focusing on the quality and efficiency of the machines manufactured and marketed, COS-MET snc is gradually expanding its market both nationally and internationally. Currently we are strongly placed in the European, South American and North American and Asian.


My new website:

Fire and surroundings is the store where you can find the best offers for the purchase of a stove or a fireplace for your home. There are also soapstone stoves, furnaces, fireplaces, pellet, fantastic barbecue (wood, gas or electric) and wood-fired ovens.

We also offer a chimney sweep for areas of Vicenza, Verona and Padua.

giovedì 28 marzo 2013

Sendmail not found in Ubuntu. Send mail is slow

Unable to send mail through Lamp server using PHP. Most likely cause is that you do not have sendmail installed.

In the apache error log you might have the following error

sh: /usr/sbin/sendmail: not found
You need to Install sendmail. Enter the following command in the terminal:

sudo apt-get install sendmail
To restart, stop, start sendmail

/etd/init.d/sendmail restart
/etd/init.d/sendmail stop
/etd/init.d/sendmail start

How to unmount after using mount --bind option

I have mounted a hard disk /dev/sda1 on /media/backup. Further, I have issued the following command:

mkdir /home/users/Desktop/backup
sudo mount --bind /media/backup /home/users/Desktop/backup
This allows me to access "/media/backup" from "/home/users/Desktop/backup" as well. However, now I would like to remove the "--bind" from "/home/users/Desktop/backup".
umount /home/users/Desktop/backup will remove the bind between the 2 folders.

You can then check /home/users/Desktop/backup to make sure that the bind is gone and remove the folder if you wish.

Install vsftpd on Ubuntu

To install a ftp server to ubuntu. I here choose vsftpd.
Here is the step I have made.
$ sudo apt-get install vsftpd

Then, make some necessary modification the vsftpd config file at /etc/vsftpd.conf
Add new user to the server.

New folder will be created at /home/. But if you want to let user access to other folder location outside. Just create a new symbolic link.
Something like below
$sudo mkdir /home//domains
$sudo mount --bind /var/www/ /home//domains

and also modify /etc/fstab if you want to make it permanent every times after reboot.
/var/www/dev  /home/ftp_user/www_dev    none    bind    0       0

After going so many things. Finally give vsftpd a restart
$sudo restart vsftpd

Note: To run vsftpd, you need to open Port 20 and 21 for client to make the active port connections.

sabato 23 marzo 2013

Installing cURL for PHP

As of Ubuntu 12.04 after installing the LAMP server from tasksel I had to do:

sudo apt-get install curl libcurl3 libcurl3-dev php5-curl
sudo service apache2 restart

Setting up FTP on Amazon Cloud Server

I'm assuming that you already have an EC2 instance created and have associated an Elastic IP Address to it.

Step #1: Install vsftpd

SSH to your EC2 server. Type:
> sudo yum install vsftpd
This should install vsftpd.

Step #2: Open up the FTP ports on your EC2 instance

Next, you'll need to open up the FTP ports on your EC2 server. Log in to the AWS EC2 Management Console and select Security Groups from the navigation tree on the left. Select the security group assigned to your EC2 instance. Select the Inbound tab and add port range 20-21:

enter image description here
Also add port range 1024-1048:
enter image description here

Step #3: Make updates to the vsftpd.conf file

Edit your vsftpd conf file by typing:

> sudo vi /etc/vsftpd/vsftpd.conf
Disable anonymous FTP by changing this line:

Then add the following lines to the bottom of the vsftpd.conf file:

pasv_address= < Public IP of your instance > 
Your vsftpd.conf file should look something like the following - except make sure to replace the pasv_address with your public facing IP address:

enter image description here

Step #4: Restart vsftpd

Restart vsftpd by typing:

> sudo /etc/init.d/vsftpd restart
You should see a message that looks like:

enter image description here

Step #5: Create an FTP user

If you take a peek at /etc/vsftpd/user_list, you'll see the following:
# vsftpd userlist
# If userlist_deny=NO, only allow users in this file
# If userlist_deny=YES (default), never allow users in this file, and
# do not even prompt for a password.
# Note that the default vsftpd pam config also checks /etc/vsftpd/ftpusers
# for users that are denied. 
This is basically saying, "Don't allow these users FTP access." vsftpd will allow FTP access to any user not on this list.
So, in order to create a new FTP account, you may need to create a new user on your server. (Or, if you already have a user account that's not listed in /etc/vsftpd/user_list, you can skip to the next step.)
Creating a new user on an EC2 instance is pretty simple. For example, to create the user 'bret', type:

> sudo adduser bret
> sudo passwd bret
Here's what it will look like:

enter image description here

Step #6: Restricting users to their home directories

At this point, your FTP users are not restricted to their home directories. That's not very secure, but we can fix it pretty easily.
Edit your vsftpd conf file again by typing:

> sudo vi /etc/vsftpd/vsftpd.conf
Un-comment out the line:

It should look like this once you're done:

enter image description here

Restart the vsftpd server again like so:

> sudo /etc/init.d/vsftpd restart
All done!

Appendix A: Surviving a reboot

vsftpd doesn't automatically start when your server boots. If you're like me, that means that after rebooting your EC2 instance, you'll feel a moment of terror when FTP seems to be broken - but in reality, it's just not running!. Here's a handy way to fix that:

> sudo chkconfig --level 345 vsftpd on
Alternatively, if you are using redhat, another way to manage your services is by using this nifty graphic user interface to control which services should automatically start:

>  sudo ntsysv
enter image description here

Now vsftpd will automatically start up when your server boots up.