Thursday, May 30, 2013

Vagrant: * Unknown configuration section 'berkshelf'.

Berkshalf vagrant variant has been renamed by its maintainer at

Users using the old command will face the following error when
executing "vagrant up":

* Unknown configuration section 'berkshelf'.
sudo vagrant plugin install vagrant-berkshelf
vagrant up

Friday, May 10, 2013

File Share using Apache

File Share using Apache

Apache is pretty useful for sharing files on network particularly on LAN. Here is how to map an external folder to an url on your apache server. Lets assume your home directory is ABC and the path of the folder that you want to share is /var/log/weblogs. And you want to access contents of this folder at url /weblogs.

Change directory to /etc/apache2/sites-enabled. And create file named downloads with the following contents.

Alias "/weblogs" "/var/log/weblogs/"

Directory "/var/log/weblogs/"
     AllowOverride None
     Options Indexes
     Order allow,deny
     Allow from all


Save the file and close it. Now restart the apache by issuing following command.
sudo apache2ctl restart
Now test everything is working as expected by going to following url in your browser.

Wednesday, May 1, 2013

Reset forgotten mysql password

This works for ubuntu/Debain only & not for red hat/Centos

# /etc/init.d/mysql stop
# mysqld_safe --skip-grant-tables &
$ mysql -u root

mysql> use mysql;
mysql> update user set password=PASSWORD("password") where User='root';
mysql> flush privileges;
mysql> quit

# /etc/init.d/mysql stop
# /etc/init.d/mysql start
$ mysql -u root -p
Take Full backup of Mysql
mysqldump -u root -ppassword --all-databases > /tmp/all-database.sql 
Restore DB
mysql -u root -ppassword < /tmp/all-database.sql