Blog
«Previous   1 2 3 4 5 6 7  Next»

Simple TinyMCE Integration Into Moodle 1.9.x – June 24, 2010 (read more)

There are a handful of solutions out there to integrate TinyMCE and Moodle, but some of them are obsolete, and some contain all sorts of things other than the TinyMCE files.

So, I started by reading this entire page, and then figuring out which versions no longer worked, and finally settled on John Stabinger's version (link to stabinger.us was removed, since it appears the site was bought by SEO spammers), which was pretty good, though it contained a lot of extra stuff.

I've tried to keep my version pretty simple, and hopefully you'll save some time by using it.  I downloaded John's version that was built using 1.9.8 from 05/12/2010.  It merged cleanly into my 1.9.9 2010-06-09.

Minor Change to the Apache2 Configuration: DirectoryIndex – May 20, 2010

We don't think it will affect anyone's current websites, but we've turned off DirectoryIndex'ing by default for security* reasons.  If you desire this behavior in a certain directory, you can turn it back on by adding (or editing an existing) .htaccess file and adding the line:

Options +Indexes

And the old functionality will be restored.

* Where "security" is defined as security through obscurity, and not any real definition of security at all, but it keeps the script kiddies away.

HOW-TO: Get Your Facebook Application to Show Up on a Page's Wall and Boxes Tab – January 29, 2010 (read more)

It about to be deprecated, so this information won't be worth much in a month or two, but for some reason, the documentation on how to post stuff to a page's wall is really sparse, and took me a while to figure out, so here goes, and I'll try to add in the keywords that I searched for while trying to find the answer.

The Secret to Upgrading osCommerce from 2.2ms2-2006-08-17 to 2.2rc1 – January 20, 2010 (read more)

I've been working with a customer to upgrade his osCommerce installation.  The interesting points of the upgrade are that he has a highly customized installation, both in the template and code.  Subversion comes to the rescue for all of that.  And I got his source code checked in (had to first figure out what version he was running, since it turns out he originally installed 2.2ms1, and had partially upgraded to 2.2ms2-2005 and then partially upgraded to 2.2ms2-2006, so it was pretty confusing as to which files and database tables had already been upgraded.

Procmail Programming – January 07, 2010

I've written a couple procmail scripts over the years, and I thought I should publish them since it might help someone.

The following script goes in /etc/procmailrc which allows users to disable the spam check for whatever reason - perhaps they use a different program or otherwise don't need the spamassassin check. (see next script, where my virtual users use a different spamd, since the user doesn't actually exist, so I need to change the username in spamc, and call a different spamd which is listening on a different port than the default spamd)

:0fw
* ? /usr/bin/test ! -e $HOME/.no-spam-check
| /usr/bin/spamc --headers

I use this next script for my "virtual" users - I now do all email via virtual users (except for the folks who were around before this switch) as it makes e-mail management easier, via PostgreSQL scripts, and a custom PHP customer script that allows them to make their own modifications easily.

This script also supports the username+extension@domain syntax, which is handy for folks who don't have whole domain names to use for email/spam tracking.  My users have an infinite number of email addresses which can be "created" by simply telling someone that their email address is john.doe+spammer@mydomain.com. If the user then creates a folder named "spammer", the mail will be delivered into that folder, and if the folder isn't created, this script will put the mail in the main inbox, and the user could filter it on the client-side using the X-Original-To: header.

##############################
## rename arguments into nice names
## strip out slashes and periods in the extension to avoid
## mis-writing stuff to other directories (like ../../../.procmailrc)
domain=$1
username=$2
extension=$3
extension=`echo "$extension" | sed -e 's/[\/.]/_/g'`

# strange formats, probably errors in the postfix database
:0
*$ ${domain:+!}
! vmail+$domain+$username+$extension+nodomain@xxxx.com
:0
*$ ${username:+!}
! vmail+$domain+$username+$extension+nousername@xxxx.com
# we disabled default spam checking with .no-spam-check
# so now we run it using the virtual spamd
#
# 02/04/2008, added --timeout=100, we are getting some cases
# where the procmail script is taking 1001 seconds to run,
# and postfix bounces the message...
:0fw
* ? /usr/bin/test -d $MAILDIR/$domain/$username
| /usr/bin/spamc --timeout=100 --port=784 --headers --username=$username@$domain

# chuck definitely known spam
:0 h
* ^X-Spam-Level: \*\*\*\*\*\*\*\*\*
/dev/null
# deliver to /home/vmail/mail/{domain}/{user}/mail/{extension}
# if they previously created the folder
:0:
*$ ! ${extension:+!}
* ? /usr/bin/test -e $MAILDIR/$domain/$username/mail/$extension
$domain/$username/mail/$extension

# deliver to /home/vmail/mail/{domain}/{user}/mail/mail
# if the directory exists.  if it doesn't, it is an error
:0:
* ? /usr/bin/test -d $MAILDIR/$domain/$username/mail
$domain/$username/mail/mail

# shouldn't ever get here unless there is a missing directory
:0
! vmail+$domain+$username+$extension+missing-dir@xxxx.com

Some spam blocking scripts:

# spammers like forging mail from @daley.snurgle.org
# and I no longer send mail using this address, so anyone
# who says they received mail from this address got spammed,
# and has a poor ISP which bounced the spam to a person who didn't send it.
:0
* ^X-Original-To: [^@]+@daley.snurgle.org
* ^Subject: .*(deliver|failure|returned|autoreply|challenge|blocked)
/dev/null

An old address that Eversave sold to spammers

:0
* ^TO_eversave@jondaley.cjb.net
/dev/null

Wordpress: Cache RSS Feeds to Lower CPU Usage – December 09, 2009

I did some work for a client who was having high CPU load issues with their tiny (20 posts, no comments) Wordpress installation.

They already had the super-cache plugin installed (I think that should be shipped by default in wordpress), but the super-cache plugin (as of version 0.9.6.1) doesn't cache RSS feeds, so for each of the ~5000 viewers of the RSS feed, the feed is regenerated each time, causing this tiny site to be the largest CPU usage of all sites on this particular shared server.

It turns out that this is a known problem, so hopefully it will be fixed in later releases of the plugin. Especially since I am asked to fix this for different clients at different times, and I have to relearn how to fix it each time, because I can't keep it in my head...

The changes I made were:

modified wp-cache-phase2.php, line 36:

if ( $wp_cache_not_logged_in && is_user_logged_in() /*&& !is_feed()*/ && !is_admin() ) {

modified wp-cache-phase2.php, line 270:

if( !empty( $_GET ) || /*is_feed() ||*/ ( $super_cache_enabled == true && is_dir( substr( $supercachedir, 0, -1 ) . '.disabled' ) ) )

added to wp-cache-phase2.php, on line 364:

if (is_feed()) {
  $type = get_query_var('feed');
  $type = str_replace('/','',$type);
  switch ($type) {
    case 'atom':
      $mediaType = "application/atom+xml";
      break;
    case 'rdf':
      $mediaType = "application/rdf+xml";
      break;
    case 'rss':
    case 'rss2':
    default:
      $mediaType = "application/rss+xml";
  }
  $htaccess = @fopen ("{$dir}.htaccess", 'w');
  if ($htaccess) {
    fputs($htaccess, "<Files *.html>\n ForceType $mediaType\n</Files>\n");
    fputs($htaccess, "<Files *.gz>\n ForceType $mediaType\n</Files>\n");
    fclose($htaccess);
  }
}

added to .htaccess,top of file

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} ^/$
RewriteCond %{QUERY_STRING} ^feed=rss2?$
RewriteRule ^.*  /feed/?   [R,L]
RewriteRule ^feed$  /feed/   [R,L]

The code now traps /?feed=rss, /?feed=rss2, /feed and redirects them to /feed/ which is now cached appropriately by super-cache.

The changes/additions I made to Michael's fixes:

  1. compressed feeds (.gz extension) work
  2. the client's server required ForceType rather than AddType
  3. I also wanted the "extra" feed URLs captured, so apache would handle the static files, rather than forcing Wordpress to dynamically redirect them

Welcome to Apollo and AT&T Callvantage customers – August 28, 2009 (read more)

Lime Daley often acquires new customers when they leave a previous provider who either doesn't provide support, or the support that is provided consists of mostly trying to figure out what language they are speaking.   The person doesn't want to have to know technical details of why their site is getting the infamous 503 Internal Server Error, nor why their emails sometimes take 15 or 30 minutes to be delivered, and they are attracted to Lime Daley because they know they will get an engineer on the phone immediately, and problems are taken care of without hassle.

Asterisk: Audible Caller ID – June 06, 2009 (read more)

In addition to hosting phone services for other people, I also host my own phone numbers (personal and business).  I prefer to not have different phones for each line, but I like any phone to be used for either number at any given time.  I haven't gotten around to setting up distinctive ringing for the different lines, but instead, our home computer audibly announces the caller's name and number, and, for the business calls, which menu choice they made.

Asterisk: Recording Custom Sound Files – June 06, 2009 (read more)

Some of my customers have a hard time creating the space-efficient .gsm files for their voice menus, so I created a simple extension where they can call up the Asterisk server, and record the menu as they want it, and then it can be placed into their dialplan.  (The number of voice menus that are created are small enough so I haven't gotten around to making the system more robust, where it would automatically move the file into a customer accessible place (and keep track of which customer recorded which menu).

Asterisk: Blacklisting For Multiple Users – June 06, 2009 (read more)

There are a number of tutorials for people trying to setup blacklisting for their Asterisk server, but they all seem to assume that there is only one user on the server, or at least all users want to share the same blacklist.

Since I host for multiple, unrelated people, they don't necessarily want to share the same blacklist, so I had to come up with a configuration that would work for all customers.

«Previous   1 2 3 4 5 6 7  Next»