Universal Pause Button

I like to play video games.  I also have a significant other, and she often walks into the room to talk to me while I'm playing a video game.  I would like to pause the game so that I can give her my undivided attention while she's talking to me, but a lot of games (particularly single-player ones) have these "un-pausable" cut scenes or other areas of the game where the normal pause functionality doesn't work.  This annoys both me and her, because I'm supposed to be the computer expert, and it looks like I don't even know how to pause my stupid video game.  So usually what ends up happening is I skip the cut scene and miss the story, or upset my SO by not paying attention to her as well as I should.

So that is why I wrote Universal Pause Button. It's a very simple Windows desktop app that sits in the system tray. Its icon resembles a pause button.  When you hit the actual Pause key (also known as Break) on your keyboard, the program determines which window is currently in the foreground (i.e. your game's window,) and pauses it.  No matter where you are in the game. Even in the middle of one of those pesky cut scenes that would otherwise be un-pausable.  When you press the key again (as long as you haven't since re-focused to another window,) the game will un-pause.

As of v1.0.3 you can now customize the "Pause" key that you want to use. Read the settings.txt file. The program reads the custom pause key from the settings.txt file during startup.

I've currently been testing this with The Witcher 3, and it is working great.  However, your mileage may vary. "Pausing" processes is something that usually only debuggers do, and I can't predict how your game will react to it.  Pausing processes may lead to race conditions among the threads of that process, but like I said, testing has been very positive for me so far.  I've already gotten great value out of the program, as there are lots of cut scenes in The Witcher 3, that I don't want to skip. The main use case for this app is single player games, as pausing your multi-player game will undoubtedly just get you kicked from the session, as if your computer had just crashed or hung. So don't use it in multi-player games.  It also works on applications that are not games at all.

Also, it's open source!  You can find the source on Github here.

If you prefer to just download the (signed) executable, here it is:

UniversalPauseButton.exe (124.3KB)

An Ode to Server Fault

Server FaultToday marks a momentous occasion, as I have finally attained 20,000 reputation on Server Fault!  20k is by no means the reputation limit, and there are still plenty of other badges to be earned as well, but it is the last reputation-based milestone in my journey.  It comes with the title of "Trusted User" and grants an extra layer of powers on the site just shy of full moderator power.

It took me almost two years and 490 answers to achieve it. 

In case you don't know, Server Fault is a question and answer site that I have referenced many times before on this blog. It is one site that is part of a larger network of question and answer sites known collectively as Stack Exchange.  Server Fault is specifically aimed at IT professionals.  People who work with servers and networks in an administrative, engineering or architectural capacity to support a business's IT operations.  It is not about programming, nor is it about the enthusiast user at home setting up a Linksys router... though the lines can sometimes be blurry.  People come and ask questions on the site, such as "Halp I broke Active Directory" or "How do I SharePoint?", and we gain reputation for providing answers to those questions and have the community vote on them based on the quality of our answers. (Or lose reputation if your answers suck!)

20k reputation is actually just a drop in the bucket on some other Stack Exchange sites such as Stack Overflow, but the difference is that Server Fault only gets a fraction of the traffic that Stack Overflow gets.  I've chosen to focus on SF as it's most closely aligned with my own professional ambitions and interests.

Q: Why did I choose Server Fault over the TechNet forums or Experts Exchange?

It's been long enough that I barely remember first stumbling upon the site, but I know I stumbled upon it while researching some problem with WSUS or DHCP or Active Directory or something like that.  The site's aesthetic design was very attractive, and the layout made sense to me and it was clean and neat.  The questions covered a wide range of interesting things that were right up my alley.  I liked the idea of being "rewarded" for giving people good answers and rewarding others for their insight. Even if the reputation is totally intangible and practically meaningless, it still gives me a sense of progression and of having earned something.  In a way, it makes a game out of answering people's questions.  I know that the TechNet forums does reputation too, but the website doesn't look and feel as nice or have as many features, the questions aren't usually as varied and interesting, and the community (both the askers and the answerers) generally seem lower caliber.  Serverfault is chock full of features, including a sweet chat room where you can go and shoot the bull with other sysadmin-type people.

I quickly signed up, and before I knew it I was visiting the site every day to see what types of technology people were discussing and if there were any questions there that I could answer.  And after I found out the site ran on a mainly Microsoft stack (IIS, .NET, MS SQL, etc.,) I was totally in love.

My very first answer on SF*My very first answer on SF. The question was from a Windows Server admin, asking what scripting language he should learn.*

One of the quirks about Server Fault that I wouldn't see on the TechNet forums is that there are a lot of questions about Unix and Unix/Linux applications too.  That's a challenge for me because, in case you haven't noticed, I'm a Microsoft evangelist.  But that doesn't mean I'm a Linux hater.  I know that it's a very solid platform used by millions of people around the world and I want to learn about it too.  Even though I tend to opt for using Microsoft platforms and tools, I also get to see other people bringing *nix and Microsoft tech together in fascinating ways, such as this guy, who is setting up 1400 Samba4-based Active Directory Read Only Domain Controllers!

Q: Why would I waste my time answering other people's questions on the internet?

Ah.  This is where it gets interesting, you see, because it's not a waste of time.  In fact, spending time on Server Fault keeps my skills sharp.  Being constantly exposed to new problems, and people applying technology in interesting ways that I had never thought about and running into new types of issues that I had never needed to solve before.  Spending time on Server Fault is an investment in myself.  I know more about my industry because of that site.  It happens again and again that I'll end up reading 3000-word TechNet articles and digging through MSDN documentation on the Active Directory schema just in order to be able to answer someone else's Server Fault question.  That's personal enrichment.

And more importantly, I've made friends there.  People that I've had the pleasure of talking to over the phone and doing business with in real life.  I've stayed up many late, alcohol-fueled nights in the chat room with these guys talking about everything from FusionIO cards to the U.S. Constitution to why I should quit my job and go work with Mark. ;)

In fact, I'm hoping to meet up with some of these guys at TechEd 2014!

 

My Entry for the Advanced Event #1 of the 2013 Scripting Games

I've been pretty excited about the annual scripting games. This is only my second Games, but they have been a terrific Powershell learning experience for me. This year it's being run by Don Jones and his gang:

http://scriptinggames.org/

http://powershell.org/wp/

Their PHP-based website has already shown to be a little buggy, and I will eat road salt before I enable Java in my browser, so I won't be using their chat room, but you have to cut them some slack as it's a brand new site that has never been used before.

When people comment on the scripts you submit, it can be humbling but is also a good learning experience for being able to tell what people wanted out of your script but didn't get. There's not any error-handling to speak of in this script - I knew that was a risk I was taking by submitting a script with no error handling, but the event description stated that I should "display all errors clearly," which is exactly what the script does with no error handling. Still, I could have still used error handling to make it a little more elegant. Also, I guess I've got to break down and start doing the -WhatIf and -Confirm junk, even though I don't exactly want to, it's going the extra mile.

Without further ado:

#Requires -Version 3
Function Move-OldFiles
{
	<#
		.SYNOPSIS
			Move files that are older than a specified number of days. (Default is 90 days.)
			Use the verbose switch if you want to see output, otherwise the Cmdlet shows only errors.
		.DESCRIPTION
			Move files that are older than a specified number of days (default 90) from the 
			source directory to a destination directory. Directory recursion is on by default,
			but can be disabled with the -NoRecurse switch. The subdirectory structure will be 
			preserved at the destination. By default, all files are moved, but a file pattern
			can be specified with the -Pattern parameter. By default, files that already exist at
			the destination and are readonly are not overwritten, unless the -Force switch is used.
			This cmdlet works with drive letters as well as UNC paths. By default, only errors are shown.
			Use the -Verbose switch if you want to see more output. This function requires Powershell 3.
		.PARAMETER SourceDirectory
			Specifies the source directory from which you want to move files. E.g. C:\Logs or C:\Logs\
			This must be a valid directory. The alias for this parameter is Source.			
		.PARAMETER DestinationDirectory
			Specifies the destination directory to which you want to move files. E.g. E:\Archives or
			E:\Logs\Old\ or \\SERVER02\Share\Logs. This must be a valid directory. The alias for
			this parameter is Destination.
		.PARAMETER OlderThan
			The number of days that a file's age must exceed before it will be moved. This is
			an optional parameter whose default is 90 days. This parameter must be a positive
			integer. The alias for this parameter is Age.
		.PARAMETER Pattern
			This is an optional filename filter. E.g., *.log or *.txt or Report*.html.
			The alias for this parameter is Filter.
		.PARAMETER NoRecurse
			This is a switch that indicates whether the cmdlet will process files in subdirectories
			underneath the specified source directory. By default, recursion is on. Optional.
		.PARAMETER Force
			This is a switch that indicates whether files that already exist at the destination
			and are readonly will be overwritten. By default they are not overwritten. Optional.
		.EXAMPLE
			PS C:\> Move-OldFiles -Source C:\Application\Log -Destination \\NASServer\Archives -OlderThan 90 -Filter *.log
		.EXAMPLE
			PS C:\> Move-OldFiles C:\Logs \\NASServer\Archives 90 *.log
		.EXAMPLE
			PS C:\> Move-OldFiles -SourceDirectory C:\Logs -DestinationDirectory \\NAS\Archives -Age 31 -Pattern *.log -Force
		.EXAMPLE
			PS C:\> Move-OldFiles C:\Logs \\NAS\Archives
	#>
	[CmdletBinding()]
	Param([Parameter(Position = 0, Mandatory = $True, HelpMessage = 'Source directory, e.g. C:\Logs')]
			[ValidateScript({Test-Path $_ -PathType Container})]
			[Alias('Source')]
			[String]$SourceDirectory,
	      [Parameter(Position = 1, Mandatory = $True, HelpMessage = 'Destination directory, e.g. \\NASServer\Archives')]
			[ValidateScript({Test-Path $_ -PathType Container})]
			[Alias('Destination')]
			[String]$DestinationDirectory,
		  [Parameter(Position = 2, Mandatory = $False, HelpMessage = 'The number of days old the file must be in order to be moved.')]
			[ValidateScript({$_ -GT 0})]
			[Alias('Age')]
			[Int]$OlderThan = 90,
		  [Parameter(Position = 3, Mandatory = $False, HelpMessage = 'The file pattern to match, e.g. *.log')]
			[Alias('Filter')]
			[String]$Pattern = "*",
		  [Parameter(Position = 4, Mandatory = $False, HelpMessage = 'Disable directory recursion, i.e. only copy the directory specified.')]
			[Switch]$NoRecurse = $False,
		  [Parameter(Position = 5, Mandatory = $False, HelpMessage = 'Specify to overwrite existing readonly files at the destination.')]
			[Switch]$Force = $False)
	
	$Start = Get-Date
    If(!($SourceDirectory.EndsWith("\")))
    {
	    $SourceDirectory = $SourceDirectory + "\"
    }
    If(!($DestinationDirectory.EndsWith("\")))
    {
        $DestinationDirectory = $DestinationDirectory + "\"
    }
	
	Write-Verbose "Source Directory:       $SourceDirectory"
	Write-Verbose "Destination Directory:  $DestinationDirectory"
	Write-Verbose "Move Files Older Than:  $OlderThan Days"
	Write-Verbose "Filename Filter:        $Pattern"
	Write-Verbose "Exclude Subdirectories: $NoRecurse"
	Write-Verbose "Overwrite if Readonly:  $Force"
	
	If($NoRecurse)
	{
		$SourceFiles = Get-ChildItem -Path $SourceDirectory -Filter $Pattern -File | Where-Object LastWriteTime -LT (Get-Date).AddDays($OlderThan * -1)
		Write-Verbose "$($SourceFiles.Count) files found in $SourceDirectory matching pattern $Pattern older than $OlderThan days."
	}
	Else
	{
		$SourceFiles = Get-ChildItem -Path $SourceDirectory -Filter $Pattern -File -Recurse | Where-Object LastWriteTime -LT (Get-Date).AddDays($OlderThan * -1)
		Write-Verbose "$($SourceFiles.Count) files found in $SourceDirectory matching pattern $Pattern older than $OlderThan days."
	}
	
	[Int]$FilesMoved = 0
	ForEach($File In $SourceFiles)
	{
		Write-Verbose "Moving $($File.FullName)"
		$DestinationFullName = $DestinationDirectory + $($File.FullName).Replace($SourceDirectory, $null)
		$DestinationFileDirectory = $DestinationFullName.Replace($DestinationFullName.Split('\')[-1], $null)
		If($PSBoundParameters['Verbose'])
		{
			Write-Progress -Activity "Move-OldFiles" `
						   -Status "Moving files..." `
						   -CurrentOperation "Transferring $($File.FullName)`..." `
						   -PercentComplete $([Math]::Round($FilesMoved / $SourceFiles.Count * 100, 0))
		}		
		If($Force)
		{
			If(!(Test-Path $DestinationFileDirectory -PathType Container))
			{
				Write-Verbose "Creating directory $DestinationFileDirectory"
				New-Item $DestinationFileDirectory -Type Directory | Out-Null
			}
		    Move-Item -Path $File.FullName -Destination $DestinationFullName -Force | Out-Null
		}
		Else
		{
			If(!(Test-Path $DestinationFileDirectory -PathType Container))
			{
				Write-Verbose "Creating directory $DestinationFileDirectory"
				New-Item $DestinationFileDirectory -Type Directory | Out-Null
			}
		    Move-Item -Path $File.FullName -Destination $DestinationFullName | Out-Null
		}
		$FilesMoved++
	}
	$End = Get-Date
	Write-Verbose "$($SourceFiles.Count) files were moved in $([Math]::Round(((New-TimeSpan $Start $End).TotalSeconds), 1)) seconds."
}

Games I've Been Playing Part I

Alright, so this blog has been up for a few months now, and so far I've only blogged about IT topics, Windows Server, networking... those sorts of things.  I've not made a single post yet that hints at what a life-long video game junkie I am.  I'm about to remedy that with this post by going over some of the video games that I've been playing recently.

Battlefield 3

bf3BF3 is my bread and butter. It seems like I play it almost every day. I've been an avid fan of the Battlefield franchise since Battlefield 1942... I thought it was great, and its Desert Combat mod made it legendary, so when Battlefield 2 came out, I was right there and played it regularly for years. Then I skipped Bad Company 1, but I did play a lot of Bad Company 2. Now we're at Battlefield 3. Every game in this franchise is amazing - at least from an online multiplayer standpoint. On the other hand, the single player campaign in most all of the Battlefield games that I've played is nothing spectacular. BF3 is no exception. I played through the single player campaign once and then never looked back. But no one should be buying a Battlefield game for the single player. For multiplayer tactical military warfare that will have you shooting people in the face with buckshot, dogfighting with other fighter jets, blowing holes in buildings with your grenade launcher to get at that sniper, and ripping your victim's dogtags off with your combat knife, all while coordinating with your team to ensure victory... there is simply no better game than Battlefield 3 right now. The graphics are unparalleled, the controls are responsive, the ballistics and hitboxes feel right... it's just a great game. One of my favorite things is that even though I've been playing the game for months, it seems like I'm still hearing new sound clips from the people around me that I've never heard before.  Things like "there's a machine gunner settin' up over there!" and "holy shit grenaaaaaade!" There are lot of those little voice clips that add to the immersion.

There are only two things that I don't like about this game and its publishers - bring back mod support, and kill Origin. (I know neither of those will ever happen, but I can dream.) I hate Origin. I am seriously considering not playing Mass Effect 3 (even though I want to) simply because Origin disgusts me.

  

Modern Warfare 3

mw3I bought Call of Duty: Modern Warfare 3 because one of my coworkers talked me into it. The single player campaign in MW3 is pretty good. Better than Battlefield 3's, for sure. It's action packed and entertaining, but mostly in the sense that an action movie is action packed and entertaining. I still would not consider it to have any replay value. The graphics don't appear to have advanced at all from the last Modern Warfare game. The multiplayer is absolutely no comparison to BF3. Modern Warfare's multiplayer game is arcade-like and twitch-based... it still feels like you're playing Quake III Arena, running down halls and hoping you pull the trigger faster than the other guy. There are no vehicles to drive, no open maps to roam around in... I don't know - it's not a bad game, but it just doesn't hold nearly as much interest for me as BF3. Also, it suffers from this horrible multiplayer synchronization bug where I keep getting "out of sync" with the other person that I'm playing with. E.g., it will appear to me like he has died, so I run over to go revive him, but then on voice chat he says "what are you talking about dude, I'm fine!" And it doesn't seem like the problem is getting patched. It still happens.  Inexcusable.

 

Assassin's Creed Revelations

ACR

I have strong feelings about this game and franchise. I think the Assassin's Creed games are fantastic games, and a pretty damn good story to boot. I didn't play the first Assassin's Creed when it came out. But Assassin's Creed II went on a Steam sale so I picked it up. I was floored. What a great game! (Seriously, Leonardo da Vinci building contraptions for me? How much cooler can you get?) After finishing it, I immediately got back on Steam and grabbed AC:Brotherhood. Again, extremely fun and interesting. Then because I was loving the storyline and the style so much, I grabbed the first Assassin's Creed game and tried to play through it. Unfortunately I wasn't able to make it through because AC:II and AC:B were so much better than the first one, they had spoiled me. I waited eagerly for months for AC:Revelations to come out. I watched the trailer at least a dozen times.

I bought it on day one. It's still good, but I don't think it's as good as ACII or AC:B. It's short. The whole Lucy/Shawn/Rebecca/real life part of the story is gone. The characters are not as interesting or as vivid as the characters from Italy like Rodrigo Borgia and Caterina Sforza. There are no more beautifully rendered chapels full of artwork. (They tried, and some scenes from AC:Rev do look really awesome, but there's only so much to work with in the Middle East.) And when it ended, I was left with a bitter taste in my mouth. I literally sat there watching the credits roll, waiting for something else to happen. I felt cheated by the lack of resolution in the ending. I guess I expected that a game called Revelations was going to offer some... revelations, or tell us something that we didn't already know. Honestly, it left me feeling like maybe Ubisoft actually wasn't concerned about telling this story in a rich and artistic way as much as just making those yearly releases on time so they can make some more money.

But, a few months after finishing it, I've pretty much come to terms with it. It's still a good addition to the franchise, and I've come to accept that all of Ezio's life and part in this story is pretty small in the grand scheme of things. I was expecting too much out of Revelations and out of Ezio himself; as if I expected everything to be resolved and wrapped up right there and then by this game.

I'm ready to see the next assassin - a whole new generation, a whole new time and place. I hear it's going to be taking place during the American Revolution, with some Native American influences... but it's going to be hard to outdo Ezio. Ezio was an incredibly memorable character, and we got to know him literally from the moment of his birth, until his death.

Ezio lives to a ripe old age and apparently dies a natural death from a heart attack on a public bench in Florence, Italy, with his wife and daughter nearby. Not at all a bad way to go for someone who spent their entire life as an international assassin.

Ubisoft - if you're listening, I just want to say this: Remember that you have a chance to tell an amazing story here. A work of art. It can be more than just a video game. It can live on long after you and the game's profits are gone. Please don't ruin that opportunity.

 

Batman: Arkham City

Batman ACNot a whole lot to say about this game other than "it rocks." I got Batman Arkham Asylum bundled with a video card upgrade a couple years ago, and I freakin' loved it. Extremely nice graphics, combat that made you feel like a real badass, and more gadgets than you knew what to do with.  So I knew that Arkham City - the sequel to Arkham Asylum - was going to be an instant buy for me.

Arkham City is just more of what made Arkham Asylum great. The combat is even better, the gadgets are even cooler, and the world is more open and free-roam-able. Plus, you can play as Catwoman, who is even more agile than Batman. Talk about kicking some major ass, ninja style.

The only downside I can think of is that there is a bit of a DirectX 11 stuttering problem, but you can easily switch DX11 off.

The only thing that gets me about Batman, is that doesn't he realize that he's actually putting more people in more danger by keeping criminal masterminds like Joker alive? I get that there is sort of a dynamic between Joker and Batman where they subconsciously keep each other alive because without each other, they would both lose their sense of purpose, even though they'll never admit that... but still, Batman's absolute refusal to kill anyone, even when it results in putting everyone else in mortal danger, annoys me.

 

Dead Island

Dead IslandThis game is interesting in that it doesn't seem like it was very well received. When the trailer was first released, everyone gawked at how awesome it was. You know, that video where everything happens backwards to the tune of a melodramatic piano and it turns out that it's a family fighting off a zombie invasion? It's here by the way. You owe it to yourself to watch it if you've not seen it. It's probably one of the best video game trailers ever made.

Alright, well the actual game didn't turn out much like that trailer, and I think that disappointed a lot of people.

However, I still really enjoyed Dead Island. (My current love of the TV show "The Walking Dead" may be related.) It's got that sort of multiplayer where teammates are free to come and go sort of like in Left 4 Dead. The acting and story line is pretty bad, but the scenery is beautiful, the zombies just keep coming, ammo is scarce so you're always feeling desperate, and the game world is very big and you're free to roam around in it.

If you had a small group of dedicated friends with voice chat - this game could simply be an amazing multiplayer experience. In that sort of "OK, you go to the lifeguard station and I will go get some gas from the gas station, and then we'll meet back here. Watch out for zombies" kind of way. However, just dropping in on a random game with one or two people you don't know... may not be so great.

 

Warhammer 40K: Space Marine

Warhammer 40k Space MarineI love the Warhammer 40k universe. It would make a fantastic MMO universe... just sayin'. It's got pure testosterone-based badassery like 8-foot tall genetically engineered space marines that destroy all of the emperor's enemies... and it also has a touch of comic relief like an "Ork" race that is ostensibly stupid, but apparently so prolific that there is no end to their numbers. When Warhammer 40K: Dawn of War came out years ago, it was a real-time strategy game like Starcraft, and I absolutely loved it. Dawn of War II took that similar RTS concept and boiled it down to where you only controlled one or two squads at a time, basically took away all of the base-building, and it was up to you to tactically maneuver those one or two squads around the terrain. That was met with mixed reactions. Some people enjoyed the more personal, tactical aspect... but some people preferred the more large-scale war-like feel of throwing hundreds of troops against one another in an epic battle.

Warhammer 40k Space Marine distills it even further to where you're actually just controlling one single space marine in a 3rd person over the shoulder type of game. There are a couple of other people with you at various parts of the game but of course they're largely useless. It's up to you to blow the heads off of endless hordes of Orks and Chaos Marines. I still enjoyed the game for what it was - stomping the heads of Orks, mowing them down with your auto-bolter, etc... the graphics are nice, the controls are nice, multiplayer is fun, but it does get old after a while.

Nothing too out of the ordinary.

 

Skyrim

Skyrim. This game was hugely popular. I played Morrowind in 2001. I played Oblivion a few years later. They're OK... but none of these games have ever really knocked my socks off. I can't just complete the main questline without feeling like I'm missing out on all those side-quests and free-roaming, yet at the same time, if I just go off and do my own thing, then I feel like I have no sense of direction or purpose. I can't just do the side missions without feeling like I'm letting the dragons/demons/bad guys rape and pillage in the meantime.

Anyway, the graphics are fantastic, obviously. The combat is fine. I hate fighting trolls. I'd rather face a dragon than a troll I think.

Anyway, I finished the main story line, but I'm just not as excited about it as most people are. I might have put 40 hours into it. I still prefer modern or sci-fi themes... see above with the Warhammer 40k MMO idea.

All that said, I will enjoy coming back to this game in a year or so, after the modders have had some time to create some really cool mods for this game.

 

Dustforce


I've been playing quite a bit of this game. It's very fun. It's addictive, and possibly most importantly - it has a fantastic soundtrack. Seriously. Just do a Youtube search for "Dustforce OST". It's good stuff.