Tuesday, December 29, 2009

Happy New Year!

Happy New Year!

Here's hoping for a fantastic 2010!

Tuesday, December 22, 2009

Happy Holidays!

Happy Holidays!

Enjoy the time off, whatever your plans!

Tuesday, December 15, 2009

Rebuilding a PC: Why?

How often should you rebuild your PC? What kicks it off for you?

Is it proactive? For example:
  • Length of time since last key event
  • Amount of data
  • Previously determined OS attempt

Or is it reactive?
  • Due to performance?
  • Perceived slowness?
  • Hardware failure?
The key is to know why you're doing it. Not all reactivity is bad (hardware failure, for example, you can't control or really prevent).

However, what if it's a server? How often do you rebuild things, even just the OS? Yes, I know up-time is king. I do.

However, if you can unlock more efficiencies through an OS upgrade, why don't you? Why not be proactive?

Tuesday, December 8, 2009

Rebuilding a PC: SyncToy

Although it didn't make the original list, one of the things I really missed during my Ubuntu adventure was SyncToy, from Microsoft.

It allows me to run all sorts of "choose your own" style backups, and make them as deep or simple as I want. This is good.

What it doesn't do is perhaps work more complicated, or have fancy feedback styled logging with pretty beautiful error output.

I don't care. It's free, it works, and I like its simplicity.

Find it here at Microsoft.

Tuesday, December 1, 2009

Rebuilding a PC: Firefox

In rebuilding Firefox, nearly everything I need is built in. However, since I am really NOT a fan of editing Firefox's about:config by hand, I adore the addon Tab Mix Plus.

You can find it here:

https://addons.mozilla.org/addon/1122


And the developer's website is over here:

http://tmp.garyr.net

Tuesday, November 24, 2009

Rebuilding a PC

So I'm rebuilding my PC again, and I realized that I'm going to need a list of my Windows-based software that is essential to getting stuff done.

Without fanfare, then, here's my top few:

1) Vista - hey, you gotta have an OS, right?

2) Thunderbird

3) EditPad Pro

4) Agent Ransack - I couldn't survive without this, because with it, I don't have to remember where I put things (as much :P)

5) Firefox

6) Eraser

Tuesday, November 17, 2009

My New Thunderbird Favorite AddOn

EMail Address Crawler 1.8.0 by CySlider has to be my new favorite Thunderbird AddOn:

https://addons.mozilla.org/en-US/thunderbird/addon/9995

The description is rather straightforward:

Automatically fill your address books or send mass mails with e-mail addresses extracted from all your e-mails.


It sounds like something a good person wouldn't do, doesn't it? Lose their addressbook, I mean.

But if you do, and you're a Thunderbird user, this little gem can save your life, not to mention your hair!

Tuesday, November 10, 2009

Ubuntu & VPC 2007

I kinda wish I'd found this link before I went all nuts on down this road. I think I could have learned a lot more about email and application configurability if I'd played more before leaping.

https://help.ubuntu.com/community/UbuntuAndVirtualPC2007

Tuesday, October 13, 2009

iTunes & Amazon

I'm downloading music from iTunes, and finding that I don't like their DRM. I think I will be switching to Amazon, eMusic, or even (shudder) straight CD rips.

Tuesday, October 6, 2009

mp3 Woes: Getting rid of tracks, revised

So here's an updated version of the track delete script. It uses a genre change to make the genre of the track "ToDelete", and I now believe this is a much cleaner way to get rid of your junk tracks.

Benefits of removing tracks this way are:
  • You can review them in the UI before removing them

  • It updates the modified date of the track, so you can run this script for a number of date ranges, and then pick them up using one O/S search

  • Because they're in the UI, and you'll be removing them via the UI, you have the option to delete them from disk as well, further lessening any followup needed


  • As always, have a backup of your library (and library of files) made before doing any of this. Caveat Emptor and all that. :)




    ' so here we begin the main portion of the script
    Const ForReading = 1, ForWriting = 2, ForAppending = 8
    Const TristateUseDefault = -2, TristateTrue = -1, TristateFalse = 0
    Dim fso, MyFile, FileName, TextLine
    Set fso = CreateObject("Scripting.FileSystemObject")

    ' Open the file for output.
    FileName = ".\ResultsFile.txt"
    Set MyFile = fso.OpenTextFile(FileName, ForWriting, True)

    ' Write the result of the function directly to the file
    MyFile.WriteLine findfilesmod

    ' Because you have to close every door you open
    MyFile.Close


    function findFilesMod

    ' I really like the ability to run test runs, and having the timings makes it a cake
    resultstring = ""
    resultstring = "Beginning " & cstr(time) & vbcrlf

    ' Otherwise, make some variables!
    ITTrackKindFile = 1
    deletedTracks = 0
    counter = 0

    ' Get a copy of iTunes running
    set iTunesApp = WScript.CreateObject("iTunes.Application")
    set mainLibrary = iTunesApp.LibraryPlaylist

    ' Since we're trying to get to the full list of songs, we need this
    set tracks = mainLibrary.Tracks

    ' Now then! We loop the full library to touch the tracks
    for each currTrack in tracks

    ' is this a file track?
    if (currTrack.Kind = ITTrackKindFile) then

    ' if the track has the date we're looking for, in this case 1 January 2001, then
    if (cdate(currTrack.ModificationDate) >= cdate("1/1/2001 00:00:00")) and (cdate(currTrack.ModificationDate) < cdate("1/2/2001 00:00:00")) then

    ' keep track of what's deleted, so it hits the results file
    ' Then, mark the track
    resultstring = resultstring & currTrack.Name & _
    "(" & currtrack.genre & ") - " _
    & currTrack.ModificationDate & vbcrlf
    currtrack.genre = "ToDelete"

    ' increment the counter
    counter = counter + 1

    end if

    end if
    ' if you want an early out after deleting a set number of files, you can use this
    ' otherwise, this script will loop iTunes whole library, nuking as it goes
    'if counter >= 1 then exit for
    next

    ' the last output
    resultstring = resultstring & "Counted " & counter & " track(s)." & vbcrlf
    resultstring = resultstring & "Finished at " & cstr(time) & vbcrlf

    ' return the results
    findfilesmod = resultstring

    end function




    Tuesday, September 29, 2009

    mp3 Woes: Getting rid of tracks by date modified

    So I'm needing to get rid of some files in iTunes. I wrote a script to seek and destroy files in my library that I imported on a specific date.

    This script takes the iTunes library and loops through it, looking for tracks that were modified on a certain date. When it finds one, it deletes it from the iTunes library. This has the added benefit of removing it from all playlists as well.

    It is worth noting the first comment in this script.



    ' this script only deletes the entries from iTunes playlist - it doesn't actually remove the files from disk!!


    ' so here we begin the main portion of the script
    Const ForReading = 1, ForWriting = 2, ForAppending = 8
    Const TristateUseDefault = -2, TristateTrue = -1, TristateFalse = 0
    Dim fso, MyFile, FileName, TextLine
    Set fso = CreateObject("Scripting.FileSystemObject")

    ' Open the file for output.
    FileName = ".\ResultsFile.txt"
    Set MyFile = fso.OpenTextFile(FileName, ForWriting, True)

    ' Write the result of the function directly to the file
    MyFile.WriteLine findfilesmod

    ' Because you have to close every door you open
    MyFile.Close


    function findFilesMod

    ' I really like the ability to run test runs, and having the timings makes it a cake
    resultstring = ""
    resultstring = "Beginning " & cstr(time) & vbcrlf

    ' Otherwise, make some variables!
    ITTrackKindFile = 1
    deletedTracks = 0
    counter = 0

    ' Get a copy of iTunes running
    set iTunesApp = WScript.CreateObject("iTunes.Application")
    set mainLibrary = iTunesApp.LibraryPlaylist

    ' Since we're trying to get to the full list of songs, we need this
    set tracks = mainLibrary.Tracks

    ' Now then! We loop the full library to touch the tracks
    for each currTrack in tracks
    ' is this a file track?
    if (currTrack.Kind = ITTrackKindFile) then
    ' if the track has the date we're looking for, in this case 1 January 2001, then
    if (cdate(currTrack.ModificationDate) >= cdate("1/1/2001 00:00:00")) and (cdate(currTrack.ModificationDate) < cdate("1/2/2001 00:00:00")) then

    ' keep track of what's deleted, so it hits the results file
    resultstring = resultstring & currTrack.Name & " - " & currTrack.ModificationDate & vbcrlf

    ' Delete the track
    currTrack.delete

    ' increment the counter
    counter = counter + 1
    end if
    end if

    ' if you want an early out after deleting a set number of files, you can use this
    ' otherwise, this script will loop iTunes whole library, nuking as it goes
    'if counter >= 1 then exit for
    next

    ' the last output
    resultstring = resultstring & "Counted " & counter & " track(s)." & vbcrlf
    resultstring = resultstring & "Finished at " & cstr(time) & vbcrlf

    ' return the results
    findfilesmod = resultstring

    end function



    Tuesday, September 22, 2009

    External connections to SQL Server 2008

    In trying to get VBScript to talk to my SQL Server, I found that I needed to enable it to accept outside connections.

    While I was in the process of researching, I found the following. Since I certainly give credit where credit is due, check out this guide:

    http://www.linglom.com/2009/03/28/enable-remote-connection-on-sql-server-2008-express/

    Tuesday, September 15, 2009

    mp3 Woes: Finding a missing mp3

    So I don't like to hunt for things manually. I especially don't like things that I can't just "Fire And Forget" when it comes to searching, so I wrote the following little script to hunt my hard drive for a particular file I wanted to find.

    Because a search like this can take a while, and will basically just run in the background until either cancelled via Task Manager (look for wscript.exe), or it completes a scan of EVERY folder on your hard drive, I don't usually write things like this without starting and ending messages.

    
    Set FSO = CreateObject("Scripting.FileSystemObject")
    StartingLoc = "C:\"
    LookingFor = "String To Search For"
    
    Sub Display_Fs(Folder)
    For Each Subfolder in Folder.SubFolders
    
    ' Uncomment to display a popup message indicating where we are
    'wscript.Echo "Getting: " & Subfolder.Path
    
    ' First, show the files in the local folder
        Set F = FSO.GetFolder(Subfolder.Path)
        Set FilesCollection = F.Files
    For Each File in FilesCollection
        if File.Type = "MP3 Format Sound" then
            if InStr(file.name, LookingFor) > 0 then
                wscript.Echo file.path
            end if
        end if
    Next
    
    ' Call the function so we dive into the current folder
        Display_Fs Subfolder
    Next
    End Sub
    
    wscript.echo "Starting"
    
    ' Because the top folder is assumed to have no higher branch we can reference,
    ' we display the currenly sitting files first
    Set F = FSO.GetFolder(StartingLoc)
    Set FilesCollection = F.Files
    For Each File in FilesCollection
    if File.Type = "MP3 Format Sound" then
        wscript.Echo File.path
    end if
    Next
    
    ' Having displayed everything local, we begin our trip down the tree
    Display_Fs FSO.GetFolder(StartingLoc)
    
    wscript.echo "Ending"

    Tuesday, September 8, 2009

    mp3 Woes Part 1

    I don't like things that are hard. I really don't.

    I also don't like things that are manual. I mean, really. Shouldn't technology be all about making life easier, not adding layers of abstraction to manually processes? Shouldn't it get rid of the manual processes, and free us up to review log files and tweak the underlying processes?

    Or have I been a DBA for too long? :)

    So I wanted to rename a bunch of files. At once, automagically, but with some manual oversight. After all, I might come up with some files that I didn't know about, didn't like the renaming of, etc.

    So here's what I came up with as requirements:

    1. I want a script that will traverse all subdirectories
    2. However, I have no interest in passing parameters (see above comment on "automatic"), so it needs to run starting in whatever directory it wakes up in
    3. It should produce a text file that I can edit before running
    4. It should not try to use iTunes API

    So here's the full text of the script that I came up with, that satisfies these requirements.




    ' This script will recurse a directory tree, from the location the file is run from,
    ' and will produce a batch file to run that will automatically un-url-encode all files
    ' it runs into

    Function ShowFileAccessInfo(filespec)
    ' This function will get the details of the file it's given
    ' and return the details as a formatted string, intended to be
    ' output to the report file later
    Dim fso, f, myString
    Set fso = CreateObject("Scripting.FileSystemObject")
    Set f = fso.GetFile(filespec)
    myString = "REM Original File: " & f.Path & vbcrlf
    myString = myString & "REM New Name: " & unescape(f.Name) & vbcrlf
    myString = myString & "REM on Drive " & UCase(f.Drive) & vbcrlf
    myString = myString & "REM Last Modified: " & f.DateLastModified & vbcrlf
    myString = myString & "move "".\" & replace(f.Name, "%", "%%") & """ "".\" & unescape(f.Name) & """ "
    myString = myString & vbcrlf & vbcrlf
    ShowFileAccessInfo = myString
    End Function


    Function ShowFolderList(folderspec)
    ' This function takes a folder it's given, and loops through
    ' the collection of objects, calling the file describer
    ' function for each one
    '
    ' At the end, it returns the formatted string back
    ' to the calling function

    Dim fso, f, sf1, f1, fdc, fc, myString
    Set fso = CreateObject("Scripting.FileSystemObject")
    Set f = fso.GetFolder(folderspec)
    Set fc = f.Files
    set fdc = f.SubFolders

    ' loop any found subdirectories
    for each sf1 in fdc
    myString = myString & ShowFolderList(sf1)
    next

    ' loop any found files
    For Each f1 in fc
    myString = myString & ShowFileAccessInfo(f1)
    Next

    ' because if you don't return what you find, this whole
    ' write it to disk thing is for naught...
    ShowFolderList = myString

    End Function



    ' so here we begin the main portion of the script
    Const ForReading = 1, ForWriting = 2, ForAppending = 8
    Const TristateUseDefault = -2, TristateTrue = -1, TristateFalse = 0
    Dim fso, MyFile, FileName, TextLine
    Set fso = CreateObject("Scripting.FileSystemObject")

    ' Open the file for output.
    FileName = ".\FileList.txt"
    Set MyFile = fso.OpenTextFile(FileName, ForWriting, True)

    ' Write the result of the function directly to the file
    MyFile.WriteLine showfolderlist(".")

    ' Because you have to close every door you open
    MyFile.Close

    Tuesday, September 1, 2009

    mp3 Woes Introduction

    So I downloaded some mp3 files of some speeches given in one of two languages - either English or Spanish. Unfortunately, the source of the files had URL-encoded the names of the files before putting them up on their server.

    So, when I downloaded the files, it was into a directory in my iTunes folder. Then, I copied the files from my iTunes directory into c:\musicfiles, so I'd have a backup of the files to work against.

    This left me with a folder structure like

    c:\musicfiles\english
    c:\musicfiles\spanish

    The next article is going to show you how I wrote a quick little script to loop everything in a given directory and un-encode it.

    Tuesday, August 25, 2009

    Calendar Reporting Part 5

    When you push the Export Times button, you should get a window like this.

    From ForBlog


    You’ll note that the dates I picked begin on Monday, 5 October 2009, and end on Friday, 9 October 2009. A note on this: It remembers that last dates you used, so you have to re-set the dates to the current week every Friday. Also, make sure you pick “Recurring Events” and “non-times-tagged items”!

    Once you hit export, you should get an Excel window like this. Check out the diagram tab, if you selected “Create Excel Diagram” in the Export Popup!

    From ForBlog

    Tuesday, August 18, 2009

    Calendar Reporting Part 4

    Then, I assigned each recurring appointment a category. This will change its color in Outlook. So, let’s say I have a Monday of a week that looks like this (with some content changed to protect the guilty!):

    Tuesday, August 11, 2009

    Calendar Reporting Part 3

    Next, I defined some custom categories in Outlook. Because I sync Outlook with my Treo smartphone, this part was easy. Along with defining the categories, I assigned each custom category a color. Now my category list looks like the following.

    Tuesday, August 4, 2009

    Calendar Reporting Part 2

    First, I grabbed a copy of Outlook Times Addin 1.1 from here: http://outlook-times-addin.wang-sweden-ab.qarchive.org/



    All I had to was shut down Outlook, install the product, and then restart Outlook.



    I then had a new toolbar in my calendar that looked like this:


    Tuesday, July 28, 2009

    Calendar reporting

    I use my calendar heavily to track both my personal and my work life. Since I use a Treo, I have no problem recording events realtime as they happen in my calendar, and assigning the tasks a category. However, it seems to take a lot of time to build my status report at the end of the week each Friday.

    What I wanted was a tool that would convert my Outlook appointment info into a useable format, so I could quickly remove any unneccessary tasks, like a meeting I didn’t attend, and then just send it on.

    Here’s a sample of one week. I’m sure many people have calendars that are much more crowded than this!

    Tuesday, July 21, 2009

    Outlook Calendaring

    So, I'm just happily emailing along the other day, and I need to arrange a conference call.

    Now, usually, this is a simple matter of popping open Outlooks calendar, entering the name of the person I want to meet with, and clicking the Scheduling Assistant button up at the top.

    In this case, however, no one I tried to enter would come back with free/busy information. I live in my calendar, and use it for time and billing tracking, so having inaccurrate information in there drives me to distraction.

    A quick search on Google later, and I found this link:

    http://groups.google.com/group/microsoft.public.exchange.admin/browse_thread/thread/bbf7ac547e6e60dd?pli=1

    In short, this is what it says:

    This is a known "feature" by Outlook 2007 clients. To make a long story short, you can re-enable it via modifying the following registry tweak: under HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\Outlook\Options \Calendar add a the dword "UseLegacyFB" with the value 1


    One quick registry edit, and I was back in business!

    Tuesday, July 14, 2009

    Introductions

    My name is Brad McKuhen.

    I am currently a Microsoft SQL Server Database Adminsitrator, DBA, & SQL Developer.

    In past lives I have worked with SQL, SQL Server 7.0/2000/2005, T-SQL, Oracle's PL/SQL, Crystal Reports 8, 8.5, 9, VB 6, VBA, VBScript, & JScript.

    I am CompTia A+ Certified and a Microsoft Certified Professional (MCP)

    Tuesday, July 7, 2009

    Guten Abend.