Showing posts with label Uniform resource locator. Show all posts
Showing posts with label Uniform resource locator. Show all posts

Friday, May 3, 2013

How to Get a Google Voice Number for Your Own Email Address

If you want to use some Google services (like Google Voice), and have them associated with your own email address, it’s not all that difficult.

First, if you already have a Google account (like a GMail address), you will want to log out of by clicking on your name or icon up in the upper right corner of any Google app, and then click the “Sign Out” button:

Sign Out of Google

Wednesday, January 30, 2013

Changing a Web Site to use hosted WordPress

I got an email from my friend Athens who had just relaunched her web site at http://www.athenskconsulting.com/ but was now having problems with email.

The first thing I did was to run over to the MX Toolbox site to see what was going on with her servers. A quick look and saw that her mail servers were pointing to mail.athenskconsulting.com, which resolved back to her WordPress blog.

Before she pointed everything to her WordPress site, everything had been working. Unfortunately, the directions at http://en.support.wordpress.com/domains/map-existing-domain/ had given her some unfortunate information, that really weren’t accurate for what she was trying to do.

Her DNS and email were previously hosted at GoDaddy (along with her old web site), and all she was really trying to do was to get her company URL to point at the blog site that she’d set up on WordPress. The instructions I mentioned before give a way to accomplish that, by repointing the domain DNS servers to be the ones that WordPress provides.

The unfortunate thing about that approach is that in order for this transition to happen smoothly, you have to transfer all of your DNS records into the WordPress settings so that things like your mail server will continue to work (following the instructions at http://en.support.wordpress.com/domains/custom-dns/

Now this might be OK if you are a geek and know what MX and CName records should look like, but typing in a DNS file in the format that WordPress expects it is much more difficult than using the GoDaddy DNS control panel (which helps prevent you from making mistakes).

I got on the phone with her, and the first thing I had her do was to switch her DNS servers back to GoDaddy. This is done by going to the Domain Manager page in GoDaddy and looking for the section that says “Name Servers”.

Screen Shot 2013-01-30 at 4.10.04 PM
Clicking on the link that says “Set Nameservers” brings up a dialog that allows you to set the DNS (which had been set to the WordPress servers per the instructions mentioned previously):

Screen Shot 2013-01-30 at 4.10.23 PM

 

This of course fixed the mail problem (along with other URL’s), but broke her web site again (which I expected it would).

We then clicked the “Launch” link on the same Domain Manager page by looking for the section that says “DNS Manager”:

Screen Shot 2013-01-30 at 4.05.29 PM

 

This brings up the actual DNS zone editor that I talked about previously. Now the first thing you should do is to back up the zone records by using the import/export button on the DNS manager:

Screen Shot 2013-01-30 at 4.17.11 PM

This gives you the basic information that you might have needed if were you going to follow the instructions on the WordPress site. It creates a text version of the information of the DNS Zone records in a standard format.

But unless you really need to move off GoDaddy for some reason, you don’t want to do that. Instead, you just need to set up a wildcard CNAME record for the WordPress blog, and make sure to remove any old A records that might be pointing to the wrong place.

So for Athens, we needed to delete all of her “A” records (since she no longer has a physical server), and add a CName that looked like:

wildcard

And once DNS propogated, she was up and running again at http://www.athenskconsulting.com/

A quick trip back to the MX Toolbox site to check and her mail servers are now pointing back to GoDaddy again:

Screen Shot 2013-01-30 at 4.46.18 PM

Clicking the link that says “ns lookup” shows that the domain is now using the GoDaddy DNS servers again:

Screen Shot 2013-01-30 at 4.46.26 PM

The one other thing I do to make sure things are working is a DNS propogation check (http://www.whatsmydns.net/), which shows which servers will resolve the host and which don’t.
Screen Shot 2013-01-30 at 4.55.21 PM

All the little green checkmarks mean everything is happy all around the world, and now everybody is resolving her site properly.

So in summary: if somebody tells you to change your DNS servers, think first and see if an alias will work better …

Wednesday, August 19, 2009

GTUG Campout – doin’ the Wave …

GTUG CampoutI recently attended the Google Technology User Group Campout at the Googleplex in Mountain View. This was a three day sprint to build something interesting with the latest Google product: Google Wave.

Google Wave, as it turns out is a very interesting experiment in social interaction. Google is trying to reinvent collaborative communication with a piece of software that is one part chat, one part Wiki, and one part WebEx.

I’d seen this product at the Google I/O conference a few months back and was impressed with the demos. Basically you get these shared documents (called Waves) that all of the collaborators can update at the same time. You can watch the hour and a half demo at http://www.youtube.com/watch?v=v_UyVmITiYQ

The demo included things like interaction with blogs, Twitter and other web technologies, as well as interesting programming doing things like on the fly grammar checking. I signed up for a sandbox account the day of the presentation (using my iPhone of course), and got set up a week or so after that.

Wave was written by the brothers Lars and Jans Rasmussen, who are the architects of the Google Maps API. In some sense, this is an experiment in building software caused by the lessons they learned with the immensely popular Maps API. By giving the developers access early in the build process, they hope to build a more solid platform that will serve the developers needs.

So Friday came and I drove over to Google with Bennett Fonacier (a friend I met through Job Connections some time back). After the 50+ people got through with their 5 minute pitches, we networked for another hour forming teams. There were many ideas that were very similar, and for the most part these groups joined up into a combined team. Bennett and Steffen Frost (CEO of Carticipate) both came up with the idea of matching people for ride shares using the Wave.

I’d originally thought I would join a team doing something health related, but since my goal was to get a working piece of code, and I was sitting with the car pool team, I joined that effort. We became one of the roughly 50 projects teams, and quickly talked through what we’d be building over the next 48 hours or so.

The other members of the Wave Rides team were:

  1. Steffen Frost was a great concept guy, and had an existing product we were going to try and emulate.
  2. Bennett Fonacier has some development background, but he was short a computer, and would be doing QA.
  3. Andreas Koll who had some experience with the Google Maps API volunteered to build the Gadget for our interface.
  4. Hannie Fan offered to provide some design expertise and CSS coding.
  5. Robert Herriott was a quiet supporter, offering constructive criticism

I took on the task of writing the Robot, which is the part of the Wave that would take the input from the Gadget and match the participants with ride partners. Andreas had a working Gadget in short order, and was able to embed it in a Wave.

While he was doing that, I was working on getting a Robot built using the guidelines in developing Wave extensions slides. I got a working “Hello World”, built the extension.xml file, and with help from the Google crew, got it so we could create a new Wave with my Robot added.
Carticipate Logo

I got the icon from the Carticipate site, added a bit of code, and the Robot was adding the Gadget to the Wave. So far I had gotten a working Robot, and Andreas had a working Gadget. Now all we needed to do was clean them up a bit and get them talking.

This turned out to be a bit tougher than expected. The current state of the world is that the Robot can add a Gadget, and send data to it when it is added to the Wave, but can only read the state from the Gadget, and not actually set anything after the Gadget is running.

Anyway, I eventually got some debug code going in my Robot that would dump out the properties of the Gadget, which helped Andreas to debug some issues he was seeing with the state of the users accessing the Gadget.

A Gadget is basically a snippet of HTML and JavaScript that gets embedded in an XML file for inclusion in the Wave. Because the working code is inside an XML document, it gets wrapped in a CDATA element, which makes editing and debugging the Gadget a bit challenging. Andreas approach was to cut the HTML code out of the Gadget and edit it as an HTML document, then paste it back into the Gadget. Not ideal, but it works.

Our original plans for the WaveRides robot was that it would behave roughly the same way as the Carticipate application does: ask the user a few questions about where they are going, if they are driving, and then show a list of everybody who is travelling in the same area and time. So as we worked, I kept prototyping closer and closer to that goal.

By the late Saturday night, we had a working prototype that launched the map gadget, and displayed back the data from the users interacting with the gadget. The gadget was displaying the location of all of the users on the map, and we were feeling pretty good about the progress (especially considering none of us had ever built anything with the Wave API before). Bennett and I headed home, expecting to finish up the next morning, leaving Andreas coding away on his gadget.

The next day we arrived at the Googleplex and found that Andreas had solved some of his remaining problems, and the gadget was looking good. I went to work on the Robot, trying to get it to match up the user data. Of course, since there was little time left, the Wave kept misbehaving (probably due to all of us pounding on the sandbox with untested code), and we kept running into walls.

My original design had been to add a blip with the map gadget and gather my data from there. I soon realized that it was difficult to keep track of the gadget that way, so I changed my code to add the gadget to the root blip, and started removing debug code. At some point, we decided to put the code up on code.google.com for safekeeping, so I spent a few minutes figuring out how to do that (you can see the code at http://waverider.googlecode.com).

It was still fairly early on Sunday morning, and Andreas had been up until the wee hours of the night, so he wasn’t around for us to ask him to make changes to his gadget. We had separated the development of the gadget and the robot, so they were actually being served by two separate app server applications. The gadget only provided input for one point, and to complete the robot to the point we could demo something interesting, we needed it to have a “from” and “to” for each participant.

So rather than reinventing what Andreas had done, I decided to change the robot to create a “from” and a “to” gadget in the Wave, and use that. Interestingly this turned out to be fairly painless. I was able to add the second instance of the gadget, and give them each a name. The Wave kept track of them separately, so I got the data from both separately.

I spent the last few moments before we were supposed to present, trying to get a simple match working. The nice thing about this was that I could version the app on the Google App engine, and keep a known working version deployed while continuing to test. As other teams presented, it became obvious that this had been a good decision, and I eventually dropped back to one of the earlier working versions for the demo.

We got to demo the concept, and explain what we would have liked to have done. I accomplished my goal of learning how to code a basic robot, and learned a lot about the API. We were by no means the slickest or coolest app there, but we had fun building it.

We’ve got the start to an open source project that could eventually be used to match people locationally, and used for all sorts of purposes, and we got to see some of the challenges in building apps for a piece of software as new as Google Wave.

Team picture

From left to right above: Steffan Frost, Fannie Han, Rob Weaver, Andreas Koll, Bennett Fonacier.

Steffen created a really cool video over that weekend as well that you can watch at http://www.youtube.com/watch?v=DkmuBmBZkBo

Wednesday, February 18, 2009

How to blog – step 1

Since I’ve been blogging for a couple of months now, I have friends who are asking me “how do you blog?”.

Seems like a simple enough question, so I figured I’d blog about it (seems a little redundant blogging about blogging, but here goes).

The first step of course is to set up your blog.

This for me was very simple, since my hosting provider (1and1.com) includes a Blog widget in their web site tools.  This seems like a straightforward approach if you have a hosting service since most of them have blog software already setup, and you don’t need to worry about any installation or maintenance issues. So in the case of a provider like mine, you just find the website application on their control panel, and walk through a few steps to set it up.

Setting up the blog on 1and1 (at least on my package) you get a control panel page that shows you what blogs you have set up. You click the button “New Blog”, and you get sent to a screen that asks you to name the blog, and choose a domain.

This was my first gotcha in setting up the blog: I chose my accuweaver.com domain, and instantly my home page became an empty blog.

Apparently the wizard just changes the virtual host to point to the blog software, which would be OK for a brand new web site, but wasn’t what I wanted.

After that stumble, I created what 1and1 calls a subdomain of blog.accuweaver.com to point to. This let me keep my existing site, and created a separate URL for the blog. The blog setup also lets you create the admin user, and decide which email notifications should go to.  Then all you have to do is choose your template, and start blogging.

Now I need to point out that there are lots of other ways to blog. My parents have both been blogging longer than I have, and they use one of the free blogging services (See my Dad’s blog at http://www.virtualbob35.blogspot.com and my Mom at http://closeknitweave.blogspot.com/).

Google hosts this service, and it works pretty much the same way as the WordPress version that I use, but it isn’t tied to a hosting provider. This is probably the best approach for most people, and it also has the same flexibility of hosting on your own web server if you  want to.

If you really want to do your due diligence, you can go to http://www.weblogmatrix.org/and compare all the hundreds of blogging software options, but based on sheer name recognition, it really boils down to WordPress, TypePad and Blogger.

Anyway, that’s enough for this post, there are lots of other blogs out there with information about how to start blogging that do a more step by step sort of guide (I like the one by Paul Stamatiou at http://paulstamatiou.com/2006/05/14/how-to-start-blogging, it’s very thorough and easy to read)

Monday, January 26, 2009

Google Translate me please …

I use Google Reader to follow industry blogs about things like PHP and Java. One of the nice things that Google Reader does, is to automagically translate the page into English when the post is in a different language.

This is very helpful especially with blogs in subjects like these, especially since the international community is very active. Reader will give you a brief translated version of the feed, and when you click the link to go to the page, it typically forwards you through http://translate.google.com so you can read the page. For the most part, this yields a very understandable page that represents the subject the author was trying to convey very well.

To set this up in Google Reader, you just set the feed to automatically translate the page by clicking on the “Feed settings” button:

Translate_check_item

Notice that with the “Translate into my Language” checked, you’ll see “Translated by Google”  at the top of the page. The link to go to the post is now run through the http://translate.google.com with the appropriate languages so that you can read it, and if you click the “View original” link, you’ll see the summary in the original language.

In the above example, the feed looks like this, when I choose original language:

German feed

Clicking on the link for this post takes me to http://feeds.feedburner.com/~r/cakephp/~3/521947537/ which ends up at the blog for CakePHP & DIEVOLUTION, which looks like:

untranslated

Going back to the translated version, if I click on the link to go the the page, I get redirected to http://translate.google.com/translate?sl=auto&tl=en&u=http%3A%2F%2Ffeeds.feedburner.com%2F~r%2Fcakephp%2F~3%2F521947537%2F , which gives me the nicely translated page (below).

translated

So this got me to thinking: it should be a relatively simple thing to add a link to your page to send it to Google translate, to allow somebody to translate into their language, since it’s basically just an HTTP GET with parameters of the page, source language and destination language.

So I figured I’d try it with my blog first. I know the URL is http://blog.accuweaver.com, and my language source is EN (English). So to translate into German for instance, I need to create a URL that starts with http://translate.google.com/translate, and includes those two elements, and the language I want it translated to.

The parameters for the link are as follows:

parameterUsed forvalue
uURL of pagehttp://blog.accuweaver.com
slSource language (English)en
tlTranslate to language (German)de

So by putting these together, I get a link that looks like: http://translate.google.com/translate?u=http://blog.accuweaver.com&sl=en&tl=de, which when clicked will give me a German translation of my page.

Google also has a JavaScript widget that you can use to allow anybody to translate your page, which effectively builds the same sorts of URL’s for each language. You simply post some JavaScript code in your page which does some magic and places a little “translate tool” on your page (see http://translate.google.com/translate_tools?hl=en) and looks like the widget below:

Saturday, December 20, 2008

Moving my VolunteerCake to my Mac …

I have been running my development for VolunteerCake with a database on my Windows box which sits in my office with my Mac. I went to meet some people at a coffee shop, and realized that I couldn’t show them the app running on my MacBook because I was no longer on the same subnet with my Windows box, so I decided to move the database to the Mac to allow me for this.

Since I had everything in place to run Cake on my Mac except for MySQL, the first step was to install MySQL. This turns out to be pretty painless. Just grab the DMG from the MySQL site, and voila, new MySQL running on my Mac. Checked everything out using the MySQL administration tools, and it all looks good (I can access the DB, set up users, etc.)

Next I need to put the data in the database, so I just do a quick export from the phpmyadmin page on the PC. I end up with a file that is the SQL needed to replicate the entire database on my Mac. I run this SQL into the Mac MySQL, and now I have an exact copy of the database on my Mac.

After that, I go to the SQL administrator tool and make sure I have the user set up to give access to that database and make sure the username and password are the same as I was using on the PC (if I were more of a DBA, I’d probably have done this with command line MySQL, but I like GUIs, especially for things I don’t do every day, and the MySQL tools are pretty cool).

Then I need to change my database.php to point at the local database in order for VolunteerCake to get the data from the Mac. This should be as easy as changing the name of the host name to ‘localhost’ from ‘monet’ since I’ve set up the user and access to the database exactly the same as what I had on the PC.

Finally, all that’s left is to fire up the same URL that I have established for my app on my Mac (http://test.lctd.org/VolunteerCake) and … wait, that didn’t work. It says it can’t find the table acos for the Aco model …

Weird, the table is there, I can connect just fine, what could this be? A quick trip to the IRC channel, and I get the suggestion of clearing my cache. OK, try that … But hit the URL again and no change.

OK, now I’m confused, so I try running ‘cake bake’ … Now something interesting: I get an error that tells me that it was unable to connect to /var/mysql/mysql.sock – what does that mean? I thought I was connecting with a TCP socket, why does it want a file? Is this some sort of file permissions issue ?

Back to the IRC chat for some guidance, thinking maybe it’s a common problem, a permissions issue or something, of course they tell me to do exactly what I’d tell somebody else to do: verify that you can connect from PHP first. Good idea – so I whip up a quick connection test page, and get the same error. So now I’ve confirmed that it’s a PHP problem, and not a Cake issue.PHP can connect to a remote DB, but not the one on my local Mac …

Now it occurs to me that I often have problems that end up being related to the open source software that came bundled with the Mac, so I do some Google searches on PHP connection to MySQL for Mac OS X, and with the connection error messages. Eventually I find what looks to be the issue: for some reason the MySQL configuration sets the socket file to /tmp/mysql.sock but the PHP that comes with the Mac is looking somewhere else (at /var/mysql/mysql.sock to be specific). So I basically have three choices, edit the php.ini, edit the mysql config file, or build symlinks to make the file accessible at both locations.

I decide to change the php.ini file, which turns out to be another excercise in hunting, since Mac OS X likes to hide the files you’d expect to find in the /etc directory. After some more Google searches, I find that the PHP5 install that comes with Leopard puts the php.ini file into /private/etc, so I edit that file, changing the part of the file that looks like the following:

; Default socket name for local MySQL connects. If empty, uses the built-in
; MySQL defaults.
mysql.default_socket =

To be:

; Default socket name for local MySQL connects. If empty, uses the built-in
; MySQL defaults.
mysql.default_socket = /tmp/mysql.sock

In order to have PHP find the mysql.sock in the location that MySQL is actually creating it. Check my URL again, and voila, everything is working !!!

So, to make a long story even longer, I relearned that mixing actual open source with vendor open source is often problematic. It was suggested by at least one person (Mark Story) on the IRC channel that the best way to set up for Cake development on the Mac is to use MacPorts, since then you end up with matching versions of the software all in a “normal” open source location.

Thursday, December 4, 2008

CakePHP and RESTful Web Services …

I’m on a quest to make my application provide RESTful web services. After much digging, I found a post by Chris Hartjes at http://www.littlehart.net/atthekeyboard/2007/03/13/how-easy-are-web-services-in-cakephp-12-really-easy/ that helped a lot.

Turns out that Cake has some really nifty built in support that can be turned on really easily. For basic XML support, all you need to do is to add a couple of lines to your routes.php file to allow Cake to handle XML. This is pretty well described in the Cookbook at http://book.cakephp.org/view/477/The-Simple-Setup

So for my VolunteerCake project I added the following lines to my routes.php:


/**
* Add in support for web services by enabling generating output based on extension
*/

Router::mapResources(array('events', 'event_josb', 'groups','jobs', 'slots', 'users', 'user_groups','user_slots'));
Router::parseExtensions();

The mapResources() does the magic that maps the REST requests to the actions in the controllers, and the parseExtensions() sets up Cake to do some other routing magic when the request has a “.xml” extension.

So now if I call any of my actions and append “.xml”, Cake changes the response type and view to return XML. Next we need to add the view for the XML, which goes in the xml directory under the view we are REST enabling (e.g.- for jobs, we have a views/jobs/xml directory where the view CTP files need to be placed).

First I created the xml directory under the views/jobs folder, and next I created an index.ctp. This is a very simple file, which Cake’s XML helper to spit out the data with the following code:

<Jobs>
<?php echo $xml->serialize($jobs); ?>
</Jobs>

Now to get the XML to display, all I have to do is create the appropriate views for my REST actions.

So for example if I go to the app/jobs action, I would normally see the XHTML representation of the page like:

Jobs XHTML screenshot

Then if I append “.xml” to that same URL, I get the XML back as shown in the following screen shot:

Screen shot of the Jobs XML in browser

Next we need to do the view.ctp to provide support for sending back the data for a specific job by ID. This is practically identical to the index.ctp, except we’ve modified the code to use the variable $job instead of $jobs (since that’s what Cake returns):

<Jobs>
<?php echo $xml->serialize($job); ?>
</Jobs>

This allows us to get the behavior of being able to get the XHTML for a specific job by using a url like /jobs/view/1 as shown:
Screen shot of jobs/view/1

Then by appending “.xml” to that same URL, we get the XML for the job with ID of 1:

Screen shot of jobs/view/1.xml

You may notice that the XML for this Job has a lot more data than we saw when we got the list for the specific Job. The XML from /jobs.xml is only one level deep, while the data from /jobs/view/1.xml has a hierarchy of a job having slots, which in turn has a job, user_slot and user.

That happened because the index action was set up to only get the data from the Jobs, while the view action had recursion set in order to gather all the related data. By setting the recursive var to 0 (zero) in the index action, we get no children, while in the view action we set the value to 2 (two) which tells cake to fetch all the HABTM data (see: http://book.cakephp.org/view/439/recursive for more on this). Alternatively we could do a specific find and modify which bits of data we populate in the controller to determine what data gets spit out in the XML (this would alleviate the one potential downside to this approach which is that ALL of the data fields and tables are currently being placed out in the XML stream).

The basic point here is that we now have a working RESTful service (at least as far as fetching data) that doesn’t require a great deal of specific view code.

Next: completing the RESTful CRUD

Wednesday, November 26, 2008

Fun with HTML and CSS

I spent some time yesterday figuring out CSS problems for Job Connections.

The Job Connections site was built using a CSS for printing that wasn’t including all of the parts of the page that should be printed. They use a stylesheet called print.css, and when somebody would try to print a page, they weren’t getting anything but the text in the middle of the page.

I took a look and found that the stylesheet was setting all of the region styles to “display: none”, which tells CSS not to display them. Editing the stylesheet to remove these bits was all that was needed, so I set it up to print everything but the menu bar at the top and down the side.

In the same file, there was a reference that looked like an attempt to make the links display as bolded when the page was printed. The code that was trying to do this looked like:

a { font-weight: bold;
border-width: 0px;
text-decoration: none;
}

That wasn’t working, mostly because the style was being applied to all anchors. I updated it to look like:

a:link, a:visited {
font-weight: bold;
border-width: 0px;
text-decoration: underline;
color: #520;
background: transparent;
}

This change applied the style to both links and visited links. I then went one step further and added some magic to get the actual link to print (works in CSS2 compliant browsers):

/* this bit will print the URL after the link
when done from the CSS2 compliant browsers */
a:link:after, a:visited:after {
content: ” (” attr(href) “) “;
font-size: 90%;
}

The magic is in the “:after” bit, which basically says “after you display the link, display something else”. With this applied, the links all get bolded, underlined, and are followed by the actual URL in parentheses afterward.

I don’t have access to post this to the JobConnections web site yet, so you can see the problem if you go there and look at the printed page (print preview from your browser).

I got access to the web site (thanks to Walt Feigenson), so this is partially fixed now. It looks pretty good except the content still has quite a large area of whitespace to the left due to the way the style sheets are interacting. I’m playing with updating this now to make the print CSS work the way it should and not inherit the styles that cause this from the “screen” CSS.