This file contains hidden or 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
The Chicago Cubs and the Washington Nationals played a very good baseball game on Thursday night – and Friday morning. The Cubs beat the Nationals, 9-8, in a Game 5 to advance to the NLCS. It was good stuff. Hope you didn’t have to go to work this morning. | |
The game sprinted past the D.C. Metro’s usual last train on Thursday and slowly and intentionally walked into the early hours of Friday morning thanks to – among other basic baseball things – so damn many pitching changes. The official time of the game is listed at an astounding 4-hours and 37-minutes. For a 9-inning game. On a weeknight. | |
Baseball is good. 277 minutes of baseball in a single evening is bad. According to our records, this was the longest game in postseason history that didn’t go into extra innings. The fact that this specifies postseason makes me think there was a regular season baseball game that lasted longer than 4 hours and 37 minutes and only went 9 innings. Can you imagine? | |
(The previous record belonged to the Red Sox and Yankees in |
This file contains hidden or 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 "rubygems" | |
require "json" | |
parsed = JSON.parse(ENV["VCAP_APPLICATION"]) # returns a hash | |
app_name = parsed.["application_name"] | |
app_index = parsed.["instance_id"] |
This file contains hidden or 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
attach-session (attach) [-dr] [-c working-directory] [-t target-session] | |
bind-key (bind) [-cnr] [-t key-table] key command [arguments] | |
break-pane (breakp) [-dP] [-F format] [-t target-pane] | |
capture-pane (capturep) [-aCeJpPq] [-b buffer-index] [-E end-line] [-S start-line][-t target-pane] | |
choose-buffer [-t target-window] [-F format] [template] | |
choose-client [-t target-window] [-F format] [template] | |
choose-list [-l items] [-t target-window][template] | |
choose-session [-t target-window] [-F format] [template] | |
choose-tree [-suw] [-b session-template] [-c window template] [-S format] [-W format] [-t target-window] | |
choose-window [-t target-window][-F format] [template] |
This file contains hidden or 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 | |
PID=$1 | |
for i in `pstree -p $PID | grep -oE '[0-9]+' | sort -u`; do | |
kill $i; | |
done; |
This file contains hidden or 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/ruby | |
# ruby script to create a directory structure from indented data. | |
# Three ways to use it: | |
# - Pipe indented (tabs or 2 spaces) text to the script | |
# - e.g. `cat "mytemplate" | planter.rb | |
# - Create template.tpl files in ~/.planter and call them by their base name | |
# - e.g. Create a text file in ~/.planter/site.tpl | |
# - `planter.rb site` | |
# - Call planter.rb without input and it will open your $EDITOR to create the tree on the fly | |
# You can put %%X%% variables into templates, where X is a number that corresponds to the index |
This file contains hidden or 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
Using Auto Scaling | |
Getting started with using Auto Scaling is easy. If you are signed up for the Amazon EC2 service, you are automatically registered for Auto Scaling. You simply: | |
Download the Auto Scaling Command Line Tools and the Amazon CloudWatch Command Line Tools from Developer Tools. | |
Use the as-create-launch-config command to create a Launch Configuration for your Auto Scaling Group. A Launch Configuration captures the parameters necessary to launch new Amazon EC2 instances. | |
Use the as-create-auto-scaling-group command to create an Auto Scaling Group. An Auto Scaling Group is a collection of Amazon EC2 instances to which you want to apply certain scaling conditions. | |
Use the as-put-scaling-policy command to describe each scaling action you want to take. For example, you can create one Policy that adds Amazon EC2 instances, and another that removes them. | |
Use the mon-put-metric-alarm Amazon CloudWatch command to create an alarm for each condition under which you want to add or remove Amazon EC2 instanc |
This file contains hidden or 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 | |
sudo apt-get update | |
sudo apt-get install -y openjdk-6-jre ruby1.8-full libxml2-utils unzip cpanminus build-essential | |
sudo mkdir -p /usr/local/aws | |
wget --quiet http://s3.amazonaws.com/ec2-downloads/ec2-api-tools.zip | |
unzip -qq ec2-api-tools.zip | |
sudo rsync -a --no-o --no-g ec2-api-tools-*/ /usr/local/aws/ec2/ |
This file contains hidden or 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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE syntax SYSTEM "syntax.dtd"> | |
<syntax> | |
<head> | |
<name>bash</name> <!-- The definitions title --> | |
<charsintokens><![CDATA[_0987654321abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ@/.]]></charsintokens> <!-- Valid Characters for Variables --> | |
<!-- <charsdelimitingtokens></charsdelimitingtokens> --> | |
</head> |
This file contains hidden or 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
Automating CPAN across a network | |
CPAN is an excellent tool, but the system has its limitations. One major drawback is that it's a single-system solution, which is fine if you want to manage your Perl installations on a single-computer basis. But if you have a set of Perl modules spread across your Web server farm or even across your lab on a range of platforms, trying to keep up to date across all the computers can be a time-consuming process -- even if you use the automation techniques I discussed above. | |
CPAN also consumes a lot of Internet bandwidth in that for each computer on which you use CPAN, CPAN expects to download a copy of the files from one of the central CPAN repositories. CPAN also relies on a configuration that has to be tailored to each computer: You can copy a configuration file, which resides in /perlinstalldirectory/CPAN/Config.pm, only if you can configure your platforms identically. | |
An obvious route to take when using CPAN is to use the autobundle function. This function generates a list |
This file contains hidden or 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
area[11]=23 | |
area[13]=37 | |
area[51]=UFOs | |
# Array members need not be consecutive or contiguous. | |
# Some members of the array can be left uninitialized. | |
# Gaps in the array are okay. | |
# In fact, arrays with sparse data ("sparse arrays") |
NewerOlder