Skip to content

Instantly share code, notes, and snippets.

View cmer's full-sized avatar

Carl Mercier cmer

  • Dallas-Fort Worth, TX
  • 00:28 (UTC -05:00)
View GitHub Profile
@cmer
cmer / gist:1267518
Created October 6, 2011 14:25
EBS RAID0 (4 volumes) vs /mnt on m1.large
EBS RAID
-------------------
Version 1.96 ------Sequential Output------ --Sequential Input- --Random-
Concurrency 1 -Per Chr- --Block-- -Rewrite- -Per Chr- --Block-- --Seeks--
Machine Size K/sec %CP K/sec %CP K/sec %CP K/sec %CP K/sec %CP /sec %CP
ip-10-124-33-11 15G 303 97 64239 9 61263 12 510 99 214939 22 1180 43
Latency 79123us 1144ms 844ms 73559us 214ms 223ms
Version 1.96 ------Sequential Create------ --------Random Create--------
ip-10-124-33-116 -Create-- --Read--- -Delete-- -Create-- --Read--- -Delete--
Dear Customer,
Thank you for your interest in the HP TouchPad and webOS. The overwhelming demand for this product in recent days has made it difficult to fulfill your request at the present time, and we are working to make more available as soon as possible. While we do not yet have specific details, we know it will be at least a few weeks before we have a limited quantity available again. We will keep you informed as we have more specifics that we can communicate, and we encourage you to join the conversation here for the latest information.
In light of this and other recent HP news, we want you to know that we remain committed to you. We will continue to honor our warranties now and in the future. We will continue delivering products that make a difference in your life and we will continue to provide the best possible service to you every day.
We are grateful for your patience and loyalty and to show our gratitude, we are offering you an exclusive one-time opportunity to save an additional amount on
# Fixes broken UTF8 strings as instructed at http://ruby.runpaint.org/encoding
def self.sanitize_string(str, request_charset=nil)
return str unless str.is_a?(String)
ic = Iconv.new('UTF-8//IGNORE', 'UTF-8')
dest = ic.iconv(str + ' ')[0..-2]
dest = encode_from_request_charset(str, request_charset) unless dest.valid_encoding?
dest
end
@cmer
cmer / git-completion.sh
Created January 2, 2011 17:24
GIT Bash Prompt Awesomeness -- Shortened directory name, uncommitted changes indicator, commits not pushed indicator
#
# bash completion support for core Git.
#
# Copyright (C) 2006,2007 Shawn O. Pearce <[email protected]>
# Conceptually based on gitcompletion (http://gitweb.hawaga.org.uk/).
# Distributed under the GNU General Public License, version 2.0.
#
# The contained completion routines provide support for completing:
#
# *) local and remote branch names
ruby 1.8.7 (2009-06-12 patchlevel 174) [universal-darwin10.0]
--------------------------------------------------------------------
YAML.load: 0.7924
Marshal.load: 0.0742
to_yaml: 5.1661
ZAML.dump: 1.4574
to_json: 0.1152
Marshal.dump: 0.0845
ruby 1.8.7 (2010-04-19 patchlevel 253) [i686-darwin10.4.0], MBARI 0x6770, Ruby Enterprise Edition 2010.02
@cmer
cmer / yaml_benchmark.rb
Created November 19, 2010 23:05
YAML, ZAML, Marshal & JSON quick'n'dirty benchmark.rb
require 'rubygems'
require 'benchmark'
require 'yaml'
require 'zaml'
require 'json'
yaml_str = <<-eos
yaml goes here
eos
( [4689]11 | *xxS0 | <:1>[2-9]xx[2-9]xxxxxxS0 | 1[2-9]xx[2-9]xxxxxxS0 | 011xxxxxxx. | [#*x][#*x][#*x][#*x]. )
Routing tables
Internet:
Destination Gateway Flags Refs Use Netif Expire
0/1 10.8.0.5 UGSc 3 0 tun0
default 192.168.1.1 UGSc 10 0 en1
10.8.0.1/32 10.8.0.5 UGSc 0 0 tun0
10.8.0.5 10.8.0.6 UH 9 0 tun0
10.37.129/24 link#8 UC 3 0 vnic1
10.37.129.2 0:1c:42:0:0:9 UHLWI 2 7 lo0
# taken from http://eigenclass.org/hiki.rb?ruby+live+process+introspection
###################
# #### RUBY STUFF
define eval
call(rb_p(rb_eval_string_protect($arg0,(int*)0)))
end
define redirect_stdout
#!/bin/bash
#================================================================================
# /engineyard/bin/monit_merb_mpc
#================================================================================
# This script controls the multi-process Merb 1.0 service
#
# Do not forget to ensure this script is executable:
# $ chmod a+x /engineyard/bin/monit_merb_mpc
#================================================================================