Skip to content

Instantly share code, notes, and snippets.

@combatpoodle
combatpoodle / LICENSE.txt
Created September 5, 2017 15:41
Modified version of jaybaird/python-bloomfilter to use mmh3 instead of more expensive cryptographic one-way functions.
Copyright (c) <2011> <Jay Baird and Bob Ippolito>
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:
@combatpoodle
combatpoodle / copy-and-format-ext4-xfs-gce-disks.sh
Created August 31, 2017 20:51
Snippets for copying and formatting GCE disks to and from XFS.
for disk in gitlab-data postgresql-data redis-data redis-disk sentry-data gke-core-b414f88f-dyna-pvc-444be9f4-5d32-11e7-97ab-42010a8a012e gke-core-b414f88f-dyna-pvc-8e70f528-4bc2-11e7-97ab-42010a8a012e; do
gcloud compute disks snapshot "$disk" --snapshot-names "$disk" --zone=us-west1-a
done
for disk in gitlab-data postgresql-data redis-data redis-disk sentry-data gke-core-b414f88f-dyna-pvc-444be9f4-5d32-11e7-97ab-42010a8a012e gke-core-b414f88f-dyna-pvc-8e70f528-4bc2-11e7-97ab-42010a8a012e; do
gcloud compute disks create $(echo $disk | sed "s/^.../old/") --source-snapshot=$disk --zone=us-west1-a
done
for disk in gitlab-data postgresql-data redis-data redis-disk sentry-data gke-core-b414f88f-dyna-pvc-444be9f4-5d32-11e7-97ab-42010a8a012e gke-core-b414f88f-dyna-pvc-8e70f528-4bc2-11e7-97ab-42010a8a012e; do
gcloud compute disks delete "$disk" --zone=us-west1-a
@combatpoodle
combatpoodle / har-schema.json
Created May 10, 2017 22:11
HAR JSON schema. For use with my branch of tv4.
{
"$schema": "http://json-schema.org/draft-04/hyper-schema#",
"name": "HAR format",
"description": "JSON Schema structuring of HAR, based on https://github.com/jarib/har/blob/master/schema.json",
"type": "object",
"properties": { "$ref": "#logType" },
"logType": {
"id": "logType",
"description": "HTTP Archive structure.",
"type": "object",
gistup
@combatpoodle
combatpoodle / .gistup
Created September 10, 2016 05:54
New Description
gistup
@combatpoodle
combatpoodle / .bash_profile
Last active August 29, 2016 23:50
For Lance - chop off what you don't need
#!/bin/bash
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
@combatpoodle
combatpoodle / Email.php
Created December 14, 2015 21:00
CodeIgniter 1.7.3 email with fix for mail() security issue in recent php 5.4/5.5/5.6. Also includes basis for unit test framework on CI 1.7.3. There's some stuff you'd need to recreate/adapt for the tests - DI, disabling pieces of the loading process, etc.
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* CodeIgniter
*
* An open source application development framework for PHP 4.3.2 or newer
*
* @package CodeIgniter
* @author ExpressionEngine Dev Team
* @copyright Copyright (c) 2008 - 2010, EllisLab, Inc.
* @license http://codeigniter.com/user_guide/license.html
<?php
add_action( 'template_redirect', 'nlp_ssl_template_redirect', 1 );
function nlp_ssl_template_redirect() {
if ( !is_ssl() && ! is_admin() ) {
if ( 0 === strpos( $_SERVER['REQUEST_URI'], 'http:' ) ) {
wp_redirect( preg_replace( '|^http://|', 'https://', $_SERVER['REQUEST_URI'] ), 301 );
exit();
} else {
@combatpoodle
combatpoodle / ks.cfg
Created October 14, 2015 20:45
RHEL7 kickstart
# Base settings install
# Zero everything out...
zerombr
clearpart --all --initlabel
# Generic boot settings...
cdrom
lang en_US.UTF-8
keyboard 'us'