Internet Sellout

Demand Unearned Rewards

Too many computers

Brogrammer, I probably am one.
Tags: Brogrammer

Kill Process By User SID VB.NET

I see a few C# Versions of this on the web. Here is a VB version.

Private Shared Function ProcessKillByOwnerSID(sProcessName As String, sSID As String) As Integer
        Dim oProcesses() As Process = System.Diagnostics.Process.GetProcessesByName(sProcessName)
        Dim i As Integer = 0
        For Each oProcess As Process In oProcesses
            If GetProcessInfoByPID(oProcess.Id, Nothing, Nothing) = sSID Then
                oProcess.Kill()
                i = i + 1
            End If
        Next
        Return i
End Function
Private Shared Function GetProcessInfoByPID(PID As Integer, sOutUser As String, sOutDomain As String) As String
        Dim sOwnerSID As String = String.Empty
        Try
            Dim sQuery As System.Management.ObjectQuery = New System.Management.ObjectQuery("Select * from Win32_Process Where ProcessID = '" & PID.ToString() & "'")
            Dim oSearcher As System.Management.ManagementObjectSearcher = New System.Management.ManagementObjectSearcher(sQuery)
            If oSearcher.Get().Count = 0 Then Return sOwnerSID
            For Each oReturn As System.Management.ManagementObject In oSearcher.Get()
                Dim sOwner(2) As String
                oReturn.InvokeMethod("GetOwner", CType(sOwner, Object()))
                sOutUser = sOwner(0)
                If sOutUser Is Nothing Then sOutUser = String.Empty
                sOutDomain = sOwner(1)
                If sOutDomain Is Nothing Then sOutDomain = String.Empty
                Dim sSID(1) As String
                oReturn.InvokeMethod("GetOwnerSid", CType(sSID, Object()))
                sOwnerSID = sSID(0)
                Return sOwnerSID
            Next
        Catch
            Return sOwnerSID
        End Try
        Return sOwnerSID
End Function

Back Up System State to Nas Share - Windows 7, 8 and Server 2012

The backup operation that started at '‎2013‎-‎03‎-‎04T04:34:27.113260900Z' has failed with following error code '0xC03A0005' (The version does not support this version of the file format.). Please review the event details for a solution, and then rerun the backup operation once the issue is resolved.
Tags: bare-metal, backup, systemstate, NAS

Excel ODBC DSN-less Connection

Create an Excel workbook with DSN-less Data Connection that works with parameterized stored procedures that take values from cells.
Tags: Data, Excel

Red Meat

Alameda County Line

Use the above myspace link to listen to a lovely tune by Red Meat. Below is some fantastic advice I got from here.

^M is DOS line break charater which shows up in unix files when uploaded from a windows file system in ascii format.
To remove this, open your file in vi editor and type

:%s/(ctrl-v)(ctrl-m)//g


and press Enter key.
Important!! – press (Ctrl-v) (Ctrl-m) combination to enter ^M character, dont use “^” and M

Reading List

Confessions - Aliester Crowley
Decline of the West - Oswald Spengler
Secret Doctrine - H. P. Blavatsky
White Goddess - Sir Robert Graves
Justine - Marquis De Sade
Don Quixote - Cervantes
Stand on Zanzabar - John Brunner
Mein Kampf - Adolph Hitler
Gold Warriors - Peggy Seagrave
Sensory Inhibition - Georg Von Bekesy
Brothers Karamazov - Fyodor Dostoyevsky
Sentimental Education - Gustave Flaubert
The Demons - Heimito von Doderer
Anthony Adverse - William Hervey Allen

 

Tags: books, vi, unix, music

To WPF or Not to WPF

WPF - Improve the propaganda, I don't have too many complaints about the platform.
Tags: Borg

Renew Certificate - Same Private Key

...if you actually have the original private key.
Tags: certificates, encryption, iis, certutil