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)
NOTE: I've created a gem based on this: https://github.com/natritmeyer/yarjuf | |
--------- | |
rspec my_spec.rb -r ./junit.rb -f JUnit -o results.xml |
# It extends activeadmin to show pretty boolean values | |
# | |
# config/initializers/active_admin.rb | |
module ActiveAdmin | |
module Views | |
class TableFor | |
def bool_column(attribute) | |
column(attribute){ |model| model[attribute] ? '✔'.html_safe : '✗'.html_safe } | |
end |
def select_from_chosen(item_text, options) | |
field_id = find_field(options[:from])[:id] | |
within "##{field_id}_chzn" do | |
find('a.chzn-single').click | |
input = find("div.chzn-search input") | |
item_text.each_char do |char| | |
input.base.invoke('keypress', false, false, false, false, char.ord, nil); | |
end | |
find('ul.chzn-results').click | |
input.base.invoke('keypress', false, false, false, false, 40, nil); # down arrow |
en: | |
errors: | |
messages: | |
wrong_content_type: "is the wrong content type" |
# (v.respond_to?(:empty?) ? v.empty? : !v) is basically rails' .blank? in plain ruby | |
class Hash | |
def delete_blank | |
delete_if do |k, v| | |
(v.respond_to?(:empty?) ? v.empty? : !v) or v.instance_of?(Hash) && v.delete_blank.empty? | |
end | |
end | |
end |
#!/bin/bash | |
# | |
# app Rails application served through an Unicorn instance | |
# | |
# Author Romain Champourlier @ softr.li | |
# | |
# chkconfig: - 87 13 | |
# | |
# description: This a web application developed in Ruby On Rails | |
# which is served through an Unicorn instance. |
To set up search history backward in inputrc add these settings: | |
This will add you ctrl + up and ctrl + down to complete command partial. But if you change your mind and want to jump different command you can simply do it by using up and down without the ctrl. | |
/etc/inputrc: | |
"\e[1;5A": history-search-backward | |
"\e[1;5B": history-search-forward | |
http://www.linuxquestions.org/questions/linux-desktop-74/how-to-search-command-history-beginning-with-what-you-type-789471/ | |
http://forums.opensuse.org/archives-software/337292-trivial-bash-question.html |
//Useful if you have a slow CI server... | |
When /^I wait until all Ajax requests are complete$/ do | |
wait_until do | |
page.evaluate_script('$.active') == 0 | |
end | |
end |
There is a long standing issue in Ruby where the net/http library by default does not check the validity of an SSL certificate during a TLS handshake. Rather than deal with the underlying problem (a missing certificate authority, a self-signed certificate, etc.) one tends to see bad hacks everywhere. This can lead to problems down the road.
From what I can see the OpenSSL library that Rails Installer delivers has no certificate authorities defined. So, let's go fetch some from the curl website. And since this is for ruby, why don't we download and install the file with a ruby script?