Movable Type is dead, long live Word Press

November 21st, 2004

Somewhat on the spur of the moment I decided to switch from to WordPress for the blog portion of this site. The switchover was all but seamless.

I’m sure no one really wants to hear the details, but what started as a Sunday morning project quickly became a Sunday project. The initial transfer to WP was actually quite simple and painless, it was the CSS that had me tinkering. I probably should have just done a quick re-work of the site and come out with a simple new design, but I wanted to see how hard it would be. In the end things look roughly the same and some parts look better in my opinion.

The main draw to WP for me was the simplicity of the configuration and ease of use of the admin section. It took me hours to get the archival format right for MT, but I had that done within the first 5 minutes of the install today. I also felt a need to switch shortly after MT decided to start charging for their previously free software. That kind of change irks me.

Well my Mental Train just derailed, so I guess . . . stay tuned for some pictures or notes about my upcoming project building one of these.

More Backing up via VBScript

October 14th, 2004

A few days late, and perhaps not in it’s most efficient form (well not perhaps . . .) Here is the script that copies a directory from one place to another. Slight enhancements enable it to keep the previous two backups and to keep a relatively well formed log detailing start and finish. Enjoy!

I use it to copy my ‘My Documents’ folder to a networked drive. I make no guarantees that it will work for you, in fact, I can almost guarantee that it will often fail, since it does so on a relatively regular basis for me, most likely because my wireless connection which it uses to do the copying is a bit spotty on service at times.

‘A quick script by Elliot Anders to backup a folder to another drive.
‘This script will keep 2 copies of the backed up folder.
‘It deletes the old copy, renames the more recent copy as the old one and copies
‘the current source folder to become the new backup.

‘”'’Configure the folders here:
sourceFolder = “C:\Documents and Settings\USERNAME\My Documents”
previousBackup = “K:\Previous My Documents”
currentBackup = “K:\Current My Documents”

logFile = “K:\backupTheStore.log” ‘This should probably be located on
the drive with the backups but not in the backup folder

‘”'’Do not make changes below this line”””’

Dim FSO, logFileStream, tempFileStream
Dim strSrcDir
Set logFSO = CreateObject(”Scripting.FileSystemObject”)
Set tempFSO = CreateObject(”Scripting.FileSystemObject”)
Set backupFSO = CreateObject(”Scripting.FileSystemObject”)

‘”'’Make a log file if this is the first time

if logFSO.FileExists(logFile) = false Then
       logFSO.CreateTextFile logFile, True
       Set initialize = logFSO.openTextFile(logFile, 2)
       firstText = “Log Created at ” & Now
       initialize.writeLine firstText
       initialize.close
End If

‘”'’Tell the log that we are starting

beginningText = “Backup of ” & sourceFolder & ” began at: ” & Now

‘”’Error here
tmp = “C:\temp\tmp.txt”
if tempFSO.FileExists(tmp) = false Then
       tempFSO.CreateTextFile tmp, True
End if

Set tempFileStream = tempFSO.OpenTextFile( tmp, 2)
tempFileStream.WriteLine beginningText
tempFileStream.close

Dim tmp, logFile
‘Create FileSystemObject
Set appendFSO = CreateObject(”Scripting.FileSystemObject”)
‘Open file for appending, don’t create
Set ftop = appendFSO.OpenTextFile( tmp, 8, false)
‘Open for reading
Set fbot = appendFSO.OpenTextFile( logFile, 1, true)
‘Append the contents of second file to first
ftop.Write fbot.ReadAll
fbot.close
ftop.close
appendFSO.DeleteFile(logFile)
appendFSO.CopyFile tmp, logFile

‘”'’Delete the old backup

If backupFSO.FolderExists(previousBackup) Then
       backupFSO.DeleteFolder previousBackup, true
End If

‘”'’Move the new to be the new old

If backupFSO.FolderExists(currentBackup) Then
       backupFSO.MoveFolder currentBackup, previousBackup
       Set f = backupFSO.CreateFolder(currentBackup)

End If

‘”'’Copy the source folder to the backup location

backupFSO.CopyFolder sourceFolder, currentBackup

‘”'’Tell the log we are done

endText = “Backup of ” & sourceFolder & ” was Successfully Completed at: ” & Now
Set tempFileStream = tempFSO.OpenTextFile( tmp, 2)
tempFileStream.WriteLine endText
tempFileStream.close

‘Open file for appending, don’t create
Set ftop = appendFSO.OpenTextFile( tmp, 8, false)
‘Open for reading
Set fbot = appendFSO.OpenTextFile( logFile, 1, true)
‘Append the contents of second file to first
ftop.Write fbot.ReadAll
fbot.close
ftop.close
appendFSO.DeleteFile(logFile)
appendFSO.MoveFile tmp, logFile

Windows Script Host VBscripting

October 1st, 2004

Before I begin, if anyone is interested, I start my new part-time job today working at an elementary school for The Mohawk Regional School District.

Lately I’ve been diving deeper into the world of Windows, I generally stick to my comfortable, stable, and virus free OS X, but once in a while (much more than before since my new job will be 99% windows work) I delve into the inner workings of a Windows machine. Lately it has been Windows Script Host, or WSH.

I’ve been working on a project that never seems to go away. Not that I didn’t finish the project, but it involves backing up a computer. Something I should do way more diligently and often. So the basic idea here was that the computer was usually backed up every evening onto a CD. Only 200 MB of data needed to be saved at any given time, but that’s some 313 CD’s a year (no Sunday backup.) And really only the past day or two needed t be saved. So along I come, and thinking there must be an equivalent to AppleScript for PC, I thought this would be an easy job. To tell the truth, copying the data wasn’t really that hard, writing the log got messy.

Network issues aside (this was a wireless connection to get the data out of the building) the basic concept was to use Windows Explorer and Scheduled Tasks to move the data to another machine each morning at 2:00 AM. After dinking around for a while with the Backup Utility I decided to go with WSH as it would give me a usable backup. With the backup utility everything is placed in one archive file and can’t be used unless it is restored.

WSH can mount a file server, but I thought it might be nicer to pass this job off to XP, so I mapped a drive and had it re-connect at login (Windows calls it Logon?) Then I simply copied the contents of the folder to be backed up over to this new drive. Voila! It worked, sort-of . . . as long as the network was up. So back to fixing the network. . . And then, the great idea that took 2 or 3 times as long to implement. A log file. To cut to the chase, I wanted the log file written in reverse chronological order so the newest information would be at the top. This requires more work than it should. It seems to me Perl can do this in it’s sleep (correct me if I’m wrong.) Any way, after lots of grammar errors and a temp file I got it all working, and wish to share the fruits of my labor with all of you. Except you’ll have to wait, because I left the final version of the other computer and haven’t backed it up yet. Ooops.

One final comment, then hopefully later today I’ll post that script, though I better preface it with this note:

Use the script at your own risk, the code is not pretty . . . yet, but I’ll work on it eventually (or not.) It works for me, if it erases all of your files, they are gone.

Oh yeah, it keeps two backups of whatever directory you send it, so that if it stops in the middle of a backup you still have the previous.

So now onto my current Beef with Windows file sharing. . . .
Can someone explain to me why I can connect to an XP share with OS X without a password . . . OR USERNAME?!!!??! Hello security risk! With XP to XP it behaves okay, though both machines have the same user account so I guess I don’t really know if it is using a password scheme. But with my Mac I’m in like Flynn! I just don’t get it, commmon Redmond, lets get this thing locked down tight.

Okay, enough already, and this should be long enough to push my previous post so that it doesn’t run into my navigation. If anyone knows a quick and dirty fix for removing Safari’s cache permanently (that doesn’t involve installing an application, I’d love to hear it, because last I checked that wasn’t sticking out the right side of the middle section.

Centered 2 Column Design

September 24th, 2004

After successfully finding a centered 2 column design and hacking it to pieces before installing it on my own site, I had some trouble with forms, IE 5.2 Mac, and the two column layout. I thought I would share my experience with all of you here.
I’ll pretty much cut to the chase, but I wanted to point out that for some reasonALA’s form did not work for me. There were a variety of others that I found that also didn’t work, I can’t say why because I really don’t know. I think it had something to do with my wanting the form on the left side of a 2 column layout.
So the final solution was this:

<div id="allcontent">
<h4> Interested in Pixel Conductor's services? </h4> <h5> Send him a note below. </h5>
<div id="leftcontent">
<div id="form">
<form method="post" action="http://www.pixelconductor.com/cgi-bin/cgiemail/cgiemail/station.txt">
<div>
<label for="name">Name:</label><input type="text" name="name" id="name" />
</div>
<div>
<label for="email">E-mail:</label><input type="text" name="email-required" id="email" />
</div>
<div>
<label for="text">Request:</label>
<textarea name="request" id="text" cols="20" rows="8">
</textarea>
</div>
<div>
<input type="submit" value="Send Your Message" class="formbutton" />
</div>
<div class="spacer">
</div>
</form>
</div>
</div>
<div id="rightcontent">
<img src="/images/ticketstub.jpg" alt="Ticket Stub" />
</div>
</div>

(Thanks to BBedit for the code converison.)

Nothing special here, just three main divs, one that holds everything and one for each side. The CSS here:
div#form {
width: 320px;
padding: 0;
margin: 1em;
margin-top: 0;
border: 1px solid #AF9101;
text-align: right;
}

label, input, textarea {
display: block;
width: 180px;
float: left;
margin-bottom: 10px;
}

label {
text-align: right;
width: 100px;
padding-right: 10px;
}

input.formbutton {
margin-left: 110px;
width: 80px;
width: auto;
text-align: center;
padding-right: 2em;
}

This bit of code comes mostly from a form on html dog. It seems that getting the textarea and associated label to line up correctly was the most difficult part, (which actually doesn’t happen on the html dog site, but does on the ALA site) IE Mac does not like placing a label to the left of a text box. Ah well, so bask in it’s functionality and let me know if you have any better solutions.

Managing DNS Servers

September 18th, 2004

I never cease learning. Today I woke up worrying about a site I just moved to a new server. For some reason the DNS hadn’t propagated overnight. In my experience this usually takes a couple hours at most. After dinking around for a couple of minutes wondering if it was ever going to change, a light bulb went off in my head. Why not use the new DNS server as my DNS server, then I would be sure to get the moved site as opposed to the old site.

The additional benefit of this thought cloud is raining down on me harder than the deluge outside. This is AMAZING! This means that whenever I move a site I can move it to the new server, tell that host that the site is going to be moved so they update their DNS servers, and then before I ever actually switch over, I can plug in their DNS server into my Network Control Panel and see and work on the new site as it will appear until I’m satisfied and then I can make the official switch later.

Have a great weekend everyone.

pixelconductor.com

September 16th, 2004

At long last I have found enough free time between working on livesuperfoods (selling health food online soon) and my various other projects to put together a site advetising my coding skills and my freedom to work for others.

I am actually quite happy with the result and pleased with myself for getting it together so quickly. It was a battle with CSS once again to get the placement of everything correct, and I still haven’t figured out how to do two columns of div’s centered on the page, but that will come soon. Thanks to glish for their reservoir of good coding for some hints to get me pointed in the right direction.

Only one more thing on my agenda and that is to wait for my new PC to come in the mail. I finally broke down, mostly because of the various bugs in IE Win CSS and bought a bran-spanking-new 2.4 GHz machine so that I can hack my standards compliant coding into pieces that actually work in that environment. Ah well, you can’t win everything I guess. If anyone is looking for a standards compliant hand coder for websites let me know.

Comments

August 29th, 2004

I have returned. It’s been over 2 months since my last post, and I’m still short on time. Farm camp was amazing, the goats are my favorite, not to mention fresh goat cheese.
Imagine my surprise when I returned and found that my comments had been generally filled up. People were actually reading my site! That is something I had never expected.
As you can probably guess only one of the comments was actually real. Sad but true. I had been spammed, I’m not even really sure what you would call it, but it seems that others think it is okay to advertise their questionable practices on my site. I’m not sure what they think they are going to get out of posting multiple identical links in a row that congratulate me on the coolness of my site in exactly the same language, but then are posted by “great teens” or some name to that effect. So for now commenting will be turned off, at least until I update my blacklist.
If you are a regular reader, or irregular, thanks for dropping in. Don’t expect a new post in the too near future as I still have a bunch of work to do on my new digs that takes priority over my blogging.

Farm Camp and other unwired places

July 23rd, 2004

I was visiting my grandmother the other day on a day off from work. She wanted me to do some updates to her site, and to show her a few of the sites I had done. I went to my site and much to my surprize found that there was nothing here! It turns out that I haven’t updated my blog in a few months, and that when you don’t update mt it tends to move everything to the archives. Too bad my homepage depends on having some quality information to make the layout function correctly.

Being out of touch from computers has been great, though keeping my skills sharp has been challenging. Luckily I’m equiped with a functioning homemade iPod charger and plenty of people to talk to. Well, I’ve bumped the number of days mt will display up to 200, so hopefully with all the moving I’m doing and looking for jobs and such, I’ll be able to keep something here for others to look at and read.

iPod Firewire Issues

May 13th, 2004

On top of my battery issues I’ve been having intermittent firewire connectivity issues. Sometimes I’ll plug in my iPod and my computer will launch iTunes immediately, other times I have to jiggle the firewire cable to get it to recognize. No longer.

I looked into the iPod repair programs available online, but the best available was $55. So I decided to take matters into my own hands. I’d seen galleries of iPod disassembly over at ipodlounge so I knew it must be possible, but there are very few step by step tutorials on getting the device apart beyond taking out the battery.

After sweating a few bullets I jumped on in and took apart my little machine. I found exactly what I expected: a broken connection on the firewire port.

Not wanting to shell out $55 or risk melting the iPod with my newfound soldering ability, I went to the local electronics shop where they mostly work on CB radios and have never heard of an iPod. They fixed the connections for $5 and I brought it home, put it all back together and have a fully functioning iPod once again.

iPod updates

May 13th, 2004

I’ve been afflicted with the dying ipod battery for some time now, and recently I decided to do something about it. Two things really.

For those of you who don’t know me, my dilema is that during the summer I spend 8 weeks out in the country working at a farm camp that I absolutely love but that has minimal access to electricity. So, with mid-June just over a month away I thought I should do something about my situation.

I still get a couple of hours of normal use on the internal battery so my first thought was to purchase an external battery that I could take with me and use to re-charge my ipod overnight. This would all be well and good if I had a dockable ipod. My original 5GB model just doesn’t seem to fit the bill.

After looking around for a solution I found Drew Perry’s site that has a great little “hack” for building your own battery. I’m not much for electronics and soldering, but I thought I’d take a trip down to Fry’s and see what I could bum up.

I also found a very similar external battery on ebay that worked off of 8 AA batteries. This seemed like a better plan to me since 9V batteries can be pricey at times. Roughtly $22 later I had a new soldering iron, batteries, battery holders, wire, solder, and most importantly a female 6-pin firewire plug which are hard to come by (Outpost part # 2534171, made by Pactech #PG-FWC6P.) I figured the actual parts cost under $10 (not bad compared to the Belkin version which also requires an outlet to recharge it.)

After an hour or so of shaky hand soldering I had a working prototype. At first I was a bit afraid of plugging it in and swore at my self for not buying a fuse and fuse holder, but I went ahead and plugged it in. I couldn’t believe my eyes, the ipod turned on and began charging. Still afraid, but now strengthened I got back online and bought parts for version 2. The parts arrived today so I’ll let you know how it goes.

The second problem was solved much more easily. I finally broke down and bought a new internal battery, which I am still waiting for, but which I got a good deal on.

Feeling less than validated with XHTML

April 7th, 2004

I think XHTML might be the death of me. If anyone can tell me how to insert code elements as text see: <$MTArchiveDate format="%Y/%m/%d">/<$MTEntryTitle dirify="1">.html or some CSS wrapped in a code tag and still have it validate I’d love to hear about it. \ doesn’t seem to work nor does wrapping it in quotes and I really don’t want to write things like (less than)$MTArchiveDate format=”%Y/%m/%d”(greater than).
For now this site is not valid XHTML.

Drop Shadowed Images - The Easy Way

April 7th, 2004

I’m in the process of bringing one of the sites I develop up to XHTML compliance, and decided it would be fun to try some CSS tricks as well. Going from a heavily table based layout, with code that is sometimes 6 years old or created by Word to CSS has had its little glitches and SNAFUs but, now that it is basically done I decided to add drop-shadows to the many images displayed on the site.
The interesting thing with this site is that it only has a handful (maybe 5) images that shouldn’t have a shadow applied so I didn’t want to go through and wrap all 300 or so other image tags in a div because I didn’t see any reason to.
After a few tries here is what I came up with:
img {
background: url(/parts/images/shadow.gif) no-repeat bottom right;
padding: 0px 5px 5px 0px;
}

This adds the drop shadows using a simple gif that is clear except the last 5 pixles on the bottom and right where it fades from black to the background color of the site. Here is a Photoshop version of that gif so that you can change the background color to fit your needs.
The real trick was taking the shadow off of the other images without having to add much code, luckily they were mostly already wrapped in divs so I just told those to have no padding and gave them an empty image to display as a backround. (It didn’t work to specify background-image: none which is what I would have liked to do. Any thoughts?)
Then for those couple of other images that were just floating out in never never land, I made a class noshadow:
img.noshadow {
padding: 0px;
background-image: url(/parts/images/empty.gif);
}

I suppose the padding:0px is overkill, but for my purposes it didn’t matter.

MT Archive Customization

April 2nd, 2004

My good friend David is in the process of setting up his own Movable Type blog and had some questions about setting up archiving schemes. As I had not set any up I figured I’d give it a try. Here are my findings based on the “Hint 1″ at NSLog().
Here is perhaps a slightly more correct version of ‘Hint 1′ for archiving.

Under Weblog Config:
keep your “Local Archive Path” pointing to the absolute path to the archive directory: /home/html/mt/archives
and keep your “Archive URL” pointing to the archive directory on your server such that it would come up in a browser: http://www.example.com/mt/archives/

In the upper right hand part of the Weblog Config page there is a link to “Archiving” Click it.
On this page you should have two things checked, “Individual” and “Monthly”
In the text box for “Individual” Archive File Template place the following text:
<$MTArchiveDate format="%Y/%m/%d">/<$MTEntryTitle dirify="1">.html

This tells MT to store your files in sub-directories under “Archives” as defined on the main Weblog Config page. These sub directories are of the format Year/Month/Day/ and then your file is named by its title. So %Y/%m/%d turns into 2004/04/01 and then a slash is appended.

Next change the “Monthly” Archive File Template text box to:
<$MTArchiveDate format="%Y/%m/"$>index.html

This tells MT to build a page for each month of entries that is placed in the archives directory in sub directories of Year/Month/ and called index.html.
This means that if someone wants to see your entries for the month of March 2004 they would be directed to
http://www.example.com/mt/archives/2004/03/index.html

This is useful if you don’t want all of your blog entries stored in the same folder, or if you plan to have so many blog entries that it will be hard to navigate them in the future.

Keep in mind this only applies to the backend of the blog and your users won’t be the wiser, unless you are converting from having all your blogs in one folder. Then you run into the problem that this re-writes all of your permanent archives to a new folder structure.

Rounded Corners in CSS

April 2nd, 2004

I’ve been tinkering today and have my very first tutorial for CSS ready to publish. This is a modification of “The Thrash Box” as described at Vertexwerks combined with the Glish ALA Style (which is based on the sliding doors model found at ALA)along with my own little modifications.
Here is the basic shape of the layout:
rounde corners layout
The general benefits of this layout model are that you can use a graphic (read pattern or color) background for you box, but you don’t have to make the files huge to slide behind the text.
It consists of 4 corners, and one pattern for the background.
Check out the CSS here:
/* Based on the ThrashBox at http://www.vertexwerks.com/tests/sidebox/ */
/* And, ALA style from Glish http://glish.com/css/9.asp */

body {
background-color: black;
}

#header {
color: white;
}

#main {
background-color: #F4EDC9;
}
/* Show only to IE PC \*/
* html .boxHead h2 {height: 1%;} /* For IE 5 PC */
* html .boxFoot h5 {height: 1%;} /* For IE 5 PC */

/* Main Content Box */
#mainContent {
float: left;
margin: 10px;
width: 67%; /* % so it will grow */
background: url(../images/slideBack.jpg);
font-size: 100%;
}

.boxHead {
background: url(../images/patternSlide_02.jpg) no-repeat top right;
margin: 0;
padding: 0;
text-align: center;
}

.boxHead h2 {
background: url(../images/patternSlide_01.jpg) no-repeat top left;
margin: 0;
padding: 22px 30px 5px;
font-weight: bold;
font-size: 1.2em;
line-height: 1em;
}

.boxBody {
background: url(../images/slideBack.jpg);
margin: 0;
padding: 5px 10px 10px;
}

.boxFoot {
background: url(../images/patternSlide_03.jpg) no-repeat bottom right;
margin: 0;
padding: 0;
text-align: center;
}

.boxFoot h5 {
background: url(../images/patternSlide_04.jpg) no-repeat bottom left;
margin: 0;
padding: 22px 30px 5px;
}

/* Links Box */
.links {
padding-top: 10px;
}

.links a {
color: red;
text-decoration: none;
}
.links a:hover {
color: white;
background-color: red;
}

If you just want to see it in action here are the links:
html file
CSS file

The major difference between this and the Thrash box is that I included a footer that holds the two bottom corners, this frees me up to put a background on the area that contains my text as well as on the entire box. In the Thrash box model you have to use the background for the main box part to put in the lower-right corner which means you have to make the file big enough to stretch if the box is dynamic. Mine also gives you a footer at the bottom or padding if left blank.
Let me know what you think of this option, I checked it in Safari, Camino, FireFox, Mozilla, IE 5 Mac, and IE 6 Win, but don’t have IE 5 Win. So far so good.

Working with Layout

March 29th, 2004

Been working on the site again, seems like once I finally have it working the way I want, looking good, and pretty much bomber, I find something that needs changing or updating. This time it was my portfolio page. Basically every page on my site except the homepage doesn’t have my blog links that show up on the left on the homepage. This looked odd because it left a 200px gap on the left side of all the pages. My temporary solution is just to give the content area of the page a -200px margin. This works, but I don’t like the necessity of an inline style. What are your solutions for content on pages that don’t have all the navigation? Should I just break the style sheet down into parts and give the pages that don’t have the extra navigation their own style sheet? Or does it make more sense to find a different layout?