Add FTP service (IIS7) to server core

You'll need the following roles added in this order

  • start /w ocsetup IIS-WebServerRole 
  • start /w ocsetup IIS-IIS6ManagementCompatibility
  • start /w ocsetup IIS-Metabase
  • start /w ocsetup IIS-FTPPublishingService 
  • start /w ocsetup IIS-FTPServer 

Then, to make the service start on boot, use the following (it does require a space after the = sign)

  • sc config MSFTPSVC start= auto 
  • net start MSFTPSVC
Categories: Windows Server 2008 server core

Server core commands

Windows 2008 Server Core requires setup via the command line.  Here are some items for common tasks:

Server core configurator; get the ISO and attach to your VM; browse the DVD drive and run Setup-Core.wsf

Add domain user to Administrators group

  • net localgroup Administrators /delete <domain\username>

Reboot the server

  • shutdown /r /t 0 

Rename the server

  • netdom renamecomputer <ComputerName> /NewName:<NewComputerName>

List installed patches

  • wmic qfe list 

Services (list/start/stop)

  • sc query; sc start; sc stop

Enable RDP for XP/2003

  • cscript C:\Windows\System32\Scregedit.wsf /ar 0
    • /ar will enable 2009/vista access
  • cscript C:\Windows\System32\Scregedit.wsf /cs 0
    • /cs enable 2003/xp
  • netsh advfirewall firewall set rule group="Remote Desktop" new enable=yes
    • adds rule to firewall for access
Categories: Windows Server 2008 server core

SQL server date formats

How many different ways are there to format a date/time? Too many.  Here is a list of formats and the specific command to get them: http://www.sql-server-helper.com/tips/date-formats.aspx

Categories: SQL Server 2005, SQL Server 2008

MP3/FLAC setup

I have an extensive audio selection on my harddrives.  It must remain oranized due to it's size (it's one of my things).  Tag&Rename (30$) is what I use to manage my collection.  It is very good at organizing my new music into the style I want them renamed and saved in.  You can setup quick buttons that rename the files/folders into exactly the format you want.  I've organized my collection by Artist/Year Album (bit rate)/track – title.flac. It also allow quick playlist generation and embed album art.

I really like how it will edit every tag in every standard.  The only thing missing is lyric grabbing.  For that I use MiniLyrics. It's not perfect but it does save the files to the album's folder as well as embed the lyrics in the files themselves.

Categories: Audio

Connecting to MySQL from Coldfusion 7

Coldfusion 7 only shipped with MySQL 3 drivers.  Here is how to add drivers for newer versions (5 at the time of this writing):

  1. Get yourself a copy of the newest MySQL Connector JDBC driver from http://dev.mysql.com/downloads/
  2. Locate the mysql-connector-java-*-bin.jar file and extract it into your cf_root/WEB-INF/lib folder on your CF server.
  3. Restart Coldfusion.

 

To add a new data source (DSN) using this new driver:

  1. Add new DSN using driver: other
  2. JDBC URL: jdbc:mysql://[host server name]:[port]/[database]
  3. Driver class: com.mysql.jdbc.Driver
  4. username/password if you want it defined in the administrator, else use them in your cfquery tags

 

 

Categories: Coldfusion, Java, MySQL

Dreamweaver Code Rewriting invalid XHTML (onLoad)

My site uses templates that are XHTML 1.0 Transitional.  Dreamweaver was rewriting my body onload and onunload with mixed case (onLoad, onUnload) even though my template was not setup that way.  Anytime I opened a page, it would rewrite them.  I had to use Modify > Template Properties > OK to set them back before committing.  I could not find why and no answers seem available.  Seems very few of us were having the problem.  I finally stumbled upon the answer.

Here is your fix:  Edit > Tag Libraries > expand the body tag in HTML tags; you should find all the attributes for the body tag.  I'll bet yours are mixed case.  Select onLoad or whichever attribute you need to change and set the Attribute case field to Lowercase. Simple, right? But hard to find. I've lived with this far too long for this simple of a fix…

Categories: CS3, Dreamweaver

SVN reminders

Here is a list of tasks to remind me how to manage my SVN virtual machine:

Create repository:

 sudo svnadmin create /var/svnroot/myrepo (substitute myrepo with whatever name you want)

Add a user:

 In the folder for the repository you
just created, go into the “conf” folder. You then need to edit the
“passwd” file

Setup authorization to use the passwd file:\

 Edit 'svnserve.conf' in the same conf folder; uncomment the 'passwd-db = passwd'

Create directory structure /trunk /branches /tags in a new temporary folder and import this structure into the repository via a right click on the folder and selecting TortoiseSVN → Import… This will import your temp folder into the repository root to create the basic repository layout.

Now you are ready to go.

 

Categories: SVN

Playing FLAC files in Windows 7/Windows Media Player 12

Windows 7 doesn't play FLAC files by default.  To make it work, you just need to install the codecs from xiph.org.  If you want better tag support, install the WMP tag support.  I didn't even have to reboot or reload my library that was building.

Categories: FLAC, Windows Media Player

Sorting photos via powershell v1

I have a drive full of photos – over 300GB – that are sorted into folders for each location photographed. The folder name is a location code of sorts.  While NTFS can have billions of files in a folder, explorer will seize up for minutes as it retrieves data for this drive.

I needed a way to sort my folders into subfolders, just to speed up browsing the drive.  If a location code was DJKSASWW, I wanted that sorted into a folder name DJKS.  This would group much smaller sets of data and still allow for an intelligent, browseable structure if human intervention was necessary.

Powershell came thorough for me.

# source location of folder to copy/move
$source = "E:\IMAGEVAULT\"

# where we want these to wind up
$destination = "R:\imagevault\"

# get our objects (this is filtered for just those that start
# with the letter 'a' right now
$folders = Get-ChildItem -filter A* $source

# loop each folder object from our source
foreach ($folder in $folders){
    # the this specific folder name
    $foo = $folder.name
    # new folder name is going to be the first 4 characters
    $newfolder = [char]$foo[0]+[char]$foo[1]+[char]$foo[2]+[char]$foo[3]
    # set the path to this new destination folder
    $newDest = $destination + $newfolder

    # test to see if this path exists
    if(Test-Path $newDest)
        {   # it does so we will show what we're copying/moving
            $folder.FullName + " to " + $newDest
            # and perform the task
            Copy-Item $folder.FullName $newDest -recurse
        } else {
            # create path since it didn't exist
            New-Item $newDest -Type Directory
            # show what we're copying/moving
            $folder.FullName + " to " + $newDest
            # and perform the task
            Copy-Item $folder.FullName $newDest -recurse
        }
}

This allows me to set a source and destination and the script (while time consuming) will fix the entire structure.

All you'd have to do is change Copy-Item to Move-Item if you didn't want a 2nd set.

Categories: powershell, scripting

Non numeric custom ID generated in SQL Server

Sometimes the Identity Column will not suffice – you need to create something custom. This article will explain how to handle that. It demonstrates how to create IDs that auto-increment and yet use custom rules like XXYYY for the result.

Categories: SQL Server, TSQL, Uncategorized

Proudly powered by WordPress Theme: Adventure Journal by Contexture International.