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
library(shiny) | |
shinyUI(pageWithSidebar( | |
headerPanel("PHP errors by time"), | |
sidebarPanel( | |
checkboxGroupInput("errors_shown", "Most common errors:", c( | |
"davidbowie.php:50"="lib/exosite/robot/davidbowie.php:50", | |
"heehaw.php:728"="inc/spoot/heehaw.php:728", |
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
input { stdin {} } | |
filter { metrics { meter => [ "foo" ] } } | |
output { stdout { debug => true } } |
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
from thrift.transport import TSSLSocket | |
from thrift.transport import TTransport | |
import cql | |
sock = TSSLSocket.TSSLSocket(host='cass.example.com', port=9160, ca_certs='/path/to/ca_certs.pem') | |
trans = TTransport.TFramedTransport(sock) | |
conn = cql.connect('cass.example.com', 9160, 'keyspace', user='username', password='password', transport=trans, cql_version='3.0.0') |
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
4> [self() ! X || X <- [rhythm,music,'my girl']]. | |
[rhythm,music,'my girl'] | |
5> flush(). | |
Shell got rhythm | |
Shell got music | |
Shell got 'my girl' | |
ok |
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 | |
require 'rubygems' | |
require 'nokogiri' | |
class Clue | |
attr_accessor :text, :answer, :value, :category, :round, :difficulty, :shownumber | |
end | |
def escape(text) |
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
cluster_name: 'cassandra-00' | |
num_tokens: 256 | |
hinted_handoff_enabled: true | |
max_hint_window_in_ms: 10800000 | |
hinted_handoff_throttle_in_kb: 1024 | |
max_hints_delivery_threads: 2 | |
authenticator: org.apache.cassandra.auth.PasswordAuthenticator |
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
INFO 20:12:11,648 Logging initialized | |
INFO 20:12:11,673 JVM vendor/version: Java HotSpot(TM) 64-Bit Server VM/1.7.0_25 | |
INFO 20:12:11,675 Heap size: 1017380864/1018429440 | |
INFO 20:12:11,675 Classpath: /usr/share/cassandra/lib/antlr-3.2.jar:/usr/share/cassandra/lib/avro-1.4.0-fixes.jar:/usr/share/cassandra/lib/avro-1.4.0-sources-fixes.jar:/usr/share/cassandra/lib/commons-cli-1.1.jar:/usr/share/cassandra/lib/commons-codec-1.2.jar:/usr/share/cassandra/lib/commons-lang-2.6.jar:/usr/share/cassandra/lib/compress-lzf-0.8.4.jar:/usr/share/cassandra/lib/concurrentlinkedhashmap-lru-1.3.jar:/usr/share/cassandra/lib/guava-13.0.1.jar:/usr/share/cassandra/lib/high-scale-lib-1.1.2.jar:/usr/share/cassandra/lib/jackson-core-asl-1.9.2.jar:/usr/share/cassandra/lib/jackson-mapper-asl-1.9.2.jar:/usr/share/cassandra/lib/jamm-0.2.5.jar:/usr/share/cassandra/lib/jbcrypt-0.3m.jar:/usr/share/cassandra/lib/jline-1.0.jar:/usr/share/cassandra/lib/json-simple-1.1.jar:/usr/share/cassandra/lib/libthrift-0.7.0.jar:/usr/share/cassandra/lib/l |
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
danslimmon@cassandra-00:~$ cassandra-shuffle enable --thrift-host 192.168.129.11 | |
Failed to enable shuffling on 192.168.176.204! | |
Failed to enable shuffling on 192.168.178.133! |
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
# Sort [1,2,3,4] with a cmp function that returns -1, 0, or 1 with equal probability. | |
# Do it 10^5 times. | |
h={1:0,2:0,3:0,4:0} | |
for i in range(99999): | |
a = sorted([1,2,3,4], | |
lambda a, b: random.sample([-1,0,1], 1)[0]) | |
h[a[0]] += 1 | |
h | |
# => {1: 60443, 2: 17374, 3: 10990, 4: 11192} | |
# The first element of `a` was `1` 60% of the time! |
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
filter { | |
# Capture all the generic syslog stuff and populate @timestamp | |
if [type] == "postfix" { | |
grok { | |
match => [ "message", "%{SYSLOGBASE} %{GREEDYDATA:_syslog_payload}" ] | |
singles => true | |
} | |
# Postfix pads single-digit numbers with spaces (WHYYYYY) | |
mutate { gsub => [ "timestamp", " ", " 0" ] } | |
date { match => [ "timestamp", "MMM dd HH:mm:ss"] } |