Skip to content

Instantly share code, notes, and snippets.

View spawnmarvel's full-sized avatar
💭
sudo ufw disable

Espen k spawnmarvel

💭
sudo ufw disable
View GitHub Profile
@spawnmarvel
spawnmarvel / run_urlencode.py
Created July 17, 2023 17:01
Url encode in Python
import urllib.parse
# abcde/fghi+jklmn=opq
# abcde%2Ffghi%2Bjklmn%3Dopq
inp = "abcde/fghi+jklmn=opq"
print(inp)
rv = urllib.parse.quote(inp, safe='')
print(rv)
@spawnmarvel
spawnmarvel / checkcert.ps1
Created July 17, 2023 18:28
Check certificate
# modified
$fqdn = "xxxx.servicebus.windows.net"
$port = 443
$tcpsocket = New-Object Net.Sockets.TcpClient($fqdn, $port)
$tcpstream = $tcpsocket.GetStream()
$sslStream = New-Object Net.Security.SslStream($tcpstream, $false)
$sslStream.AuthenticateAsClient($fqdn)
$certinfo = New-Object security.cryptography.x509certificates.x509certificate2($sslStream.RemoteCertificate)