Skip to content

Instantly share code, notes, and snippets.

Avatar
:shipit:

Pavel Oborin Oborichkin

:shipit:
View GitHub Profile
@Oborichkin
Oborichkin / bash_wait_for_key.sh
Created Oct 20, 2019
Waiting for keypress in bash
View bash_wait_for_key.sh
#!/bin/bash
wait_for_key () {
echo "Press any key to continue"
while [ true ] ; do
read -t 3 -n 1
if [ $? = 0 ] ; then
break ;
fi
done
@Oborichkin
Oborichkin / certificate.py
Created May 17, 2019
📝 Create self signed SSL certificate in Python
View certificate.py
import socket
import os
# pip install pyOpenSSL
from OpenSSL import crypto
def create_self_signed_cert(name=None):
CERT_FILE = os.path.join("certificates", name + "_cert.pem" if name else "cert.pem")
KEY_FILE = os.path.join("certificates", name + "_key.pem" if name else "key.pem")
@Oborichkin
Oborichkin / tls_client.py
Last active Nov 24, 2022
Simple TLS client and server on python
View tls_client.py
import socket
import ssl
from tls_server import HOST as SERVER_HOST
from tls_server import PORT as SERVER_PORT
HOST = "127.0.0.1"
PORT = 60002
client = socket.socket(socket.AF_INET, socket.SOCK_STREAM)