With a little side of applesauce...

Tuesday, June 9, 2009

Pidgen - Yahoo and Unknown Error 29

I have multiple Yahoo accounts, and found that one account wouldn't connect, and gave an "Unknown Error 29" message, plus a link to an image. The fix is found in this bug, and is to visit:

http://login.yahoo.com

and login. Once you do that, you can re-enable your broken account in Pidgin, and it should connect fine.

Monday, June 8, 2009

Google blocks my manual attempt to find credit card numbers

I had to post this, as I continue searching for information that should not be found on a clients' servers:
    We're sorry...

... but your query looks similar to automated requests from a computer virus or spyware application. To protect our users, we can't process your request right now.

We'll restore your access as quickly as possible, so try again soon. In the meantime, if you suspect that your computer or network has been infected, you might want to run a virus checker or spyware remover to make sure that your systems are free of viruses and other spurious software.

If you're continually receiving this error, you may be able to resolve the problem by deleting your Google cookie and revisiting Google. For browser-specific instructions, please consult your browser's online support center.

If your entire network is affected, more information is available in the Google Web Search Help Center.

We apologize for the inconvenience, and hope we'll see you again on Google.


Contrary to the wording, my access to Google Search was not blocked.

Thursday, June 4, 2009

Coldfusion / Postgresql - prepare Norwegian characters with diacritics for case-insensitive search

Postgresql is unable to perform case-insensitive searches on letters with diacritics, so I created a Coldfusion function to search and replace these special characters, with their regular expression equivalent. ie:
Lårdal becomes L(Å|å)rdal


Here is the example SQL statement after running the function:
SELECT * from bygdeboker WHERE kommune ~* 'L(Å|å)rdal'


Then encoding became an issue, as our Postgresql database is set to UTF-8 encoding, but Coldfusion assumes iso-8859-1 on form variables. Once we figured that out, the function started to work:

    <cffunction name="searchNorwegianSpecialCharacterCaseInsensitive"
returnType="string"
access="public"
output="no"
hint="Returns a string containing a regular expression-ready search for handling
special characters in both upper and lowercase. ie:
Bokmål becomes Bokm(Å|å)l

which would be used in:
SELECT * from bygdeboker
WHERE kommune ~* 'Bokm(Å|å)l'

Access seems to handle special character searches out of the box,
but this type of search is needed for Postgresql.

This function only handles the following Norwegian characters:
Æ,æ,Å,å,Ø,ø,Ä,ä,Ë,ë,Ö,ö,Ü,ü,É,é

@Param myString string on which to search and replace

@return newString string which is SELECT ready">
<cfargument name="myString" type="any" required="true">
<!--- letter we are not using à --->
<cfset lEntities = "Æ,æ,Å,å,Ø,ø,Ä,ä,Ë,ë,Ö,ö,Ü,ü,É,é">
<cfset lEntitiesChars = "(Æ|æ),(Æ|æ),(Å|å),(Å|å),(Ø|ø),(Ø|ø),(Ä|ä),(Ä|ä),(Ë|ë),(Ë|ë),(Ö|ö),(Ö|ö),(Ü|ü),(Ü|ü),(É|é),(É|é)">

<cfset newString = ReplaceList(arguments.myString, lEntities, lEntitiesChars)>
<cfreturn newString>
</cffunction>


Thanks to Bob for his help on understanding UTF-8/iso-8859-1 encoding!

Wednesday, June 3, 2009

Clamav - Unable to create temporary directory ERROR

I was getting the following error in /var/log/exim4/mainlog:
2009-06-03 10:46:38 1MBsfl-0000sC-SY malware acl condition: clamd:
ClamAV returned
/var/spool/exim4/scan/1MBsfl-0000sC-SY/1MBsfl-0000sC-SY.eml: Unable to
create temporary directory ERROR
2009-06-03 10:46:38 1MBsfl-0000sC-SY H=smtp.remote.com
[192.168.1.1] F=<user@bounce.remote.com>
temporarily rejected after DATA
2009-06-03 10:46:38 1MBsfa-0000rz-PH malware acl condition: clamd:
ClamAV returned
/var/spool/exim4/scan/1MBsfa-0000rz-PH/1MBsfa-0000rz-PH.eml: Unable to
create temporary directory ERROR
2009-06-03 10:46:38 1MBsfa-0000rz-PH H=(D7Y0PS91) [10.0.0.1]
F=<user@local.org> temporarily rejected after DATA


I floundered for a bit with so little information, but finally tracked it down to bad permissions on /tmp. The relevant clamd.conf line is:
TemporaryDirectory /tmp


And, the fix was:
chmod 1777 /tmp

Tuesday, June 2, 2009

Debian-exim showing as uid in ps output

In case you are wondering why you are seeing the uid instead of the username for Debian-exim:
106       6851  6343  0 16:28 ?        00:00:00 /usr/sbin/exim4 -bd -q30m



Here is the answer:
http://wiki.debian.org/PkgExim4UserFAQ#Whydoes.22ps.22displayExim.27saccountnameonlyasanumber.3F

Coldfusion - encode/decode diacriticals

I have found that the "HtmlUnEditFormat" function, in conjunction with built-in HTMLCodeFormat function handle all of my diacritical needs. Nice!

Here is the link to the function, plus the link to the original author:
http://speeves.erikin.com/2009/06/coldfusion-replace-html-ized-characters.html

Monday, June 1, 2009

Coldfusion - replace HTML-ized characters with their special equivalents

Coldfusion doesn't have an HTMLCodeFormat counterpart to decode HTML-encoded entities with their human-readable special characters, (a la PHP html_entity_decode() ). The following function takes care of that:

<cffunction name="HtmlUnEditFormat" access="public" returntype="string" output="no" displayname="HtmlUnEditFormat" hint="Undo escaped characters">
<cfargument name="str" type="string" required="Yes" />
<cfscript>
var lEntities = "&##xE7;,&##xF4;,&##xE2;,&Icirc;,&Ccedil;,&Egrave;,&Oacute;,&Ecirc;,&OElig,&Acirc;,&laquo;,&raquo;,&Agrave;,&Eacute;,&le;,&yacute;,&chi;,&sum;,&prime;,&yuml;,&sim;,&beta;,&lceil;,&ntilde;,&szlig;,&bdquo;,&acute;,&middot;,&ndash;,&sigmaf;,&reg;,&dagger;,&oplus;,&otilde;,&eta;,&rceil;,&oacute;,&shy;,&gt;,&phi;,&ang;,&rlm;,&alpha;,&cap;,&darr;,&upsilon;,&image;,&sup3;,&rho;,&eacute;,&sup1;,&lt;,&cent;,&cedil;,&pi;,&sup;,&divide;,&fnof;,&iquest;,&ecirc;,&ensp;,&empty;,&forall;,&emsp;,&gamma;,&iexcl;,&oslash;,&not;,&agrave;,&eth;,&alefsym;,&ordm;,&psi;,&otimes;,&delta;,&ouml;,&deg;,&cong;,&ordf;,&lsaquo;,&clubs;,&acirc;,&ograve;,&iuml;,&diams;,&aelig;,&and;,&loz;,&egrave;,&frac34;,&amp;,&nsub;,&nu;,&ldquo;,&isin;,&ccedil;,&circ;,&copy;,&aacute;,&sect;,&mdash;,&euml;,&kappa;,&notin;,&lfloor;,&ge;,&igrave;,&harr;,&lowast;,&ocirc;,&infin;,&brvbar;,&int;,&macr;,&frac12;,&curren;,&asymp;,&lambda;,&frasl;,&lsquo;,&hellip;,&oelig;,&pound;,&hearts;,&minus;,&atilde;,&epsilon;,&nabla;,&exist;,&auml;,&mu;,&frac14;,&nbsp;,&equiv;,&bull;,&larr;,&laquo;,&oline;,&or;,&euro;,&micro;,&ne;,&cup;,&aring;,&iota;,&iacute;,&perp;,&para;,&rarr;,&raquo;,&ucirc;,&omicron;,&sbquo;,&thetasym;,&ni;,&part;,&rdquo;,&weierp;,&permil;,&sup2;,&sigma;,&sdot;,&scaron;,&yen;,&xi;,&plusmn;,&real;,&thorn;,&rang;,&ugrave;,&radic;,&zwj;,&there4;,&uarr;,&times;,&thinsp;,&theta;,&rfloor;,&sub;,&supe;,&uuml;,&rsquo;,&zeta;,&trade;,&icirc;,&piv;,&zwnj;,&lang;,&tilde;,&uacute;,&uml;,&prop;,&upsih;,&omega;,&crarr;,&tau;,&sube;,&rsaquo;,&prod;,&quot;,&lrm;,&spades;";
var lEntitiesChars = "ç,ô,â,Î,Ç,È,Ó,Ê,Œ,Â,«,»,À,É,?,ý,?,?,?,Ÿ,?,?,?,ñ,ß,„,´,·,–,?,®,‡,?,õ,?,?,ó,­,>,?,?,?,?,?,?,?,?,³,?,é,¹,<,¢,¸,?,?,÷,ƒ,¿,ê,?,?,?,?,?,¡,ø,¬,à,ð,?,º,?,?,?,ö,°,?,ª,‹,?,â,ò,ï,?,æ,?,?,è,¾,&,?,?,“,?,ç,ˆ,©,á,§,—,ë,?,?,?,?,ì,?,?,ô,?,¦,?,¯,½,¤,?,?,?,‘,…,œ,£,?,?,ã,?,?,?,ä,?,¼, ,?,•,?,«,?,?,€,µ,?,?,å,?,í,?,¶,?,»,û,?,‚,?,?,?,”,?,‰,²,?,?,š,¥,?,±,?,þ,?,ù,?,?,?,?,×,?,?,?,?,?,ü,’,?,™,î,?,?,?,˜,ú,¨,?,?,?,?,?,?,›,?,"",?,?";
</cfscript>
<cfreturn ReplaceList(arguments.str, lEntities, lEntitiesChars) />
</cffunction>


This is taken from here.