Skip to content

Instantly share code, notes, and snippets.

View andre's full-sized avatar

Andre Lewis andre

View GitHub Profile
FROM ubuntu:trusty
RUN apt-get update && apt-get install -y ruby ruby-dev gcc make curl
RUN gem install sinatra --no-rdoc --no-ri
ADD . /srv/
# start it up
WORKDIR /srv/
#! /usr/bin/env ruby
require "open3" # for reading stderr
# A dirt-simple script to merge a pull request from someone on github.
# Andre Lewis, 2009
#
# Assumptions:
# 1. you're currently working on master
# 2. you've already reviewed the pull request and have decided to include it.
# Quick and dirty applescript to determine batter life under very light load. This script just navigates Safari to a
# page every 10 seconds to simulate web browsing.
#
# You'll need to change the file output path (in the log method) for your machine.
#
# The test:
# * a freshly charged and calibrated battery
# * dim brightness to 50%
# * turn off bluetooth
# * set display to never go to sleep
>> MySQLTuner 1.0.1 - Major Hayden
-------- General Statistics --------------------------------------------------
[--] Skipped version check for MySQLTuner script
[OK] Currently running supported MySQL version 5.1.41-3ubuntu12.3
[OK] Operating on 32-bit architecture with less than 2GB RAM
-------- Storage Engine Statistics -------------------------------------------
[--] Status: -Archive -BDB -Federated +InnoDB -ISAM -NDBCluster
[--] Data in InnoDB tables: 267M (Tables: 9)
@andre
andre / nokogiri_test.rb
Created January 26, 2011 20:11
This will crash macruby inconsistently with "incorrect checksum for freed object - object was probably modified after being freed."
require "rubygems"
require "nokogiri"
puts "starting"
html=<<-EOS
<div class="result">
<div>
<h1>
# Takes an IP or hostname. Reports 1 if it can ping the host, 0 if it can't
class Ping < Scout::Plugin
OPTIONS=<<-EOS
host:
name: Host
notes: the IP address or hostname to ping
EOS
def build_report
#!/bin/sh
#
# killspike2
# Remove (presumably erroneous) peaks from RRD files
#
# Matt Zimmerman <mdz@debian.org>, 05/2002
#
set -e
# Multiple, concurrent HTTP (non-SSL) requests
#
# Works in macuruby
require 'net/http';
def do_https
http=Net::HTTP.new('www.yahoo.com', 80)
http.start() {|http|
req = Net::HTTP::Get.new('/')
warning: Could not find object file "/Users/lrz/src/macruby-0.10/ext/openssl/openssl_missing.o" - no debug information available for "openssl_missing.c".
warning: Could not find object file "/Users/lrz/src/macruby-0.10/ext/openssl/ossl.o" - no debug information available for "ossl.c".
warning: Could not find object file "/Users/lrz/src/macruby-0.10/ext/openssl/ossl_asn1.o" - no debug information available for "ossl_asn1.c".
warning: Could not find object file "/Users/lrz/src/macruby-0.10/ext/openssl/ossl_bio.o" - no debug information available for "ossl_bio.c".
warning: Could not find object file "/Users/lrz/src/macruby-0.10/ext/openssl/ossl_bn.o" - no debug information available for "ossl_bn.c".
Apache Server Status for localhost
Server Version: Apache/2.2.14 (Ubuntu) PHP/5.3.2-1ubuntu4.2 with
Suhosin-Patch Phusion_Passenger/2.2.15
Server Built: Apr 13 2010 19:28:27
__________________________________________________________________
Current Time: Friday, 20-May-2011 11:46:05 PDT
Restart Time: Friday, 25-Mar-2011 17:38:18 PDT