Skip to content

Instantly share code, notes, and snippets.

View mbertrand's full-sized avatar

Matt Bertrand mbertrand

  • MIT Office of Digital Learning
  • Massachusetts
View GitHub Profile
@ricardo-rossi
ricardo-rossi / ElasticSearch.sh
Last active February 25, 2025 22:09
Installing ElasticSearch on Ubuntu 14.04
#!/bin/bash
### USAGE
###
### ./ElasticSearch.sh 1.7 will install Elasticsearch 1.7
### ./ElasticSearch.sh will fail because no version was specified (exit code 1)
###
### CLI options Contributed by @janpieper
### Check http://www.elasticsearch.org/download/ for latest version of ElasticSearch
## Copyright (c) 2014 Elysium Digital LLC
##
## 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:
##
## The above copyright notice and this permission notice shall be included in
@ushu
ushu / S3 buckets copy.md
Created October 29, 2013 16:12
Copy between S3 buckets w/ different accounts

This is a mix between two sources:

basically the first resource is great but didn't work for me: I had to remove the trailing "/*" in the resource string to make it work. I also noticed that setting the policy on the source bucket was sufficient. In the end these are the exact steps I followed to copy data between two buckets on two accounts

Basically the idea there is:

  • we allowe the destination account to read the source bucket (in the console for the source account)
  • we log as the destination and start the copy
@straypacket
straypacket / README.md
Last active December 26, 2015 17:59
PyTables + PostgreSQL

Usage

Schema

The file schema.py defines the schema used for PyTables, and therefore should be run first.

We'll be creating three tables, according to the data already available in the PostgreSQL server:

  • SensorData - This table will have data from each MAC address, per day

  • minified_raw_data - This sub-table has raw data from the routers

@JulieGoldberg
JulieGoldberg / DynamicLayersTileServer
Last active December 25, 2015 05:39
A decorator around the WSGITileServer that allows for custom tilestache configuration.
from TileStache import WSGITileServer, splitPathInfo
import re
#
# Decorator for the WSGITileServer that allows for custom tilestache configuration.
#
# Takes in a tilestache config file and a series of parameter names. Any that are present will be sent to the
# provider and the cache classes on each call.
@patricksurry
patricksurry / README.md
Last active November 22, 2019 18:46
Illustrate embedding geojson/topojson geometry into a google maps overlay using d3.geo.projection.

Based on http://bl.ocks.org/mbostock/899711 which uses D3 to draw elements into a google maps overlay layer, but doesn't use d3.geo machinery to draw map geometry. This gist illustrates how to align a D3 mercator projection with google maps so we can do standard d3 mapping stuff on top of the google API.

@jaxbot
jaxbot / gist:5748513
Created June 10, 2013 12:58
Block nginx from serving .git directories
location ~ /\.git {
deny all;
}
# or, all . directories/files in general (including .htaccess, etc)
location ~ /\. {
deny all;
}
@mindplay-dk
mindplay-dk / README.md
Last active September 3, 2024 11:39
ISO 3166-2 Country and State/Region Tables for MySQL
@rburhum
rburhum / urls.py
Created January 17, 2013 20:15
Add tilestache to Django
...
url(r'^v1/tiles/(?P<tile_user>([^/]+))/(?P<tile_layer>([^/]+))/(?P<tile_zoom>(\d+))/(?P<tile_column>(\d+))/(?P<tile_row>(\d+))\.(?P<tile_format>([a-z]+))$', TileManager.as_view(), name='tile_manager'),
...
@dbouwman
dbouwman / PointClusterService.cs
Created March 24, 2012 21:26
Server Side Clustering Class in C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using SafeRoutes.Infrastructure.Storage.Domain;
namespace SafeRoutes.Infrastructure.Services
{
/// <summary>
/// Service that clusters ProjectPoints