Compiling with konanc behind proxy - kotlin

How to specify proxy settings for konanc?
I tried to start it with
konanc hello.kt -Dhttp.proxyHost=10.0.0.100 -Dhttp.proxyPort=8800
and also tried to specify system variable at Windows
set JAVA_FLAGS=-Dhttp.proxyHost=10.0.0.100 -Dhttp.proxyPort=8800
but it fails on
Download native dependencies…
with java.net.ConnectException: Connection refused: connect
Thank you!

set JVM_OPTS=-Dhttp.proxyHost=xxx -Dhttp.proxyPort=yyy -Dhttps.proxyHost=xxx -Dhttps.proxyPort=yyy
It worked for me. Many repositories are using https, not only http.

In OS X or Linux, with kotlin native version 1.0.2, use environment variable JAVA_OPTS to append custom JVM settings.
$ export JAVA_OPTS='-Dhttp.proxyHost=proxy-host -Dhttp.proxyPort=proxy-port -Dhttps.proxyHost=proxy-host -Dhttps.proxyPort=proxy-port'

Related

NGROK failed to start the tunnel

I have been trying to run the shopify app in my local machine, but this error keeps popping up.
"Ngrok failed to start the tunnel"
Ngrok is successfully installed in my system, and env variable is also set to correct location.
Try using a different version of #shopify/app and #shopify/cli. I had the same problem with version 3.14.0 and I used 3.21.0. This solved my problem.
"#shopify/app": "3.21.0",
"#shopify/cli": "3.21.0",

WolfSSL: Resume Session failure due to configuration issue of build (cmake)

I am using an Ubuntu 20.04 machine along with the CLion IDE 2020.3.2 and I want to create an app using WolfSSL which would need the TLS1.3 implementation of it.
Using CLion, I cloned the official repository https://github.com/wolfSSL/wolfssl.git. CLion automatically built the project and I was able to run all the \wolfssl\examples perfectly.
Thus, the resumption session does not work.
I run both Server/Client with these arguments: client/server -v 4 -r
And I am getting this output from the client side: didn't reuse session id!!! which I can verify from Wireshark that there was no resumption made but just another handshake.
At another build I did, where instead of cmake ( which is the default of CLion ) I used make I manged to run properly the resumption but for that I had to add in the configuration before the build this command: ./configure --enable-all which "Enables all wolfSSL features, excluding SSL v3".
What is the equivalent command of --enable-all I should use in my Cmake configuration ? Or what should I do so I can achieve properly the resumption?
I tried -DWOLFSSL_ALL -DENABLE_ALL and others but did not managed to do it. I tried including many of them separately to find which is the one that enables the resumption but nothing yet.
The specific wolfSSL option for enabling TLS sessions is HAVE_SESSION_TICKET.
There is not currently an equivalent macro for the ./configure --enable-all option, but you can use the "user_settings" method to get close:
https://github.com/wolfSSL/wolfssl/tree/master/examples/configs
Here is an example that configures most of the library options:
https://github.com/wolfSSL/wolfssl/blob/master/examples/configs/user_settings_all.h

IntelliJ HTTP-Proxy works but fails at gradle dependencies

so currently at work I face the problem, that I cannot build projects, which use global dependencies. We use an auto-config proxy script, which I already set in the File->Settings->Appearance & Behaviour->System Settings->HTTP Proxy and tested with the Check Connection-function.
The check connection function is working for any arbitrary html and also for the needed gradle-file (jcenter.bintray.com/com/android/tools/build/gradle/2.0.0/gradle-2.1.0-javadoc.jar).
For solutions I already tried to:
set the Proxy Information into the gradle.properties
tried to set http and/or https proxy settings
* systemProp.http(s).proxyHost=linktoproxyconfig.org
* systemProp.http(s).proxyPort=xxxx
* systemProp.http(s).proxyUser=xxxx
* systemProp.http(s).proxyPassword=xxxx
changing the repository direction (jcenter() vs. jcenter{url http://jcenter.bintray.com}
I am aware of the fact, that one can work offline, downloading the gradle locally. But to prevent the additional maintenance of gradle versions on different machines I would like to restrain from the work offline option.
Edit: Maybe I should also add the error message:
Gradle sync failed: Connection timed out: connect. If you are behind an HTTP proxy, please configure the proxy settings either in IDE or Gradle.
I would be most grateful if someone has an idea about a solution.
IntelliJ IDEA 2017.3 does not seem to respect the proxy options for downloading Gradle. So add the proxy options to both gradle.properties and gradle-wrapper.properties, and then run ./gradlew in a terminal. This will download Gradle. After that, IntelliJ will work.
It also happend to me and the problem was that Gradle installation was wrong. I added a GRADLE_HOME environment variable and appended %GRADLE_HOME%/bin to PATH. I restarted the IDE and it worked! :)
Source: https://docs.gradle.org/current/userguide/installation.html#sec:installation_environment_variables
Another possible caveat:
Check if your environment variables for GRADLE_USER_HOME is set. Gradle will look for the gradle.properties in this directory.
I am facing the same problem because I using the proxy in Windows 10. Going to set the auto dectect the proxy fixed the connection timeout problem:
version IntelliJ IDEA 2022.1.2 (Community Edition).

How to run Apache Tomcat 8 in debug mode?

I am trying to run Apache Tomcat 8.0.21 in debug mode.
When I give the command
sh catalina.sh jpda start
it gives this error.
error message
ERROR: Cannot load this JVM TI agent twice, check your java command
line for duplicate jdwp options. Error occurred during initialization
of VM agent library failed to init: jdwp
Can anyone help ?
Either
unset CATALINA_OPTS
unset JPDA_ADDRESS
unset JPDA_OPTS
unset JPDA_TRANSPORT
catalina.sh jpda start
Or
# in .bashrc, .profile etc.
export CATALINA_OPTS="-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8000 -Djava.security.egd=file:/dev/urandom -Denv=dev -Xms1024M -Xmx2048M -XX:PermSize=256M -XX:MaxPermSize=768m"
# At your shell prompt
./startup.sh
Explanation
As Arnab said in the comments, if your shell configuration includes environment variables mentioning jdpw (such as CATALINA_OPTS, JDPA_ADDRESS, JPDA_OPTS), just launch using ./startup.sh as if you were not trying to do remote debugging and the script will pick up the jdpw option from your environment variables.
The launch option syntax catalina.sh jpda start should only be used if you don't have any environment variables that already specified a remote debug port. It's meant to be convenient but if you've previously configured your shell to support java remote debugging you're probably mixing the two alternative approaches.
You can just add env variable and run the tomcat as usual
Debug port is 8000 in this case
export CATALINA_OPTS="-agentlib:jdwp=transport=dt_socket,address=8000,server=y,suspend=n"
Then run the tomcat
sh ./catalina.sh start
This happened to me with Eclipse when I tried to add the debugging parameters (-Xdebug -agentlib:jdwp=transport=dt_socket,address=8000,server=y,suspend=y) so I could suspend Tomcat on start. Unfortunately I then launched my Tomcat (within Eclipse) using the Debug button.
Why this is a problem
When you are launching Tomcat in Debug mode Eclipse itself inserts the debug parameters. When you have your own debug parameters in the launch configuration you are indeed passing them twice.
So if you need to launch Tomcat from within Eclipse and suspend it on start (so you can connect with debugger) you need to:
- add the debugging parameters to the "Arguments -> VM arguments" box of your launch config,
- and then Run this config, not Debug.
This way only the debugging parameters from your launch config are added.
There is alternative approach, recommended in 'catalina.sh':
"Do not set the variables in this script. Instead put them into a script
setenv.sh in CATALINA_BASE/bin to keep your customizations separate."
For Windows, the file name with environment variables will be 'setenv.bat'.
Thank you mr Dimitar II
Verified this works perfectly and is consumed automatically when running startup.bat
file: setenv.bat
#echo off
rem The proper way to set environment up for running Catalina
set "CATALINA_OPTS=-agentlib:jdwp=transport=dt_socket,address=8000,server=y,suspend=n"

Downloading CVS repository generates a server connection error

I have an "org.eclipse.team.internal.ccvs.ssh2..." error leading to a Connection Timeout downloading a CVS repository using extssh.
I have tried installing different versions of Eclipse, still the same Connection Timeout issue exists.
I can download other svn/git projects. Only this CVS repository has issues. I have checked my Java version and tried to pull the code using command line.
Screenshot showing the error:
When I tried to pull code from command prompt:
This looks like a firewall problem. Go to Preferences -> General -> Network connections to set your proxies, etc.
Also, the reason this won't work on the command line is that the extssh protocol is not defined for the command line. You should be able to use ssh or pserver (for anonymous access).