You can use strace on a specific pid to figure out what a specific process is doing, e.g.:
strace -fp <pid>
You might see something like:
select(9, [3 5 8], [], [], {0, 999999}) = 0 (Timeout)
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 |
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 |
# 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 | |
# 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() |
#!/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)" |
require "rubocop" | |
module RuboCop | |
module Cop | |
module Lint | |
# This cop checks bad use of the Minitest `assert` method | |
# | |
# `assert` method's second argument is the error message when the | |
# first argument evals to false. | |
# |
Разрабатывайте скрипты с опциями set -eu
class MessageImageWorker | |
@queue = :message_image_queue | |
def self.perform(message_id, image_path) | |
MessageImage.create!(message_id: message_id, image: image_path) | |
end | |
end |