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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
# If you're looking into the C10M problem (10 million concurrent connections) | |
# you might want to play with DPDK (Originally proprietry Intel, now open source) | |
# | |
# C10M: http://c10m.robertgraham.com/ | |
# DPDK: http://dpdk.org/ | |
# | |
# This is a quick summary how to install dpdk on ubuntu | |
# running inside virtualbox on a mac | |
# On my Mac: |
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
require 'gsl' | |
require 'time' | |
module Diskalerter | |
class ThresholdEstimator | |
attr_reader :timestamps, :signal, :threshold, :now | |
# timestamps - a list of timestamps in epoch milliseconds | |
# signal - a list of values for the provided timestamps | |
# threshold - the "exhaustion" threshold (e.g., 100 for a percentage signal) |
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 | |
# | |
# Copy data from a Time Machine volume mounted on a Linux box. | |
# | |
# Usage: copy-from-time-machine.sh <source> <target> | |
# | |
# source: the source directory inside a time machine backup | |
# target: the target directory in which to copy the reconstructed | |
# directory trees. Created if it does not exists. | |
# |
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
development: | |
adapter: mysql2 | |
encoding: utf8 | |
database: my_database | |
username: root | |
roles: | |
- admin | |
- developer | |
- guest | |
password: |
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/sh | |
# create custom fact to identify the role of this server | |
mkdir -p /etc/facter/facts.d/ | |
echo "server_role=puppetmaster" >> /etc/facter/facts.d/server_role.txt | |
# make sure everything is up to date | |
wget http://apt.puppetlabs.com/puppetlabs-release-raring.deb | |
dpkg -i puppetlabs-release-raring.deb | |
apt-get update |
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 | |
# | |
# Pivot the root partition to a tmpfs mount point so that the root volume can | |
# be re-partitioned. | |
# | |
############################################################################## | |
set -x | |
set -e | |
# Prevent selinux from interfering |
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
{ | |
"AWSTemplateFormatVersion" : "2010-09-09", | |
"Description" : "Creates auto scaling Elastic Search Cluster", | |
"Parameters" : { | |
"InstanceType" : { | |
"Description" : "Elastic Search node instance type", | |
"Type" : "String", | |
"Default" : "t2.small", |
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 | |
build=alpha # define build ["stable", "beta", "alpha"] | |
disk=hvm # define disk backing ["pv", "hvm"] | |
if [ "x$1" = "x" ]; then | |
echo "Usage: $0 REGION"; exit 1 | |
fi | |
#### deprecated |
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
set hostnames to {"web01", "sys01", "mem01", "redis01"} | |
if application "iTerm" is running then | |
tell application "iTerm" | |
create window with default profile | |
tell current tab of current window | |
select | |
tell current session | |
-- make the window fullscreen |