Skip to content

Instantly share code, notes, and snippets.

View ilovechai's full-sized avatar
🎆

Krishna Sheth ilovechai

🎆
View GitHub Profile
@ilovechai
ilovechai / mssql_ssl_conf.md
Last active January 27, 2022 19:03
Configure SSL certificates MS SQL server on Windows Server

Enable SSL connection MSSQL

@ilovechai
ilovechai / get_tds_cert.py
Created January 27, 2022 18:41 — forked from lnattrass/get_tds_cert.py
A terrible way to connect to MS SQL Server and dump the certificate as a PEM
import sys
import pprint
import struct
import socket
import ssl
from time import sleep
# Standard "HELLO" message for TDS
prelogin_msg = bytearray([ 0x12, 0x01, 0x00, 0x2f, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x06, 0x01, 0x00, 0x20,
0x00, 0x01, 0x02, 0x00, 0x21, 0x00, 0x01, 0x03, 0x00, 0x22, 0x00, 0x04, 0x04, 0x00, 0x26, 0x00,
@ilovechai
ilovechai / gitbot.py
Last active October 18, 2021 11:44
Python script to comment on pull request
## Install PyGithub
!pip install PyGithub
from github import Github
import os
import sys
docker_image = 'Some docker build image with url'
build_url = os.environ.get('BUILD_URL')
git_commit = os.environ.get('GIT_COMMIT')
@ilovechai
ilovechai / freezesets.py
Created May 18, 2021 16:44
Python snippet to create frozen sets of nested dictionaries.
def freeze(o):
if isinstance(o, dict):
return frozenset({k: freeze(v) for k, v in o.items()}.items())
if isinstance(o, list):
return frozenset([freeze(v) for v in o])
return o