Skip to content

Instantly share code, notes, and snippets.

@maxyko
maxyko / ssl-check.py
Created December 22, 2020 14:01 — forked from gdamjan/ssl-check.py
Python script to check on SSL certificates
# -*- encoding: utf-8 -*-
# requires a recent enough python with idna support in socket
# pyopenssl, cryptography and idna
from OpenSSL import SSL
from cryptography import x509
from cryptography.x509.oid import NameOID
import idna
from socket import socket
@maxyko
maxyko / ansible_variable_precedence.md
Created July 31, 2020 17:09 — forked from ekreutz/ansible_variable_precedence.md
Ansible variable precedence (order, hierarchy)
@maxyko
maxyko / boto3-list-instances.py
Created February 5, 2020 09:09 — forked from ableasdale/boto3-list-instances.py
Using Boto 3 to list out AWS EC2 instance information
import boto3
from termcolor import colored
ec2 = boto3.resource('ec2')
for i in ec2.instances.all():
print("Id: {0}\tState: {1}\tLaunched: {2}\tRoot Device Name: {3}".format(
colored(i.id, 'cyan'),
colored(i.state['Name'], 'green'),
@maxyko
maxyko / self-signed-certificate-with-custom-ca.md
Created April 23, 2019 07:15 — forked from fntlnz/self-signed-certificate-with-custom-ca.md
Self Signed Certificate with Custom Root CA

Create Root CA (Done once)

Create Root Key

Attention: this is the key used to sign the certificate requests, anyone holding this can sign certificates on your behalf. So keep it in a safe place!

openssl genrsa -des3 -out rootCA.key 4096
@maxyko
maxyko / squash-commits.sh
Created November 30, 2017 11:12 — forked from jbub/squash-commits.sh
git squash last two commits into one
git rebase --interactive HEAD~2
# we are going to squash c into b
pick b76d157 b
pick a931ac7 c
# squash c into b
pick b76d157 b
s a931ac7 c
@maxyko
maxyko / apt_pinning_priorities.md
Created November 6, 2017 11:48 — forked from JPvRiel/apt_pinning_priorities.md
Apt package pinning and priorities
@maxyko
maxyko / snakecoin-server-full-code.py
Created September 6, 2017 20:47 — forked from aunyks/snakecoin-server-full-code.py
The code in this gist isn't as succinct as I'd like it to be. Please bare with me and ask plenty of questions that you may have about it.
from flask import Flask
from flask import request
import json
import requests
import hashlib as hasher
import datetime as date
node = Flask(__name__)
# Define what a Snakecoin block is
class Block: