Great UNIX tip from -- Use /usr/local for your software packages. It's cleaner.

Mac OS X, for example, is smart enough to realize that you’ll want to install your own apps, and makes special accommodations for you to do this without doing any harm to the rest of the system. On OS X, just create a folder in your home directory named Applications, and OS X will “magically” give it the Applications icon, and treat it the same way it does with the “normal” Applications folder at the root of your hard drive.

In the same way, UNIX and UNIX-like systems make the same provision for you, using a method suggested by the FHS … the /usr/local folder.

The FHS defines the /usr/local as the “tertiary hierarchy for local data installed by the system administrator.” Translated into English, this means put apps you build yourself here.

For old unix gurus this is obvious, but I strangely these conventions like /usr/local aren't really documented anywhere. You just kind of learn it as you go.

I'm starting to prefer self-compiled / self-built installations to even Ubuntu apt-get, since you get much better control over what version is being used. And for an admin, control is key.

Configuring MySQL's my.cnf config file... the slightly-better-than-default defaults.

user = mysql
pid-file = /var/run/mysqld/
socket = /var/run/mysqld/mysqld.sock
port = 3306
basedir = /mysql/
datadir = /data01/data
tmpdir = /tmp
thread_cache_size = 64
table_cache = 64
key_buffer = 64M
sort_buffer_size = 256K
read_buffer_size = 256K
read_rnd_buffer_size = 256K
max_allowed_packet = 1M
innodb_data_home_dir = /data01/data
innodb_data_file_path = ibdata1:1000M:autoextend
innodb_buffer_pool_size = 768M
innodb_additional_mem_pool_size = 8M
innodb_flush_log_at_trx_commit = 1
innodb_support_xa = 0
innodb_lock_wait_timeout = 50
innodb_log_files_in_group = 2
innodb_log_file_size = 64M
innodb_log_buffer_size = 8M
innodb_thread_concurrency = 8

MySQL settings are somewhat like magic. But perhaps this set of settings from should help out just a bit... especially since stock mysql settings in Ubuntu assume a box with 64 meg of RAM.

Unless you're partying like it's 1999, avoid the default defaults and go with these or one of the other ones listed on the site above.

Bleeding edge Javascript techniques from the creators of jQuery, Prototype, Dojo and YUI (liveblogged from #sxsw)

Cross posted from my personal posterous, where I posted a little bit while we were at SXSW...

Here are my quick notes from SXSW talk "More Secrets of Javascript LIbraries"

Bundling/dynamic loading
(Nate Koechley, YUI)
Javascript files for modern websites really have gotten huge. So it makes a difference how you load them. Some cool tools mentioned:

Meta language libraries
(Andrew Dupont, Prototype)

  • GWT turns Java into Javascript
  • Pyjamas turns Python in to Javascript
  • Cappuccino by 280 North turns Objective-J into Javascript
  • Google Caja turns Javascript into safer Javascript.

Google Caja sounds like a fascinating way to allow rich JS embeds on-page, perhaps solving the XSS dangers of embedding 3rd party JS. Definitely going to check that out later.

Dupont points to Resig's blog post about JavaScript Language Abstractions that a lot of these meta-language libs actually divorce you from being able to harness the full power of Javascript because you never actually learn how to write it.

"Thicker abstractions have more hassle, but offer greater rewards." --Andrew Dupont

At the end of the day, I think you use the tools that work best for you. I love what the guys are doing at 280 North, but a site like Posterous probably wouldn't use it because we're more of a native web experience. And in talking to them, they're not meant as a replacement for Prototype, etc. Cappuccino is really for extra-rich internet apps where you might use Flash/Air, instead of classic native websites. So different strokes for different folks!

(Becky Gibson, IBM / Dojo)

ARIA = Accessible Rich Internet Applications. New standard for supporting screen readers, magnfiiers, etc. Lets us JS developers create tree controls, tabs, and rich JS functionality but still have it work great for those needing assistive tech.

Biggest issues with accessibilty and rich JS content:
  • Adding dynamic controls that you create to the tab order -- by default only links and form controls are added, so if you add onClick listeners to direct divs, etc -- screen readers often can't even see these things.
  • AJAX'ed content that gets inserted into the div sometimes doesn't get picked up because assistive technologies don't get notifications of page updates.

Pretty cool stuff coming -- hopefully browser support comes sooner rather than later, since that determines when we'll be viably able to use these new standards. Might have to switch to jQuery to take advantage of this on Posterous.

Performance and Testing
(John Resig, jQuery)

Cool jQuery profiler plugin for Firefox tells you what's happening during load time.

"The very act of measuring it is causing the problems." --Resig. Timer resolution is only 15ms on Windows, for instance -- error rate 50 to 750% using your own JS timers.

Also cool: Firefox, Safari 4 and IE8 all have built-in JS profilers too.

Testing using FireUnit. You can actually add profiling data as part of tests, so if certain tasks take too slow in a given browser you can build that into your JS test suites. Cool.

John Resig is a badass. He just busted out Big-O notation on analyzing JS DOM manipulation.

The jQuery team runs 6 test suites in 11 different browsers (not even including multiple platforms) that must be run on every commit. But luckily they created TestSwarm so you can automate browser JS unit tests. Also awesome -- can script manual testing cross-browser too. Brand new project John Resig is working on now, but he says you can sign up on the site to hear about when it's up.