Open Source Technical Information: Rad Hat
Showing posts with label Rad Hat. Show all posts
Showing posts with label Rad Hat. Show all posts

Tuesday, 6 March 2012

How to Backup and Restore MySQL Database on Fedora16, Centos and Redhat

,

The mysqldump client is a backup program originally written by Igor Romanenko. It can be used to dump a database or a collection of databases for backup or transfer to another SQL server (not necessarily a MySQL server). The dump typically contains SQL statements to create the table, populate it, or both. However, mysqldump can also be used to generate files in CSV, other delimited text, or XML format.

 Mysql-server info
Source RPM  : mysql-5.5.20-1.fc16.src.rpm
 Build Date  : Fri 27 Jan 2012 09:17:21 AM CET
 Build Host  : x86-04.phx2.fedoraproject.org
 Relocations : (not relocatable)
 Packager    : Fedora Project
 Vendor      : Fedora Project
 URL         : http://www.mysql.com
 Summary     : The MySQL server and related files

1- Start  mysql  server

[pirat9@Fedora16 ~]$ sudo service mysqld   start
Connect  to the  Server   with
[pirat9@Fedora16 ~]$ mysql -u root -p
Output
 Enter password:
 Welcome to the MySQL monitor.  Commands end with ; or \g.
 Your MySQL connection id is 2
 Server version: 5.5.20 MySQL Community Server (GPL)
Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
 affiliates. Other names may be trademarks of their respective
 owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>

2- Create new database

In my case i created a new database called unixmen
mysql> create database unixmen;
Query OK, 1 row affected (0.00 sec)
-Show databases with
mysql> show databases;
 +--------------------+
 | Database           |
 +--------------------+
 | information_schema |
 | mysql              |
 | performance_schema |
 | test               |
 | test1              |
 | unixmen            |
 +--------------------+
 6 rows in set (0.00 sec)
mysql>

3- Backup  mysql database

Backup MySQL database to <databasebackupfiles>.sql
<databasename> = Target existing database name
<databasebackupfiles> = Preferred backed up file name
# mysqldump -u root -p <databasename> > <databasebackupfiles>.sql
 Enter password: <Type your mysql password and press enter
i will back up the database named <unixmen> to mylbackup file. This will taking backed up all the tables including the data :
# mysqldump -u root -p unixmen > backup.sql
 Enter password:
 View the content on mysqlbackup.sql
more mysqlbackup.sql

4- Restore MySQL database

To restore the backed up database named “mbackup.sql” to new database named “new” as below :
# mysql -u root -p <mysqlpassword> <databasename> < <databasebackupfiles>.sql
<mysqlpassword> = MySQL password
<databasename> = Database name that will be restore
<databasebackupfiles> = Backed up database file, normally .sql file
Create the new database mysqlnew :
mysql> CREATE DATABASE mysqlnew;
 Query OK, 1 row affected (0.01 sec)
As example, i will restore the mysqlbackup.sql backed up file to database named “new” :
# mysql -u root -p password new < mysqlbackup.sql
or
mysql -u root -p new < mysqlbackup.sql

If you found any thing wrong then pleas Let me know ...Write Your tips and suggestion in comment ... Thank you...

Why GIMP wins over Photoshop

,
GIMP (GNU Image Manipulation Program) is an iconic example of successful free software for image management in the age of Digital Photography. Thanks largely to some advanced software such as GIMP and some proprietary photo imaging software such as Photoshop – creating and editing photos, artwork – is now not just for professionals and Film Studios but for personal use as well.
Though there is a sizeable market for Photoshop, at the heart of digital photos industry are experts who swear by the scope and wide-ranging flexibility GIMP offers them. Be it filters that allow them to start artwork from scratch, GIMP to many users, is more than an ‘image manipulation’ tool. Because, if the need arises all it takes are personalized scripts that can render the desired effect professionals are aiming for- Versatility remains GIMP’s core feature.

Add to it high-performance features such as better gradient tool, an expert lasso tool and definitely a better ink tool; Drag handles for both rectangle /ellipse select tools, and you have all the right function-features that are not so comfortable to use on Photoshop. GIMP definitely makes for quicker and more intuitive use.
While Photoshop does offer a ‘well-packaged’ software for professional photographers as against the ‘upgrades and support’ by GIMP developer community, GIMP becomes a more comfortable software to use as it overcomes, Photoshop’s sluggishness on even slightly older software. GIMP remains- fast and easy to install (is much smaller than Photoshop).

You can forget about using curves tools in Photoshop, over an open window. For one, it will not allow you, and besides, it is embedded in not in the Colors menu as in GIMP, but in the image-adjustments menu!
However, this is not to say Photoshop is not good as a technical tool. It is, but at the price tag and bundled features it offers, GIMP wins hands down because of the free-to-use licensing it adopts.
A great deterrent in using Photoshop is the very strict licensing stipulations; it becomes expensive and limits the number of users.  Free-to-use GIMP does not squabble about the number of people using its software and instead encourages greater user adoption, propagating FOSS philosophy.

Probably, where GIMP, really makes the difference is in the ‘right click’ on an image to get to a menu, which incidentally are not more than a layer deep. In Photoshop the multi-layered drop down menu, which are not accessible on open windows, do not just limit the user experience, but are actually frustrating in the long run.
Photoshop is definitely, it has to accepted, smoother but GIMP does make up for the jerks in paintbrush cloning with the undistracted work flow it makes possible- cloning, scaling more quicker, easier and intuitive.
Where GIMP truly wins over Photoshop would be its portability. It can go on CD’s, memory sticks and sometimes the Xbox 360 (Microsoft) as well. GIMP UI small real-estate, CMYK and 3D-features does give it the scope of a Photoshop package but with the expensive price-tag.


If you found any thing wrong then pleas Let me know ...Write Your tips and suggestion in comment ... Thank you...

How to- Disable SELinux on Fedora/Centos/RHEL/SL

,

 Security-Enhanced Linux (SELinux) is a Linux feature that provides a mechanism for supporting access control security policies, through the use of Linux Security Modules (LSM) in the Linux kernel. It is a set of Kernel modifications and user-space tools that can be added to various Linux distributions. Its architecture strives to separate enforcement of security decisions from the security policy itself and streamlines the volume of software charged with security policy enforcement .
In this post will show you  : How  to  disable  Selinux without  having to reboot ?
  • First   check  the  Selinux  status  with
#getenforce
Output Enforcing 
  • Disbale the  enforcing  with
#setenforce 0
This  the  the  temporally   disabling of the  selinux, but how  to disable  is  permanently ?
  • What you need to do is to  change “SELINUX=enforcing” to “SELINUX=disabled” in /etc/sysconfig/selinux
# This file controls the state of SELinux on the system. # SELINUX= can take one of these three values: # enforcing - SELinux security policy is enforced. # permissive - SELinux prints warnings instead of enforcing. # disabled - No SELinux policy is loaded.
SELINUX=enforcing # SELINUXTYPE= can take one of these two values: # targeted - Targeted processes are protected, # mls - Multi Level Security protection. SELINUXTYPE=targeted
TO
# This file controls the state of SELinux on the system. # SELINUX= can take one of these three values: # enforcing - SELinux security policy is enforced. # permissive - SELinux prints warnings instead of enforcing. # disabled - No SELinux policy is loaded.
SELINUX=disabled # SELINUXTYPE= can take one of these two values: # targeted - Targeted processes are protected, # mls - Multi Level Security protection. SELINUXTYPE=targeted
  • Check the  status  again
#getenforce
 Output 
Disabled

If you found any thing wrong then pleas Let me know ...Write Your tips and suggestion in comment ... Thank you...

The growth of LibreOffice over Microsoft Office

,
LibreOffice after one and half-years as an open source office productivity suite has grown from being just a fork of OpenOffice.org (OOo) and emerged as an independent tool for those who prefer the openness and scope of work copyleft offers over claustrophobic copyright licenses and proprietary software. Following the game-changing split and backing by The Document Foundation (TDF) LibreOffice has over 25,000 code commits and 330 contributors. Secondly, it has over 15million Linux OS users, a further 10 million users are split between Microsoft (90-percent) and Mac OS X (5- percent). 

Even as these numbers speak of the domination of LibreOffice over the Office tools segment, there is room for thought, that it will soon break critical mass and move and become the most used office suite as Microsoft Office looks traction because of two major aspects – the phenomenal prices at which each version of the suite is sold and the claustrophobic licensing factor. In contrast LibreOffice, encourages and engages in the opposite, offering any number of downloads and use for almost the same set of tools – for spreadsheets, database creation, Math or desktop publishing. Despite paying due credit to Microsoft’s more mature platform and dedicated development input, the increase in contribution and excellent open governance model is fast moving LibreOffice to streamline its suite and offer a great package.

Additionally, there are umpteen limitations Microsoft Office struggles with – Document Sharing, technical support which is handled by trained office desk personnel as against developers who offer hands-on solutions for LibreOffice suite users. Another very vital and potentially dangerous issue is that of security. Every time Microsoft Office has a security-hole, and there have been many, users are typically unaware of the lurking dearth as they are not informed of such issues. Microsoft usually tries to patch them with standard security updates that they offer.
Interface on LibreOffice is its mainstay; frugal, minimalistic but highly functional and easily accessible. Microsoft’s ribbon interface, though now spread over all its products remains an acquired method.
Microsoft Office is limited to running on Windows or Mac. LibreOffice’s advantage is that not only will it run on other platforms, Windows, Linux or Mac, it actually runs on legacy hardware as well, which is simply not possible with Microsoft Office.

Perhaps, where LibreOffice truly delivers is its agility. With great implementation- in terms of algorithm, architecture and language, minimal layers and a integrated minimal program that LibreOffice has truly delivers on the speed over Microsoft’s Office.

LibreOffice 3.5 includes template creator for Writer, tweaked better performing Calc and elliptical arcs; Additionally, LibreOffice is to be available for tablets and a browser launched online LibreOffice suite. And for commercial users, LibreOffice is to offer integrative features for Microsoft SharePoint.
A recent development in this direction is Intel’s open move to encourage LibreOffice code improvement and offers download via Intel website. SUSE, in fact developed the Windows version of LibreOffice. Intel in fact, is considering adding LibreOffice to its AppUp Center providing users a great alternative to use vendor neutral productivity suite.

If you found any thing wrong then pleas Let me know ...Write Your tips and suggestion in comment ... Thank you...

Tuesday, 14 February 2012

How to disable server signature using .htaccess or by editing Apache?

,
Procedure for  disableing server signature using .htaccess or by editing Apache


Question : How to disable server signature using .htaccess or by editing apache config file?

Answer:
Attackers can use server signature to their advantage when performing an attack, this is the reason why  it is always advised to disable the server signature.
There are 2 methods to do it
.
I tried to make this quick tip more detailed for Linux newbies
1- Using .htaccess:
Open your public_html folder (Browse public_html using ftp to display all hiden files)
Now to disable the server’s signature used to identify the server, use the following code in your .htaccess file:

 # Disable server signature
 ServerSignature Off

This will hide the Apache version normally seen at the bottom of your 404 error pages, directory listing..etc.

2- Disable signature by editing httpd.conf
There are two directives that you need to add, or edit in your httpd.conf / apache2.conf file:

For Ubuntu and LinuxMint edit apache conf using the following command (for Centos/Fedora edit httpd.conf):
 
cd /etc/apache2/
vi apache2.conf
and add these 2 lines at the bottom of the file:
ServerSignature Off
ServerTokens Prod
The ServerSignature appears on the bottom of pages generated by apache such as 404 pages, directory listings, etc.
The ServerTokens directive is used to determine what Apache will put in the Server HTTP response header. By setting it to Prod it sets the HTTP response header as follows:

Server: Apache
When is done, restart apache:
/etc/init.d/httpd restart    CentOS/Fedora/RHEL sudo /etc/init.d/apache2 restart    Ubuntu/Debian/LinuxMint

Here are the results in my linuxmint:
Before:
 















After:




If you found any thing wrong then pleas Let me know ...Write Your tips and suggestion in comment ... Thank you...

Deal of the Day

Advertisement here

Advertisement here