for ruby 2.2.10
dnf install compat-openssl10-devel --allowerasing
for ruby 2.6.6
$ openssl version
remove compat-openssl10*
dnf install openssl-devel
<?php | |
function currency_convert($from,$to,$amount) { | |
$string = "1".$from."=?".$to; | |
$google_url = "http://www.google.com/ig/calculator?hl=en&q=".$string; | |
$result = file_get_contents($google_url); | |
$result = explode('"', $result); | |
$converted_amount = explode(' ', $result[3]); | |
$conversion = $converted_amount[0]; | |
$conversion = $conversion * $amount; | |
$conversion = round($conversion, 2); |
git log --format=format: --name-only | egrep -v '^$' | sort | uniq -c | sort -rg | head -10 |
for ruby 2.2.10
dnf install compat-openssl10-devel --allowerasing
for ruby 2.6.6
$ openssl version
remove compat-openssl10*
dnf install openssl-devel
https://stackoverflow.com/questions/62256277/geojson-to-elasticsearch-unable-to-tessellate-shape | |
https://stackoverflow.com/questions/55587629/failed-to-create-valid-geo-shape/55588509#55588509 |
check if these values change after sound smartctl -A /dev/sda|grep -E 'Power_Cycle_Count|Load_Cycle_Count'
acoustic level sudo hdparm -M /dev/sda /dev/sda: acoustic = 254 (128=quiet ... 254=fast)
see current value sudo hdparm -B /dev/sda
namespace :cachestore do | |
desc "clear cache store" | |
task :clear, roles: [:app] do | |
with rails_env: fetch(:rails_env) do | |
within current_path do | |
execute :bundle, :exec, "rake cache:clearstore" | |
end | |
end | |
end | |
end |
http://robots.thoughtbot.com/post/47202759358/using-gdb-to-inspect-a-running-ruby-process
That’s not a great thing to have to say, is it? However, I bet you’ve said it before and may not have immediately know why.
With liberal use of puts and maybe pry, you can figure out what a problem might be next time you run it, but sometimes you need to figure out what that problem is right now.
As it turns out, and I know this is a shocker, Ruby processes are just regular processes. They can be debugged with gdb.
Having recently had the need to find out why a job of mine was running particularly slowly, I found out about this lovely tool the hard way: frantic googling. I found some very useful functions for gdb in a blog post by Rasmus on Ruby callstacks.
curl -GET "http://localhost:9200/_cluster/allocation/explain?pretty" | |
curl -XPOST 'localhost:9200/_cluster/reroute?retry_failed' |