Skip to content

Instantly share code, notes, and snippets.

@AdilHindistan
AdilHindistan / .gitignore
Created Mar 17, 2016 — forked from octocat/.gitignore
Some common .gitignore configurations
View .gitignore
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
View onename
Verifying that +adilhindistan is my blockchain ID. https://onename.com/adilhindistan
@AdilHindistan
AdilHindistan / decodeVBE
Created Dec 24, 2015
Decode Encoded VBE files
View decodeVBE
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 Dec 24, 2015
MsiInstaller Events which completed successfully
View msiinstaller
Get-WinEvent -FilterHashtable @{LogName="Application"; ProviderName='MsiInstaller'} |? {$_.message -match 'Installation Completed Successfully'}
@AdilHindistan
AdilHindistan / Fix-SystemPath
Created Nov 20, 2015
PowerShell Function to Fix System Path by removing duplicates
View Fix-SystemPath
Function Fix-SystemPath {
<#
.SYNOPSIS
Fixes System Path
.DESCRIPTION
Removes duplicates from System Path
#>
[CMDLETBINDING(SupportsShouldProcess)]
param(
View WinSxS
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 Nov 8, 2015
PowerShell Scripting Puzzle for November 2015
View 2015-11-PS-Scripting-Puzzle
param([string]$VMNameStr)
$VMNameStr.Split(',').Trim().where{$_ -notmatch '^$'}
View cmd_ForFiles
## 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"
View cmd_nslookup_srv
## 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