Skip to content

Instantly share code, notes, and snippets.

View bretthoerner's full-sized avatar

Brett Hoerner bretthoerner

View GitHub Profile
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
<log4j:configuration debug="true"
xmlns:log4j='http://jakarta.apache.org/log4j/'>
<appender name="console" class="org.apache.log4j.ConsoleAppender">
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern"
value="%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}: - %m%n" />
</layout>
@bretthoerner
bretthoerner / PKGBUILD
Created September 13, 2014 15:47
Mesos 0.20.0
# Maintainer: Daichi Shinozaki <dsdseg@gmail.com>
pkgname=mesos
pkgver=0.20.0
pkgrel=1
pkgdesc="A cluster manager that simplifies the complexity of running applications on a shared pool of servers"
arch=('x86_64')
url='http://mesos.apache.org/'
license=('Apache')
groups=('science')
depends=('python2' 'python2-boto' 'curl' 'libsasl' 'leveldb' 'java-environment' 'libunwind')
#!/bin/bash
set -euo pipefail
if [ $# -eq 0 ]; then
sleep 0.2 # xmonad holds keyboard; race condition fix
scrot -s -e "$0 \$f"
exit
fi
//Setup Option[String]s
val maybeValue1 : Option[String] = Some("Value1")
val maybeValue2 : Option[String] = Some("Value2")
val maybeValue3 : Option[String] = None
(maybeValue1, maybeValue2, maybeValue3) match {
case (Some(v1), Some(v2), Some(v3)) => (v1, v2, v3)
case _ => println("Handle error here")
}
@bretthoerner
bretthoerner / .emacs.el
Last active December 17, 2015 02:29 — forked from mattdeboard/.emacs.el
(eval-after-load 'rcirc
'(defun-rcirc-command matt (arg)
"Matt cycling"
(interactive "i")
(rcirc-send-message process target "http://i.imgur.com/YkhDPmH.png")))
Feb 20, 2013 5:11:28 AM org.apache.solr.update.processor.DistributedUpdateProcessor doDefensiveChecks
SEVERE: ClusterState says we are the leader, but locally we don't think so
Feb 20, 2013 5:11:28 AM org.apache.solr.update.processor.DistributedUpdateProcessor doDefensiveChecks
SEVERE: ClusterState says we are the leader, but locally we don't think so
Feb 20, 2013 5:11:28 AM org.apache.solr.update.processor.DistributedUpdateProcessor doDefensiveChecks
SEVERE: ClusterState says we are the leader, but locally we don't think so
Feb 20, 2013 5:11:28 AM org.apache.solr.common.SolrException log
SEVERE: org.apache.solr.common.SolrException: ClusterState says we are the leader, but locally we don't think so
at org.apache.solr.update.processor.DistributedUpdateProcessor.doDefensiveChecks(DistributedUpdateProcessor.java:295)
at org.apache.solr.update.processor.DistributedUpdateProcessor.setupRequest(DistributedUpdateProcessor.java:230)
scala> val m = Map("baz" -> 1, "foo" -> null)
m: scala.collection.mutable.Map[String,Any] = Map(baz -> 1, foo -> null)
scala> m.get("baz")
res2: Option[Any] = Some(1)
scala> m.get("foo")
res3: Option[Any] = Some(null)
scala> m.get("huh?")
;; gist
(add-to-list 'load-path (concat dotfiles-dir "gh.el"))
(require 'gist)
#!/bin/bash
date=`date "+%Y%m%d"`
file="/tmp/mysql-${date}.dump.gz"
mysqldump -h"host" -u"user" -p"pass" tr_production | gzip > $file
s3cmd put $file s3://bucket/mysqlbackups/ 2> /dev/null
rm -f $file
# system config
script "increase nofiles to 300k" do
interpreter "bash"
flags "-e"
user "root"
creates "/etc/security/limits.d/nofiles.conf"
code <<-EOH
echo "* hard nofile 300000" >> /etc/security/limits.d/nofiles.conf
echo "* soft nofile 300000" >> /etc/security/limits.d/nofiles.conf
echo "root hard nofile 300000" >> /etc/security/limits.d/nofiles.conf