Skip to content

Instantly share code, notes, and snippets.

View mattehicks's full-sized avatar

Mattehicks mattehicks

View GitHub Profile
@mattehicks
mattehicks / add-by-id.sh
Created October 29, 2018 04:01 — forked from CesarCapillas/add-by-id.sh
SOLR bash recipes for creating, deleting or truncating collections, monitoring and searching.
#!/bin/bash
COLLECTION=${2:-zylk}
SERVER=${3:-localhost}
PORT=${4:-8983}
if [ -z "$1" ]; then
# Usage
echo 'Usage: add-by-id.sh <id> [<collection> <solr-server=localhost> <port=8383>]'
else
curl -X POST "http://${SERVER}:${PORT}/solr/${COLLECTION}/update?commit=true" -H "Content-Type: text/xml" --data-binary "<add><doc><field name='id'>$1</field><field name='url'>$1</field></doc></add>"
@mattehicks
mattehicks / main.tf
Created April 11, 2018 00:02 — forked from bradgignac/main.tf
Terraform Example
/* Providers */
provider "aws" {
region = "us-west-2"
}
/* Variables */
variable "name" {
default = "XXXXX"
@mattehicks
mattehicks / fabfile.py
Created October 26, 2016 23:40 — forked from robbernabe/fabfile.py
Masterless Puppet with Fabric
from fabric.api import task, lcd, local, env, sudo
from fabric.contrib.project import rsync_project
#################################################
# Globals
env.port = 13412
env.use_ssh_config = True
env.disable_known_hosts = True
#!/usr/bin/env python
'''
Send memory usage metrics to Amazon CloudWatch
This is intended to run on an Amazon EC2 instance and requires an IAM
role allowing to write CloudWatch metrics. Alternatively, you can create
a boto credentials file and rely on it instead.
Original idea based on https://github.com/colinbjohnson/aws-missing-tools
'''
#! /usr/bin/lua
-- Usage: mysql2sqlite.lua [data base name]
-- $ ./mysql2sqlite.lua my_database
-- $ ./mysql2sqlite.lua "my_database my_table"
-- $ ./mysql2sqlite
-- Set here the path to the temp file you want mysqldump to dump the database into
local mysqldump_file = '/tmp/lua.sql'
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mattehicks
mattehicks / readme.md
Last active August 29, 2015 14:08 — forked from ashrithr/readme.md

Installing ELK (CentOS)

Install JDK

rpm -ivh https://dl.dropboxusercontent.com/u/5756075/jdk-7u45-linux-x64.rpm

Install & Configure ElasticSearch

@mattehicks
mattehicks / README.md
Last active August 29, 2015 14:07 — forked from mbostock/.block

This example is the second of three in the Path Transitions tutorial; see the previous example for context.

The desired pairing of numbers for path interpolation is like this:

M x0, y0 L x1, y1 L x2, y2 L x3, y3 L xR, y4
   ↓   ↓    ↓   ↓    ↓   ↓    ↓   ↓
M xl, y0 L x0, y1 L x1, y2 L x2, y3 L x3, y4

Where xl is some negative value off the left side, and xr is some positive value off the right side. This way, the first point ⟨x0,y0⟩ is interpolated to ⟨xl,y0⟩; meaning, the x-coordinate is interpolated rather than the y-coordinate, and so the path appears to slide off to the left. Likewise, the incoming point ⟨xr,y4⟩ is interpolated to ⟨x3,y4⟩.

{
"Statement": [
{
"Action": [
"route53:ChangeResourceRecordSets",
"route53:GetHostedZone",
"route53:ListResourceRecordSets"
],
"Effect": "Allow",
"Resource": [
/^(\+\d)*\s*(\(\d{3}\)\s*)*\d{3}(-{0,1}|\s{0,1})\d{2}(-{0,1}|\s{0,1})\d{2}$/