Skip to content

Instantly share code, notes, and snippets.

View jondlm's full-sized avatar

Jon de la Motte jondlm

  • Stripe
  • Portland, OR
View GitHub Profile
@naholyr
naholyr / _service.md
Created December 13, 2012 09:39
Sample /etc/init.d script

Sample service script for debianoids

Look at LSB init scripts for more information.

Usage

Copy to /etc/init.d:

# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)
@grahamking
grahamking / runperf
Last active November 7, 2023 21:17
Bash script to run a benchmark under decent conditons.
#!/bin/bash
#
# Usage: runperf ./my-benchmark-binary
#
# Script to run a benchmark / performance test in decent conditions. Based on:
# - https://www.llvm.org/docs/Benchmarking.html
# - "Performance Analysis and Tuning on Modern CPU" by Denis Bakhvalov, Appendix A.
# - https://github.com/andikleen/pmu-tools
#
# Note that this doesn't do any actual benchmarking, your binary must be able to do that all by itself.

This document has moved!

It's now here, in The Programmer's Compendium. The content is the same as before, but being part of the compendium means that it's actively maintained.

@faun
faun / glacier_restore.rb
Created November 17, 2012 01:53
Restore files from Amazon Glacier in blulk
#!/usr/bin/env ruby
require 'base64'
require 'openssl'
require 'digest/sha1'
require 'net/http'
require "uri"
require 'time'
DEBUG = false
@jondlm
jondlm / logger.js
Last active August 29, 2015 14:03
A flexible console logger for Node.js complete with log levels and color
// Logging levels:
//
// INFO
// WARN
// ERROR
// FATAL
//
// Usage:
// var log = require('./logger.js');
//