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
pafy@bisou ~ % schedtool -h | |
get/set scheduling policies - v1.3.0, GPL'd, NO WARRANTY | |
USAGE: schedtool PIDS - query PIDS | |
schedtool [OPTIONS] PIDS - set PIDS | |
schedtool [OPTIONS] -e COMMAND - exec COMMAND | |
set scheduling policies: | |
-N for SCHED_NORMAL | |
-F -p PRIO for SCHED_FIFO only as root | |
-R -p PRIO for SCHED_RR only as root |
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/env ruby | |
require 'rethinkdb' | |
include RethinkDB::Shortcuts | |
c = r.connect(:host => 'localhost', :port => 28015, :db => 'db').repl | |
100.times do | |
r.db_drop('db').run(c) rescue nil | |
r.db_create('db').run(c) | |
r.table_create('table').run(c) |
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/env ruby | |
require 'rethinkdb' | |
include RethinkDB::Shortcuts | |
10.times.map do |i| | |
Thread.new do | |
begin | |
db = i.to_s | |
c = r.connect(:host => 'localhost', :port => 28015, :db => db).repl | |
100.times do |
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
# | |
# Cookbook Name:: redis | |
# Recipe:: _server_install_from_source | |
include_recipe "build-essential" | |
redis_source_tarball = "redis-#{node.redis.source.version}.tar.gz" | |
redis_source_url = "#{node.redis.source.url}/#{redis_source_tarball}" | |
user node.redis.user |
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
Signal.trap 'SIGUSR2' do | |
# Using a thread because we cannot acquire mutexes in a trap context in | |
# ruby 2.0 | |
Thread.new do | |
Thread.list.each do |thread| | |
next if Thread.current == thread | |
puts '----[ Threads ]----' + '-' * (100-19) | |
if thread.backtrace | |
puts "Thread #{thread} #{thread['label']}" |
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
def controller_action | |
center = some_point | |
models = Model.where(:location.near => {:point => center :max_distance => 100}) | |
render :json => models.map { |m| :distance => SomeGeoGem.distance(m.location, center), :name => m.name } | |
end |
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
def synchronize | |
begin | |
lock | |
rescue Recovered | |
# don't care | |
end | |
begin | |
block.call | |
ensure |
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/env ruby | |
require 'optparse' | |
require 'fileutils' | |
#################### | |
# Global vars | |
#################### | |
$skip_upload=false | |
$skip_screenshot=false |
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/env ruby | |
# `Gemfile` should have the following: | |
# source 'https://rubygems.org' | |
# gem 'goliath' | |
# gem 'nobrainer', :github => 'nviennot/nobrainer' | |
require 'bundler' | |
Bundler.require | |
# NoBrainer configuration. |
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
require 'bundler' | |
Bundler.require | |
NoBrainer.configure do |config| | |
config.app_name = 'test' | |
config.environment = 'dev' | |
config.logger = Logger.new(STDERR).tap { |l| l.level = Logger::DEBUG } | |
end | |
NoBrainer.drop! |