Skip to content

Instantly share code, notes, and snippets.

View ralph-tice's full-sized avatar

Ralph Tice ralph-tice

  • Kentik
  • Texas
View GitHub Profile
@bbeck
bbeck / jenkins-swarm-client
Created October 28, 2013 23:05
jenkins swarm client init.d script for CentOS
#!/bin/bash
#
# Jenkins Swarm Client
#
# chkconfig: 2345 89 9
# description: jenkins-swarm-client
source /etc/rc.d/init.d/functions
@bokmann
bokmann / JRuby Awesome Performance
Last active August 31, 2023 07:32
brief summary of massive performance improvements with JRuby
# Thee will be more information here when I share the entire problem space I'm working on, but
# in short, this is preview material for my second talk in a series called "What Computer Scientists Know".
# The first talk is on recursion, and goes through several examples., leading up to a problem based
# on a simple puzzle that initial estimates based on performance of a previous puzzle would take years
# to solve on modern computers with the techniques shown in Ruby. That sets the stage for improving the
# performance of that problem with threading, concurrency, and related tuning.
#
# The second talk is on threading and concurrency, touching on algorithmic performance as well.
# Using some knowledge of the problem (board symmetry, illegal moves, etc), we reduce the problem space
# to about .5% of what we initially thought it was. Still, the initial single threaded solution took more
@miketheman
miketheman / plusfiles.rb
Created August 27, 2013 13:38
fragment for dealing with S3 and plus sign in URLs. Part of a bigger tool that will be open-sourced at some point.
# S3 translates a '+' in filenames to %2B in the URL, breaking apt
# Here we will traverse any file in the pool/ dir and create a hardlink for
# any file that has a plus in its name. apt/wget will do the right thing.
Dir.chdir('<%= @repo_root %>') do
plusfiles = Dir.glob '**/*/*+*.deb'
begin
plusfiles.each do |file|
File.link(file, file.gsub('+', ' '))
end
rescue SystemCallError # swallow this if file already exists
@itsderek23
itsderek23 / Dockerfile
Created August 27, 2013 02:09
Example Docker File to start a Rails app located in a local ./docker-rails directory.
# docker build -t="rails" .
FROM ubuntu:12.04
RUN apt-get update
## MYSQL
RUN apt-get install -y -q mysql-client libmysqlclient-dev
## RUBY
@aphyr
aphyr / gist:6266347
Last active December 21, 2015 06:48
In this ZK demo, a partition places the primary on the minority component. All
operations time out while the cluster converges on a new primary, at which
point three clients (talking to the three nodes in the majority component) can
proceed again. When the partition is healed, the two minority nodes can begin
accepting writes again. As with single-node Postgres, Zookeeper's client
protocol and ZAB both allow for false negatives (timeouts may actually succeed)
but not false positives (every successful write *will* be present in the final
set.)
HOW TO READ THIS CHART:
@ragnard
ragnard / collectd.conf
Created July 26, 2013 14:43
Riemann collectd
FQDNLookup true
Hostname "localhost"
Interval 5
LoadPlugin syslog
<Plugin syslog>
LogLevel info
</Plugin>
@krishnanraman
krishnanraman / zipcodes of wealthy elite
Last active December 20, 2015 06:09
Where do the WEALTHY WELL EDUCATED ELITE live ?
/*
Goal: Use Scalding to datamine the 2010 US Census data (kindly provided by @ElonAzoulay & @hmason), to find
Where do the WEALTHY WELL EDUCATED ELITE live ?
WEALTHY == house value quarter million, household income 150k
WELL EDUCATED == sort by edu, edu = (10 * Phd + 5 * MS + 1 * BS) score
*/
import com.twitter.scalding._
import cascading.tuple.Fields
import cascading.tap.SinkMode
@fedesilva
fedesilva / In-2.10.x.scala
Last active December 18, 2015 05:29
I love this language.
implicit class In[T](t:T) {
def in(opts:T*): Boolean = opts contains t
}
scala> 1 in ( 2, 3 )
res1: Boolean = false
scala> 1 in ( 2, 3, 2, 1 )
res2: Boolean = true
jar 'com.netflix.hystrix:hystrix-core', '~>1.2.16'