MoonPoint Support Logo

 

Shop Amazon Warehouse Deals - Deep Discounts on Open-box and Used ProductsAmazon Warehouse Deals



Advanced Search
October
Sun Mon Tue Wed Thu Fri Sat
           
         
2011
Months
Oct


Sun, Oct 16, 2011 10:42 pm

Backing Up a MySQL Database

The mysqldump command can be used to backup a MySQL database. The mysqldump command will write its output, which consists of SQL statements that can be used to recreate the database, to standard output by default; you can use > filename to redirect its output to a file. The format of the command to backup one or more databases is mysqldump --databases db1 db2 db3 > outputfile.sql where db1, db2, etc. are the names of the databases you wish to back up and outputfile.sql is the name of the output file to which the dababase will be dumped.. The --databases option causes all names on the command line to be treated as database names. Without this option, mysqldump treats the first name as a database name and those following as table names.
# mysqldump -p --databases partsdb > partsdb-20111016.sql
Enter password:

In the above example, the -p option causes mysql to prompt for the mysql account password with the username assumed to be the same as the login name for the account from which you are running the command. If you wish to specify the username, use --user=user_name or -u user_name.

If you want to back up all databases you can use the command mysqldump --all-databases > dump.sql to back up all databases to which the account has access on the system to a file named dump.sql in this case.

A dump file can be used in several ways:

An example script to dump mysql databases to a gzip file which will be transferred to another server via SSH for safekeeping can be found at How to have a rock solid Linux backup without pro budget. Placing your dump file on another system ensures you don't lose your data should the system on which your databases reside suffer a hard drive crash or some other catastrophe.

References:

  1. 6.4.1. Dumping Data in SQL Format with mysqldump
    MySQL :: Developer Zone
  2. 6.4. Using mysqldump for Backups
    MySQL :: Developer Zone
  3. How to have a rock solid Linux backup without pro budget
    documentation planet

[/software/database/mysql] permanent link

Tue, Oct 04, 2011 5:12 pm

Determining Image Info Under Mac OS X

If you need to determine information about an image file from the command line on a Mac OS X system, you can use the file command.

If you wanted information about all of the .jpg and .png files in a directory, you could use the command file *.png *.jpg

$ file *.png *.jpg
upgrade-windows-grayed.png:         PNG image, 256 x 256, 8-bit/color RGBA, non-interlaced
Vista_Install_Type_Product_Key.jpg: JPEG image data, JFIF standard 1.01

For some image files, the file command will show the image dimensions. The command will reveal the actual image type, even if a file has been given the wrong extension as shown below.

$ cp Vista_Install_Type_Product_Key.jpg test.png
$ file test.png
test.png: JPEG image data, JFIF standard 1.01

Another useful utility for determining the dimensions of an image file is sips. You can use the -g pixelHeight and -g pixelWidth options to obtain the dimensions of an image.

$ sips -g pixelHeight -g pixelWidth example.jpg 
/Users/jsmith/Documents/example.jpg
  pixelHeight: 600
  pixelWidth: 800

References:

  1. Get the dimensions of most images from the command line UNIX
    Date: December 1, 2003
    Mac OS X Hints

[/os/os-x] permanent link

Sat, Oct 01, 2011 8:20 pm

JavaScript and Cascading (CSS) Style Sheets

Cascading Style Sheets are the dominant style sheet language used now for enhancing the formatting and layout of HTML web pages, but there was also a shortlived alternative known as JavaScript Style Sheets (JSS) or (JSSS).

CSS provides adds additional capabilities for controlling the appearance of web pages and provides a mechanism for separating webpage content from web page design to allow a uniform look for webpages throughout a site.

[ More Info ]

[/network/web/html/css] permanent link

Valid HTML 4.01 Transitional

Privacy Policy   Contact

Blosxom logo