Proxy settings in RStudio for third party API access - api

I'm using RStudio on a server that is behind my company's firewall. I referred to the link here and did the same changes in my RProfile script:
RProfile
http_proxy=http://proxy.dom.com:80
http_proxy_user=user:passwd
I'm trying to access an API (Omniture a.k.a. api.omniture.com) using the package RSiteCatalyst and even though I mentioned the proxy, I'm unable to bypass the firewall. Below is what I do:
library(RSiteCatalyst)
SCAuth('username','shared-secret') # Authentication
And the error that I get
Error in function (type, msg, asError = TRUE) :
Could not resolve host: api.omniture.com
Before going to IT I came here for the StackOverflow gods to help out. Would greatly appreciate it. Thanks.

I think that article has a typo. Can you put the http_proxy lines in your .Renviron rather than your .Rprofile, then restart RStudio? (If that does the job, we'll update the article!)

Related

How do make an SSL Connection from a Kong serverless function using a client certificate

I'm trying to create a serverless function for Kong for authentication purposes. I'm required to use a client certificate to authenticate with the remote service that we have to use. I can't seem to get this working and there appears to be no clear documentation on how to do this. I've tried pintsized/lua-resty-http, ngx.socket.tcp(), and luacurl (failed to build) without success. I'm using the newest version of Kong in an Alpine Linux container in case that matters.
What is the best way to do this? Right now I'm considering simply calling curl from within Lua as I know that works, but I was hoping for a better solution that I can do with just Lua/OpenResty.
Thanks.
UPDATE: I just wanted to add, just in case it helps, that I'm already building a new image based on the official Kong one as I had to modify the nginx configuration templates, so installing new software into the container is not an issue.
All,
Apologies for the ugly code, but it looks like a found an answer that works:
require("socket")
local currUrl= "https://some.url/"
local https = require("ssl.https")
local ltn12 = require("ltn12")
local chunks = {}
local body, code, headers, status = https.request{
mode = "client",
url = currUrl,
protocol = "tlsv1_2",
certificate = "/certs/bundle.crt",
key = "/certs/bundle.key",
verify = "none",
sink = ltn12.sink.table(chunks),
}
If someone has a better answer, I'd appreciate it, but it's hard to complain about this one. The main issue is that while this works for a GET request, I'll be wanting to do POSTs to a service in a future and I have no idea how to do it using similar code. I'd like one libary/API that can do any type of REST request.
This blog got me on the right track: http://notebook.kulchenko.com/programming/https-ssl-calls-with-lua-and-luasec

CKAN API Request doesn't work: `http://demo.ckan.org/api/3/action/package_list`

I've run into a strange problem that a simple API request doesn't work. I tried to call http://demo.ckan.org/api/3/action/package_list and http://127.0.0.1:5000/api/3/action/package_list, and both resulted in the error: "No such file or directory".
When I run http http://127.0.0.1:5000/api/3/action/package_list, I get "result": []
If I browse CKAN through it's user interface, I can see the datasets.
Before running this command, I activated the virtual environment and started up CKAN server.
Do anyone know what might be the problem??
p.s. this same command worked before, but it doesn't work anymore today.. and I've tried to restart the virtual machine.. since I'm pretty new to development, it could also be that I missed some pre-conditions. Any advice would be very much appreciated!
Thanks a lot in advance!
Qing

Connecting IntelliJ Idea Servers to GitLab.com: what info is actually needed?

I'm trying to configure IntelliJ IDEA 2017.1.2 in order to get the tasks from a private repository on GitLab.com.
To do that I have to create the corresponding entry in the Servers window.
Now, I don't have the faintest idea about how I should fill the Servers form in IDEA.
What URL I have to use for Server URL ?
What token ?
Any advice? Thx in advance.
UPDATE: Based on the information mentioned in the issue IDEA-193736, the connectivity problem with the new GitLab Issues API (V4) should be fixed when the update 2018.2 is released.
The https://gitlab.com URL didn't work for me as the API URL was updated to V4 on GitLab. So, after some trial and error I was able to make it work by completing the following steps:
Create a Personal Access Token on GitLab (https://gitlab.com/profile/personal_access_tokens) with API and read_user access permissions
In IntelliJ (or Pycharm in my case), the Server URL should be https://gitlab.com/api/v4/issues? (with the question mark at the end)
The token is the Personal Access Token that was generated previously
Also, don't forget to increase the connection timeout to 15000 milliseconds under the Tasks section in the Settings (Settings => Tools => Tasks).
Task Server Screenshot
Hope it helps someone else.
[EDIT] This answer was valid in '17, when it was created. For an up to date anwer, pls see other answers in the thread.
So, here's how to do it.
First of all, go to gitlab.
Access with your data and get a personal access token.
Then, you can configure IntelliJ Idea with the following values:
You can now check all your GitLab's issues directly in Idea, as shown here below.

cannot connect to genymotion and getting proxy error

I have dowloaded latest version of genymotion with proxy server 2.2.2 and while connecting i am getting invalid reply from server (do you use a proxy?). I am not using proxy for sure. Any ideas?
Answer, its all about the http proxy server on the genymotion settings just UNCHECK on the genymotion setting or remover the http proxy server by UN-ticking the ability to enter HTTP PROXY and PORT let it be blank by unckecking hence login your credentials, if it doesn't work try confirming you email with genymotion.
In my case I went to Settings > Network > I checked "Use HTTP Proxy" and I filled the Http Proxy and port fields (with company proxy valid values).
After that I connect smoothly as silk.
I had the same problem in ubuntu and after some struggle when i was almost giving up i stop the docker (had one instance running in port 3337 in my PC) and for my surprise it's finally work.
I had a similar issue (invalid reply from server without Proxy, on a highly customized and quite broken ubuntu 16.04). nothing of the above helped. (seemingly)
Then I visited this site:
http://qaru.site/questions/835901/genymotion-stuck-on-splash-screen
(well, you have to let google translate it, if you are not russian)
the error described there is completely different. (computer crash resulting in different networking issues)
but it had one thing in common with my case:
everything worked fine, and then suddenly: SOME NETWORKING ERROR - without reason
well, for me, the solution was the same as described on the russian page:
removing a (corrupted?!) conf file.
the conf file was at (my home folder)/.config/Genymobile/Genymotion.conf
i deleted it (i had to do it with root, because the file was owned by root, but this might have been the case because i messed a bit with genymotion...)
Then, i restarted genymotion and logged in again and it worked like a charm.
I had to allow Genymtion.exe in windows firewall. I'm using v3
Had the same problem, managed it using a VPN.

Eve REST Api always returns 404 when not connected via localhost

I followed the Quick Start Guide and setup the /people endpoint.
It's all working fine as long as I just ask the API via 127.0.0.1. So when I try to connect remotely via 192.168.0.206 it's giving me a 404.
I already changed app.run() to app.run(host='0.0.0.0') and I've also tried app.run(host='192.168.0.206') without success.
When running with app.run(host='0.0.0.0') I can connect via localhost but not via the remote Interface.
strace-ing did not helped neither reading the documentation as well :-)
I guess it depends on the SERVER_NAME variable, but can not figure out, what is going on there.
I tried different things there as well like 192.168.0.206:5000, 192.168.0.206, the hostname of the box, 0.0.0.0:5000.
Any suggestions?
Set SERVER_NAME = None, which is the default setting.