Ubuntu: How to erase CD-RW/DVD-RW from Command-line

Here’s an easy way to erase CD-RW and DVD-RW from command-line in Ubuntu:

you only need to install ‘wodim’ package:
sudo apt-get install wodim
Then run:
wodim -scanbus
To search for the cdrw device in case if you don’t already know.

To erase the entire disk, run:
wodim dev=/dev/cdrom blank=fast

That’s all!

How to Import export MySQL database from command line

This tip would be useful for those who are either making backup of their remote mysql database or moving their web hosting to their provider.

Here’s how to export mysql DB to SQL file using command-line utility :
mysqldump –user=username –password=1234 –databases your_database –opt –quote-names –complete-insert > example.sql

Here’s how to import the SQL back into mysql database :
mysql –user=username –password=1234 –databases your_database –host=mysql_server host

Don’t forget to add your ip address to the list of allowable host on the remote MySQL server!