Skip to content

Instantly share code, notes, and snippets.

[Wed, 20 Jun 2012 18:20:22 +0200] DEBUG: ---- End uname -o STDERR ----
[Wed, 20 Jun 2012 18:20:22 +0200] DEBUG: Ran (uname -o) returned 0
[Wed, 20 Jun 2012 18:20:22 +0200] DEBUG: Loading plugin linux::filesystem
[Wed, 20 Jun 2012 18:20:22 +0200] DEBUG: Loading plugin linux::uptime
[Wed, 20 Jun 2012 18:20:22 +0200] DEBUG: Loading plugin linux::ssh_host_key
[Wed, 20 Jun 2012 18:20:22 +0200] DEBUG: Loading plugin linux::ps
[Wed, 20 Jun 2012 18:20:22 +0200] INFO: Client key /etc/chef/client.pem is not present - registering
[Wed, 20 Jun 2012 18:20:22 +0200] DEBUG: Signing the request as pinedesk-validator
[Wed, 20 Jun 2012 18:20:22 +0200] DEBUG: String to sign: 'Method:POST
Hashed Path:T5H8a5T8H5qw5E+eZlaLUya7avQ=
@dsummersl
dsummersl / gist:3744192
Created September 18, 2012 16:40
Example log4j logstash configuration
# one way w/o web interface:
# java -jar lib/playbooks/servers/files/logstash-1.1.1-monolithic.jar agent -f lib/playbooks/servers/files/logstash.conf
# another with a web interface(http://localhost:9292) :
# java -jar lib/playbooks/servers/files/logstash-1.1.1-monolithic.jar agent -f lib/playbooks/servers/files/logstash.conf -- web --backend 'elasticsearch:///?local'
# nc localhost 3333 < logfile
#
# When you are all done, you can delete the 'data' folder to delete the database.
input {
tcp {
@dsummersl
dsummersl / gist:4041911
Created November 8, 2012 21:49 — forked from miceno/gist:802781
Groovy (java) escape HTML with grapes
import org.apache.commons.lang.StringEscapeUtils
// Import with groovy grapes:
@Grab(group='commons-lang', module='commons-lang', version='2.3' )
xml = '''
<module id="id" version="0.0.1" package="package"> </module>
'''
StringEscapeUtils.escapeHtml(xml).split("\n").each() {println it }
" pathogen setup {{{
" Needed on some linux distros.
" see http://www.adamlowe.me/2009/12/vim-destroys-all-other-rails-editors.html
filetype off
call pathogen#runtime_append_all_bundles()
call pathogen#helptags()
filetype on
filetype indent on " Enable filetype-specific indenting
filetype plugin on " Enable filetype-specific plugins
@dsummersl
dsummersl / makeFullScreen.applescript
Created November 30, 2012 12:19
Applescript script for toggling applications in and out of fullscreen mode.
on run argv
(*
Toggle an application from full screen to non full screen (or the reverse).
Parameters:
1: application name(ie, Chrome)
2: boolean (true/false).
When true ensure that the application is in full screen mode (if not, make it so)
When false ensure that the application is NOT in full screen mode (if not, make it so)
*)
set theapp to item 1 of argv
@dsummersl
dsummersl / .profile fragment
Created December 5, 2012 15:42 — forked from christilden/.profile fragment
Lightning-fast project-wide find/replace with git grep and sed
gg_replace() {
if [[ "$#" == "0" ]]; then
echo 'Usage:'
echo ' gg_replace term replacement file_mask'
echo
echo 'Example:'
echo ' gg_replace cappuchino cappuccino *.html'
echo
else
find=$1; shift
@dsummersl
dsummersl / .profile fragment
Created December 5, 2012 15:43 — forked from jcamenisch/.profile fragment
Lightning-fast project-wide find/replace with git grep and sed
gg_replace() {
if [[ "$#" == "0" ]]; then
echo 'Usage:'
echo ' gg_replace term replacement file_mask'
echo
echo 'Example:'
echo ' gg_replace cappuchino cappuccino *.html'
echo
else
find=$1; shift
@dsummersl
dsummersl / .profile fragment
Created December 5, 2012 15:43 — forked from jcamenisch/.profile fragment
Lightning-fast project-wide find/replace with git grep and sed -- with confirm option.
gg_replace() {
if [[ "$#" == "0" ]]; then
echo 'Usage:'
echo ' gg_replace term replacement file_mask'
echo ' gg_replace [-c] term replacement file_mask'
echo
echo 'Options:'
echo ' -c == confirm. Allows you to interactively confirm each modification.'
echo
echo 'Example:'
let fn = { 'cmpstr': a:1 }
function fn.compare(x,y) dict
let a = a:x
let b = a:y
exec "return ". self.cmpstr
endfunction
return sort(a:list,fn.compare,fn)
let list = ['1','10','2']
let fn = { }
function fn.compare(a,b) dict
return str2nr(a:a) < str2nr(a:b)
endfunction
return sort(a:list,fn.compare,fn)