With a little side of applesauce...

Saturday, July 31, 2010

Apache2 - Symbolic link not allowed or link target not accessible

I usually map my DocumentRoot to my Eclipse workspace to simplify testing on my projects, but tonight, I wasn't able to get that mapping to work... Here was the error:

[Sat Jul 31 20:41:28 2010] [error] [client 127.0.0.1] Symbolic link not allowed or link target not accessible: /home/myhome/Documents

The fix is to change the Group directive from:

#Group ${APACHE_RUN_GROUP}
Group myusergroup

And, restart Apache.

Friday, July 30, 2010

Android - Wells Fargo app username

Some may know that the Wells Fargo web interface login will allow either a social security number or your self-generated username to login. What some may not know is that the Wells Fargo app on Android will only allow the self-generated username.

https://www.wellsfargo.com/privacy_security/fraud/protect/online_tips

Wednesday, July 28, 2010

Firefox 4 Beta 2 on Ubuntu Lucid 10.04 LTS

It is very easy to setup the new beta release of firefox. Essentially, visit http://www.mozilla.com/en-US/firefox/beta/, hit the download button, (which saved it to ~/Downloads), and then perform the following:
speeves@mycomputer:~/Downloads$ bzip2 -d firefox-4.0b1.tar.bz2 
speeves@mycomputer:~/Downloads$ tar xvf firefox-4.0b1.tar
firefox/
firefox/mozilla-xremote-client
firefox/platform.ini
firefox/README.txt
firefox/libsoftokn3.chk
firefox/libnssckbi.so
...
speeves@mycomputer:~/Downloads$ sudo mv /opt/firefox /opt/firefox4b1 #if firefox4beta1 is installed
speeves@mycomputer:~/Downloads$ sudo mv firefox /opt/
speeves@mycomputer:~/Downloads$ ln -s /opt/firefox/firefox ~/bin/firefox4
speeves@mycomputer:~/Downloads$ firefox4

I setup a link to firefox4, so that I could move back and forth between my production version and the new beta.

Tuesday, July 27, 2010

iTunes - sync HTC Aria

The simplest way to sync iTunes with your HTC Aria, (on Windows), is to:

1. Mount the phone as a drive
2. Create a Music folder on the phone, (which showed up as E: for me).
3. Create a desktop shortcut to c:\Documents and Settings\myuser\My Music\iTunes\iTunes Music
2. Double-click the shortcut, and line up the two windows so that you can see the iTunes directory, and the phone.
3. Copy-and-paste folders and files over to the Music folder on the phone

I'm guessing that DRM'd music files will not play on the Aria, but haven't tried it myself.

Saturday, July 24, 2010

Coldfusion - Displaying images from a database

I have found that serving images housed in a database is made easier by using a mixture of Coldfusion and jQuery/JSON. Here is how I did it:

1. Create a CFC with the setStudentImage function. This calls another CFC which simply returns a query with all matching user images, loops through the results base64-encodes the image, adds it to the array, then returns the array. (We need to base64-encode the image, so that we can hand it off to JSON, (Is this really needed? I haven't checked, as I notice that I am returning an array to Javascript, and not JSON)).

    <cffunction name="setStudentImage"
access="remote"
return="array"
hint="returns image via email

@return result array">
<cfargument name="email" type="string" required="false" default="">

<!--- Define variables --->
<cfset var data="">
<cfset var result = ArrayNew(1)>

<!--- do search --->
<cfset userObject = cfcCard.getImageByEmail( '#email#' )>

<!--- build result array --->
<cfloop query = "userObject">
<cfset base64Img = ToBase64( userObject.IMAGE )>
<cfset ArrayAppend( result, '#base64Img#')>
</cfloop>

<cfreturn result>
</cffunction>


2. We create our cfajaxproxy, and the Javascript to call Coldfusion for the image, then modify our img tag to display our image:
<cfajaxproxy cfc="#Application.cfcPath#.Card" jsclassname="o">

<script type="text/javascript">
function callSetStudentImage( useremail ) {
var inst = new o();
var result = inst.setStudentImage( String( useremail ) ) ;

return result;
}
...
function getStudentInfo( magstrip ) {
...
var userimg = callSetStudentImage( useremail );
if (userimg != "") {
$( '#myimg' ).attr( 'src', 'data:image/*;base64,' + userimg ).resize({maxHeight: 150, maxWidth: 200});


3. Ben Forta's method for displaying images from a database here, worked well for everything, except for size manipulation, so I turned to a great jQuery plugin, jQuery Resize Image Plugin, to do the resizing for me:
 $( '#myimg' ).attr( 'src', 'data:image/*;base64,' + userimg ).resize({maxHeight: 150, maxWidth: 200});


The only issues that I have now, are displaying the base64-encoded images in Google Chrome, (for some reason), and Firefox 4 Beta 1...

Coldfusion 8 - cfinput supports onBlur

Though it is not documented, cfinput does support the onBlur attribute.

Sunday, July 18, 2010

Android - set your favorite mp3 as ringtone

The built-in ringtone library only supports files up to 300 kb, (though I couldn't set the 297kb umyaya.ogg for St. Olaf College either...). The work-around is to install Rings Extended app (free) from the Android Market, then:

Home->Sound & Display->Phone ringtone->Music

Choose your favorite piece, and click OK to save.

Picked up this little nugget from Forged Defiance:
http://xanderx.com/2009/09/21/use-ogg-vorbis-for-lag-free-ringtones-on-android/

Thursday, July 15, 2010

Ubuntu Lucid - repeating keys

My repeating keys just turned off on its own today, and I needed to turn it off and then back on again to fix the issue:

System->Preferences->Keyboard->Uncheck 'Key presses repeat when key is held down'->Close

Then:
System->Preferences->Keyboard->Check 'Key presses repeat when key is held down'->Close

Firefox 4 Beta 1 doesn't render base64-encoded images

I've wasted a bit of time trying to load dynamic images into my page using jQuery and Coldfusion, when it hit me, that Firefox 4 Beta 1 could be part of the problem:

Tuesday, July 13, 2010

Ubuntu Lucid - transfer music files to iPhone iOS4 from Rhythmbox

iOS4 support is still limited on GNU/Linux at this point.

1. Rhythmbox sees the iPhone, and can transfer files to it, but doesn't update the iPhones database, so the iPod app doesn't see the music files.

- The cause is that libgpod doesn't support iOS4 yet (July 11, 2010).
https://bugzilla.gnome.org/show_bug.cgi?id=623899

Monday, July 12, 2010

Virtualbox - mount/unmount CD/DVD

I was having problems installing guest additions on Ubuntu Lucid, with the following error:
Could not mount the media/drive '/usr/share/virtualbox/VBoxGuestAdditions.iso' (VERR_DEV_IO_ERROR)

The answer was to:

"Shut down the guest. Go to the storage section of the guest settings in the VBox program.
Click once on the CD/DVD and then on the right select empty in the drop down list.
Start the guest and then click on install guest additions."


http://forums.virtualbox.org/viewtopic.php?f=7&t=27168

iPhone - activate on GNU/Linux?

I guess not. What a drag?! I am installing my Windows 7 VM in Virtualbox as we speak, so that I can download iTunes...

Wednesday, July 7, 2010

Firefox 4 Beta 1 on Ubuntu Lucid

It is very easy to setup the new beta release of firefox. Essentially, visit http://www.mozilla.com/en-US/firefox/beta/, hit the download button, (which saved it to ~/Downloads), and then perform the following:
speeves@mycomputer:~/Downloads$ bzip2 -d firefox-4.0b1.tar.bz2 
speeves@mycomputer:~/Downloads$ tar xvf firefox-4.0b1.tar
firefox/
firefox/mozilla-xremote-client
firefox/platform.ini
firefox/README.txt
firefox/libsoftokn3.chk
firefox/libnssckbi.so
...
speeves@mycomputer:~/Downloads$ sudo mv firefox /opt/
speeves@mycomputer:~/Downloads$ ln -s /opt/firefox/firefox ~/bin/firefox4
speeves@mycomputer:~/Downloads$ firefox4

I setup a link to firefox4, so that I could move back and forth between my production version and the new beta.