This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.SOLUTION | |
.FILENAME domain-join.ps1 | |
Joins a computer to the targeted domain, using a retrieved credential, deleting the old account | |
.DESCRIPTION | |
.PARAMETER -Join |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Example code for encrypting and decrypting secrets with .Net cryptography using either symmetric or asymmetric encryption | |
################################### | |
## SYMMETRIC ENCRYPTION ## | |
## Using AES 256-bit in CBC mode ## | |
################################### | |
# Create an AES key and Initialization vector | |
$AES = [System.Security.Cryptography.Aes]::Create() | |
$Key = [System.Convert]::ToBase64String($aes.Key) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
############################################################################################## | |
# Wait for URLs until return HTTP 200 | |
# | |
# - Just pass as many urls as required to the script - the script will wait for each, one by one | |
# | |
# Example: ./wait_for_urls.sh "${MY_VARIABLE}" "http://192.168.56.101:8080" | |
############################################################################################## |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# set to system default proxy | |
[System.Net.WebRequest]::DefaultWebProxy = [System.Net.WebRequest]::GetSystemWebProxy() | |
[System.Net.WebRequest]::DefaultWebProxy.Credentials = [System.Net.CredentialCache]::DefaultNetworkCredentials | |
# or a custom one | |
[System.Net.WebRequest]::DefaultWebProxy = New-Object System.Net.WebProxy("http://localhost:8080") | |
# or use username and password auth | |
[System.Net.WebRequest]::DefaultWebProxy = New-Object System.Net.WebProxy("http://localhost:8080",$true) | |
[System.Net.WebRequest]::DefaultWebProxy.Credentials = New-Object System.Net.NetworkCredential($user, $passwd) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
:====================================================================================================================================================== | |
:Thanks to abbodi1406 for SppExtComObjPatcher-kms\2-Activate-Local.cmd, which used as base in this script | |
:Thanks to rpo for the Great and Continued help in improving this script. | |
:Thanks to AR_Alex for the ideas and suggestions. | |
:====================================================================================================================================================== | |
::=========================================================================== | |
fsutil dirty query %systemdrive% >nul 2>&1 || ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Requires -RunAsAdministrator | |
#Requires -Version 5 | |
<# | |
.Synopsis | |
Activates Windows via KMS | |
.DESCRIPTION | |
It's a drop in replacement for slmgr scripts | |
.EXAMPLE | |
Start-WindowsActivation -Verbose # Activates the local computer | |
.EXAMPLE |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Determine OS version | |
osvers=$(sw_vers -productVersion | awk -F. '{print $2}') | |
sw_vers=$(sw_vers -productVersion) | |
# Determine OS build number | |
sw_build=$(sw_vers -buildVersion) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Check if a machine was enrolled via DEP (10.13+) | |
# Show whether a machine has a device enrollment profile (DEP) present (10.13.0+), | |
# and if the MDM enrollment is user approved (10.13.4+) | |
/usr/bin/profiles status -type enrollment | |
# Checking for a DEP profile on macOS | |
# Display the DEP profile for a macOS device in 10.13 and above: | |
sudo /usr/bin/profiles show -type enrollment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
BASEDIR=$(dirname "$0") | |
FILE=$(basename "$1") | |
EXTENSION="${FILE##*.}" | |
if [[ $EXTENSION == "apk" ]]; then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# utils.py - Saturday, December 28, 2019 | |
# -*- coding: utf-8 -*- | |
""" I have been experimenting to see which web framework would make the better | |
wrapper for Tweepy. I decided on Django, with the Allauth package. | |
Afer going through the Django-Allauth Tutorial at | |
https://wsvincent.com/django-allauth-tutorial/ and playing with the DjangoTweepy repository at | |
https://github.com/martinjc/DjangoTweepy/blob/master/src/twitter_auth/utils.py, | |
this is what I contrived. | |
NewerOlder