February 26, 2008

Markdown and flickrnotes

Markdown makes writing in Movable Type painless and flickrnotes makes embedding flickr images relatively easy, but together, they make embedding flickr images completely painless.

I won't go into how to install both packages, so go make them both work, then come back.

I use the format %(flick-image-number) to engage flickrnotes from within markdown. To do this: open your Markdown.pl file (usually in the movable type plugin directory). Scroll down to sub _DoImages {. At the very end of the subroutine insert the following code (you will need to change the path to flickrnotes from /script/flickrnotes.php:

# Next, handle inline flickr images:  %(flickr_image_number)

$text =~ s{
    (               # wrap whole match in $1
      %\(           # literal paren
        [ \t]*
        <?(\S+?)>?  # src url = $2
        [ \t]*
      \)
    )
}{
    my $result;
    my $whole_match = $1;
    my $url         = $2;

    $result = "<script src=\"/script/flickrnotes.php?$url\"></script>";

    $result;
}xsge;

Alternately, you can download my pre-modified Markdown.pl file and simply replace your existing one.

Now try it out. Before markdown, linking to flickr was something like this: <a href="http://flickr.com/photos/spiffed/2283833703/"><img src="http://farm3.static.flickr.com/2362/2283833703_bd86b1477c.jpg?v=0">.

After markdown, it looked something like this: [![](http://farm3.static.flickr.com/2362/2283833703_bd86b1477c.jpg?v=0)](http://flickr.com/photos/spiffed/2283833703/)

With flickrnotes, it looked something like: <script src="/script/flickrnotes/?2283833703"></script>

Now it just looks like this:

 %(2283833703)

Posted by spiffed at 1:30 PM | Comments (0) | TrackBack

September 1, 2007

Installing Windows 3.1 in VMWare

If you plan on installing Windows 3.1 or even just DOS in VMWare, you'll need a few extra things. I have prepared a floppy image containing utilities for DOS in VMWare.

It contains the following:

Posted by spiffed at 12:39 AM | Comments (1)

July 21, 2007

Install VMWare ESX Server 3 in VMWare Workstation

VMWare Virtual Infrastructure ESX Server If you install ESX Server 3 into a VMWare Workstation virtual machine, you’ll find it installs perfectly fine, but the VMWare network adapter is not supported by ESX Server. Thankfully, the adapter is modeled after the AMD PCNet32 adapter and VMWare server is based on Linux.

Start VMWare ESX Server

Choose the Service Console from the boot menu Start your VMWare ESX Server virtual machine. When prompted by the Grub boot loader, choose the third option to enter “Service Console only”. This will start Linux, and place us at the root prompt.

Logging in as root Login as root (or login as another user and su to root). You should now be at the shell prompt.

Get the Kernel Modules

Floppy device configuration page While you could re-compile the kernel to enable the PCNet32 module and the mii module it depends on, I’ve already gone to the trouble. Just download the tar archive containing the modules.

After downloading the tar file, we’re going to mount the tar file as the floppy image for the virtual machine. Simply open the floppy configuration window (VM —> Removable Devices —> Floppy —> Edit), open the tar file under “Use floppy image”, and ensure the device is connected.

This bit of trickery allows us to read the tar image from the /dev/fd0 device. In reality, any smaller-than-a-floppy file can be read this way.

Install the Modules

extracting and chmod'ing the files Finally, we need to execute the following commands to execute and extract the files into the modules directory.

cd /lib/modules/2.4.21-37.0.2.ELvmnix/kernel/drivers/net
tar -xvf /dev/fd0
chmod 644 pcnet32.o mii.o

To confirm they’re really there, a quick directory listing of ls -l mii.o pcnet32.o.

Reboot

Finally simply reboot to enable the modules. If you have more to do in the service console, load the mii driver then the pcnet driver with:

insmod mii
insmod pcnet

Posted by spiffed at 12:44 AM | Comments (2)

December 29, 2005

Custom Drive Icons in Windows

If you've found a Windows format icon (.ico file) (from the excellent Icon Factory maybe) that you'd like to use as a drive icon, the process is simple.

Copy the .ico file in question to the root of the drive in question, and then on the drive, create a file called "autorun.inf".
Edit this file with any text editor, and insert the following (replacing icon.ico with the name of the actual icon file):
[autorun]
ICON="icon.ico"

Save the file, unmount and remount the drive, and you should have icons.

Posted by spiffed at 9:52 PM | Comments (0)

November 30, 2005

SMP computer crashes in DirectX heavy programs

Three of my Windows based PCs are Dual Pentium IIIs based on an Apollo Pro 133A chipset. Wonderful machines in every respect and dirt cheap, but they reboot at random during very heavy DirectX usage in Windows XP. There are a number of ways to remedy this.

If you never intend to use DirectX acceleration, you can disable it outright by dragging the 'Hardware Acceleration' slider under the 'Troubleshoot' tab of the 'Advanced' options of the 'Display Properties' control panel. (Or you could use a non-accelerated video card.)
If however, you’re stuck with only owning an Apollo Pro 133A based computer and have a gaming itch from time to time, the trick is to disable the second CPU. The easiest way I know of to do this, is to change the driver for you 'Computer' to a standard 'ACPI PC' from the usual 'ACPI Multiprocessor PC' setting.
Enter Device Manager and expand the 'Computer' node. Right click on 'ACPI Multiprocessor PC' and choose 'Update Driver'.
Choose to 'Install from a list...' and next.
Choose not to search '...I will choose the driver to install.' and next.
Choose from the list and next again.
Finally, finish and restart.
To return to SMP and enjoy the power of having both CPUs: enter device manager, and bring up the properties tab for your 'Advanced Configuration and Power Interface (ACPI) PC' (under Computer). Click the 'Driver' tab and then 'Roll Back Driver'.
Strangely it's not possible to choose the 'ACPI Multiprocessor PC' driver from the driver update wizard.
A final caution, do not update to a non ACPI driver, or you'll find all of your device require new drivers. MPS based drivers are particularly bad for this as VIA doesn't provide IDE drivers for them.

Posted by spiffed at 1:56 PM | Comments (0)

September 5, 2005

X11&SSH on Windows

Of the 3 most common desktop OS's (*nix, Mac OS X, and Windows), Windows is the only one not to include an X server of some kind. Several 3rd parties make X11 servers for Windows, but they're many many dollars. Thankfully, Starnet makes X-Win32 LX; X-Win32 is pretty much a fully featured X11 server, but it only accepts connections from your local IP/localhost. If you use SSH to connect to your remote X client, this isn't a problem for you. All Starnet asks in return is your email so they can send the registration info.

Posted by spiffed at 2:29 PM | Comments (0)

August 13, 2005

"Failed to save Local Policy Database"

Sometimes, after a fresh install of Windows XP, the security managment console refuses to apply changes, instead providing the error "Failed to save Local Policy Database".
Often the problem is that you do not have permission to add/change entries in the database; if you're part of the administrators group, you have permission to change the permissions though. Fire up regedit and give the Administrator group "Full Control" over "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\".

Posted by spiffed at 7:55 PM | Comments (0)

July 18, 2005

Fetchmail only retreiving mail headers on POP3

So you got fetchmail talking to some POP3 box, but it only pulls in the headers of messages?
The most likely problem is that your POP3 server kind of supports the 'TOP' command, returning only the headers of the top x messages instead of the full body like fetchmail wants.
The sollution is to use the -a flag which forces fetchmail to use RETR instead of TOP.

-a | --all
(Keyword: fetchall) Retrieve both old (seen) and new messages from the mailserver. The default is to fetch only messages the server has not marked seen. Under POP3, this option also forces the use of RETR rather than TOP.

Posted by spiffed at 2:32 PM | Comments (0)

May 7, 2005

Updating ATI's Catalyst drivers under Windows XP breaks DirectX

Since I moved to XP SP2, updating ATI's drivers for my Radeon has thoroughly broken DirectX. After a driver upgrade it is immediately obvious by the very slow screen redraws/updates. Running dxdiag and looking at a 'Screen--' tab will show DirectDraw and Direct3D to both be missing.

The solution is painfully simple; after running ATI's install utility and rebooting the computer (as requested), reinstall the driver via device manager:

Posted by spiffed at 10:52 AM | Comments (0)