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
iab ienn if err != nil { | |
\<CR> return err | |
\<CR>} |
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
function sshscreen() { | |
tmpfile=$(mktemp -t sshscreen-) | |
echo "exec ssh $*" > "$tmpfile" | |
chmod 755 "$tmpfile" | |
screen -s "$tmpfile" | |
} |
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
class LogFormatElement | |
@_caster = nil | |
attr_accessor :abbrev, :name, :regex | |
# Class variables that determine the _default_ for abbrev, name, and regex in an instance. | |
# That is, an instance will initialize with these values for the instance variables @abbrev, | |
# @name, and @regex. | |
class << self; attr_accessor :abbrev, :name, :regex end | |
# Additionally we need to access this from within the instance: | |
class << self; attr_accessor :_caster end |
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 | |
require 'rubygems' | |
require 'json' | |
# This is a git update hook that allows you to declare a given class | |
# or method or what-have-you deprecated. If you try to push deprecated | |
# code to the repo, you'll see an error and the push will fail. The | |
# error also gives you a string that you can stick in your commit | |
# message to bypass the deprecation rule. |
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
grok patterns: | |
CHEF_RUNTIME INFO: Chef Run complete in %{NUMBER:runtime} seconds | |
HOST_PART \b[A-Za-z][0-9A-Za-z-]{0,62}\b | |
HOST_FIRSTPART %{HOST_PART:hostname_short} | |
collector.conf: | |
filter { |
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
dan@george:~$ echo union > foo.csv | |
dan@george:~$ file foo.csv | |
foo.csv: ASCII c program text | |
dan@george:~$ echo onion > foo.csv | |
dan@george:~$ file foo.csv | |
foo.csv: ASCII text | |
dan@george:~$ echo function > foo.csv | |
dan@george:~$ file foo.csv | |
foo.csv: ASCII text | |
dan@george:~$ echo typedef > foo.csv |
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 | |
set -x | |
exec >/tmp/foo.log 2>&1 |
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
$ echo "uvoptcuce faimspz ara"|sed 'secede; severe; syzygy; samsara; serenade; seduceable; serpentine; strategist' | |
unadoptable fainting aegis |
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/perl | |
# | |
# What it does (example): | |
# | |
# dan@cleon:~/tools/server$ yes | ./add_timestamps.pl | head | |
# 2012-10-02 14:59:16.579109 y | |
# 2012-10-02 14:59:16.579180 y | |
# 2012-10-02 14:59:16.579210 y | |
# 2012-10-02 14:59:16.579240 y | |
# 2012-10-02 14:59:16.579269 y |