Skip to content

Instantly share code, notes, and snippets.

@mickm
mickm / update-pingdom-iptables.sh
Created November 21, 2012 20:21
Whitelist Pingdom probe-servers in iptables.
#!/bin/bash
#
# Whitelist Pingdom probe-servers in iptables.
#
# Create a chain called "PINGDOM" and jump to it somewhere before
# the final REJECT/DROP, e.g.
#
# # New chain for Pingdom rules
# :PINGDOM - [0:0]
#
@mickm
mickm / main.cpp
Created September 13, 2019 16:19
astra fps test case
// usage:
// run this with the mini and stereo s and compare the fps in different light conditions
// the fps will drop on the stereo s in low light
// the mini maintains 30 fps in all lighting conditions
// seems like the autoexposure works differently (aperture priority vs shutter priority maybe?) on the stereo s vs the mini
#include <chrono>
#include <cstdio>
#include <cstdlib>
#include <astra/capi/astra.h>
@mickm
mickm / gist:7832447
Created December 6, 2013 21:31
dump tables, sequences, indices, constraints and data (no languages, functions, types, etc.)
pg_dump --no-owner --no-privileges $(paste -sd\ <(echo '\dt' |psql -At |awk -F\| '{print $2}' |egrep -v '^(spatial_ref_sys|geometry_columns)$' |xargs -n 1 echo -t))
% strings /Applications/Utilities/Terminal.app/Contents/MacOS/Terminal |grep adjustedRelative
colorForANSIColor:adjustedRelativeToColor:
colorForExtendedANSIColor:adjustedRelativeToColor:
%
@mickm
mickm / gist:6315020
Created August 23, 2013 02:41
ARM auto-vectorization gcc flags
# -O3 -mcpu=cortex-a8 -mfpu=neon -mfloat-abi=softfp -ftree-vectorize -ffast-math -funsafe-math-optimizations -fsingle-precision-constant
@mickm
mickm / nginx.rb
Last active December 12, 2015 04:38
require 'formula'
class Nginx < Formula
homepage 'http://nginx.org/'
url 'http://nginx.org/download/nginx-1.2.6.tar.gz'
sha1 '432059b668e3f018eab61f99c7cc727db88464e8'
devel do
url 'http://nginx.org/download/nginx-1.3.10.tar.gz'
sha1 '11cd44bc0479594fd2e5f7a65bf8f2c36ad5ec1e'
@mickm
mickm / 0-readme.md
Created May 27, 2012 18:02 — forked from sj26/0-readme.md
ruby-1.9.3-p194 cumulative performance patch.

Patched ruby 1.9.3-p194 for 30% faster rails boot

What is?

This script installs a patched version of ruby 1.9.3-p194 with patches for boot-time performance improvements (#66 and #68), and runtime performance improvements (#83 and #84). It also includes the new backported GC from ruby-trunk.

Huge thanks to funny-falcon for the performance patches.

@mickm
mickm / top_terms.rb
Created February 24, 2012 15:27
Pull top site search terms and top search engine terms from GA
#!/usr/bin/env ruby
GA_USER = 'foo@example.com'
GA_PASS = 'secrets!'
GA_PROPERTY = 'UA-8411317-51'
require 'rubygems'
require 'garb'
class SiteSearchTerms
@mickm
mickm / 0-readme.md
Created February 21, 2012 03:02 — forked from burke/0-readme.md
ruby-1.9.3-p125 cumulative performance patch.

Patched ruby 1.9.3-p125 for 30% faster rails boot

What is?

This script installs a patched version of ruby 1.9.3-p125 with patches to make ruby-debug work again (#47) and boot-time performance improvements (#66 and #68), and runtime performance improvements (#83 and #84).

Huge thanks to funny-falcon for the performance patches.

@mickm
mickm / s3helper
Created March 23, 2011 02:51
Duplicity wrapper to manage S3 backups for media files
#!/bin/bash
#
# Duplicity wrapper to manage S3 backups for media files.
#
# aptitude install duplicity python-boto
#
# Configure the settings below then run a test backup AND a test restore.
# Once working, schedule a regular backup with cron. Only one backup will
# run at a time so set a short cron period if you want.
#