Skip to content

Instantly share code, notes, and snippets.

DATESTAMP_ES %{YEAR}-%{MONTHNUM}-%{MONTHDAY} %{HOUR}:%{MINUTE}:%{SECOND},%{NUMBER}
ELASTICSEARCHLOG \[%{DATESTAMP_ES:timestamp}\]\[%{WORD:level}\]\[%{DATA:module}%{SPACE}\] \[%{WORD:name}\]%{SPACE}%{GREEDYDATA:message}
{"thingy":"stuff"}
#!/usr/bin/env python
#
import time
from couchdbcurl import client
for i in range(4,10):
s = client.Server("http://server%s.local:5984/"%i)
print "Server %s" % i
for d in s:
[10:31:47] <C> .w 78757
[10:31:47] <diffusion> Austin, TX (78757): 94F/94F 31% 9 mph from SW Fair (1h19m13s from now)
[10:34:59] <witriew> .w
[10:34:59] <diffusion> Mountain View, CA (94043): 17C/17C (63F/63F) 78% 7 mph (11 km/h) from NNW Cloudy (38m59s ago)
[10:35:05] <witriew> mmmmmm
[10:35:46] <witriew> .w vancouver, ca
[10:35:46] <diffusion> Locations found: Vancouver, Canada; West Vancouver, Canada; North Vancouver, Canada
[10:35:55] <witriew> .w Vancouver, CA
[10:35:55] <diffusion> Locations found: West Vancouver, Canada; Vancouver, Canada; North Vancouver, Canada
@opie4624
opie4624 / 01-create-repo.txt
Created September 8, 2011 06:58
Splitting a repository
~/Code/Work$ mkdir repoA
~/Code/Work$ cd repoA/
~/Code/Work/repoA$ git init
Initialized empty Git repository in /Users/akraut/Code/Work/repoA/.git/
(init) ~/Code/Work/repoA$ touch file1
(init file1) ~/Code/Work/repoA$ touch file2
(init file1 file2) ~/Code/Work/repoA$ git add file?
(init file1 file2) ~/Code/Work/repoA$ git commit -m 'add test files'
[master (root-commit) 6be573c] add test files
0 files changed, 0 insertions(+), 0 deletions(-)
@opie4624
opie4624 / AppMessages.txt
Created May 15, 2011 07:02
Crash of Mac Arduino 0022
localhost ~/Downloads/noisebridge$ /Applications/Arduino.app/Contents/MacOS/JavaApplicationStub
[JavaAppLauncher] Requested [1.5*], launching in [1.6] instead.
WARNING: RXTX Version mismatch
Jar version = RXTX-2.2pre1
native lib Version = RXTX-2.2pre2
Binary sketch size: 1018 bytes (of a 30720 byte maximum)
Invalid memory access of location 0xb1a2fbe0 eip=0x2f15b90c
Segmentation fault
localhost ~/Downloads/noisebridge$
root@prx7:~# shef -z
loading configuration: /etc/chef/client.rb
Session type: client
Loading....................epic fail!
/usr/lib/ruby/gems/1.8/gems/chef-0.9.16/lib/chef/mixin/recipe_definition_dsl_core.rb:56:in `method_missing': undefined method `template' for #<Chef::Recipe:0x7fe8a0e720a8> (NoMethodError)
from /var/cache/chef/cookbooks/chef-client/recipes/config.rb:29:in `from_file'
from /usr/lib/ruby/gems/1.8/gems/chef-0.9.16/lib/chef/cookbook_version.rb:473:in `load_recipe'
from /usr/lib/ruby/gems/1.8/gems/chef-0.9.16/lib/chef/mixin/language_include_recipe.rb:40:in `include_recipe'
from /usr/lib/ruby/gems/1.8/gems/chef-0.9.16/lib/chef/mixin/language_include_recipe.rb:27:in `each'
@opie4624
opie4624 / Xoom-3G-MtnView.txt
Created February 25, 2011 21:56
Measurement Lab NDT tests from my Motorola Xoom
Testing started at Fri Feb 25 02:28:31 PST 2011
From:
OS: Name = Linux, Architecture = armv7l, Version = 2.6.36.3-g2a65edc
Java: Version = 0, Vendor = The Android Project
Latitude: 37.574165
Longitude: -122.309439
NetworkType: mobile
To:
@opie4624
opie4624 / sudoers
Created February 23, 2011 23:47
example environment variables for sudo
## Locale settings
Defaults env_keep += "LANG LANGUAGE LINGUAS LC_* _XKB_CHARSET"
##
## Run X applications through sudo; HOME is used to find the
## .Xauthority file. Note that other programs use HOME to find
## configuration files and this may lead to privilege escalation!
Defaults env_keep += "HOME"
##
## X11 resource path settings
Defaults env_keep += "XAPPLRESDIR XFILESEARCHPATH XUSERFILESEARCHPATH"
var fs = require('fs');
var email_file = process.argv[2];
var ws = fs.createWriteStream('/var/node/log.txt', {flags: 'a+', mode: 0666});
ws.write(email_file + ' ' + new Date() + " \n", 'utf8');
var http = require('http');
try {
var mail_server = http.createClient(3000, 'mail.example.com');
var request = mail_server.request('POST', '/services/1.0/rest/mail/', {host: 'mail.example.com'});