Skip to content

Instantly share code, notes, and snippets.

View nabla-c0d3's full-sized avatar
🌴

Alban Diquet nabla-c0d3

🌴
View GitHub Profile
@nabla-c0d3
nabla-c0d3 / sslyze_api.py
Created December 18, 2017 04:13
Using SSLyze as a Python module
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import unicode_literals
from sslyze.concurrent_scanner import ConcurrentScanner, PluginRaisedExceptionScanResult
from sslyze.plugins.utils.certificate_utils import CertificateUtils
from sslyze.plugins.certificate_info_plugin import CertificateInfoScanCommand
from sslyze.plugins.session_renegotiation_plugin import SessionRenegotiationScanCommand
@nabla-c0d3
nabla-c0d3 / client_auth.md
Created February 25, 2018 01:48 — forked from mtigas/gist:952344
Mini tutorial for configuring client-side SSL certificates.

Client-side SSL

For excessively paranoid client authentication.

Using self-signed certificate.

Create a Certificate Authority root (which represents this server)

Organization & Common Name: Some human identifier for this server CA.

openssl genrsa -des3 -out ca.key 4096
openssl req -new -x509 -days 365 -key ca.key -out ca.crt
@nabla-c0d3
nabla-c0d3 / sslyze-api-1-4-0.py
Last active March 4, 2018 18:58
Migrating to SSLyze 1.4.0
# With SSLyze 1.4.0, the code that performs connectivity testing with a server needs to be slightly changed:
# SSLyze before 1.4.0
try:
server_info = ServerConnectivityInfo(
hostname='smtp.gmail.com',
port=587,
tls_wrapped_protocol=TlsWrappedProtocolEnum.STARTTLS_SMTP
)
server_info.test_connectivity_to_server()
name download_total
AFNetworking 61983241
Fabric 50998892
Crashlytics 49667729
SDWebImage 45471101
Alamofire 42097177
CocoaLumberjack 36071914
Bolts 35294870
FirebaseInstanceID 30277793
FirebaseAnalytics 30254593
@nabla-c0d3
nabla-c0d3 / delete_old_tweets.py
Created January 19, 2019 23:42
Delete old tweets
import tweepy
from datetime import datetime, timedelta
consumer_key = ''
consumer_secret = ''
access_token = ''
access_secret = ''
auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
auth.set_access_token(access_token, access_secret)
import time
from invoke import task, Context
CMD_COMPOSE = "docker-compose -f docker-compose.dev.yml"
CMD_RUN_APP = f"{CMD_COMPOSE} run --rm app"
@task
def build(ctx):