How can install sensu-plugins through a proxy or by offline package - sensu

I am using Debian 7 amd64, sensu (version 0.28.4-1).
I install sensu-plugins through a proxy with the command:
/opt/sensu/embedded/bin/gem install sensu-plugins-redis --user-install --no-document -p http://myproxy:3128 --verbose -s https://rubygems.org/
But have an error:
ERROR: While executing gem ... (Errno::EPERM)
Operation not permitted - send(2)
When I try to directly install it in a server, which have directly internet connection, everything is successful.
I don't know why.
I also find key work: install sensu-plugins by offline package, but not have recommendation.
Please help me, thanks so much.

Related

raspberry pi openvpn: ERROR: Cannot open TUN/TAP

I'm getting the above error when trying to connect to vpn given a .ovpn file. Usually this bug happens after an upgrade occurs and you haven't restarted yet. But I already did and the error still exists. I have tried reinstalling the openvpn (I'm using 2.4.7 on debian) and would not like to use this on docker.
Since getting this error when executing the command sudo openvpn file.ovpn often returns vague errors such as the one above, you can produce a more specific error when trying to import the ovpn file into NetworkManager instead.
After installing network-manager of course:
nmcli con import type openvpn vpn file.ovpn
Connect to the profile:
nmcli con up id vpn
Running this command would immediately show you a clearer error that is something along the lines of the org freedesktop networkmanager vpn plugin being unknown. Which is then solvable by installing the said plugin.
sudo apt install network-manager-openvpn
And that should do it.

Drush cannot locate mysql on localhost MAMP

Using drush commands to update Drupal 8 Core on a localhost build in MAMP, I've found that drush won't acknowledge my mysql.
From reading a few threads apparently this is due to MAMP's default locations for MYSQL location not being compatible with drush's expectation.
I've followed a few forum suggestions for fixed but so far have not had any luck.
The Latest attempt gives me this permission error:
[warning] The command 'mysql' is required for preflight but cannot be found.
Please install it and retry. Drush Commandline Tool 9.2.3
Other attempts:
I followed the suggestion from March 14th on this thread:
https://github.com/drush-ops/drush/issues/3464
which gave me this error:
[info] Executing: mysql --defaults-file=/private/tmp/drush_iBYWVg --database=drupal20180405 --host=localhost --port=3306 --silent < /private/tmp/drush_7T1mwj [info] Executing: mysql --defaults-file=/private/tmp/drush_bvCyn3 --database=drupal20180405 --host=localhost --port=3306 --silent < /private/tmp/drush_a9aRha In Connection.php line 149: [PDOException (2002)] SQLSTATE[HY000] [2002] No such file or directory
Another potential solution I tried came from Chrisblomm's answer on this thread:
Drush cannot connect to MySQL on MAMP?
Unfortunately for me that triggered the first error again:
[warning] The command 'mysql' is required for preflight but cannot be found.
Please install it and retry. Drush Commandline Tool 9.2.3
UPDATE: I found a solution here:
Andrew Patton's comments on this thread solved it for me:
https://stackoverflow.com/a/29990624/2639928
Specifically his tips to "define and export mysql and mysqladmin as functions".
Once I added his suggested lines of code to to my Mac's local .bash_profile it then allowed drush to correctly identify the mysql.
This meant I was able to use all the drush commands I needed that had previously triggered drush errors.
Andrew Patton's comments here solved it for me:
https://stackoverflow.com/a/29990624/2639928
specifically his tips to "define and export mysql and mysqladmin as functions"
once I added that to my mac / user / .bash_profile my drush acknowledged the mysql and I was able to use all the commands I needed that had previously given me drush errors.
I have the same issue in my php container
[warning] The shell command 'mysql' is required but cannot be found. Please install it and retry.
The mysql client was not installed so to fix it I added mysql client
apt-get install -y default-mysql-client

After install of php5-mysqlnd: MySQL server has gone away + crazy amount of connections

OS: Ubuntu 14.04
PHP Version 5.5.9-1ubuntu4.23
MySQL '5.6.33-0ubuntu0.14.04.1'
After installing php5-mysqlnd, the SQL server doesn't maintain a connection with apache2.
Installed using the following steps
sudo apt-get remove php5-mysql
sudo apt-get install php5-mysqlnd
sudo service apache2 restart
In phpinfo() I get the following information under mysqlnd
active_connections 18446744073709551613
active_persistent_connections 18446744073709551613
All other information from that table is zero, except for bytes_received which is 95
Under mysqli, i get the following
Client API library version mysqlnd 5.0.11-dev
mysqli.allow_persistent On On
Basically it seems the connection is timing out, but the number of connections is weird in phpinfo();
I also tried adding extension=mysqlnd.so to php.ini as per this post:
install both mysql and mysqlnd on ubuntu 12.04
First You Remove The Program(ie Apache,Sql,And Php And Its Modules) and Then Start Again To Install, Because Some It Occurs.
Do It.

How to install CDR-STATS on Exiting CentOS FreeSWITCH Server Manually without Bash Script

I am trying to install CDR-STATS on Exiting CentOS 6.4 server where FreeSWITCH is already running well, i read all available documentation and mailing list but i didn;t find any notes where can i install step by step.
Please any one know help me to get ride on it.
I appreciate your support.
Thanks in Advance.
CDR-Stats comes with a script install-all-cdr-stats-freeswitch.sh which will install FreeSWITCH with CDR-Stats. In the scenario where you have already FreeSWITCH installed, you can execute the install-cdr-stats.sh, it will prompt you with a question to know if you want to run an installation for FreeSWITCH or Asterisk.
cd /usr/src/ ; wget --no-check-certificate https://raw.github.com/Star2Billing/cdr-stats/master/install/install-cdr-stats.sh -O install-cdr-stats.sh ; bash install-cdr-stats.sh
I will also advice you to read carefully the install-freeswitch script, cause it does few things apart installing FreeSWITCH for instance configuring it to be used with mongodb_cdr.
https://github.com/Star2Billing/cdr-stats/blob/master/install/install-freeswitch.sh#L166

Omniauth Facebook Error - Faraday::Error::ConnectionFailed

(FYI: I'm following the Twitter Omniauth from railscast #241. I used Twitter successfully, now going onto Facebook)
As soon as I logged into Facebook using Omniauth, I get this error:
Faraday::Error::ConnectionFailed
SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed
What does this mean?
This is my code
Rails.application.config.middleware.use OmniAuth::Builder do
provider :facebook, '<key from fb>', '<another key from fb>'
end
There's actually nothing much in my code, all I have is in the sessionController that I want to use to_yaml to see what's inside the request.env
class SessionsController < ApplicationController
def create
raise request.env["omniauth.auth"].to_yaml
end
end
How do I solve the Faraday error?
I've fixed this on Mac OS X Lion 10.7.4 with this solution:
$ rvm remove 1.9.3 (or whatever version of ruby you are using)
$ rvm pkg install openssl
$ rvm install 1.9.3 --with-openssl-dir=$rvm_path/usr
after this you will need to download the missing cacert.pem file:
$ cd $rvm_path/usr/ssl
$ sudo curl -O http://curl.haxx.se/ca/cacert.pem
$ sudo mv cacert.pem cert.pem
You are getting this error because Ruby cannot find a root certificate to trust.
Fix for Windows: https://gist.github.com/867550
Fix for Apple/Linux: http://martinottenwaelter.fr/2010/12/ruby19-and-the-ssl-error/ <--This site is now down.
Here is the Apple/Linux fix according the site above:
The solution is to install the curl-ca-bundle port which contains the same root certificates used by Firefox:
sudo port install curl-ca-bundle
and tell your https object to use it:
https.ca_file = '/opt/local/share/curl/curl-ca-bundle.crt'
Note that if you want your code to run on Ubuntu, you need to set the ca_path attribute instead, with the default certificates location /etc/ssl/certs.
In the end, that’s what will work on both Mac OS X and Ubuntu:
require 'net/https'
https = Net::HTTP.new('encrypted.google.com', 443)
https.use_ssl = true
https.verify_mode = OpenSSL::SSL::VERIFY_PEER
https.ca_path = '/etc/ssl/certs' if File.exists?('/etc/ssl/certs') # Ubuntu
https.ca_file = '/opt/local/share/curl/curl-ca-bundle.crt' if File.exists('/opt/local/share/curl/curl-ca-bundle.crt') # Mac OS X
https.request_get('/')
Andrei's answer didn't work for me on Mac OSX 10.8.3. I had reinstalled openssl to install ruby 2.0 some time ago and since then always got this error. I fixed it thanks to Andrei's answer and instructions from the Rails project.
I ran:
$ rvm -v
$ rvm get head
# Installation of latest version of rvm...
$ rvm -v
# rvm 1.19.5 (master)
$ rvm osx-ssl-certs status all
# Certificates for /usr/local/etc/openssl/cert.pem: Old.
# Certificates for /Users/mpapis/.sm/pkg/versions/openssl/0.9.8x/ssl/cert.pem: Old.
$ sudo rvm osx-ssl-certs update all
# Updating certificates...
Then I checked if the certificates were correctly updated by running rvm osx-ssl-certs status all again but /usr/local/etc/openssl/cert.pem was still not updated. I don't know if that was necessary but I did the following:
$ cd /usr/local/etc/openssl/
$ curl -O http://curl.haxx.se/ca/cacert.pem
$ mv cacert.pem cert.pem
After that the problem was fixed. Hope that helps someone else who runs into the same issue.
this worked for me (on Mac OS X):
$ brew install curl-ca-bundle
$ export SSL_CERT_FILE=/usr/local/opt/curl-ca-bundle/share/ca-bundle.crt
Alternative Solution:
[I am Win7 user with manual install the Ruby and Ruby on Rails]
I have the same problem but cannot resolve by the answer that given by this question. By the way, finally, I got problem solved by following url
Facebook Redirect url in ruby on rails open ssl error
https://github.com/technoweenie/faraday/wiki/Setting-up-SSL-certificates
The RVM website suggests running rvm osx-ssl-certs update all
RVM Website: How to fix broken certificates in your operating system.
For Windows 7: the above solution link of Neil Hoff (Fix for Windows: https://gist.github.com/867550) did not work for me.
Here is what works:
Using cmd.exe:
curl -o c:\cacert.pem http://curl.haxx.se/ca/cacert.pem
set SSL_CERT_FILE=c:\cacert.pem
using msysgit bash:
curl -o /c/cacert.pem http://curl.haxx.se/ca/cacert.pem
export SSL_CERT_FILE=/c/cacert.pem
If you do not have curl on your windows 7 command line get it here:
http://www.confusedbycode.com/curl/#downloads
original solution is from here - credit to:
https://github.com/chef/chef-dk/issues/106
Dunn.
Andrei's answer worked for me, however I ran into a huge roadblock when trying to reinstall Ruby 1.9.3. Because I had installed a new version of Xcode since installing 1.9.3 I was unable to reinstall until I opened the Xcode Preferences and installed the Command Line Tools from the Downloads tab.
Check out certified gem. Description:
Ensure net/https uses OpenSSL::SSL::VERIFY_PEER to verify SSL
certificates and provides certificate bundle in case OpenSSL cannot
find one