How to backup MySQL Database via SSH

First you log in using your terminal application by typing the flowing SSH command:

ssh yourusername@hostname-or-ipaddress

After that, you will be prompted to enter your password. As you enter your password, the text will be hidden. Next we should switch to the “root” user. You can do so by typing the following in your terminal window:

su – root

You will have to enter a password once more. Now navagate to where you would like to store your MySQL database file. For an example of changing the directory to the “public_html” direcotry, type this:

cd /var/www/html_public

Now you can back up your db here using the following command. This command will backup all of your databases. I also chose to compress them after the pipe “|” as a gzip file. Type the following but be sure to change the user name and password to your info:

mysqldump -u yourusername -p yourpassword –all-databases | gzip >databasebackup.sql.gz

You can also target single database using the following:

mysqldump -u yourUserName -p yourDBName | gzip >databasebackup.sql.gz

Tagged : / / / /

CSS Center Web Page Using Styles Sheets

How to center a fixed box container using CSS? The sample below dose a few things. First it centers all body content  using the body tag text-align center attribute. This is done to fix a bug in IE and other browsers that do not support margin auto styles. Next thing it will do is take your div with an id of “container” and auto center the margin with a width of 900 pixels. You can change the width to match your content as needed. Lastly it will reset the text to align left. You can align the text as you see fit but here we just wanted to make sure it set back to the default Firefox & Safari text alignment.

Place the following code in your styles tag.

body
{
text-align: center;
}

div#container
{
margin-left: auto;
margin-right: auto;
width: 900px;
text-align: left;
}

Tagged : / / / /

How to pass fashvars using AS3 and Swfobject

Swfobject has become the most popular choice for embedding flash content on the web. They’ve made it extremely easy to pass variable (flashVars) in to flash using two type of syntax. Take a look at the example below:

<script type=”text/javascript”>

var flashvars = {};

swfobject.embedSWF(“myContent.swf”, “myContent”, “300”, “120”, “9.0.0”,”expressInstall.swf”, flashvars);

</script>

Flash on iPhone coming soon via Adobe CS5

The new Adobe CS5 Flash will now give flash developer the ability to publish their flash content as an iPhone application. Flash alread allows developers to publish as SWFs, Projector files, and as QuickTime movies. This does not mean that iPhone users will be able to view flash content through the iPhone’s web browser. That’s Apples restriction. What Adobe has done is allow developers to repackage existing flash content as an iPhone application.

iPhoneAppsFlash

This will increase the number of apps available on iTunes store. This will also give agencies and software companies access to a market place that may have shied away from because of a lack of technical resources or fear of outsourcing.

Flash developers will have to follow the same requirement for deployment as other iPhone app developers. They will have to join Apples iPhone Developers Program and follow their guidelines. One of the requirements is to obtain a certificate from Apple in order to test and distribute your app through the iTunes store.

You can find books on Amizon already geared for Flash iPhone development. There is one by The Essential Guide to iPhone Application Development for Flash Users (Paperback).

If you can’t wait for Adobe and want to dive right in to iPhone application development, here are a few books to help you start building apps.

iPhone Advanced Projects (Paperback)
iPhone Application Development For Dummies

For more info on Apples requirements, you can view them here: http://developer.apple.com/iphon

Tagged : / / / / /