Skip to content

Instantly share code, notes, and snippets.

@AdilHindistan
AdilHindistan / .gitignore
Created March 17, 2016 01:13 — forked from octocat/.gitignore
Some common .gitignore configurations
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
Verifying that +adilhindistan is my blockchain ID. https://onename.com/adilhindistan
@AdilHindistan
AdilHindistan / decodeVBE
Created December 24, 2015 15:57
Decode Encoded VBE files
option explicit
Dim oArgs, NomFichier
'Optional argument : the encoded filename
NomFichier=""
Set oArgs = WScript.Arguments
Select Case oArgs.Count
Case 0 'No Arg, popup a dialog box to choose the file
NomFichier=BrowseForFolder("Choose an encoded file", &H4031, &H0011)
Case 1
If Instr(oArgs(0),"?")=0 Then '-? ou /? => aide
@AdilHindistan
AdilHindistan / msiinstaller
Created December 24, 2015 02:47
MsiInstaller Events which completed successfully
Get-WinEvent -FilterHashtable @{LogName="Application"; ProviderName='MsiInstaller'} |? {$_.message -match 'Installation Completed Successfully'}
@AdilHindistan
AdilHindistan / Fix-SystemPath
Created November 20, 2015 17:50
PowerShell Function to Fix System Path by removing duplicates
Function Fix-SystemPath {
<#
.SYNOPSIS
Fixes System Path
.DESCRIPTION
Removes duplicates from System Path
#>
[CMDLETBINDING(SupportsShouldProcess)]
param(
Function Get-WinSxSTemplate {
$template = '@
{Processor*:amd64}_{Name:bthpan.inf.resources}_{PublicKey:31bf3856ad364e35}_{Version:10.0.10586.0}_{Language:en-us}_{Hash:ea44fe42ab20740b}
{Processor*:msil}_{Name:system.identitymodel}_{PublicKey:b77a5c561934e089}_{Version:10.0.10586.0}_{Language:none}_{Hash:cc783afbf0482328}
{Processor*:amd64}_{Name:addinprocess32}_{PublicKey:b77a5c561934e089}_{Version:4.0.10586.0}_{Language:none}_{Hash:674039174f59a7e0}
{Processor*:amd64}_{Name:1394.inf}_{PublicKey:31bf3856ad364e35}_{Version:10.0.10586.0}_{Language:none}_{Hash:87b4eef7b03f2543}
@'
$template2 = '@
{Processor*:amd64}_{Name:c_cdrom.inf.resources}_{PublicKey:31bf3856ad364e35}_{Version:10.0.10586.0}_{Language:en-us}_{Hash:0c3fdd23f3e210c1}
@AdilHindistan
AdilHindistan / 2015-11-PS-Scripting-Puzzle
Last active November 8, 2015 05:13
PowerShell Scripting Puzzle for November 2015
param([string]$VMNameStr)
$VMNameStr.Split(',').Trim().where{$_ -notmatch '^$'}
creating a test
## Find all files under C:\ that has changed today (Windows / Batch Scripting)
C:\>forfiles /p c: /s /d +0 /c "cmd /c echo @fdate 0x09 @path"
3/8/2015 "C:\Users\Adil\AppData\Local"
3/8/2015 "C:\Users\Adil\AppData\Local\Temp"
3/8/2015 "C:\Users\Adil\AppData\Local\Microsoft\Windows"
3/8/2015 "C:\Users\Adil\AppData\Local\Microsoft\Feeds\FeedsStore.feedsdb-ms"
3/8/2015 "C:\Users\Adil\AppData\Local\TechSmith\Snagit\CachedNotifications.json"
3/8/2015 "C:\Users\Adil\AppData\Roaming\Microsoft\Windows\Themes"
## AH Adil Hindistan Command line
## Lookup Active Directory Domain Controller SRV records in DNS
nslookup -q=srv _ldap_.tcp.dc._msdcs
## lookup KMS SRV record for xyz.org
nslookup -q=srv _vlmcs._tcp.xyz.org
Server: cdc-infoblox-02.xyz.org
Address: 10.11.11.11