Skip to content

Instantly share code, notes, and snippets.

@vonkoch
vonkoch / gist:5849103
Last active December 18, 2015 21:39
List recent Watson reports
@echo Listing 3 (/c:3 param) most recent Watson reports
wevtutil.exe qe Application /c:3 /rd:true /f:text "/q:*[System[EventID=1001]]"
@vonkoch
vonkoch / gist:5848784
Created June 24, 2013 09:15
Essential Linq
Using In and Not In
For In and Not-In queries use
- Intersect (http://msdn.microsoft.com/en-us/library/system.linq.enumerable.intersect.aspx) and
- Except (http://msdn.microsoft.com/en-us/library/system.linq.enumerable.except.aspx)
standard extension methods.
Pasted from <http://www.codeproject.com/Articles/59831/LINQ-Implementing-IN-and-NOT-IN.aspx>
Distinct (http://msdn.microsoft.com/en-us/library/system.linq.enumerable.distinct.aspx)
Using DATEDIFF and LIKE in LINQ
@vonkoch
vonkoch / gist:5848773
Last active December 18, 2015 21:39
hg
Show me what was pulled but not yet updated
hg log -r .:
or
hg log -P .
Compare
hg log -r .: -P .
Put the following in your $HOME/.hgrc file:
[alias]
@vonkoch
vonkoch / gist:5848711
Created June 24, 2013 09:01
NT User Domain-Role-Membership
run
net user <username> /domain
to see all the roles a user is in.
@vonkoch
vonkoch / gist:5848700
Last active December 18, 2015 21:39
WHS Backup
1. Plug in external HD
2. In WHS Console go to "Server Storage" tab
3. Wait until you see the external HD appear in "Server Backup Hard Drives" section
4. In WHS Console go to "Computer & Backup" tab
5. Select "<whs> - Your home server" in the list of machines
6. Click "Backup Now"
7. Wait for backup to complete
8. Go back to "Server Storage" tab and
9. Disconnect external HD
@vonkoch
vonkoch / gist:5848694
Last active January 14, 2016 09:33
P2V - Physical to Virtual
1. Use Disk2VHD (http://technet.microsoft.com/en-us/sysinternals/ee656415.aspx) from sysinternals.com to create VHDs from the disks in the physical machine
2. Install Virtual PC
3. Create virtual machine pointing at the VHD files as the virtual HDs
4. If the virtual machine blue screens with a "Stop 0x0000007B" when starting then the device drivers aren't right, most likely the disk physical machine didn't have drivers for the IDE disks that Virtual PC provides, see http://support.microsoft.com/kb/314082
a. In order to follow the KB you need to mount the VHD and change it's registry:
On Win 7
diskpart
select vdisk file="path to .vhd"
attach vdisk
[seems to auto assign drive letters]
@vonkoch
vonkoch / gist:5848633
Last active December 18, 2015 21:39
Win7 - Compact VHD
Use DISKPART to attach the VHD in read-only mode and then use COMPACT command:
diskpart
select vdisk file="path to .vhd"
attach vdisk readonly
compact vdisk
detach vdisk
@vonkoch
vonkoch / gist:5848626
Last active December 18, 2015 21:39
Win7 - Stuck Print Job
Restart the Print Spooler service:
psservice restart "print spooler"
Or use the services control panel:
services.msc
Scroll to Print Spooler and right click and select Restart.