User.first.name # => "Renan"
User.first.name # => OpenSSL::Cipher::CipherError: bad decrypt
#!/bin/bash | |
# Pushes the current branch to origin and opens a tiny tmux split to track | |
# the CI status. Upon completion, speaks the status aloud using `say`. | |
set -e | |
if [ "$1" != "--wait" ]; then | |
git push -u origin HEAD | |
tmux split-window -dv -l 2 "'$0' --wait" | |
else | |
ref="$(git rev-parse -q HEAD)" |
# Updated for Ruby 2.3 | |
string_t = None | |
def get_rstring(addr): | |
s = addr.cast(string_t.pointer()) | |
if s['basic']['flags'] & (1 << 13): | |
return s['as']['heap']['ptr'].string() | |
else: | |
return s['as']['ary'].string() |
# Capistrano configuration | |
# | |
# require 'new_relic/recipes' - Newrelic notification about deployment | |
# require 'capistrano/ext/multistage' - We use 2 deployment environment: staging and production. | |
# set :deploy_via, :remote_cache - fetch only latest changes during deployment | |
# set :normalize_asset_timestamps - no need to touch (date modification) every assets | |
# "deploy:web:disable" - traditional maintenance page (during DB migrations deployment) | |
# task :restart - Unicorn with preload_app should be reloaded by USR2+QUIT signals, not HUP | |
apt update | |
apt upgrade | |
apt install build-essential | |
apt install pkg-config | |
apt install libnet-dev python-yaml libaio-dev | |
apt install libprotobuf-dev libprotobuf-c0-dev protobuf-c-compiler protobuf-compiler python-protobuf libnl-3-dev libcap-dev python-future | |
# criu install | |
curl -O -sSL http://download.openvz.org/criu/criu-3.10.tar.bz2 | |
tar xjf criu-3.10.tar.bz2 |
class Node | |
attr_accessor :edges, :jobs, :id | |
def initialize(id, arrivals_per_tick) | |
@id = id | |
@jobs = 0.0 | |
@tick = 0 | |
@edges = [] | |
@arrivals_per_tick = arrivals_per_tick | |
end |