Search This Blog

Monday, April 16, 2012

How to restrict website using firestarter

Qs. Can we restrict website access using firestarter. The requirement is
as follows:
We are using a internet shared system using firestarter. This system
is kept for public use in a museum. The administrator over there wants
only access to 2-3 websites which is related to the museum rest site
should be accessible. Can we do it through firestarter?

Ans: To restrict all websites except few, provide the websites in "Outbound traffic policy" -> Restrivticve by default" -> "Allow connectiosn to host"
The websites listed under this site only will be allowed now and all other websites are restricted

Thursday, April 12, 2012

Backing Up and Restoring A MySQL Database

This tutorial explains the how to backup and restore the MySQL Database. Databases are used to store large amount of precious data and it becomes very important to Backup your data. In case case of some hardware or software failures  backup data can be used to restore the Database.

Backing Up MySQL Database

MySQL database backup can be accomplished in two ways:

a) Copying the raw mysql database files &
b) Exporting tables to text files

Copying the MySQL database files

MySQL uses the same table format on different platforms, so it's possible to copy MySQL table and index files from one platform and use them on another without any difficulties (assuming, of course, that you're using the same version of MySQL on both platforms).

Exporting tables to text files

The MySQLDump is handy utility that can be used to quickly backup the MySQL Database to the text files. To use the MySQLDump utility it is required to logon to the System running the MySQL Databse. You can use Telnet to remotely logon to the system if you don't have the physical access to the machine.

The syntax for the command is as follows.

mysqldump -u [Username] -p [password] [databasename] > [backupfile.sql]
[username] - this is your database username
[password]- this is the password for your database
[databasename] - the name of your database
[backupfile.sql] - the filename for your database backup

Let's discuss the example of backing up MySQL Database named "accounts" into text file accounts.sql. Here are the scenarios of taking the backup assuming that both user name and password of the database is "admin".

a) Taking the full backup of all the tables including the data.
Use the following command to accomplish this:
mysqldump -u admin -p admin accounts > accounts.sql

b) Taking the backup of table structures only.
Use the following command to accomplish this:
mysqldump -u admin -p admin --no-data accounts > accounts.sql

c) Taking the backup data only.
Use the following command to accomplish this:
mysqldump -u admin -p admin --no-create-info accounts > accounts.sql

Restoring MySQL Database

Restoring the MySQL is very easy job. You can use the following to command to restore the accounts database from accounts.sql backup file.

mysql - u admin -p admin accounts < accounts.sql

In this tutorial you learned how to take the backup of your MySQL Database and restore the same in the event of some database crash or on some other machine.


Source: http://www.roseindia.net/mysql/mysql_backup_restore.shtml

How to get mysql Database dump and restore database


1.You can use following commands for taking mysql dump in .sql format
go to /var/lib/mysql

search for the database whose dump you want.

ls -l | grep database_name

mysqldump database_name > database.sql

2. If the mysql dumpis available and you want to restore that you need to use following command for that

cd /var/lib/mysql

check the database name where you want to restore the mysqldump
ls -l | grep database_name

mysql database_name < database.sql


Tuesday, April 10, 2012

Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)


First: Make sure that the owner of /var/lib/mysql and its files and subdirectories is mysql user of mysql group

to do that run the following command:

chown mysql.mysql -R /var/lib/mysql/*

Second: change write permissions to rwxr-xr-x (755) for mysql directory, and all its files and subdirectories, by running the following command:

chmod 755 -R /var/lib/mysql/*

now start mysql service by running the following command (Red Hat and may fedora):

service mysql start


the error message should disappear and should output:
Starting MySQL. [ OK ]

Source: http://forums.mysql.com/read.php?11,27769,213014

Sunday, April 1, 2012

how to checkout file/folder from svn


1. In svn is not installed, install it by following command

     sudo apt-get install subversion
2. Now to download file/folder user following command
   
 $svn checkout url_path_of_file/folder

eg to download speech_tools from 
svn://svn.berlios.de/festlang/trunk/speech_tools  use following command 

$svn checkout
svn://svn.berlios.de/festlang/trunk/speech_tools