Fantastic writeup of Anuva Wines on ArgentinasTravel.com

Jon masterfully captures the essence of the private wine tastings, all the way from his initial skepticism to his overwhelming support.

…this is a family business, and not a faceless corporation. I’ve been to those large tastings where you, like a bottle in the assembly line, are pushed in and out so quickly that you don’t even have time to ask what you just drank.

http://argentinastravel.com/4474/anuva-wines-a-special-introduction-to-argentinean-wine/

Let me know what you think!

Python — Quickly Debug a Variable Value

raise Exception, “an error message string”
Will raise an exception and print the string.

raise Exception, str(my_variable)

raise Exception, str(myDictionary)

raise Exception, ” %s %s %s” % (v1, v2, v3)

Reviews of Anuva Wine Tastings in Buenos Aires

I thought I should share a few great write-ups of Anuva Wine Tastings in BA written recently.

Travel Writer Jon Brandt has great things to say about a wine tasting he attended last weekend

http://ttravelguy.blogspot.com/2010/04/wine-tasting-with-anuva-wines.html

“I’ve been to wine tastings before in Sicily and in Mendoza, but this was different. Rather than being rushed through a distillery with a guide who doesn’t fully reach fluent status, we were in Karlin’s home, and we were quickly made to feel like old pals.

Karlin is actually an American expat, so aside from his perfect English, he had a different perspective to give us for restaurants, politics, and culture. This isn’t a lesson that should be taken for granted, and to be honest I think it’s one of the best and most distinguishing qualities of this experience.”

San Telmo Loft had a similar experience, with great pictures and write ups of each wine served.

http://santelmoloft.com/2010/03/26/anuva-wine-tasting/

“He wanted to be reassured that the wine tasting was going to be run by professionals who would not only pour from bottles but be able to answer his questions and guide him to the must-visit bodegas (wineries) on his trip to Mendoza.

We decided to call the various places. Several places were not able to answer our questions at all. In essence, you go there, pay to taste the wines, and have zero guidance or discussion about what you are tasting and why these wines were chosen. Also, we didn’t want a full dinner with the wine tasting. We really wanted to focus on the wines. Paired with the appropriate foods, yes, but not a full meal.

Sarah, the Tasting Room Director at Anuva Wines, answered the phone. She answered all of Andy’s questions and showed such knowledge and professionalism that we knew Anuva was the place.”

I’m glad to read that both appreciated the wines, the wine knowledge, and personal service.

If you’re visiting  Buenos Aires any time soon, consider booking a tasting early in your trip,  because we’ll be sure to recommend nearby restaurants, activities, and answer any questions you might have during your stay.

https://www.anuvawines.com/wine-tastings/visiting-buenos-aires/book/

For more reviews, visit TripAdvisor

http://www.tripadvisor.com/Attraction_Review-g312741-d1475622-Reviews-Anuva_Wines-Buenos_Aires_Capital_Federal_District.html

Django to PHP

First few days on PHP from django. No I am not switching. I will definitely use django for projects built from the ground up, and I will probably use PHP for really simple stuff.


I like how easy its going to be to extend stuff like WordPress to fit the needs of casual sites that don’t need a monster built from scratch.

Good GOD it’s at least a hundred times easier to learn this after programming experience. The first time you have to learn it from the backend to the front end. PHP would have been so much easier to learn than django with no prior server experience. At least it’s as simple as FTPing a freakin file for most providers.

With django, the programming itself is well documented, but you have to learn a little bit about what’s normally split into at least 3 or 4 other jobs titles to run your own server.

Also, not having a database abstraction layer is pretty awesome in a sense. Django’s ORM didn’t require me to use much raw SQL, so.. I was spoiled. Dealing with PHP will force me to learn SQL, which is a good thing.

Php? Plop down a file in FTP. Wow that’s easy.

PHP — Log Arbitrary Stuff to File

Reminder: I’m brand new at PHP. I’ve been told it’s the devil, but I’m liking it so far.


Anyways, logging random stuff to file:

class logfile {
function write($the_string) {
if ( $fh = @fopen("/home/clubarge/static.anuvawines.com/wp/wp-content/logfile.txt", "a+"))  {
$the_string .= '\r\n';
fputs( $fh, $the_string, strlen($the_string));
fclose( $fh );
return (true);
}
}
}
// write to the log
$lf = new logfile();
$lf->write("LOG ME");
Fantastic! Now you can see what's breaking in your code by logging variables as you see fit.  $lf->write($myvar);

PHP / WordPress — Enable Debugging, Log Writing, etc.

This is my first time messing around with PHP, making a plugin based on other plugins to try to understand how PHP works.

I really needed debugging enabled though. WordPress defaults to a blank white screen of death if any errors are posted.

I went through 10 different ideas for displaying debug messages all the way to php. It turns out all you need enabled are a few options in wp-config.php for wordpress display the errors.

The big problem for googling this answer is that only this post has the KEY that I needed: “WP_DEBUG_DISPLAY”

http://fuelyourcoding.com/simple-debugging-with-wordpress/

WP_DEBUG alone didn’t do it, moving php.ini to my user on dreamhost and enabling errors didn’t do it..

So that’s it:

define(‘WP_DEBUG’, true);

define(‘WP_DEBUG_DISPLAY’, true);

The php.ini settings may be required as well, but the bottom line is WP_DEBUG_DISPLAY.

Nginx / WordPress — Proxy Subdirectory to WordPress Subdomain

Using Nginx to proxy a subdirectory to a wordpress installation on a subdomain.

I’m moving our blog onto our main site, but want to keep them on separate servers from the main site for various reasons.

The blog will be on blog.anuvawines.com, but be accessible from anuvawines.com/blog (for SEO, since google thinks of subdomains as separate sites).

Double Update: Don’t do it!

It’s more trouble than its worth for me — I simply bought a bigger server to handle a separate PHP process and let nginx actually serve it at /blog/.

Update: I ran into issues with permalinks due to the proxy. It looks like WP checks the ‘home’ option against something to pull the post_ID from your permalink format. I tried digging in and replacing option_get(‘home’) where i thought the ID was being generated, but couldn’t solve the issue.

My end solution was to set the home field to the real address where WP is hosted, and to edit the link generator itself to pull data from a new option field I made called proxy_home.

That way, all my issues were solved.

For my peace of mind, I made my subdomain return a 403 forbidden if a certain header was not passed to the subdomain on proxy.  Of course, this could be any other method that generally IDs the proxy server (ip/referrer/whatever). The reason is not for security, so anything goes.

Set up the nginx proxy

Say we want to proxy domain.com/blog/ to blog.domain.com. Note that I say proxy, because we don’t want a redirect. We want a 200 http status message. One that google will crawl as apart of domain.com/

Set up a location in your /etc/nginx/nginx.conf aside your other location directives.

location /blog/ {
 proxy_pass http://static.anuvawines.com/wordpress ;
 proxy_set_header X-Real-IP $remote_addr;
 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}

Restart nginx, and you’re good to go. Visit the mydomain.com/blog and you will be able to navigate to the site, with an HTTP 200 message.

The only problem is that the links are still using the subdomain address, and if you tried admin authentication, it fails.

Set up wordpress links to use proxy address

This is pretty much good to go out of the box, but you will have to change your WordPress installation to rewrite the urls for your proxy domain instead.

Right now, all links are subdomain.mydomain.com/, when they should be accessed by domain.com/blog

add a few lines to your wp-config.php

define('WP_HOME', 'http://mydomain.com/blog');
define('WP-SITEURL', 'http://mydomain.com/blog');

Reload the page and your urls should be set to the new ones.

Fixing admin/authentication for proxy address

Suddenly, we have a problem. We can’t log in via the proxy, OR the actual subdomain address because we set the above 2 lines.

subdomain.mydomain.com/login will redirect to mydomain.com/blog and fail.

I dug around the cookie headers to see that wordpress is looking for a database entry called home and siteurl to set these cookies. The above code fixed our links, but these cookies look directly at the db. I suspect this means the above step is useless.

So, go into your mysql db, alter the wp_options table, option_name “siteurl” and option_name “home”, and set them to the proxy address.

In my case, anuvawines.com/blog

The cookies will now match the domain when you are logging in via the proxy address.

Mimi wo Sumaseba / Whisper of the Heart — Ghibli Studio

I was listening to some old music and came across the soundtrack for this movie, one of my favorites that most people tend to fall asleep watching.

I looked up some reviews and am super happy that lots of people appreciate it as well.

http://www.imdb.com/title/tt0113824/usercomments?start=0

Basically, every Ghibli film i’ve seen is deeply moving. They are the movies I think about 5 years later, not the countless action movies I’ve seen since then.

I suggest you watch them.