Skip to content

Instantly share code, notes, and snippets.

View kezabelle's full-sized avatar

Keryn Knight kezabelle

View GitHub Profile
@bbl
bbl / Makefile
Created June 13, 2020 12:17
Get Makefile root directory absolute path
ROOT_DIR:=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
test:
@echo $(ROOT_DIR)
@apolloclark
apolloclark / devsecops_maturity_model.md
Last active January 22, 2024 05:08
DevSecOps Maturity Model

DevSecOps Maturity Model

DevSecOps has finally become popular within the wider IT industry in 2019. I started as a web developer in 2001, learned about testing automation, system deployment automation, and "infrastructure as code" in 2012, when DevOps was becoming a popular term. DevOps became common after the release of The Phoenix Project in Jan 2013. It has taken 7+ years for security to become integrated within the DevOps methodology. The following is a list of concepts I go through with project owners, project managers, operations, developers, and security teams, to help establish how mature their DevOps and security automation is, and to help them increase that maturity over time. This model is based on experience consulting with a variety of US Financial, Healthcare, and Department of Defense, organizations, and combines:

@jarshwah
jarshwah / rabbitmq_to_cloudwatch.sh
Created June 5, 2019 13:23
Send RabbitMQ queue length to Cloudwatch
#! /bin/bash
# This script reads rabbitmq statistics and report them as CloudWatch metrics.
# https://gist.github.com/GoodMirek/2dc39100d18c72eed3f0f3569e221f4f
# RabbitMQ::messages_ready
# RabbitMQ::messages_unacknowledged
# RabbitMQ::consumers
# Dimensions: QueueName, InstanceId, VHost
@simonw
simonw / sql_replace_in_django_orm.py
Last active April 20, 2024 18:34
How to use the SQL replace function in a Django ORM query
from django.db.models import F, Func, Value
from myapp.models import MyModel
# Annotation
MyModel.objects.filter(description__icontains='\r\n').annotate(
fixed_description=Func(
F('description'),
Value('\r\n'), Value('\n'),
function='replace',
)
@JordanReiter
JordanReiter / crontab
Last active July 11, 2023 10:39
Remind yourself of what you did over the past day and week by reading a summary of all of your git commits.
0 22 * * 1,2,3,4,5 /path/to/git_changes.sh /path/to/projects/ # Sends 5 PM EST if server time is UTC
0 21 * * 5 /path/to/git_changes.sh -w /path/to/projects # Sends Friday @ 4PM EST if server time is UTC
@dannguyen
dannguyen / google-map-usgs-data-better.py
Last active April 5, 2023 07:37
quickie demo of how to use the Google Static Maps API and Python to serialize and visualize USGS earthquakes data http://www.compciv.org/guides/python/how-tos/creating-proper-url-query-strings/
# slightly more Pythonic, cleaner version
from csv import DictReader
import requests
import webbrowser
USGS_URL = 'http://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/significant_month.csv'
GMAPS_URL = 'https://maps.googleapis.com/maps/api/staticmap'
# get the USGS data, create a list of lines
lines = requests.get(USGS_URL).text.splitlines()
# get the latitude/longitude pairs
@kevinelliott
kevinelliott / osx-10.11-setup.md
Last active April 10, 2022 15:47
Mac OS X 10.11 El Capitan Setup

Mac OS X 10.11 El Capitan

Custom recipe to get OS X 10.11 El Capitan running from scratch, setup applications and developer environment. This is very similar (and currently mostly the same) as my 10.10 Yosemite setup recipe (as found on this gist https://gist.github.com/kevinelliott/0726211d17020a6abc1f). Note that I expect this to change significantly as I install El Capitan several times.

I use this gist to keep track of the important software and steps required to have a functioning system after a semi-annual fresh install. On average, I reinstall each computer from scratch every 6 months, and I do not perform upgrades between distros.

This keeps the system performing at top speeds, clean of trojans, spyware, and ensures that I maintain good organizational practices for my content and backups. I highly recommend this.

You are encouraged to fork this and modify it to your heart's content to match your own needs.

@warpfork
warpfork / liteide-wrapper
Created March 10, 2015 23:19
a wrapper script for teaching liteide how to workspaces
#!/bin/bash
set -euo pipefail
IFS=$'\0'
#
# config
# (you'll want to fix these to your environment, or change the project auto-detect to fit.)
#
litespace="~/liteideSpace/"
sourcespace="~/repos/"
@ulope
ulope / gist:1495a9e7572c62885f30
Created January 14, 2015 12:10
Automatically place tox working directories into a central location
# Add this to your shell's rc file.
# Optionally export TOX_WORKDIR_BASE if you don't like the default of ~/.cache/tox
tox() {
if [ -z "$TOX_WORKDIR_BASE" ]; then
TOX_WORKDIR_BASE=~/.cache/tox
fi
if [ -f tox.ini ]; then
if [ -d .tox -a ! -L .tox ]; then
echo "Warning: Existing .tox directory is not symlinked into TOX_WORKDIR_BASE! Remove and re-run to auto-create symlink."
@rodricios
rodricios / summarize.py
Last active November 18, 2020 17:21
Flipboard's summarization algorithm, sort of
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
pip install networkx distance pattern
In Flipboard's article[1], they kindly divulge their interpretation
of the summarization technique called LexRank[2].