Web
Gmail, SPF, and Broken Email Forwarding?
by Frank Kim on Jul.11, 2008, under Web
I read this article on Slashdot, Gmail, SPF, and Broken Email Forwarding?, which explains how email forwarding to Gmail and possibly other service providers may sometimes silently fail.
Background: Like many people, I have me@mydomain.com as my public facing Email address. When Email comes into my server, I forward it to me@gmail.com. But since my friend has published SPF (Sender Policy Framework) records that say only his server is allowed to send Emails for friend@frienddomain.com, gmail apparently rejects (silently buries actually!) the Email since it is forwarding through my server. Please note that this is exactly what SPF is designed to prevent — spammers from sending Emails with your address — but it breaks forwarding and has other problems.
I also do what the author above talks about, i.e. I forward the email for my various domains to my various Gmail accounts. Hopefully this is not an issue, that no one who emails directly to my domain email addresses is using SPF.
One proposed solution by a Slashdot poster makes sense, use Google apps. Fortunately this is available for free on Dreamhost, my web host, and is easy to set up. I might try it later.
Is there another solution?
Yes, of course. Have all your email sent to Google in the first place! You don’t have to switch everything over to the Google app tool, you can just set MX records for your domain pointing to them, and collect it all (or forward it inside or outside Google.) It’s free (with a paid version available.) Check it out here Smart apps for email, documents, sites and more
How Facebook Stores Billions of Photos
by Frank Kim on Jun.30, 2008, under Web
Those guys at Facebook sure are smart. Here is an online presentation titled Needle in a Haystack: Efficient Storage of Billions of Photos.
Jason Sobel, the manager of infrastructure engineering at Facebook, … explains how Facebook efficiently stores ~6.5 billion images, in 4 or 5 sizes each, totaling ~30 billion files, and a total of 540 TB and serving 475,000 images per second at peak.
Adobe Flash and Shockwave Versions
by Frank Kim on Jun.13, 2008, under Adobe, Web
Often I find myself wondering what version of Adobe Flash or Shockwave I am running. Here are some useful pages for doing that.
- if you’ve installed Flash and/or Shockwave
- what version of Flash you are running
- install Flash
- install Shockwave
One day I might try to figure what is the difference between Flash and Shockwave, when I actually care.
Stats on Dreamhost with WordPress
by Frank Kim on Jun.03, 2008, under HTTP Server, WordPress
On my WordPress blogs hosted by Dreamhost to get stats I needed to add this to the .htaccess file.
# BEGIN Stats
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} ^/(stats|failed_auth\.html).*$ [NC]
RewriteRule . - [L]
</IfModule>
# END Stats
This is further explained in the Dreamhost Wiki page Making stats accessible with htaccess.
Dreamhost uses Analog to generate web statistics. Other recommended AWStats which seems more powerful. Maybe I’ll switch if I feel the need.
Google Doctype
by Frank Kim on May.16, 2008, under Web
Chris Weekly says Google Doctype looks like “a new, excellent resource for keeping up with webdev tips and tricks, browser compatibility issues, etc.”
Documenting the Open Web
Google Doctype is an open encyclopedia and reference library. Written by web developers, for web developers. It includes articles on web security, JavaScript DOM manipulation, CSS tips and tricks, and more. The reference section includes a growing library of test cases for checking cross-browser and cross-platform compatibility.
Google Doctype is 100% open.
- Open source
- Open content
- Open to contributions from anyone
phpMyAdmin not starting
by Frank Kim on Mar.05, 2008, under MySQL, PHP
Today when I started up phpMyAdmin (version 2.10.0.2) by going to http://localhost/phpMyAdmin I saw this error screen.
phpMyAdmin – Error |
I googled around but could not find any solutions.
So I went and tried to install the latest version of phpMyAdmin, 2.11.5. When I tried to run setup I saw this error screen.
phpMyAdmin – Error |
| Cannot start session without errors, please check errors given in your PHP and/or webserver log file and configure your PHP installation properly. |
Now that I had an error message to work with I googled around and found this post, Xampp phpMyAdmin Problem, which helped me diagnose the problem.
It turns out during one of my cleaning sessions I wiped out the session directory in, “C:\DOCUME~1\fkim\LOCALS~1\Temp\php\session.” After restoring it I ran into my next problem.
phpMyAdmin – Error |
Cannot load mysql extension. Please check your PHP configuration. – Documentation |
I upgraded to PHP 5.2.5 from 5.2.1 but that did not help. I installed the mbstring module but that did not help.
Finally I added the PHP extension directory to the path (I had already added the PHP directory to the path) and it finally worked! My path now includes the following two directories, E:\Program Files\PHP and E:\Program Files\PHP\ext.
Optimize Firefox for Broadband
by Frank Kim on Jan.23, 2008, under Web
This PC World article describes how to optimize Firefox for broadband. Another site verifies that these changes are a good idea.
I haven’t noticed a change yet but it seems like a good idea.
Submitting an ATG Form Using a Text Link
by Frank Kim on Jul.20, 2007, under Form Handlers, JavaScript, Page Development
It has always bedeviled me how to submit an ATG form using a text link. I have asked many people about this but no one seems to know. Finally with the help of ATG support I figured it out.
Below is a simple example of how to do it. The trick is the hidden submit input which triggers ATG to call the handleSubmit method of the form handler.
<%@ taglib uri="/dspTaglib" prefix="dsp"%>
<dsp:page>
<script>
function submit(form) {
form.submit();
}
</script>
<dsp:form action="<%=request.getRequestURI()%>" method="post" name="testForm">
Foo: <dsp:input type="text" bean="TestFormHandler.foo"/>
<p><a href="javascript:submit(document.testForm)">Submit</a>
<dsp:input type="hidden" bean="TestFormHandler.submit" value="Submit"/>
</dsp:form>
</dsp:page>
You can also invoke the JavaScript like this:
<p><a href="#" onclick="submit(document.testForm); return false;">Submit</a>
Submitting a form with a radio button
by Frank Kim on Apr.28, 2007, under JavaScript, JSP, Struts
Submitting a form from a radio button is not common but it is a nice UI which is even better when done with AJAX.
A typical form with two radio buttons would look something like this.
<form action="test.html"> 1 <input type="radio" name="test" value ="1"><br> 2 <input type="radio" name="test" value ="2"> <p><input type="submit" value="submit"> </form>
But with basic JavaScript you can make a simpler form like this.
<script>
function submitAction( form, absPath ) {
form.action = absPath;
form.submit();
}
</script>
<form action="test.html" id="test">
1 <input type="radio" name="test" value ="1" onchange="submitAction(document.getElementById('test'), 'test.html')"><br>
2 <input type="radio" name="test" value ="2" onchange="submitAction(document.getElementById('test'), 'test.html')">
</form>
If you are using Struts the above form’s JSP would be:
<html:form action="test.do" styleId="test">
1 <input type="radio" name="test" value ="1" onchange="submitAction(document.getElementById('test'), 'test.do')"><br>
2 <input type="radio" name="test" value ="2" onchange="submitAction(document.getElementById('test'), 'test.do')">
</html:form>
WordPress Contact E-Mail Form
by Frank Kim on Mar.17, 2006, under WordPress
Naively, I put up email addresses for sales, information, and site feedback on the Contact Us page. The spam robots discovered these email addresses and have begun to spam me.
Fortunately there is a WordPress plugin, PXS Mail Form, for email forms that seems quite mature and even protects against exploits. You can see how it is used on this page.
I made only one change to this plugin that allows you to set the subject of the email form using a GET request. Previously you could only do this using a POST request.
***************
*** 58,69 ****
} else {
$show_subject = 1;
$subject = '';
! if (empty($_POST['your_subject'])) {
$subject = get_option('pxs_subject');
$subject = stripslashes($subject);
$subject_mm = '';
} else {
! $subject = $_POST['your_subject'];
$subject = stripslashes($subject);
$subject_mm = ': '.$subject;
}
--- 58,69 ----
} else {
$show_subject = 1;
$subject = '';
! if (empty($_REQUEST['your_subject'])) {
$subject = get_option('pxs_subject');
$subject = stripslashes($subject);
$subject_mm = '';
} else {
! $subject = $_REQUEST['your_subject'];
$subject = stripslashes($subject);
$subject_mm = ': '.$subject;
}