A few items here assume zsh as shell (globs and expansion modifiers, print -l
).
Required installation order:
Previously recorded:
gmp nettle gnutls npth libgpg-error libgcrypt libksba libassuan ( pinentry , gnupg )
## Environment normalisation | |
# Ignore bundler config. | |
/.bundle | |
/vendor/bundle | |
/lib/bundler/man/ | |
# Unless supporting rvm < 1.11.0 or doing something fancy, ignore this: | |
.rvmrc |
#!/bin/bash | |
PATH=$(rbenv root)/bin:$(rbenv root)/plugins/ruby-build/bin:$PATH | |
version=${1:-2.2.7} | |
trap 'exit 1' 2 | |
eval "$(rbenv init -)" |
require 'thread' | |
# ################################## | |
# Ruby anti-race conditions workshop | |
# ################################## | |
class Sheep | |
def initialize | |
@shorn = false | |
end |
require 'thread' | |
# ################################## | |
# Ruby anti-race conditions workshop | |
# ################################## | |
# Eliminating interleavings at lines 22-25 with '''Mutex''' | |
# But you shouldn't write code like this in a multi-threaded environment: | |
# Whenever you have multiple threads sharing a reference to an object, | |
# and making modifications to it, you're going to run into trouble | |
# unless you have some kind of locking in place to prevent a context switch |
# Lazy initialization is another form of | |
# the check-then-set race condition. | |
# The ||= operator effectively expands to | |
@logger ||= Logger.new | |
# expands to | |
if @logger == nil | |
@logger = Logger.new |
#!/usr/bin/ruby2.4 | |
# | |
# This file was generated by RubyGems. | |
# | |
# The application 'rubygems-update' is installed as part of a gem, and | |
# this file is here to facilitate running it. | |
# | |
require 'rubygems' |
### Nginx ### | |
check process nginx with pidfile /opt/nginx/logs/nginx.pid | |
start program = "/etc/init.d/nginx start" | |
stop program = "/etc/init.d/nginx stop" | |
if cpu > 60% for 2 cycles then alert | |
if cpu > 80% for 5 cycles then restart | |
if memory usage > 80% for 5 cycles then restart | |
if failed host 127.0.0.1 port 80 protocol http | |
then restart | |
if 3 restarts within 5 cycles then timeout |
Homebrew build logs for libtorrent-rasterbar on Ubuntu 18.10 | |
Build date: 2019-01-05 07:57:51 | |
========================================================================================================= | |
Before and after migration on /home/linuxbrew/.linuxbrew/Homebrew $HOMEBREW_REPOSITORY, | |
before and after I sourced zsh without export$PATH="BLAH-BLAH-BLAH/.pyenv/shims:$PATH" (terminal restarted, zcomdump removed). | |
libtorrent-rasterbar formula can't be compiled at all (no binary bottle presented) |
Fetching https://github.com/rails/spring.git | |
The dependency tzinfo-data (>= 0) will be unused by any of the platforms Bundler is installing for. Bundler is installing for ruby but the dependency is only for x86-mingw32, x86-mswin32, x64-mingw32, java. To add those platforms to the bundle, run `bundle lock --add-platform x86-mingw32 x86-mswin32 x64-mingw32 java`. | |
Fetching gem metadata from https://rubygems.org/.......... | |
Fetching version metadata from https://rubygems.org/... | |
Fetching dependency metadata from https://rubygems.org/.. | |
Resolving dependencies... | |
Using rake 12.0.0 | |
Using concurrent-ruby 1.0.5 | |
Using i18n 0.8.6 | |
Using minitest 5.10.3 |