Skip to content

Instantly share code, notes, and snippets.

@AdilHindistan
AdilHindistan / check-win-update
Created May 27, 2020 23:43
check windows update shortcut
ms-settings:windowsupdate?activationSource=SMC-IA-4028685
@AdilHindistan
AdilHindistan / PS_ParameterSets
Created April 23, 2014 19:37
Sample for a complex PowerShell ParameterSet implementation
##AH - AdilHindistan
## Sample for a complex Parameter Set
## The best way to get it right is to write them down as shown in .NOTES
<#
.NOTES
Parameter Sets
P1: SourceDN DestinationDN SourcePercent Recurse
P2: SourceOU DestinationOU SourcePercent Recurse
## Exif Tool URL
http://www.sno.phy.queensu.ca/~phil/exiftool/
## Use Exif tool to set creation date to original date from the picture itself
exiftool.exe -recurse "-FileCreateDate<DateTimeOriginal" "-FileModifyDate<DateTimeOriginal" path/to/pics/folder -overwrite_original -ext jpg -fixBase -progress
Example:
c:\tools\exiftool.exe -recurse "-FileCreateDate<DateTimeOriginal" "-FileModifyDate<DateTimeOriginal" Z:\AdilBezen\Resimler\2013\2013.08\2013.08.Site -overwrite_original -ext jpg -fixBase -progress
##AH - Adil Hindistan - IE
IE9 Clearing Cache - Options
User Command:
rundll32.exe c:\windows\system32\inetcpl.cpl,ClearMyTracksByProcess {SomeNumber}
Preserve Favorites website data
--------------------------------
Temporary Internet Files (Temp)
#AH - AdilHindistan - 2014-02-04 WSUS Update Scopes
## We are trying to find out updates that are needed on Computers but we have NOT approved yet
## WSUS Update Scope
$UpdateScope = New-Object Microsoft.UpdateServices.Administration.UpdateScope
D:\> $updateScope |Get-Member -MemberType property
TypeName: Microsoft.UpdateServices.Administration.UpdateScope
##AH - Adil Hindistan - Changing name of a domain joined computer
Current Name..: Adil-Laptop1
New Name......: Adil-Laptop2
1) Registry is updated:
HKLM\System\CurrentControlSet\Control\ComputerName\ComputerName /v ComputerName /t REG_SZ /d Adil-Laptop2
HKLM\System\CurrentControlSet\Services\Tcpip\Parameters /v "NV Hostname" /t REG_SZ /d Adil-Laptop2
## Fun fact, simply change the above two keys and reboot, you will get error:
"the security database on the server does not have a computer account for this workstation trust relationship"
# launches window to edit "user" Environment Variables (Windows)
rundll32 sysdm.cpl, EditEnvironmentVariables
@AdilHindistan
AdilHindistan / fix-psrepository.ps1
Last active June 19, 2018 20:03
Fix PSGallery Registration
Function Fix-PSRepository {
<#
Fixes the issue with PSGallery:
Find-Module <module_name> -> does not find anything
Get-PSRepository -> returns "Unable to find module repositories"
Register-PSRepository -Default -Verbose -> should fix it but behind the proxy, following should be run first
#>
[system.net.webrequest]::defaultwebproxy = new-object system.net.webproxy('http://proxy_address:proxy_port')
@AdilHindistan
AdilHindistan / concurrency.md
Created June 9, 2018 01:29
Python Concurrency
@AdilHindistan
AdilHindistan / aws_saml.py
Created April 10, 2018 19:26 — forked from JoeyG1973/aws_saml.py
aws saml login with session that auto refreshes.
# Took this:
# https://s3.amazonaws.com/awsiammedia/public/sample/SAMLAPICLIADFS/samlapi_formauth_adfs3.py
# converted to boto3 and smooshed it together with this:
# https://gist.github.com/kapilt/ac8e222081f63ba64e93
# which gave birth too this:
import sys
import botocore
import boto3
import requests