Remote Desktop Client 6.1 – /console now /admin

Posted by walsh_r on 23 Sep 2008 | Tagged as: Microsoft, Windows

Recently I discovered after installing Windows Vista SP1 that the /console option was missing from the Remote Desktop Client.  Luckily, the functionality remains, only with a new command.

Prior to version 6.1 of RDP, to access the console type “mstsc /console”.

Post version 6.1 of RDP, to access the console type “mstsc /admin”.

SQL Server 2005 Backup Script

Posted by walsh_r on 27 May 2008 | Tagged as: Backups, Databases, Microsoft

Sql Server 2005

Those of you looking for a simple backup setup for your SQL server 2005 databases are in luck! I’ve stumbled across this script, and modified it to work for me in my environment.

I am not suggesting that your entire SQL server backup strategy should be to create backup files from your databases nightly. However, a nightly backup scripted to an alternate location is absolutely a crucial component of your SQL server backup strategy.

Use SQL Server Agent to create and schedule a job containing the following code as the command portion of the only step the job will contain:

DECLARE @DBName varchar(255)

DECLARE @DATABASES_Fetch int

DECLARE DATABASES_CURSOR CURSOR FOR
select
DATABASE_NAME = db_name(s_mf.database_id)
from
sys.master_files s_mf
where
– ONLINE
s_mf.state = 0

– Only look at databases to which we have access
and has_dbaccess(db_name(s_mf.database_id)) = 1

– Not master, tempdb or model
and db_name(s_mf.database_id) not in (’Master’,'tempdb’,'model’)
group by s_mf.database_id
order by 1

OPEN DATABASES_CURSOR

FETCH NEXT FROM DATABASES_CURSOR INTO @DBName

WHILE @@FETCH_STATUS = 0
BEGIN
declare @DBFileName varchar(256)
set @DBFileName = datename(dw, getdate()) + ‘ – ‘ +
replace(replace(@DBName,’:',’_'),’\',’_')

exec (’BACKUP DATABASE [' + @DBName + '] TO DISK = N”c:\db backup\’ +
@DBFileName + ”’ WITH NOFORMAT, INIT, NAME = N”’ +
@DBName + ‘-Full Database Backup”, SKIP, NOREWIND, NOUNLOAD, STATS = 100′)

FETCH NEXT FROM DATABASES_CURSOR INTO @DBName
END

CLOSE DATABASES_CURSOR
DEALLOCATE DATABASES_CURSOR

Edit the line which contains c:\db backup\ to point at the location where you would like the database backup files to be deposited.

Modify the line with datename(dw, getdate()) in it to change the output file name of your database backups. If you leave the above script unchanged, your database backup files will be named: Monday – dbname.bak, Tuesday – dbname.back etc. In my case, I chose to leave this naming convention for one particular reason. I schedule the SQL Server Agent job to run a few hours before I schedule a task in Windows to execute a batch file which copies the contents of my backup directory to a network file server. By keeping all of my files named using days of the week as the only delimiting factor, I know that my file server will never have more than 7 days worth of data saved onto it (since every Monday will overwrite every past Monday, and every Tuesday will overwrite every past Tuesday, etc).

Clonezilla

Posted by walsh_r on 16 May 2008 | Tagged as: Backups, Imaging

Clonezilla Logo

Starting my 3rd major IT job in the last 5 years, I find myself talking companies into investing into tools that I use on a regular basis time and time again.  Naturally, when I found out that my new employer did not have an imaging solution in place for me to use as a safety net prior to reconfiguring some critical server componants, I decided to go shopping.  This time however, what I found had a $0.00 price tag.

Clonezilla is available in two editions, Clonezilla live, and Clonezilla server.  Live is suitable for single machine backup and restores, and is completely self contained into one linux based bootable cd.  Clonezilla server edition can be used to clone multiple machines simutaneously (similar to Ghostcasts from Norton and Symantec’s products).

In my test environment, I was able to use Clonezilla server to image 4 machines at once (using multicast) with an image size of approx 6 GB.  The entire process took just over 12 minutes.

Check this great product (did I say that it was FREE?) here.

Features of Clonezilla

  • Free (GPL) Software.
  • Filesystem supported: ext2, ext3, reiserfs, xfs, jfs of GNU/Linux, and FAT, NTFS of MS Windows. Therefore you can clone GNU/Linux or MS windows. For these file systems, only used blocks in partition are saved and restored. For unsupported file system, sector-to-sector copy is done by dd in Clonezilla.
  • LVM2 (LVM version 1 is not) under GNU/Linux is supported.
  • Multicast is supported in Clonezilla server edition, which is suitable for massively clone. You can also remotely use it to save or restore a bunch of computers if PXE and Wake-on-LAN are supported in your clients.
  • Based on Partimage, ntfsclone and dd to clone partition. However, clonezilla, containing some other programs, can save and restore not only partitions, but also a whole disk.
  • By using another free software drbl-winroll, which is also developed by us, the hostname, group, and SID of cloned MS windows machine can be automatically changed.

Sync Google Calendar with Outlook 2007 or 2003

Posted by walsh_r on 18 Mar 2008 | Tagged as: GMail, Google, Microsoft

Google has forged ahead yet again!

Google Sync

Many thought GMail’s previous support of IMAP had finally made Google a major player in the online application industry.  However, one major downfall has always been the lack of standardized support to syncronize Google Calendar with the heavily used personal and business used Microsoft Outlook.

Early this month, Google officially announced that Google Calendar will now sync with Outlook 2007, and 2003.  Synchronization is made possible by use of a small resource light tool called Google Calendar Sync.

Once installed, this software can monitor your primary Google Calendar, and default Outlook Calendar.  It provides directional control over the flow of information (one or two way synchronization options).  Syncs can even be configured to automatically run at a minimum of every 10 minutes.

Check out this Google Calendar Help page for more information, and to download the latest version of the Google Sync software.

SPOOLSV.EXE high CPU usage FIX

Posted by walsh_r on 10 Mar 2008 | Tagged as: Printing or Scanning, Windows

Symtoms:

  • Slow or unresponsive Windows XP system.
  • SPOOLSV.EXE high CPU usage (90-100%)

Cause:

  • Print spool service hung on a corrupted file stored in a temporary printer queue directory.

Resolution:

  1. Restart the Windows XP workstation.
  2. Log into the workstation with an Administrative account.
  3. Delete the contents of the following directory:
    1. c:\windows\system32\spool\Printers\
  4. Restart the print spooler service (and or the entire workstation).

Anyone managing a group of Windows XP workstations noticing SPOOLSV.EXE hogging the CPU from task manager should give this a try.

Another “Convert MKV x264 to WMV for the Xbox 360″

Posted by walsh_r on 07 Feb 2008 | Tagged as: Media Center, Multimedia, Xbox 360

Thanks to Chris Lynch for helping to refine the MKV to WMV conversion method. His original thread from xbox-scene.com can be found here.

Click here to download the guide by Chris Lynch in PDF format.

This guide demonstrates a very polished method of converting MKV files into WMV-HD video files with 5.1 audio surround sound, using Windows XP or Windows Vista. This guide accomodates multiple types of audio sources (AC3, DTS, etc), where older conversion methods failed in the past.

HD screen cap

Background from previous article…

The Xbox 360 was officially released by Microsoft on May 12, 2005, as a 7th generation gaming console, and network ready media center extender. The hardware capabilities of the Xbox 360 make it the best high definition video player on the market for its price. However, the software limitations imposed upon that hardware by Microsoft leave much to be desired by users hoping to to consolidate their living room multimedia equipment into one box. Originally, the biggest fall back of those limitations is by far the lacking support for any digital video file support other than WMV. The majority of internet available digital video content is not in WMV format.

Recent updates via Xbox live have enabled support for .avi and .divx files. However, the current popular format for internet digital high definition video content is Matroska video (MKV). MKV container files include x264 HD video content (720p, 1080i, and 1080p), along with 5.1 AC3 or DTS audio. The Xbox 360’s software limitations prevent it from being able to display MKV HD video files. MKV playback is not natively supported on the Xbox 360.

How to Convert MKV x264 to WMV for the Xbox 360 (Part 2)

Posted by walsh_r on 10 Nov 2007 | Tagged as: Media Center, Multimedia, Xbox 360

**Update Visit http://www.ryanwalsh.ca/blog/?p=8 for a new polished tutorial similar to this one, to convert all of your MKV’s to WMV (DTS support included).

With all of the required software from Part 1, we are now ready to start converting x264 MKV video files to WMV-HD.

Process:

The first step is to separate the audio and video portions of the MKV file. By doing this, we will minimize the reduction in quality associated with converting video files from one type to another. Skipping this step, will negatively impact the frame rate of the outputted WMV-HD files.

  1. Open MKVExtractGUI (C:\Program Files\MKVtoolnix\MKVextractGUI.exe by default).
  2. Select the MKV file using the input section of MKVExtractGUI.
    1. After a few moments, items will be displayed in the Content box of the MKVExtractGUI.
  3. Select the audio track (usually labeled with A_AC3).
  4. Click Extract.
    1. This will extract the audio portion of your MKV file to the output directory (which is by default, the same location as the input directory).
    2. Once the extraction is complete, click OK and close MKVExtractGUI.

Extracting Audio from MKV using MKVExtractGUI

The second step in the conversion process is to create an AVIsynth script to be used in a TMPG Express project (the software which we will use in the next step).

  1. Open up notepad, or any other text editor, and create a script using the following as a guideline. Remember to edit the script so that it matches the path to your file, and the correct filename.
    1. DirectShowSource (”C:\wmv_working\Oceans.Thirteen.2007.720p.HDDVD.x264-SiNNERS.mkv”)
    2. c:\wmv_working in this example, is the directory where the mkv file is being stored, and the full path to the file is C:\wmv_working\Oceans.Thirteen.2007.720p.HDDVD.x264-SiNNERS.mkv
  2. Save the file as “movie.avs”.

Our next step is to create a project in TMPG Express, using the AVIsynth script as our video source file, and the extracted AC3 file as the audio source.

  1. Launch TMPG Express
  2. Start a new project
  3. Click “Add File”
  4. Select the AVIsynth file created earlier. You may have to change the file type drop down list to “All Files” for the script to appear.
  5. Select the AC3 file extracted previously as the source file for the AUDIO.
    TMPG Project Window
  6. Click “Yes” if prompted to reset a key frame list
  7. Pay attention to the details listed beside “Source Format” for the video portion of the project. Particularly, note the resolution of the video somewhere before proceeding, as you will need to enter in this information in future steps. The resolution of the video in my example, is 1280*528.
  8. Rename the clip name if you’d like, and click OK to proceed.
  9. Select “Format” at the top of the TMPG window.
    Select Format from the Main Menu
  10. The “Output Format Selection” window will display. Click “Browse” at the bottom of your screen, and select the custom Xbox 360 720p VBR TMPG profile extracted from the wmv-hd.zip file in Part 1 of this tutorial. The file’s name is Xbox 360 720 VBR.txp4e
  11. Once you have selected the TMPG profile in step 7, you will be directed to the TMPG Format window. There are two key things to adjust in this Window.
    TMPG Format Window

    1. Enter the correct values for the video resolution (as noted earlier).
    2. Click on the “Calculator” button.
      1. From the Calculator, you can adjust the bit rate of your output file, to achieve whatever quality/size limitations needed. For example, I try to make my HD-WMV files fit onto a blank 4.7 GB DVD. To do this, select DVD 4.7 GB (UDF) from the drop down list, enter 100% of the media capacity, and click OK.
      2. Most HD MKV files are released to fit onto a 4.7 GB DVD, or an 8.5 GB DVD already. If your MKV file is set to fit onto an 8.5 GB disc, it may make sense to you for your converted file to fit the same. In this case, select DVD 8.5 GB (UDF) instead.
      3. If you never plan to burn the video files to DVD, file size may not be an important factor for you. In this case, try to match the file size of your MKV file by experimenting with the bit rate values.
  12. Click on Encode at the top of the TMPG menu.
    Click on Encode
  13. Change the output file name if you choose, and click Start Encode to have TMPG begin the transcoding process.
  14. Sit back, and wait. This process can take quite a bit of time, depending on the specs of your system, and the length of the video file. For example: a dual core, 64 bit 4200+ AMD, with 3 GB of RAM, and Windows Vista finishes a 1.5 hour movie in approximately 12.5 hours.

Thanks again to Cody Browning for helping many of us come up with this conversion method. His original thread from xbox-scene.com can be found here.

Linux – Taking over an existing TTY session remotely

Posted by white_b on 23 Oct 2007 | Tagged as: Linux

Some of us have run across situations where we want to be able to keep user-mode programs running in a Linux TTY session, but still want to be able to manage them remotely through SSH or other means.

One solution is the ‘linuxvnc’ utility, which can grab a TTY session and display it for use in a VNC window. I will be covering this utility, as tested on Ubuntu 7.04 Feisty (although it should work for virtually any distro).

For starters, let’s grab linuxvnc from the repositories with apt:

sudo apt-get install linuxvnc

Once that is done, fire it up: (root access is required to grab TTYs)

sudo linuxvnc X

Where ‘X’ is the TTY # you want to grab. linuxvnc should indicate that it’s listening on port 5900.

You can now connect with any VNC client, such as RealVNC, KRDC, or whatever. One thing I’ve noted is that KRDC has trouble with linuxvnc sessions if it attempts to use ‘Tight’ VNC encoding. I would recommend using zlib instead.

Of course if you’re using VNC over the Internet, I strongly recommend tunneling it through SSH. That, however, is a tip for another day.

How to Convert MKV x264 to WMV for the Xbox 360 (Part 1)

Posted by walsh_r on 22 Oct 2007 | Tagged as: Media Center, Multimedia, Xbox 360

**Update Visit http://www.ryanwalsh.ca/blog/?p=8 for a new polished tutorial similar to this one, to convert all of your MKV’s to WMV (DTS support included).

Thanks again to Cody Browning for helping many of us come up with this conversion method. His original thread from xbox-scene.com can be found here.

The Xbox 360 was officially released by Microsoft on May 12, 2005, as a 7th generation gaming console, and network ready media center extender. The hardware capabilities of the Xbox 360 make it the best high definition video player on the market for its price. However, the software limitations imposed upon that hardware by Microsoft leave much to be desired by users hoping to to consolidate their living room multimedia equipment into one box. The biggest fall back of those limitations is by far the lacking support for any digital video file support other than WMV. The majority of internet available digital video content is not in WMV format.

The current popular format for internet digital high definition video content is Matroska video (MKV). MKV container files include x264 HD video content (720p, 1080i, and 1080p), along with 5.1 AC3 or DTS audio. The Xbox 360’s software limitations prevent it from being able to display MKV HD video files. This tutorial will demonstrate one method of converting MKV files into WMV-HD video files with 5.1 audio surround sound, using Windows XP or Windows Vista.

Required:

Background:

There are lots of different video codec combinations that can be used to decode MKV files, however, many of these packaged tend to have conflicting versions of video codecs (namely ffdshow) which cause unsatisfactory encodes to WMV-HD (choppiness, image quality, etc). It is my recommendation to uninstall all existing video codecs on the machine which will be used to encode the WMV-HD video, and install only the codecs listed above. Install any other future necessary codecs one at a time, and test encodes to verify that the new codecs have not introduced any problems.

Unfortunately TMPG 4.0 Express is not a free or open source product. I’ve chosen it in my demonstration because of its ease of use, flexibility of encode times/quality settings, and price.

Preparation:

  1. Uninstall all existing video codecs and reboot.
  2. Install TMPG 4.0 Express.
  3. Install Xvid
  4. Install ffdshow tryouts
  5. Install Haali Media Splitter
  6. Extract wmv-hd.zip into a temporary directory.
    1. Contents of wmv-hd.zip
      (contents of wmv-hd.zip)
    2. Install Avisynth.
    3. Install MKVtoolnix.
    4. Copy all of the files from the MKVextractGUI folder to the folder where MKVtoolnix was installed (c:\program files\MKVtoolnix by default).
  7. Create a temporary directory which will be used to store MKV files to be converted. For the remainder of this tutorial, I will refer to this directory as c:\wmv_convert\ .
    1. Copy “Xbox 360 720 VBR.txp4e” to c:\wmv_convert .

After completing the above steps, you are now ready to convert MKV (x264) to WMV-HD for the Xbox 360.

Continued on Page 2…

IIS, PHP, MySQL and Windows Server 2003

Posted by walsh_r on 16 Oct 2007 | Tagged as: Databases, Web Design

The creation of a database driven website is very simple in concept; add content to the database, and display the content on pages. The work going on behind the scenes to make this concept function, is not always so simple. There are numerous methods and products that can be used to accomplish different parts of this task, but getting them all to work nicely together can deliver headaches to anyone.

One popular combination often chosen by developers is the use of the PHP scripting language, and MySQL database. Both products are free, open source, cross platform, and have a large base of corporate and personal users.

Getting PHP and MySQL to work nicely with Windows Server 2003 and IIS can be troublesome, mostly due to the many different versions of PHP and MySQL, and the frequency that each product is updated (don’t get me wrong, free updates to products are great, once they are configured and working as expected). After experiencing some problems related to versions myself, I decided to write this tutorial on how to configure an operational MySQL database capable of interacting with PHP, IIS 6.0 on Windows Server 2003.

Required:

Background:

  1. IIS 6.0 previously installed on a Windows 2003 Server.

PHP Installation

  1. Create a folder on your root (C:) and name it PHP. (C:\PHP)
  2. Unzip the contents of the PHP 5.2.3 ZIP file to the PHP folder created in step 1.
  3. Open the IIS MMC snap-in.
    1. In the properties of the website you wish to use PHP with (most likely the default website), go to the Home Directory tab, and select Configuration.
    2. Under Application Configuration, check to see if .php is in the list. If it is, you will need to click edit and modify the Executable to C:\php\php5isapi.dll. If it is missing from the list, click add, and use C:\php\php5isapi.dll as the Executable and .php as the extension.
  4. Copy php.ini-recommended from C:\PHP to C:\Windows and rename to php.ini .
  5. Reboot.

To test the PHP installation, create a new file in notepad that contains the code below. Save the file as test.php in the root directory of your website.

<?PHP
phpinfo();
?>

Open a web browser from your web server and test http://127.0.0.1/test.php . If PHP is installed correctly, you will get a listing of the PHP configuration.

MySQL Installation

  1. Install MySQL 5.0
  2. Install the GUI tools for MySQL 5.0
  3. Run the MySQL Server Instance Config Wizard from the Start menu.
    1. Detailed Configuration
    2. Developer Machine
    3. Non-Transactional Database Only
    4. Decision Support (DSS)/OLAP
    5. Check Enable TCPIP Networking
    6. Port 3306
    7. Standard Character Set
    8. Install as a Windows Service
    9. Assign a root password (remember this password!!)

    *Remember the password that you assign to the root account! Document the password in a secure, reliable location.

  4. Launch the MySQL Administrator Program (the GUI tools installed earlier)
    1. Server host: localhost
    2. username: root
    3. password: use the password assigned above.
  5. If the tool connects and lists information about your MySQL server, then MySQL has been configured correctly.

To finish things off, we need to configure PHP to load some MySQL extensions. This will enable the web server, PHP, and MySQL to work together while server content to web pages from the MySQL database.

  1. Copy C:\PHP\libmysql.dll to C:\windows\system32\ .
  2. Open C:\Windows\PHP.ini in Notepad.
  3. Search the INI file for the following lines, and edit them to read as follows. If there is a semi-colon in front of the line, remove it.
    1. extension_dir=”c:\php\ext\”
    2. extension=php_mysql.dll
    3. extension=php_mysqli.dll
  4. Reboot.

To test the configuration, create a new file in notepad that contains the code below. Save the file as mysqltest.php in the root directory of your website. Edit the code to replace the root password with the one previously assigned.

<?PHP

//(”server name”,”username”,”password”)
$rst = @mysql_connect(”localhost”,”root”,”insert_password_here”);

if (!$rst){
echo( “<p>Unable to connect to database manager.</p>”);
die(’Could not connect: ‘ . mysql_error());
exit();
} else {
echo(”<p>Successfully Connected to MySQL Database Manager!</p>”);
}

if (! @mysql_select_db(”mysql”) ){
echo( “<p>Unable to connect database…</p>”);
exit();
} else {
echo(”<p>Successfully Connected to Database ‘MYSQL’!</p>”);
}
?>


Open a web browser from your web server and test http://127.0.0.1/mysqltest.php . If everything is configured correctly, your web browser will display Successfully Connected to MySQL Database Manager and Successfully Connected to Database ‘MYSQL’.

The Web Server is now ready to serve PHP web pages and communicate with a MySQL database.

Next »