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
# 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

Working with Ad-Hoc Ansible command

  • Add SSH Credentials ssh-add /path/to_cred_file.pem

  • contents of inventory.yml

   inventory.yml
   [dockerbuild]
   59.68.67.67

Setup New Mac

Install Homebrew

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Install, Setup Python

## Download & Install Python 2.7.x using the msi
https://www.python.org/downloads/
## Download pip from https://bootstrap.pypa.io/get-pip.py (Use PowerShell) to D:\Temp
PS C:\> Invoke-WebRequest -Uri 'https://bootstrap.pypa.io/get-pip.py' -OutFile D:\temp\get-pip.py
## Copy get-pip.py to Scripts folder under Python > Tools > Scripts
## Make sure you started PowerShell on an elevated window (Runas Administrator) as it needs to write to 'Program Files(x86)'
## Most useful
## Control > System and Security > System
control /name microsoft.System
## System Properties = Control > System and Security > System > Advanced System Settings
%Windir%\System32\SystemPropertiesAdvanced.exe
## Control > System and Security > Admin Tools
control /name microsoft.AdministrativeTools
@AdilHindistan
AdilHindistan / Cleanup Win10 QuickAccess
Created July 9, 2016 16:23
Cleanup recent (quick access) shortcuts for Windows 10
#AH - Cleanup Win10 QuickAccess / Recent
rm "$($env:appdata)\Microsoft\windows\Recent\*" -force -recurse