Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am jonman364 on github.
  • I am jonman364 (https://keybase.io/jonman364) on keybase.
  • I have a public key ASCYXx04__IPF3K6yZNaV1AfmvEcvDZ8577s98MdFysdbAo

To claim this, I am signing this object:

@jonman364
jonman364 / du.sh
Created December 30, 2014 12:20
du without du
#!/bin/sh
find ${1:-.} -type f -exec ls -lnq {} \+ | awk '
function pp() {
u="+Ki+Mi+Gi+Ti";
split(u,unit,"+");
v=sum;
r=0;
for(i=1;i<5;i++) {
if(v<1024) break;
r=v%1024;
@jonman364
jonman364 / oneclick2tars.cs
Created November 7, 2014 14:27
OneClick to Tar files
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
namespace oneclick2tars {
class Program {
static void Main(string[] args) {
long offset = 0;
@jonman364
jonman364 / RemoveDrivers.ps1
Created November 4, 2014 19:55
Remove all OEM drivers from an offline image
$image = “imagePath”
$dism = dism /image:$image /get-drivers
ForEach($line in $dism){
If($line -like “Published Name*”){
$sp = ($line -split “ “)
$oem = $sp[3]
Dism /image:$image /Remove-Driver /Driver:$oem
}
}
' checkpatch.vbs
' Check if KB# patch is installed
Set objSession = CreateObject("Microsoft.Update.Session")
Set objSearcher = objSession.CreateUpdateSearcher
Set objResults = objSearcher.Search("Type='Software'")
Set colUpdates = objResults.Updates
strSearch = InputBox("Enter KB number")
' installfonts.vbs
' Installing multiple Fonts in Windows 7
Option Explicit
Dim objShell, objFSO, wshShell
Dim strFontSourcePath, objFolder, objFont, objNameSpace, objFile
Set objShell = CreateObject("Shell.Application")
Set wshShell = CreateObject("WScript.Shell")
Option Explicit
Dim oWim, items, item, info, comp
comp = "."
If WScript.Arguments.Count > 0 Then
comp = WScript.Arguments.Item(0)
End If
'********************************************************
'* pstfinder.vbs *
'* Jon Dunlap 2011 *
'* *
'* pstfinder.vbs finds all PST files on the C: drive *
'* of all computers under the specified OU. *
'* *
'* Usage: pstfinder.vbs [OU | CN] ... *
'* Multiple OUs or computers can be given. Must be *
'* full distinguished name. *
' resetlogon.vbs
' Jon Dunlap 8/3/2010
'
' Reset last logon user ID in Windows XP or Windows 7. In Windows 7, script
' automatically elevates itself to write to the registry.
'
' 5.1 WinXP; 5.2 Win2003; 6.1 Win7
Option Explicit
Option Explicit
Dim objFSO, objReg
Dim aKeys, sKey, sectemp
Dim process
Const strProc = "OUTLOOK.EXE"
For Each process in GetObject("winmgmts://.").InstancesOf("win32_process")
If UCase(process.name) = strProc Then