In a mirror, dimly A blog at the intersection of geek, faith and creative writing.

11Feb/100

Never gonna be alone (Nickelback)

With valentine’s day coming, I felt the need to let the music speak.

(listen)

Time, is going by, so much faster than I
And I’m starting to regret not spending all of here with you
Now I’m wondering why I’ve kept this bottled inside
So I’m starting to regret not selling all of it to you
So if I haven’t yet, I’ve gotta let you know

You’re never gonna be alone from this moment on
If you ever feel like letting go, I won’t let you fall
You’re never gonna be alone, I’ll hold you ’til the hurt is gone

And now, as long as I can, I’m holding on with both hands
‘Cause forever I believe
That there’s nothing I could need but you
So if I haven’t yet, I’ve gotta let you know

You’re never gonna be alone from this moment on
If you ever feel like letting go, I won’t let you fall
When all hope is gone, I know that you can carry on
We’re gonna see the world out, I’ll hold you ’til the hurt is gone

Oh, you’ve gotta live every single day
Like it’s the only one, what if tomorrow never comes?
Don’t let it slip away, could be our only one
You know it’s only just begun, every single day
Maybe our only one, what if tomorrow never comes?
Tomorrow never comes

Time is going by so much faster than I
And I’m starting to regret not telling all of this to you

You’re never gonna be alone from this moment on
If you ever feel like letting go, I won’t let you fall
When all hope is gone, I know that you can carry on
We’re gonna see the world out, I’ll hold you ’til the hurt is gone

I’m gonna be there always
I won’t be missing a word all day
I’m gonna be there always
I won’t be missing a word all day

Filed under: Music No Comments
6Feb/101

Twitter Updates for 2010-02-06

  • "The Observation Deck" (Naomi Epel) – a great source of writing prompts! #

Powered by Twitter Tools

Filed under: Twitter 1 Comment
5Feb/100

Writing Prompt

I was poking through “The Observation Deck” (Naomi Epel) – pick a card at random and look up its description in the book, then use it as a starting point for writing.

I pulled “Choose the right name” – which concludes with an interesting exercise:

Brainstorm a list of interesting names, or pick one from the phonebook. Then sketch a written portrait of the person who might bear such a name. Assign an age, occupation and marital status. Describe hobbies, mode of dress and favourite foods. Think of three other names such a person might bear.

Filed under: Writing No Comments
4Feb/101

The Phantom Of The Opera

Comparison of versions:

Sarah Brightman and Antonio Banderas

(did you know that ‘Puss in Boots’ from “Shrek” could sing?)

Michael Crawford and Sarah Brightman

Steve Harley and Sarah Brightman

(ok, so who gave them permission to re-write the lyrics?)

Gerard Butler and Emmy Rossum

(one minute he’s killing Persians in “300″ then he’s singing, who ever knew he had the voice?)

Filed under: Music 1 Comment
2Feb/100

“Eve of the War” (from Jeff Wayne’s “War of the Worlds”)

“Wild” performing a cover of “Eve of the War” live

now, “Wild” broke up, and two members went on to form the band “Escala” (briefly called “Scala”)

Escala – Kashmir Featuring Slash (of Guns ‘n’ Roses fame)

I know that track – its been done before by the quartet “Bond”. Which version do you prefer:

Bond – Kashmir

Its a good thing that Escala renamed themselves, as YouTube turned up the “Scala” choir cover version of “Enjoy the Silence” (Depeche Mode)

which begs a comparison with other versions of the song:

Depeche Mode (the original)

Cover versions

Tori Amos

Breaking Benjamin

http://www.youtube.com/watch?v=-kd680Cz8gg

Yana

http://www.youtube.com/watch?v=gvRz0ouXOhw

Van Helsing & Van Giessen

HIM

Lacuna Coil

At the end of the day, my vote rests firmly with Lacuna Coil as being the best cover of this track.

Filed under: Music No Comments
30Jan/100

Bryan Adams – “Heaven”

I was listening to a streaming radio station (on Pandora.com) that I’ve trained to play some nostalgic 80′s rock tracks. It played THE PERFECT song for the mood I was in, almost like it was reading my mind.

In a few days it’s the anniversary of my wife and I’s first date – we were married 18 months to the day from our first date – so the date has more significance than Valentines! So, a musical, emotional dedication to 16 years since the first date. (yes, and looking forward to a 15th wedding anniversary in August 2010).

Original

http://www.youtube.com/watch?v=3eT464L1YRA

Unplugged

http://www.youtube.com/watch?v=Z7b37l_B4vI

Cover versions

DJ Sammy featuring Yanou

Do (unplugged)

Leticia and Tito

Filed under: Music No Comments
10Jan/100

Twitter Updates for 2010-01-10

  • Alright, I'm fed up of waking up and seeing snow outside the window. Someone bring back summer, and do it quickly! #

Powered by Twitter Tools

Filed under: Twitter No Comments
13Dec/090

PHP-on-Tomcat (Part II)

The original goal of being able to run PHP on top of Tomcat was to allow simple development of PHP based applications like WordPress and/or bbPress. To get these working I needed a database.

The wildly popular mySQL database has a nice installer for OS X. Mine installed to /usr/local. I did the install ages ago and forgot what the “root” database user password was. Ooops! No matter, there are some great resources online talking about how to go about resetting permissions. I opted for the incredibly easy, but utterly insecure method (from inside the terminal) :

  1. Stop the existing server
  2. Restart telling it to turn off permissions: mysqld_safe --skip-grant-tables --user=_mysql &
  3. Jump into the mysql shell application: mysql -u root mysql
  4. Change the “root” password: UPDATE mysql.user SET Password=PASSWORD('#########') where user='root';
  5. Persist privilages: FLUSH PRIVILEGES;

Next on the list was exposing my mySQL database to the Tomcat hosted PHP code. Step 1 was making sure I have mySQL JDBC drivers installed, Step 2 was creating a JNDI datasource in the context, and step 3 was getting the PHP to use it.

The officially supported mySQL Connector/J was a quick download. The JAR file for it was dropped into the $CATALINA_HOME/lib directly. Good to go. The context file was more of a challenge, under the $CATALINA_HOME/conf/Catalina/localhost I created an XML config file that matched the name of my webappphp.xml – where I declared the JNDI datasource. It took some tweaking and reading around but finally ended up coming together:

<Context reloadable="true">
    <Resource
        name="jdbc/mydata"
        auth="Container"
        type="javax.sql.DataSource"
        username="root"
        password="#########"
        driverClassName="com.mysql.jdbc.Driver"
        url="jdbc:mysql://localhost:3306/test"
    />
</Context>

The documentation for Quercus states

Scripts can use the jndi name directly:

<?php

  // standard PHP
  //mysql_connect($host, $username, $password, $dbname);

  // using JNDI lookup
  mysql_connect("java:comp/env/jdbc/myDatabaseName");

?>

But that doesnt help me to run WordPress as I’m not about to go modifying their code. Never fear, there’s another option. The documentation for Quercus also says that you can put an entry into the WEB-INF/web.xml file that forces all database connections to go through the same underlying JNDI datasource:

.
.
.
    <!--
      Tells Quercus to use the following JDBC database and to ignore the
      arguments of mysql_connect().
    -->
    <init-param>
      <param-name>database</param-name>
      <param-value>jdbc/test</param-value>
    </init-param>
.
.
.

So, a quick update to point at my own datasource and wall was ready to go. I downloaded and unzipped wordpress into the PHP webapp directory, pointed a browser at http://localhost:8080/php/wordpress and found myself stepping through the famous 5 minute install. Less than 5 minutes later I was looking at the main page of a fully-functioning WordPress install.

Filed under: Java, Tech, Wordpress No Comments
12Dec/090

Twitter Updates for 2009-12-12

  • PHP-on-Tomcat on OS X, using a JNDI/JDBC datasource out to mysql, running wordpress – take that LAMP stack! :-) #

Powered by Twitter Tools

Filed under: Twitter No Comments
12Dec/092

PHP-on-Tomcat

I am generally a Java programmer (if my day-job is to be believed) and hacking my way through Apache configuration isnt my idea of a fun evening. For some odd reason my trusty old black MacBook hasnt had the best of times when I try to enable “web sharing” and then try executing PHP scripts – all I get is a dump of the source. Time for a creative solution to the problem!

The folks that created the Resin App Server have a 100% Java implementation of PHP 5 released under the Open Source GPL license, known as Quercus. So step 1 was to download the latest release that will run on non-Resin app servers: quercus-4.0.1.war.

This was the point where I also realized that I dont have an up-to-date install of Apache Tomcat on my system either. Step 2 was to go download Tomcat 6.0.20 and install it.

Many applications need to know where Tomcat lives, and that means setting the CATALINA_HOME environment variable to point to the install. In a terminal I edited the global startup file for the terminal: sudo vi /etc/bashrc to add the line:

CATALINA_HOME=/Users/paul/Documents/Devt/3rd-party/apache-tomcat-6.0.20

Step 3 was to $CATALINA_HOME/bin/startup.sh to start tomcat and then point a browser at http://localhost:8080/quercus-4.0.1/ where I saw confirmation that all was well:

Testing for Quercus™…


Congratulations! Quercus™ Open Source 4.0.1 is interpreting PHP pages. Have fun!

I didnt like the URL though, but that’s easily changed. I simply nuked the quercus-4.0.1 directory under $CATALINA_HOME/webapps and renamed the Quercus WAR file “php.war”. I bounced Tomcat and bingo – a “php” directory I could drop files into. As a final test, I created info.php

<?php

    phpinfo();

?>

and hit it on the pretty URL: http://localhost:8080/php/info.php. All displayed correctly. I was off and rolling running PHP on top of Apache Tomcat! Stay tuned for Part II – getting WordPress running on top of PHP running on Tomcat!

Filed under: Java, Tech 2 Comments