April 2007

Importing Existing Email into Gmail

We recently switched to Google Apps at work and I have been looking for a way to import my existing email, which was stored on an IMAP server, into Gmail. The answer became clear when I came across Mark Lyon’s GMail Loader (GML), but it was much simpler than I thought. Rather than use GML, all I had to do was move my email from their IMAP folders into the Inbox. Then, I configured Gmail to Get mail from other accounts under Settings » Accounts.

This only works for POP3, which was available on my old mail server, but requires that all email be moved to the Inbox. Gmail downloads 200 messages at a time and checks for mail every hour, so the process can take a long time. Filters, SPAM, and virus checks are performed on each message, so check your Spam folder periodically for misdirected messages. There are several settings that allow you to automatically Archive and label incoming messages. See Google’s Help Center for more information.

So, although GML looks interesting and powerful, using Gmail’s built-in POP3 fetcher was the best solution for me.

google

Comments (0)

Permalink

Internationalize PHP Applications

The other day it dawned on me that my hobby website, My Cycling Log, has a large international audience and that I should cater more to them. My Cycling Log is basically exactly what its name suggests: an online cycling log. It’s a place for cyclists to log their rides, share their achievements with their friends and the world, and organize themselves into groups. The site is constantly evolving largely driven by user feedback.

My first step in making My Cycling Log friendlier for international users was to implement user-specific timezones. This is a no brainer. PHP handles timezones quite elegantly using the date_default_timezone_set function.

The second step is to internationalize the text.  An article on IBM’s website lays it out very clearly: How to internationalize PHP apps.  I’m still looking for translators, but I will update this post once I begin the process.

Uncategorized

Comments (1)

Permalink

MSSQL Transaction Log Full

Problem: Occasionally I get the following JDBC error from MSSQL:

The log file for database 'db_example' is full. Back up the transaction log for the database to free up some log space.

Solution:

BACKUP LOG db_example WITH TRUNCATE_ONLY
DBCC SHRINKFILE(db_example_log, 2)

If ‘db_example_log’ is not the logical name of the logfile, the 2nd command will fail. The correct logical name can be found by running the following statements:

USE db_example;
SELECT * FROM sysfiles;

mssql

Comments (0)

Permalink

Oracle ADF Cache Files

Problem: I have a web application running under Tomcat using the Oracle ADF framework. When the application is installed as a service under Windows, it outputs cache files in mass to \WINDOWS\system32\ Needless to say, this doesn’t make the system administrators happy.

Solution Under Linux: This problem is avoided by starting the application with a working directory of <application.root>\temp Then, these ADF cache files get dumped there. The following snip-it does the trick:

pushd "$CATALINA_BASE"/temp > /dev/null
exec "$EXECUTABLE" start "$@"
popd > /dev/null

CATALINA_BASE: <application.root>

EXECUTABLE: <tomcat.home>/bin/catalina.sh

Solution Under Windows: Unknown at this point, please provide feedback.

java
oracle
tomcat

Comments (0)

Permalink

Site Monitoring

After having some site performance and availability problems, I began investigating ways to monitor web servers. There are lots of sites offering various services, here’s what I’ve settled on.

1. Broadband Reports offers both free and paid services. Their Line Monitoring tool provides a continuous response time graph shown below by sending out pings every 10 minutes. The Line Monitoring tool costs approximately $1 per week. It also provide the ability to setup a HTTP ping to a specific URL.

Line Monitor - Ping

Line Monitor - HTTP Ping

2. mon.itor.us is a free web site monitor tool. As far as simplicity in setup, mon.itor.us couldn’t be easier. Their website serves as a dashboard with drag-and-drop modules for each of your sites. These modules can also be included in your OS X dashboard, Google Personal, Netvibes, etc. Another nice feature is the ability to be notified when your sites are unavailable. Alerts can be sent to an email address, IM account, or cellphone. The main problem with mon.itor.us is in its ping frequency, which is currently between 30-45 minutes. According to their parent site Monitis they are rolling out a Bronze plan ($10 per month) that will ping every 5 minutes and provide some advanced features.

Mon.itor.us - Ping

apache

Comments (0)

Permalink

Apache Tomcat Proxy Connector

I ran into some trouble configuring Apache/Tomcat on Fedora Core 6 using the Proxy AJP Module this week. Here are my final settings and a brief description of the problem and solution.

/etc/httpd/conf.d/proxy_ajp.conf :

LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
ProxyPass / http://localhost:9013/

server.xml :

<Connector acceptCount="100" connectionTimeout="20000" disableUploadTimeout="true" port="9013" redirectPort="8943" proxyName="www.myhost.com" proxyPort="80"/>

After settings things up, nothing worked. I found the following error in the Apache logfile:

[Fri Mar 30 02:23:34 2007] [error] (13)Permission denied: proxy: HTTP: attempt to connect to 127.0.0.1:9013 (localhost) failed
[Fri Mar 30 02:23:34 2007] [error] ap_proxy_connect_backend disabling worker for (localhost)

After digging around Google a bit, I finally found the following solution:

http://uppertank.net/blog/?m=200512


[root@clue conf]# getsebool -a
allow_execmem –> active
allow_execmod –> active
allow_execstack –> active
allow_kerberos –> inactive
allow_ypbind –> inactive
dhcpd_disable_trans –> inactive
httpd_builtin_scripting –> active
httpd_can_network_connect –> inactive
httpd_disable_trans –> inactive
httpd_enable_cgi –> active
httpd_enable_homedirs –> active
httpd_ssi_exec –> active
httpd_tty_comm –> inactive
httpd_unified –> active
mysqld_disable_trans –> inactive
named_disable_trans –> inactive
named_write_master_zones –> inactive
nscd_disable_trans –> inactive
ntpd_disable_trans –> inactive
portmap_disable_trans –> inactive
postgresql_disable_trans –> inactive
read_default_t –> active
snmpd_disable_trans –> inactive
squid_connect_any –> inactive
squid_disable_trans –> inactive
syslogd_disable_trans –> inactive
use_nfs_home_dirs –> inactive
use_samba_home_dirs –> inactive
winbind_disable_trans –> inactive
ypbind_disable_trans –> inactive
[root@clue conf]# setsebool httpd_can_network_connect true
[root@clue conf]# getsebool httpd_can_network_connect
httpd_can_network_connect –> active
[root@clue conf]#

apache
linux
tomcat

Comments (1)

Permalink