This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TODO: | |
- edit /opt/statsd/local.js | |
- correct the graphite host to localhost | |
- if desired, put 'debug: true' in there | |
- make the box accessible via the hostname 'graphite' | |
- update conf/storage-schemas.conf, see example for these retention rules: | |
6 hours of 10 second data | |
1 week of 1 minute data | |
5 years of 10 minute data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
binary_search(){ | |
TARGET=$1 | |
TO_SEARCH=(${@:2}) | |
LENGTH=${#TO_SEARCH[@]} | |
START=0 | |
END=$((LENGTH - 1)) | |
while [[ $START -le $END ]]; do | |
MIDDLE=$((START + ((END - START)/2))) | |
ITEM_AT_MIDDLE=${TO_SEARCH[MIDDLE]} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Configure a Windows host for remote management with Ansible | |
# ----------------------------------------------------------- | |
# | |
# This script checks the current WinRM/PSRemoting configuration and makes the | |
# necessary changes to allow Ansible to connect, authenticate and execute | |
# PowerShell commands. | |
# | |
# Written by Trond Hindenes <trond@hindenes.com> | |
# Updated by Chris Church <cchurch@ansible.com> | |
# Updated by Kurt Griffiths <kurt.griffiths@rackspace.com> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
lastCommit="" | |
editorCmd="sed -i ''" | |
for commit in $@; do | |
lastCommit=${commit:0:7} | |
editorCmd="$editorCmd -e 's/pick ${lastCommit}/fixup ${lastCommit}/'" | |
done | |
GIT_SEQUENCE_EDITOR=$editorCmd git rebase -i ${lastCommit}~2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# Remove all gems EXCEPT defaults :) | |
`gem list -d`.split(/\n\n^(?=\w)/).each do |data| | |
match = data.match(/(?<name>([^\s]+)) \((?<versions>.*)\)/) | |
name = match[:name] | |
versions = match[:versions].split(', ') | |
if match = data.match(/^.*\(([\d\.]*),? ?default\): .*$/) | |
next if match[1].empty? # it's the only version if this match is empty |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void Main() | |
{ | |
var array = new byte[10000000]; | |
var initBlk = new InitblkMemoryHelper(); | |
var loop = new LoopMemoryHelper(); | |
// First run for JIT warmup and type initialization | |
initBlk.Memset(array, 0, array.Length, 42); | |
loop.Memset(array, 0, array.Length, 42); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
r53 = AWS::Route53.new( | |
:access_key_id => 'aws-key-id', | |
:secret_access_key => 'aws-secret-key') | |
response = r53.client.list_resource_record_sets( | |
:hosted_zone_id => "zone-id", | |
:start_record_name => 'xxx.example.com', | |
:start_record_type => 'CNAME' | |
) | |
puts response[:resource_record_sets].map{|r| r[:name]} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "unicode.h" | |
#include <stdint.h> | |
#include <stddef.h> | |
int is_valid_char(uint32_t ch) | |
{ | |
return ch < 0xd800 || ch > 0xdfff; | |
} | |
int is_combo_char(uint32_t ch) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /tmp/test = EBS-SSD | |
# /mnt/test = instance-store | |
root@ip-10-0-2-6:~# dd bs=1M count=256 if=/dev/zero of=/tmp/test | |
256+0 records in | |
256+0 records out | |
268435456 bytes (268 MB) copied, 3.26957 s, 82.1 MB/s | |
root@ip-10-0-2-6:~# dd bs=1M count=256 if=/dev/zero of=/tmp/test | |
256+0 records in | |
256+0 records out |
OlderNewer