Robocopy Notes

Install cmder: It’s the nicest shell I’ve seen for windows. Run your console as Administrator. Otherwise you can’t use the /B backup switch. Also rember you need to do a net use command as administrator.

Before you robocopy stuff, setup a dedicated drive letter. The drive letter is only available to the logged in session. So if you have drive p: for Bob, and then you boost your console to Administrator–no more drive p: ! So dont use the users drive mappings: create admin drive mappings.

net use p: \\nas02\backup\ "secret" /user:bob /persistent:yes

Remember to type the password with “double quotes” and not ‘single quotes’. If you type single quotes you may as well be typing capital Xes: they become part of your password.

The net use command to see if you already have a drive share. Close any File Explorer windows open to that server becuase that’s equivalent of have a net use $d /user:anonymous open at the same time, and windows wont cooperate. Mount the directory

There are a lot of switches. We’ll assume a C:\Users directory.

C:\Users\bob> mkdir c:\temp
C:\Users\bob> cd C:\Users
C:\Users> robocopy bob P:\bu-bob\ /mir /ZB /FFT /XA:SH /W:5 /R:2 /dcopy:T ^
 /XJ /XD "Temp*" "cache2" "temporary internet files" "*cache*" /NFL

First try the command without the /LOG switch. The command goes faster with the LOG turned on, do that later. /XF is a pattern to exclude files. Example log option: /LOG:C:\temp\bu.txt. The /NFL will show directories. not files.

The /MT flag is useful, but it prohibits logging, not available on Vista. The /XJ flag should be default, but sadly–no. Juntion points create these really frustrating backup path loops. Use /XJ!

Windows OEM License

liftarn_Big_brickSo it turns out you can destroy a windows virtual host really quickly, just by moving it from one host system to another host.

This is something I’ve done with Linux virtual hosts many times, and it seems like an intrinsic way to manage resources.

But not with Windows. They really expect you to take the time to install and configure all your applications again if the motherboard changes. It must not be possible to do live migration of windows virtual hosts.

SourceForge is making Open Source Look Like a Scam

Not only when I download something from SourceForge these days am I presented a proxy-downloader that tries to sell me on installing some unsolicited system utility — like a browser home page take over — it manages to install some other bullshit system utilities as well. Holy shit. This is not the Sourceforge I used to use. It is seriously WASTING MY TIME and making me HATE free (as in beer) software on Windows! Can’t they tell how much they are pissing in the well?

All I wanted to do was install Filezilla. Now I have crap to uninstall as well. Who at OSDL or FSDL or do I have to strangle to stop this?

Update: Malwarebytes just popped up and said it blocked some malware. It started scanning and found four new bits of badness on my filesystem and asked me to reboot. Sure.

Translating Filenames — Bash Voodoo Style #linux

This is an example of using Bash to convert a crazy apache log and translating the filename into an IIS log pattern:

d=`date +%Y%m%d`
find k -type f \
| while read filename
  echo "$nextfile"
  cat $filename | $translate > "$nextfile"

I love how I can refer to a shell variable ($d) inside a string translation (${d}).

Well, the Microsoft has Landed on the Jed

I spent all day getting my workstation to build a set of pretty intense C# projects. I’m impressed that we got it working in a day (not counting the four days it took to straighten out my Visual Studio  install on my Vista workstation). Having developed projects in Perl, PHP, Java and C, and having been a Linux administrator for 15 years, the process was a bit different, of course.

The biggest difference is how many commercial components I had to manage. Contrast this to a Linux environment where most packages are either pre-installed, or managed by the distribution maintainers. In a Linux distribution, having to hand-roll and maintain out-of-band libraries is not really kosher. One of the things I installed today blew my Windows Explorer away…literally, in one case, a hybrid Java-based installer crashed the Aero interface and dumbed my desktop down to “Windows Basic.” Wow, 64 bit Vista at that.

The other thing that I reflected on was the amount of “oral tradition” that guided the application setup. Since there’s never been a product installer (this being a web based application), setting up the IIS application was never scripted. Wow! This was like nothing I’ve done before using Apache. I can see how an apache .htaccess file would be like black magic compared to an IIS Basic Settings dialog…but its usually just a file kept in source control and often just another bit of automatically deployed collateral…and just another bit of code to a programmer. In this case IIS really involved hand-holding.

The combination of 64-bit and 32-bit libraries was tricky. IIS 7 was not happy for a while until we forced it to run applications as 32-bit. I’ve seen plenty of 32/64 bit dissonance on Linux before. It’s actually quite sad that 64-bit architectures have been around for what…20 years (the Alpha) and it’s still a problem. (It’s still a problem on my home Ubuntu box: Firefox won’t touch my Adobe Flash.) I wish someone, a decade ago, came up with fundamentally better ideas on how to deal with combining 32- and 64-bit software together. The notion of “just keep them separate” is quite unrealistic…unfortunately, it just increases the pain…and quite unacceptable when it comes to customers that have invested in proprietary 32-bit development libraries–people won’t pay for 64 bit versions if the 32-bit ones can be made to work.  Makes me appreciate how much work has gone into making so many Linux distros 64-bit friendly, really. The crazy IIS install also made me love bash scripting all the more…it made me think this would be a great time to learn Power Shell and create a PoSH installer for all the components. (It won’t get asked for, tho.)

Time to keep an open mind. Time to shelve my pride. I am now at a place where PHP has being stomped out like a smoking cigarette butt. The last time I coded full time in a Windows GUI was in San Francisco, using JBuilder, approaching a decade ago. The JBuilder eventually got discarded for Notepad++ and well crafted Ant scripts. I wouldn’t think that anyone now would have the chance to discard Visual Studio 2008.

My last thot is…gosh, this is what, like, a million other programmers use every day. I’ve been using F/LOSS components for so long, I forget how much of the world F/LOSS is almost entirely missing. In “typical” desktop and server environment, Windows is still the majority in much of the world. Some day I will develop more with Linux. Mostly, I am grateful to still be employed…that’s is definitely the most important point of all. I won’t let Microsoft be a barrier to that.