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
- job:
name: Deploy_Gitlab
project-type: pipeline
parameters:
- string:
name: gitlab_host
default:
description:
- string:
name: user
import ssl
import urllib2
import urllib
import logging
import json
import sys
logger = logging.getLogger(__name__)
logger.addHandler(logging.NullHandler)
@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 / tabs.py
Last active November 1, 2017 09:15
Custom types (object of a class with their attributes) are mutable, Lines:122-124.(/openstack/horizon.git/openstack_dashboard/dashboards/project/access_and_security/tabs.py)
# Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
# Copyright 2012 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
def min(*args, **kwargs):
key = kwargs.get("key", None)
if len(args) >= 2:
#print('Two or more')
_minimum = list(args)[0]
for _indx in range(1,len(args)):
if key:
expression = (key(args[_indx]) < key(_minimum))
else:
expression = args[_indx] < _minimum