My computer’s been acting a little funny lately, and I think the hard drive is to blame. So, I’m attempting to back up my data to the office network share, which I’ve done a few times in the past.
Rather than doing a simple copy and paste, I was wondering if there might be a way to copy only the files that had changed, and a quick google revealed that the utility was actually built in to Windows 7, in the form of the command line tool called Robocopy (Robust Copy). It has a huge amount of flexibility, including options for including subdirectories (/e), ignoring empty subdirectories (/s), deleting files that are no longer in the source directory (careful with this one!) (/mir), ignoring or including directories and files based on system flags such as hidden or system (/XA:)…the list goes on. The difficulty I had, however, was copying to a network drive.
And this is a whole other can of worms - accessing a network share via the command line. Apparently having this feature caused some kind of security vulnerability, which is why you’re forced to work around it. However, the only workaround I could actually make work (net use X: //server/share) wouldn’t give me access to my local hard drive at the same time. How useful.
Attempting a robocopy without net useseemed to work - it spent a good chunk of time happily chewing through the files. Subsequent runs even checked out - only the files that changed were “uploaded”! However, a peek into the directory with Explorer didn’t show any of the files it claimed to be copying over. It’s possible I’ll someday figure out where they went, but using robocopy with neither the existing mount (X:/self/backup) nor the direct path (//server/share/self/backup) caused anything to actually show up on the network share, as far as I can determine. I eventually found that it had created a hidden system folder, somehow with exactly the same name and path as the folder I was trying to copy to. I’d already had ‘Show Hidden Files and Folders’ checked, but not ‘Show Protected System Files’. Attributed to the magic ‘My Documents’ to ‘Documents’ thing.
Eventually, I came across a helpful fellow here (scroll down to a comment by the elusive “Don”), who had written his own little freeware utility called RoboMate - a GUI front-end for Robocopy, which, as a GUI, seems to have legit access to the network share! Peeking into the folder, even during the operation, confirms that this is actually working. I don’t know what the sufficiently advanced magic words were (although I admit I’m a little curious), but I’ll post them here if I do happen across them.
I was trying to add a DHCP reservation on Microsoft Server, a fairly standard thing.
After entering the details, it popped up “The Unique Identifier you have entered may not be correct. Do you want to use this Identifier anyway?” Hitting ‘Yes’ gave me the error message “The DHCP server received a message that was not valid”, hitting ‘No’ had no effect.
Google-fu results: Enter the MAC address without a colon separator. How silly to not support a standard separator.
This is a post I found through the excellent blog Coding Horror - I often experience a similar phenomenon, that framing a question properly does a lot of the work for you!
Coding Horror itself is about so much more than just programming - through the magic of transferable xp, it offers fantastic resources for anyone involved in any kind of problem solving or team management (although, granted, with an IT focus).
In the end, I figured out it was due to some odd RAID configuration. I could have spent more time trying to figure out how to make that work, but in the end I just installed it on one of our other computers (only two cores instead of three).
Somehow, I never have an easy time setting things up, and it seems to bear an inverse relation to the amount of time claimed on the website.
For example, on the Banana Dance website, the site claims that it takes three minutes to get up and running. From download to successful log-in, it took me more like five days, but I can at the very least confirm that this time it wasn’t really my fault.
My first adventure was setting up PHP to work with Apache. I downloaded the first installer on the PHP for Windows website, because the latest version generally seems like a good idea. I wanted to install it as a module, which didn’t work, but after mucking around, I got it to work as a binary executable instead (I’d eventually find out that I need to download thread-safe PHP 5.4 instead, due to some libraries not making it to the Windows version until that point).
This got me to the Banana Dance setup page, and it is every bit as cute as the rest of the software package. And although I liked the cuteness at first, after multiple reinstalls and filling out of the same information, it began to grate a little.
I was never able to convince this page that it has permissions to edit the /generated folder, but that didn’t turn out to be an actual problem.
The first time I filled out this page and clicked “Start Dancing!”, I got an error about not being able to access the /mysql folder. Relatively easily defeated - a search on the Banana Dance forum revealed that the incorrect folder was auto-generated, and all I needed to do was remove the trailing /setup from the Install folder field.
And so, I did get to the default home page with relatively little trouble. Logging in, however, turned out to be a little more troublesome. After poking around the source code and the forum boards a little, I discover this was a problem that had been recently solved in an update (cookies that expired immediately due to incorrect server system time). After a few iterations of downloading, installing, deleting, and installing again (including a version direct from Jon Belelieu himself), I come to the conclusion that it’s a different issue, although still related to cookies.
I tracked down the code that creates the cookies, and couldn’t see anything immediately obvious - I tried setting a longer session, and adding cookies for the server domain without a prepending . or www. It turned out the latter action was on the right track.
Perhaps I should have learned from my experience setting up MoinMoin and tried sniffing out the HTTP headers first and foremost. Nevertheless, it finally occurred to me to check the headers using Wireshark, and they seemed to come through fine. Stumped again.
However, I also had a working Django installation on the server, which was why I figured the issue was specific to Banana Dance. I compared its cookies to the ones issued by Banana Dance, and lo and behold, Django issued a cookie without a domain at all - just a simple /.
And so, finally, issue was pwned, and I had my first experience fixing a bug in an open source software project. Wireshark demonstrates its usefulness again - I will likely eventually wonder how I got along without it.
I tried out MoinMoin wiki, and while I’m sure it’s great for programming projects and the like, it just wasn’t quite polished enough for use with my occasionally less technically adept coworkers (I hope I can say that as an honest assessment and not in a demeaning fashion). Even I was having trouble making sure things were added to the appropriate Category all the time, and the CategoryCategory stuff just seemed like too much extra ridiculous typing (although, I do realise this was configurable, it also seemed unnecessary to have a prefix at all). That, plus the Calendar API was confusing, and that there was no built-in photo gallery led me to try out Banana Dance instead, even though I wasn’t all that familiar with PHP.
The Banana Dance site boasts 3-minute set-up, and while I didn’t quite find that to be the case (a story for another post), the UI is much more polished and accessible, the permissions are much more configurable and finer-grained, and it was just easier in so many aspects (except set-up in my particular case) that I’m moving forward with this one instead.
I came across this blog post a while back, and while I can appreciate the career advice, I can’t quite give up this label. In fact, I choose to wear it with pride, and I can apply it (with varying degrees) to everything I do, from playing music, to DJing, to blogging, to the act of making a computer program.
So, here is what I mean when I proudly and precisely say that yes:
I am a programmer.
I create solutions and processes, and I describe them clearly, rigorously, and logically.
I present arrangements of human output in the most meaningful ways I can imagine.
I document problems and limitations to the highest accuracy I can achieve.
I choose my tools with careful consideration of the problem domain and the desired results. My tools do not define the full body of my work, although I do admit some preference to certainschools of thought.
And always, everything I create or present or document is designed for the eyes of other human beings. I am no mere code monkey, content to design for the cruft of man-made machines.