Monday, August 6, 2012

Read & Remove EXIF Data From the Command Line

Most digital cameras will insert metadata into images. This metadata is stored using the exchangeable image file format (EXIF) and can contain camera specifications, exposure settings, thumbnails, GPS coordinates and more. This article outlines some Linux command line tools you can use for reading, editing and removing EXIF metadata from images.
Reading and Editing EXIF Metadata with ExifTool
ExifTool is powerful a Perl program that can be used to read and edit EXIF metadata in images. To install ExifTool as /usr/bin/exiftool on Fedora, install the perl-Image-ExifTool package:
su -c 'yum install perl-Image-ExifTool'
Alternatively, you can use CPAN to install ExifTool in /usr/local/bin/exiftool.
su -c "perl -MCPAN -e'install Image::ExifTool'"
After installation, you will have the exiftool command available in /usr/bin or /usr/local/bin. To view the EXIF metadata in an image, just past the image as an argument to exiftool.
exiftool dsc_0790.jpg
Here is a snippet of the output from the above command:
ExifTool Version Number : 7.60
File Name : dsc_0790.jpg
Directory : .
File Size : 4.4 MB
File Modification Date/Time : 2008:07:16 09:45:20-07:00
File Type : JPEG
MIME Type : image/jpeg
Exif Byte Order : Big-endian (Motorola, MM)
Make : NIKON CORPORATION
Camera Model Name : NIKON D200
Orientation : Horizontal (normal)
X Resolution : 300
Y Resolution : 300
Resolution Unit : inches
Software : Bibble 4.10a
Modify Date : 2007:06:23 22:00:14
Exposure Time : 1/40
F Number : 2.0
Exposure Program : Aperture-priority AE
ISO : 100
.
.
.

ExifTool has many options for editing and removing EXIF metadata in images. To see the available options, use the --help switch or read the ExifTool documentation.
exiftool --help
Reading EXIF Metadata with Jhead
Jhead is a command line tool for displaying EXIF data embedded in JPEG images. On Fedora, use Yum to install Jhead:
su -c 'yum install jhead'
Now, use /usr/bin/jhead to read EXIF metadata:
jhead dsc_0790.jpg
Here is an example of the output produced by the jhead command:
File name : dsc_0790.jpg
File size : 4654488 bytes
File date : 2008:07:16 09:45:20
Camera make : NIKON CORPORATION
Camera model : NIKON D200
Date/Time : 2007:06:23 22:00:14
Resolution : 3880 x 2608
Flash used : No
Focal length : 50.0mm (35mm equivalent: 75mm)
Exposure time: 0.025 s (1/40)
Aperture : f/2.0
ISO equiv. : 100
Exposure bias: 1.00
Whitebalance : Auto
Exposure : aperture priority (semi-auto)
GPS Latitude : ? ?
GPS Longitude: ? ?
======= IPTC data: =======
(C)Flag : 0
DateCreated : 20070623
Time Created : 220014
Record vers. : 4

Removing EXIF Metadata with ImageMagick
If you need to strip the EXIF metadata from images, use ImageMagick's mogrify command. To install ImageMagick on Fedora, use Yum:
su -c 'yum install ImageMagick'
After ImageMagick is installed, you will have /usr/bin/mogrify available. The mogrify command can be used to strip Exif data from images.
mogrify -strip imagename.jpg
If you need to process a large number of files, use find and xargs:
find ./folder_of_images -name '*.jpg' | xargs mogrify -strip


http://hacktux.com/read/remove/exif

Monday, July 16, 2012

Important Tweaks/Things to do After install of Ubuntu 12.04 Precise Pangolin

http://www.noobslab.com/2012/04/important-things-to-do-after-install_26.html

http://www.webupd8.org/2012/04/things-to-tweak-after-installing-ubuntu.html

http://www.techdrivein.com/2012/06/25-things-i-did-after-installing-ubuntu.html

http://www.omgubuntu.co.uk/2012/04/10-things-to-do-after-installing-ubuntu-12-04

http://howtoubuntu.org/things-to-do-after-installing-ubuntu-12-04-precise-pangolin/


Intel GM45 driver installation

https://launchpad.net/~xorg-edgers/+archive/ppa

http://askubuntu.com/questions/85318/how-can-i-get-my-intel-integrated-graphics-to-be-recognized-in-system-info

http://askubuntu.com/questions/129227/how-do-i-install-intel-hd-graphics-driver-on-ubuntu-12-04

http://intellinuxgraphics.org/index.html


Note:

Downgrade Mesa libraries,

sudo apt-get install libgl1-mesa-dri=8.0.2-0ubuntu3 mesa-common-dev=8.0.2-0ubuntu3
 
Link


CompizConfig

Delete .Xauthority in my home


rm -rf .compiz-1
 
rm -rf ~/.config/compiz-1/compizconfig/*
 
sudo apt-get purge compizconfig-settings-manager

sudo apt-get install compizconfig-settings-manager compiz-fusion-plugins-extra
 
unity --reset
 
Link  
 
 
 
VAAPI driver for Intel G45 & HD Graphics family 
 
 
https://launchpad.net/ubuntu/+source/intel-vaapi-driver/

Thursday, July 5, 2012

How to Install New Kernel on Ubuntu

How to install Linux Kernel 3.4 in Ubuntu 12.04. WARNING This isn't worth doing unless you're having problems with the old kernel or you're adding new hardware which is unsupported in old Kernel 3.2, such as nVidia Kepler (600 series) or AMD HD 7000 series Graphics cards.

Improvements in Kernel 3.4:
Reduced Power Usage
Speed improvements for BTRFS file systems
More wireless network drivers from Ralink and Broadcom added
Support for nVidia Kepler chipsets (600 series)
Support for AMD Southern Islands GPUs (HD 7000 series)
Support for AMD Trinity Processors

Ubuntu Kernel Website: http://kernel.ubuntu.com/~kernel-ppa/mainline/
Look for the latest Kernel
Download linux-headers-3.4.x-xxx-all.deb, plus the headers and image for your system architecture.
e.g. linux-headers-3.4.x-xxx-i386.deb, and linux-image-3.4.x-xxx-generic-i386.deb for 32bit systems.

Open Terminal
cd ~/Downloads
sudo dpkg -i linux*.deb

Reboot
Check the new kernel is running with either System Monitor or "uname -r"

If you have any problems with the new kernel reboot and select "Previous Versions" on the Grub Menu (hold down Shift key if Grub doesn't show by default)

Remove auto updating old Kernel:
In Synaptic remove: linux-generic, linux-headers-generic, linux-image-generic
You can also remove any older kernels to free up some harddrive space.

http://www.youtube.com/watch?v=traegZveTKo 

http://askubuntu.com/questions/142192/can-i-install-linux-kernel-3-4-in-ubuntu-and-kubuntu-12-04

Friday, June 1, 2012

How to Back Up and Restore a MySQL Database

If you're storing anything in MySQL databases that you do not want to lose, it is very important to make regular backups of your data to protect it from loss. This tutorial will show you two easy ways to backup and restore the data in your MySQL database. You can also use this process to move your data to a new web server.
Back up From the Command Line (using mysqldump)
If you have shell or telnet access to your web server, you can backup your MySQL data by using the mysqldump command. This command connects to the MySQL server and creates an SQL dump file. The dump file contains the SQL statements necessary to re-create the database. Here is the proper syntax:
$ mysqldump --opt -u [uname] -p[pass] [dbname] > [backupfile.sql]
  • [uname] Your database username
  • [pass] The password for your database (note there is no space between -p and the password)
  • [dbname] The name of your database
  • [backupfile.sql] The filename for your database backup
  • [--opt] The mysqldump option
For example, to backup a database named 'Tutorials' with the username 'root' and with no password to a file tut_backup.sql, you should accomplish this command:
$ mysqldump -u root -p Tutorials > tut_backup.sql

This command will backup the 'Tutorials' database into a file called tut_backup.sql which will contain all the SQL statements needed to re-create the database.
With mysqldump command you can specify certain tables of your database you want to backup. For example, to back up only php_tutorials and asp_tutorials tables from the 'Tutorials' database accomplish the command below. Each table name has to be separated by space.
$ mysqldump -u root -p Tutorials php_tutorials asp_tutorials > tut_backup.sql

Sometimes it is necessary to back up more that one database at once. In this case you can use the --database option followed by the list of databases you would like to backup. Each database name has to be separated by space.
$ mysqldump -u root -p --databases Tutorials Articles Comments > content_backup.sql

If you want to back up all the databases in the server at one time you should use the --all-databases option. It tells MySQL to dump all the databases it has in storage.
$ mysqldump -u root -p --all-databases > alldb_backup.sql

The mysqldump command has also some other useful options:
--add-drop-table: Tells MySQL to add a DROP TABLE statement before each CREATE TABLE in the dump.
--no-data: Dumps only the database structure, not the contents.
--add-locks: Adds the LOCK TABLES and UNLOCK TABLES statements you can see in the dump file.
The mysqldump command has advantages and disadvantages. The advantages of using mysqldump are that it is simple to use and it takes care of table locking issues for you. The disadvantage is that the command locks tables. If the size of your tables is very big mysqldump can lock out users for a long period of time.
Back up your MySQL Database with Compress
If your mysql database is very big, you might want to compress the output of mysqldump. Just use the mysql backup command below and pipe the output to gzip, then you will get
the output as gzip file.

$ mysqldump -u [uname] -p[pass] [dbname] | gzip -9 > [backupfile.sql.gz]

If you want to extract the .gz file, use the command below:

$ gunzip [backupfile.sql.gz]

Restoring your MySQL Database
Above we backup the Tutorials database into tut_backup.sql file. To re-create the Tutorials database you should follow two steps:
  • Create an appropriately named database on the target machine
  • Load the file using the mysql command:
$ mysql -u [uname] -p[pass] [db_to_restore] < [backupfile.sql]
Have a look how you can restore your tut_backup.sql file to the Tutorials database.
$ mysql -u root -p Tutorials < tut_backup.sql
To restore compressed backup files you can do the following:
gunzip < [backupfile.sql.gz] | mysql -u [uname] -p[pass] [dbname]
If you need to restore a database that already exists, you'll need to use mysqlimport command. The syntax for mysqlimport is as follows:

mysqlimport -u [uname] -p[pass] [dbname] [backupfile.sql]

Backing Up and Restoring using PHPMyAdmin
It is assumed that you have phpMyAdmin installed since a lot of web service providers use it. To backup your MySQL database using PHPMyAdmin just follow a couple of steps:
  • Open phpMyAdmin.
  • Select your database by clicking the database name in the list on the left of the screen.
  • Click the Export link. This should bring up a new screen that says View dump of database (or something similar).
  • In the Export area, click the Select All link to choose all of the tables in your database.
  • In the SQL options area, click the right options.
  • Click on the Save as file option and the corresponding compression option and then click the 'Go' button. A dialog box should appear prompting you to save the file locally.
Restoring your database is easy as well as backing it up. Make the following:
  • Open phpMyAdmin.
  • Create an appropriately named database and select it by clicking the database name in the list on the left of the screen. If you would like to rewrite the backup over an existing database then click on the database name, select all the check boxes next to the table names and select Drop to delete all existing tables in the database.
  • Click the SQL link. This should bring up a new screen where you can either type in SQL commands, or upload your SQL file.
  • Use the browse button to find the database file.
  • Click Go button. This will upload the backup, execute the SQL commands and re-create your database.

http://webcheatsheet.com/sql/mysql_backup_restore.php



http://www.thegeekstuff.com/2008/09/backup-and-restore-mysql-database-using-mysqldump/


http://www.supportfacility.com/blog/mysql/how-to-repair-mysql-table-from-ssh/

http://viralpatel.net/blogs/mysql-database-backup-mysql-mysqldump-backup-command/

Thursday, May 31, 2012