Skip to content

Instantly share code, notes, and snippets.

View abanoub-nasser's full-sized avatar

Abanoub Nasser Murice abanoub-nasser

View GitHub Profile
@hakluke
hakluke / dumpCN.py
Last active September 18, 2022 10:52
#!/usr/bin/python3
import ssl,sys,json
cert = ssl.get_server_certificate((sys.argv[1], 443)) #Retrieve SSL server certificate
cert = ssl.PEM_cert_to_DER_cert(cert) #Convert certificate to DER format
begin = cert.rfind(b'\x06\x03\x55\x04\x03') + 7 #Find the last occurence of this byte string indicating the CN, add 7 bytes to startpoint to account for length of byte string and padding
end = begin + cert[begin - 1] #Set endpoint to startpoint + the length of the CN
jsondata = {"ip": sys.argv[1], "cn": cert[begin:end].decode('utf-8')}
print(json.dumps(jsondata))
@antespi
antespi / Odoo - Rename an addon without losing data.md
Last active March 13, 2025 21:42
Odoo - Rename an addon without losing data

Odoo - Rename an addon without losing data

Rename addon

  • Change __openerp__.py addon name field
  • Change README.rst file