Category: Tech

Tech related posts.

App Pools Gone Mad!

IIS.  I’m not a fan.  But it’s a requirement where I work, so there you go.  Occasionally one of our IIS servers will slow to a crawl or stop responding altogether.  Often it’s a application pool run amok.  An app pool is essentially a container that holds the processes of a web application.  And if your web application isn’t written well, and doesn’t have decent controls in it, it can go nuts.  If someone can, say run an open ended database query with the potential to return a bajillion records because your app doesn’t disallow this sort of irresponsible behavior, the app pool containing that process is going to fill. And fill. And fill, eventually gobbling all  your processor cycles. An easy way to discern this is if the process w3wp.exe is pegging your CPU at 99%.  Find this in Task Manager.

Continue reading

Active Directory Account Lockout – Creation – Deletion – Disable monitoring

We’ve used a variety of third party tools to monitor Active Directory domain account changes.  They’ve all either been expensive or kind of sucked (or, unfortunately, both).  But if you’re running a relatively new OS on your controller you can use the magick of Powershell to ship you alerts on account changes!  Powershell can monitor the local Security Event Log on your controller and ship you an email when events matching your description are entered.  Here’s an example Powershell script:

Continue reading

USB Game Controllers and Windows 8

Once upon a time, long ago, I had an Unreal Tournament problem. The problem was that I was playing too much Unreal Tournament. So I gave it up and, since then, haven’t played games much at all.  Recently, however, I found myself pet sitting a puppy that needed to be kept in a confined space, eg: my office, and needed company, eg: me, so I grabbed a game I’d read about: Guacamelee.  And I had some Nintendo style knockoff controllers laying around from having built a Raspberry PI MAME machine for fun.  I installed the game, plugged in the controllers, confirmed Windows saw them, and fired up the game.  It couldn’t see the controller at all.

I did two things to fix this problem.  First, I installed DirectX.  Secondly, I downloaded x360ce, unpacked it into the root directory of the game, renamed the xinput1_3.dll to xinput9_1_0.dll (which is already done for you in the download above), fired up x360ce.exe to confirm it could see the controller, killed it, and fired up the game.  Voila – controller.

TrueCrypt Open Audit

Phase 2 is done.  Read it here.  The findings summary is basically:

During the engagement, CS [Cryptography Services] identified four (4) issues, and none led to a complete bypass of confidentiality in common usage scenarios. The standard workflow of creating a volume and making use of it was reviewed, and no significant flaws were found that would impact it.

The most severe finding relates to the use of the Windows API to generate random numbers for master encryption key material among other things. While CS believes these calls will succeed in all normal scenarios, at least one unusual scenario would cause the calls to fail and rely on poor sources of entropy; it is unclear in what additional situations they may fail.

Additionally, CS identified that volume header decryption relies on improper integrity checks to detect tampering, and that the method of mixing the entropy of keyfiles was not cryptographically sound. Finally, CS identified several included AES implementations that may be vulnerable to cache-timing attacks. The most straightforward way to exploit this would be using native code, potentially delivered through NaCl in Chrome; however, the simplest method of exploitation through that attack vector was recently closed off.

So basically, unless you’re concerned about the Windows API generation of the encryption key, the last version of TC prior to the developer bailout remains an effective encryption solution.  And TCNext is out there, though they’ve got no new version as yet (7.1 is available there).

Cisco VPN Command Line

I work remote, and use the Cisco VPN client to connect to the network.  There’s a timeout set on our concentrator that gives me the boot every day.  It’s a minor annoyance to be sure, but still.  It’s no fun being deep in thought on a server only to be unceremoniously kicked from the network.

So I’ve been fiddling with the command line interface of the client, to see if I can cobble together a script I can schedule to log me out and back in on my time frame rather than that of the concentrator.  Here’s what I’ve come up with so far.

1
2
3
"%programfiles(x86)%\Cisco Systems\VPN Client\vpnclient.exe" disconnect

@echo y | "%programfiles(x86)%\Cisco Systems\VPN Client\vpnclient.exe" connect %1 user %2 pwd %3 nocertpwd stdin

The first line disconnects the current connection (if already disconnected the script continues gracefully).  The second line needs 3 arguments fed to it in this order: profile, username and password.  the @echo y | exists because the concentrator I connect to has a disclaimer splash that requires a Y response to bypass in order to fully establish the connection.

Thus far my only problem is I’ve not found a way to suppress the client GUI window that appears when the disconnect occurs.

PCI\VEN_8086&DEV_29D4&SUBSYS_281E103C&REV_02

Rebuilding an old HP dc5800 to Windows 8.1 64 and a pesky PCI Simple Communications Controller can’t find its driver.  Its hardware id is:

PCI\VEN_8086&DEV_29D4&SUBSYS_281E103C&REV_02

Googlin’ turns up lots of dead links.  It’s the Intel Management Engine Interface, and here is the driver.

Yeah, I know the title of this post overruns the right column.  I figure by having the hardware id be the post title it will be easier for people in need to find, so I’m leaving it.

Perl MP3 ID3 Tags

I keep my mp3s in directories, separated by genre/artist – album.  I like to keep my tags clean and uniform (and I use Tag&Rename for that), but sometimes I let my collection get away from me a bit.  When that happens I bust out Perl because, well, I guess because it’s familiar.  I’ve written scripts to do simple things like remove non media files recursively from directory structures and alter file and or folder names (say, change underscores to spaces or remove common unwanted verbiage).  Because these scripts are for me, there’snever really any error handling or debugging.  They’re quick one-offs, written for no one but myself.  They’re rarely (never) written as efficiently as they could be.  They’re not like my production code, which I’m meticulous about.  These are sloppy little tools, written as quickly as possible, made to solve immediate irritations.  Here’s an example:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
use File::Find::Rule;
use MP3::Tag;
use List::MoreUtils qw(uniq);

my @txt_files  = File::Find::Rule
    ->file
    ->name('1 *', '01 *','1_*', '01_*','1-*', '01-*')
    ->in('\\\\server\\music\\mall');

foreach (@txt_files)
{
    $mp3 = MP3::Tag->new($_);
    $mp3->get_tags();
    if (exists $mp3->{ID3v1})
    {
        $taggit = $mp3->{ID3v1}->artist . "\t" . $mp3->{ID3v1}->album . "\t" . $mp3->{ID3v1}->genre;
        push(@tags, $taggit);
        print "Filename: $_\n";
        print "Artist: " . $mp3->{ID3v1}->artist . "\t";
        print "Title: " . $mp3->{ID3v1}->title . "\t";
        print "Album: " . $mp3->{ID3v1}->album . "\t";
        print "Genre: " . $mp3->{ID3v1}->genre . "\n";
    }
$mp3->close();
}

@sortedtags = uniq(@tags);

open (OUTPUT, ">tags.txt");
foreach $tag (@sortedtags)
{
    print OUTPUT $tag . "\n";
}
close (OUTPUT);

This one finds all the files in the \\server\music\all\ path beginning with 1 or 01 (or 1_ or 01_ or 1- or… you get the picture), dumps their ID3V1 Artist, Album and Genre tags into an array, winnows that array down to unique values, and dumps that to a text file.  Why?  Because sometimes I’m unsure what genre I’ve labeled an artist/album (and let’s be fair here.  Are the Night Birds Punk or Rock?  The Ramones?  And is Thom Yorke Rock or Electronic?  Hmm?  If Tom Petty’s Damn The Torpedoes is Classic Rock, then is Hypnotic Eye as well?) and rather than have to open the directory and look at the tag on one of the songs, I wanted a way to just dump it to a file to refer to later.

Why is it listing the Filename, Artist, Title, Album etc in the CMD as it runs?  Because I’m a dork and like to watch things run in command lines.

Why didn’t I write some fancy regex to handle the file name match, or better yet write something that would just pull the data from a single file per subdirectory?  Because there’s a tipping point.  If you spend more time writing and testing your script than it would take doing manually whatever you’re writing your script to automate, you’re not being effectively lazy.

I’ve definitely been guilty of taking more time to write a script than what it would take to just do the task, but in those instances it’s because I’m enjoying writing and testing and learning.  Sometimes I don’t want to write and test and learn.  I want to kick some sloppy shit off in a CMD prompt and let it run in the background while I pick my nose and watch redlettermedia.  I don’t care how long it takes, so long as I’m not the one doing it anymore.  Somewhere there are probably nerds who are very unhappy with me for that statement.  Too bad.

Windows 8 Preview Pane woes

I don’t like the Windows 8 preview pane.  It makes moving and deleting things difficult, especially over network shares.  It likes to lock shit up thanks to the (usually hidden) thumbs.db file it creates.  So, turn it off.  It’s a simple reg hack:

1
2
3
4
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer]
"NoReadingPane"=dword:00000001

Windows 2008 r2 Updates Reboot Loop

Tonight was our maintenance window at work, and I updated a bajillion virtual servers. Went OK save for one Windows 2008 r2 box that got stuck in a reboot loop. Updates failed, so I bounced the box to start fresh.  It would begin boot, show the dialogs for installing/configuring updates, reach “Configuring Updates: Stage 3 of 3,” and crater. Repeat infinitely. Thankfully the fix was easy. I mounted and booted from the 2008 Server ISO and:

  • Selected to Repair
  • Selected the Command Prompt option
  • Executed the command del C:\Windows\winsxs\pending.xml (actually because it was a virt the drive wasn’t C, but you get the idea)
  • Restarted and let it boot from the hard drive

After that it came up fine.