Archive for May, 2007
Xenix: The Microsoft Linux
By Justin Silverton

History of Xenix
Microsoft created their own variant of the unix operating system called xenix. They purchased a license for Version 7 Unix from AT&T in 1979, and announced on August 25, 1980 that it would make it available for the 16-bit microcomputer market.
Xenix varied from its 7th Edition origins by incorporating elements from BSD, and soon possessed the most widely installed base of any Unix flavour due to the popularity of the inexpensive x86 processor, even though the port created for Tandy Corporation computers proved to be more robust.
Microsoft did not sell Xenix directly to end users; instead, they licensed it to software OEMs such as Intel, Tandy, Altos and SCO, who then ported it to their own proprietary computer architectures. Microsoft Xenix originally ran on the PDP-11; the first port was for the Zilog Z8001 16-bit processor. Altos shipped a version for their computers early in 1982, Tandy Corporation shipped TRS-XENIX for their 68000-based systems in January 1983, and SCO released their port to the Intel 8086 processor in September 1983. A port to the 68000-based Apple Lisa also existed. At the time, Xenix was based on AT&T’s UNIX System III.
Version 2.0 of Xenix was released in 1985 and was based on UNIX System V. An update numbered 2.1.1 added support for the Intel 80286 processor. Subsequent releases improved System V compatibility.
The end of an era
Xenix served as a workhorse for small businesses. It had the following features that many businesses were looking for in an operating system:
- Simple, small, and stable
- Unlimited-user licenses
- Command-line administration
With all of the benefits, Xenix had some major disadvantages. CD-ROMs, PCI, and mice were not supported (or barely functional) and it just barely supported SCSI disks and tapes, or Networking.
Later versions of Xenix did have networking support (and increased hardware support), but by this time, Linux had already started making its way into the business world.
Screenshot

Source: http://en.wikipedia.org/wiki/Xenix
No commentsEmbedding flash movies made easy
By Justin Silverton
There are a few way to embed a flash object or movie in a webpage:
1) Default code from adobe
It consists of an Object tag with an Embed tag placed inside it. This is the most popular Flash embed method and is the default choice when publishing your Flash movie from the Adobe Flash IDE. This is the most compatible way to embed a Flash movie, and will work in the widest range of browsers.
2) A separate flash movie
This method involves placing a Flash movie on the index page of your website, and this Flash movie then checks the versopm variable in the Flash player and redirects the user either to the Flash content inside the site, or an upgrade page.
Issues to consider with this method
- It will damage your search engine positioning - Since you are now using your index page as an empty Flash detection page, when people search for you in Google or other search engines, many times, the description text ends up showing up as “Detecting Flash Player” or even no description at all.
- It is not valid HTML or XHTML
3) The Adobe Flash Player Detection Kit
Adobe has a flash detection kit that comes with Flash versions 8 and higher.
Issues to consider with this method
- Not very user friendly
- has the same issues as #2
A better solution is to use SWFObject, a Javascript Flash Player detection and embedding script.
The script can detect the Flash plug-in in all major web browsers (on Mac and PC) and is designed to make embedding Flash movies as easy as possible. It is also search engine friendly, degrades gracefully, can be used in valid HTML and XHTML 1.0 documents.
SWFObject works in all the current web browsers, including, on PC: IE5/5.5/6, Netscape 7/8, Firefox, Mozilla, and Opera. On Mac: IE5.2, Safari, Firefox, Netscape 6/7, Mozilla, and Opera 7.5+.
How to use it
Usage is straight-forward and simple. Include the swfobject.js Javascript file, then use a small amount of Javascript on your page to embed your Flash movie. Here is some example code:
<script type="text/javascript" src="swfobject.js"></script>
<div id="yourcontent">
This text is replaced by the flash object
</div>
<script type="text/javascript">
var so = new SWFObject("test.swf", "mymovie", "400", "200", "8", "#FFFFFF");
so.write("yourcontent");
</script>
Here is a description of its parameters:
var so = new SWFObject(swf, id, width, height, version, background-color [, quality, xiRedirectUrl, redirectUrl, detectKey]);
Create a new SWFObject and pass in the required arguments:
- swf - The file path and name to your swf file.
- id - The ID of your object or embed tag. The embed tag will also have this value set as it’s name attribute for files that take advantage of swliveconnect.
- width - The width of your Flash movie.
- height - The height of your Flash movie.
- version - The required player version for your Flash content. This can be a string in the format of ‘majorVersion.minorVersion.revision’. An example would be: “6.0.65″. Or you can just require the major version, such as “6″.
- background-color - This is the hex value of the background color of your Flash movie.
Optional arguments are:
- quality - The quality you wish your Flash movie to play at. If no quality is specified, the default is “high”.
- xiRedirectUrl - If you would like to redirect users who complete the ExpressInstall upgrade, you can specify an alternate URL here.
- redirectUrl - If you wish to redirect users who don’t have the correct plug-in version, use this parameter and they will be redirected.
- detectKey - This is the url variable name the SWFObject script will look for when bypassing the detection. Default is ‘detectflash’. Example: To bypass the Flash detection and simply write the Flash movie to the page, you could add ?detectflash=false to the url of the document containing the Flash movie.
The latest version can be downloaded here
7 commentsHow to find slow mysql queries
by Justin Silverton
It has happened to all of us running a website or application using mysql as its back-end database. Performance is suddenly very sluggish and you have no idea what is causing it. Now there may be other factors that are causing the issue (overloaded CPU, harddrive running out of space, or a lack of bandwidth), but it could also be a query that is not optimized and/or is taking much longer than it should to return.
How do you know which queries are taking the longest to execute? Mysql has built-in functionality for checking this through the slow query log.
To enable (do one of the following):
1) add this to /etc/my.cnf
log-slow-queries=/tmp/slow_queries.log
long_query_time=10
2) call mysqld with –log-slow-queries[=/tmp/slow_queries.log]
long_query_time is the maximum amount of seconds a query can take before it will be logged to the slow query log.
other related options:
–log-slow-admin-statements
Log slow administrative statements such as OPTIMIZE TABLE, ANALYZE TABLE, and ALTER TABLE to the slow query log.
–log-queries-not-using-indexes
If you are using this option with –log-slow-queries, queries that do not use indexes are logged to the slow query log.

If slow query logging has been enabled successfully, you will see “ON” in the VALUE field for “log_slow_queries” (shown above).
Note: Queries handled by the query cache are not added to the slow query log, nor are queries that would not benefit from the presence of an index because the table has zero rows or one row.
You may also run into the case where a query is slow at one time (such as when you are logging it) but not another (if you execute it manually):
- A table may be locked, causing the query to wait. the lock_time indicates how long the query waited for locks to be released
- none of the data or indexes have been cached in memory. This is common when MySQL first starts or your tables have not been optimizied
- a background process was running, making disk I/O considerably slower
- The server may have been overloaded with other unrelated queries at the same time, and there wasn’t enough CPU power to do the job efficiently
Log analysis
MySQL also comes with mysqldumpslow, a perl script that can summarize the slow query log and provide a better idea of how often each slow query executes.
6 comments





