Categories
Linux

Useful Linux Commands

Yes, I know.  This is pretty thin.  But as I stumble through my infrequent tasks in Linux, I need to write down the little bits that I need to remember.  Feel free to chip in!

To Delete a Folder With Contents

[sourcecode language="bash"]
rm -rf {folder}
[/sourcecode]

Show full path of current dir in linux command prompt

[sourcecode language="shell"]
PS1="[\u@\h \w]\\$ "
[/sourcecode]

Categories
MySQL

MySQL Error Number 1045

Connection attempts to a MySQL database can return "MySQL Error Number 1045".  This is a frustrating error, but has a reasonably simple solution.

While this solution is presented in the context of databases hosted on dreamhost.com accessed by the MySQL Administrator tool, most of the discussion is likely to apply to anyone encountering the 1045 error.

At the root of the error is the fact that the database server validates not only the user account making the request but also the machine the request is being made from.  To resolve the error it is necessary to tell the server that the machine is authorized.

The first step is determine the fully qualified host name of the machine you are accessing from.  The easiest way to do that is to google "display my host name".  This will locate sites like www.displaymyhostname.com, which will show you the fully qalified host name for your machine.  Copy this, you'll need it in a moment.

In the case of Dreamhost.com databases, log into your dreamhost.com control panel, then select MySQL databases from the menu.

Scroll down to the database you were trying to access, then to the right of the database name click the username being used.

The next page lists the databases that user has access to and the rights held on those databases.

In the "Allowable Hosts" section, add, on a separate line, the fully qualified host name you identified above.

Save the changes, and you're done.  You'll now be able to access your database.

Categories
Web Development

Internal Server area accessing WAMP Server Alias

Problem:

When WAMP Server is installed and a directory alias is configured, the following error is encountered when trying to access the site;

Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.

Solution:

Start WAMP Server from the Start menu.

Click the WAMP icon in the notification area.

Select Apache, then Apache Modules.

Scroll the list to rewrite_module and select it.

Click the WAMP icon again, then click "Restart All Services".

Categories
iPhone

Sync an Outlook Contacts Category with your iPhone

This should be a lot easier.  A cynic might think Apple made this difficult on purpose to sell more of their MobileMe service.  But enough of that.

In setting up my new iPhone, I wanted to export a single category of contacts from my standalone (i.e. not connected to Microsoft Exchange) Outlook installation. 

Because I don’t want all of the hundreds of contacts in Outlook, some of which are obsolete but I keep for historical purposes, I have a category called cellphone contacts for those I want to carry with me on my mobile, and it worked fine on my old Motorola cellphone – easy as pie to sync my contacts.

iTunes, however, doesn’t or can’t handle Outlook categories.  So here’s my workaround. 

This was done in Vista with Outlook 2007, and assumes that you do not use Windows Mail or Windows Contacts.  You you may have to adjust for your setup.

 

In Outlook

In Outlook, create a category if you haven’t already and add it to those contacts you want on your iPhone.

Now, still in Outlook, create a new folder called Contacts iPhone or some such.

In Outlook Contacts, create and open a category view of your contacts for the cellphone category.  Press Ctrl-A to select all of them, then drag them to the Contacts iPhone folder.  On the pop-up menu, be sure to select Copy, not Move.

Select File > Import and Export…, then select Export to a file from the list of actions and click Next.

In the Export to a file dialog, select Comma Separated Values (Windows) and click Next.

Select the Contacts iPhone folder in the Select folder to export from list, and click Next.

Now select a place to keep the file (c:\temp\contacts.csv works well) and click Next, then click Finish.

 

In Windows Mail

Now we move to Windows Mail, an application you may never have heard of.

Open Windows Mail, then click the Contacts tab.  If there are no contacts there, you can proceed.  If there are, you have to decide whether you can delete them to proceed or include then in your iPhone contacts.

When ready to proceed, select File > Import > Windows Contacts.  Click CSV (Comma Separated Values in the list, then click Import.  Browse to your .csv file, i.e. c:\temp\contacts.csv, then click Open, Next and Finish in sequence.

image

Now we move to iTunes.

 

In iTunes

In iTunes, connect your iPhone, select it in the list of devices in the left pane, then select Info.

image

Scroll down to the Sync Contacts section. Check the box and select Windows Contacts from the list.

image

Now the the last bit.  Just sync your iPhone and check for your contacts.  If you have a lot of old useless contacts there, you may want to clear them off and start afresh – but that’s your call.

 

Epilogue

There’s no way this should be this much of a hassle, but it seems it must be.

For maintenance, it seems that periodically copying the contacts over the the Contacts iPhone folder in Outlook, saving the .csv, importing to Windows Mail, then syncing the iPhone should be easy enough.  It’s more of a hassle getting is set up and figuring out how to do it.  The ongoing refreshes should be easy enough, albeit annoying.

Categories
Joomla!

Display an alternate Joomla Template

Sometimes you just want to see what your site would look like in another template.

Simply add the parameter ?template=template_name to your URL and you’ll see it.

Technorati Tags: ,