Apache Tomcat Native Library (APR)

January 25th, 2010

If you have ever looked at the console or logs while starting a Tomcat instance on Windows you have probably seen the following line about APR.

INFO: The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path

As long as the “tcnative-1.dll”  is in the Windows PATH, generally you can place it in c:\windows\system32, but any other location in the PATH will work should you need it to be portable, or have different versions in use.

NOTE: Other Operating Systems use a similar approach as Windows to add an environmental variable, optionally you can also add the appropriate location to the “java.library.path” attribute used when calling the VM, if you are more technically inclined.

Cheers

ReplayTV Internet Video Sharing (IVS)

December 25th, 2009

ReplayTV, as a predecessor to the commonly known Tivo had two features that ultimately lead to the companies undoing:

  1. Commercial Advance (automatic)
  2. Internet Video Sharing

Obviously, advertisers did not like the first feature, and movie studios did not like the second. As these boxes could easily share ‘anything’ that they could receive it was/is relatively easy to send video that was captured from cable networks or DVDs over an internet connection.

Mind you that sharing is not as easy as it is over the file sharing networks, user interaction is required to both send and recieve files, and that process is far slower than most people would be willing to wait if they just wanted to ‘pirate’ something.

Several years ago, when I first purchased my unit, it was easy to go to http://www.myreplaytv.com/ to remotely manage my hardware, that service is now gone but in it’s absence there have been some creative solutions.

My ReplayTV (5xxx) ISN: 00004-54831-42373

Test your connection (or mine):
http://www.lhaven.net/ivstest/

Merry Christmas!

Windows NTFS Performance

December 22nd, 2009

For a very long time I was perplexed as to why my old 900Mhz Pentium-3 server outperformed many of my newer and faster machines, even when they all were running with essentially the same amount of memory and had the same 7200rpm hard-drives.

I recently realized that over the years, I had optimized the WindowsXP NTFS registry settings with a variety of software and manual edits, and thus had essentially changed the way that windows works with the drive itself.

Here are the current settings that these machines utilize, perhaps you can try them for yourselves:

WARNING: You need to be confortable making edits to your registry to do these changes, as such I will not document ‘how’ to open the registry itself, you can easily find that info anyways.  These are all DWORD settings.

HKLM\SYSTEM\CurrentControlSet\Control\FileSystem

  • DisableNTFSLastAccessUpdate  = 1
  • NtfsDisable8dot3NameCreation = 1
  • NtfsDisableLastAccessUpdate = 1
  • NtfsMftZoneReservation = 2

Cheers

Dotless IP Address

December 11th, 2009

This is a concept I had forgotten about until recently, it can often serve as a simple means of code obfuscation and is also sometimes referred to as “Decimal Address”.

Some background:

  • DNS is used to convert a URL/domain name into an IP address that is used to contact the remote machine.
    EXAMPLES:
    localhost = 127.0.0.7
    giantgeek.com = 99.138.127.198
  • IP addresses (as IPv4) are represented as groups of 4 hexadecimal or decimal octets.
  • Those numbers can be plugged into a simple formula to be represented as a single large integer.

As such, you can use the following as equivalents:

  • http://localhost
  • http://127.0.0.1
  • http://2130706433

REFERENCES:

JavaScript StringBuffer

November 29th, 2009

Eventually, you come to a point where the performance of JavaScript becomes an issue.  Most modern browsers have made significant improvements  in their javascript engines, unfortunately Microsoft has yet to do the same.  MSIE’s (at least up to and including MSIE8)  javascript performance lags far behind Mozilla/Firefox, Safari, Chrome and Opera.

String concatenation is extremely slow in MSIE,  but arrays are generally fast… as such it’s often beneficial to implement an object similar to the Java StringBuffer (or StringBuilder) for JavaScript.

The StringBuffer implementation… you can customize to make it more functional, but this is the core:

function StringBuffer(){
this.buffer = [];
}
StringBuffer.prototype.append = function append(string){
this.buffer.push(string);
return this;
};
StringBuffer.prototype.toString = function toString(){
return this.buffer.join(”");
};

Example:

function example_slow(x1,x2,x3){
var rc = x1;
rc+=x2;
rc+=x3;
return rc;
}

function example_fast(x1,x2,x3){
var sb = new StringBuffer();
sb.append(x1);
sb.append(x2);
sb.append(x3);
return sb.toString();
}

References:

Cheers

Data URL’s (aka HTML Inline Images)

October 29th, 2009

Here’s a useful trick for minimizing server HTTP connections, unfortunately it’s not universally supported so you will need to provide alternate methods for non-supporting browsers (such as MSIE).

This works by placing the content of the image into the URL itself, as such there’s no need to open up a new server connection and no extra caching at any tier.

<img src=”data:image/gif;base64,R0lGODlhEAAOALMAAOazToeHh0tLS/7LZv/0jvb29t/f3//Ub/ /ge8WSLf/rhf/3kdbW1mxsbP//mf///yH5BAAAAAAALAAAAAAQAA4AAARe8L1Ekyky67QZ1hLnjM5UUde0ECwLJoExKcppV0aCcGCmTIHEIUEqjgaORCMxIC6e0CcguWw6aFjsVMkkIr7g77ZKPJjPZqIyd7sJAgVGoEGv2xsBxqNgYPj/gAwXEQA7″ alt=”embedded folder icon” width=”16″ height=”14″ />

Enable .htaccess on Apache HTTPD Server

October 20th, 2009

Occasionally, there becomes a need to expose the use of the .htaccess file to the domains hosted on your Apache server. This technique is particularly useful when you host websites for external clients (or developers).

The steps to enable it are relatively easy,

  • Uncomment the ‘httpd.conf’ line that reads as:

    LoadModule rewrite_module modules/mod_rewrite.so

  • Review (and replace as appropriate) all cases of :

    AllowOverride None with AllowOverride All

    in the following files:
    httpd.conf, /extra/httpd-vhosts.conf, /extra/httpd-autoindex.conf and any related files you may be using.

  • Add the .htaccess file into the appropriate websites/folders
  • Restart the server to accept the changes

NOTE: If you develop or host on Windows, you’ll likely have problems creating the file because there is no filename, just a file extension. You can create (or download) it from any non-Windows host and use it without additional changes. Apache does let you use a different filename, but you also need to be careful to update related security configuration that is used to prevent download of such files.

Happy hosting!

Free Router Firmware Upgrades

September 2nd, 2009

I’ve been using an old Linksys WRT-54G (version 2.0) for years, while Linksys released a few firmware updates over the years, none of them really added any new functionality. Thankfully, they had released the source code to the open-source community and several excellent releases have been made available.

Additions such as real-time monitoring/graphing, boosting wireless transmitter power, QoS (Quality of Service) and WOL (Wake-on-LAN) have been added making the router and network much more useful and valuable.

The most prominent versions are:

NOTE: There are several branches on both of these, you can read more at their respective websites.

I was easily able to update from the Linksys firmware (4.21.1) to Tomato 1.25 in only a few minutes, it was even capable of saving my existing configuration making the transition that much easier!

Happy Networking

Open Source Desktop Virtualization

June 24th, 2009

Through the years, I’ve had to develop, maintain and support software on a variety of systems. Unfortunately, it’s often impossible to maintain specific software versions or configurations installed on physical machines. In the realm of web development, this becomes increasingly complex because of the rapid release of multiple browser versions.

To aid in testing, I’ve found that it’s often best to run these configurations in Virtual Machines, I’ve used VirtualPC and VMWare in the past, but have recently become a fan of Sun’s OpenSource release of VirtualBox as it runs on a wide variety of host systems and supports most x86 based operating systems as clients.

Cheers

Atari 2600 Emulator

April 29th, 2009

While it was not technically a personal computer, the Atari 2600 was one of the first pieces of technology that I had experience with in my youth. I’ll likely outline the progression of machines/operating systems in a future post.

I’ve heard about Stella for quite a while, but never had any time to fiddle with it. Recently I found that Ubuntu includes an installer for it and took a chance look. Other versions are available for MacOS and Windows.

I also found a few websites that contain ROM images for the emulator and was playing some of my old games in a matter of minutes.

For those legal types out there… I actually do own the games that I played, in fact, they are currently boxed up in my basement.

References:

Happy Retro Gaming!!!