Skip to content

Instantly share code, notes, and snippets.

View msummers42's full-sized avatar

Matt Summers msummers42

View GitHub Profile
@003random
003random / cert_info.go
Last active March 20, 2024 15:05
Prints SSL certificate info from a given URL. Including the encoded public key and cert itself
package main
import (
"fmt"
"os"
"bytes"
"encoding/pem"
"crypto/tls"
"crypto/x509"
)
@gbaman
gbaman / graphql_example.py
Created November 1, 2017 00:18
An example on using the Github GraphQL API with Python 3
# An example to get the remaining rate limit using the Github GraphQL API.
import requests
headers = {"Authorization": "Bearer YOUR API KEY"}
def run_query(query): # A simple function to use requests.post to make the API call. Note the json= section.
request = requests.post('https://api.github.com/graphql', json={'query': query}, headers=headers)
if request.status_code == 200:
@FrankSpierings
FrankSpierings / README.md
Last active February 20, 2025 10:48
Linux Container Escapes and Hardening
@jdunck
jdunck / README
Created April 12, 2015 21:44
Migrating to django 1.7 migrations
Scenario:
You have a long-running branch to upgrade your existing codebase to django 1.7.
You've previously used south, and your existing deployment includes schema changes since the
base of the django-1.7 upgrade branch.
You need to re-create django (core) migrations periodically since you can't merge
south migrations into core migrations.
(Assumes commands are run from root of project and that apps are top-level directories Adjust pathing if that is not the case.)
@jbq
jbq / uwsgi-watch-wc
Last active April 4, 2019 11:21
Python script using pyinotify to detect changes in a working copy, and notify UWSGI to reload app. To be used along with UWSGI's "attach-daemon" option.
#! /usr/bin/python
import pyinotify, sys, os, signal, threading, time, syslog
lastEventTime = None
def iswatched(path):
return (path.endswith(".tmpl") or path.endswith(".py"))
def callback(evt):