environment-variables

Tomcat 8 - context.xml use Environment Variable in Datasource

て烟熏妆下的殇ゞ 提交于 2019-12-31 11:42:21
问题 I have a Tomcat 8 project that uses a datasource (see below) <Resource auth="Container" name="jdbc/JtmDS" driverClassName="org.apache.derby.jdbc.EmbeddedDriver" type="javax.sql.DataSource" username="xfer" password="xfer10" url="jdbc:derby:/home/PUID/tm/control/JtmDB" initialSize="25" maxTotal="100" maxIdle="30" maxWaitMillis="10000" removeAbandonedOnBorrow="true" removeAbandonedTimeout="20" /> This works perfectly well. However the url is a hard-coded path /home/PUID/tm/control/JtmDB When

Tomcat 8 - context.xml use Environment Variable in Datasource

纵然是瞬间 提交于 2019-12-31 11:40:16
问题 I have a Tomcat 8 project that uses a datasource (see below) <Resource auth="Container" name="jdbc/JtmDS" driverClassName="org.apache.derby.jdbc.EmbeddedDriver" type="javax.sql.DataSource" username="xfer" password="xfer10" url="jdbc:derby:/home/PUID/tm/control/JtmDB" initialSize="25" maxTotal="100" maxIdle="30" maxWaitMillis="10000" removeAbandonedOnBorrow="true" removeAbandonedTimeout="20" /> This works perfectly well. However the url is a hard-coded path /home/PUID/tm/control/JtmDB When

Mac OS X socks proxy environment variable

无人久伴 提交于 2019-12-31 07:38:08
问题 I know it's possible to set the socks proxy server via network app and there is a Mac specific utility to set it but I prefer to just set the socks proxy server as an environment variable if possible. Does anyone know the appropriate export setting? In case anyone is wondering this is possible for http proxy, for example, export http_proxy=http://my-proxy-server:1080/ get picked up by the JVM as http.proxyPort=1080 and http.proxyHost=my-proxy-server . When passed as Mac system level setting,

Powershell and cmd environment variables

佐手、 提交于 2019-12-31 04:03:16
问题 I use a batch script to set some environment variables local to that shell. When I launch PowerShell from that command prompt, I was expecting those environment variables to be available in the PowerShell script. But I don't see that happening. Can someone help me what I'm missing? 回答1: Those environment variables should be there in PowerShell but you have to access them using the Environment provider e.g.: $env:foo where foo is the environment variable name. 来源: https://stackoverflow.com

Create environment variables for a new user in C#

一曲冷凌霜 提交于 2019-12-30 10:18:35
问题 We are trying to build an installer, in Wix, for a product. Part of this product requires the installation of elasticsearch as a service, and getting it running as a service. The service should run under a separate user account. The first step, getting the user account set up, has been successful. However, in order to allow elasticsearch to run correctly, we need to set up certain Environment variables. In order to reduce the chance of inadvertent user error, we will have to have these

Using custom environment variables in .htaccess

烂漫一生 提交于 2019-12-30 10:14:20
问题 I need something like this: SetEnv foo bar.baz RewriteEngine On RewriteCond %{HTTP_HOST} ^%{foo}$ RewriteRule ^(.*)$ http://www.foo/$1 [L] UPD: I have made as follows: SetEnv HOSTNAME_ENV testsite RewriteEngine On RewriteCond %{HTTP_HOST} ^%{ENV:HOSTNAME_ENV} RewriteRule ^(.*)$ http://www.%{ENV:HOSTNAME_ENV}/$1 [L,R=301] But it doesn't work. %{ENV:HOSTNAME_ENV} is not defined. 回答1: This won't work, because mod_rewrite does not expand variables in test patterns. Consequently, your expression

Updating Environment Variables of a Container using Docker

北城以北 提交于 2019-12-30 09:59:53
问题 I've setup a server with multiple docker containers, accessible with jwilders nginx reversre proxy. When you run the containers you can set the VIRTUAL_HOST environment variable. I've been trying to figure out a way of updating these after a container was launched. A solution posted here : You just stop docker daemon and change container config in /var/lib/docker/containers/[container-id]/config.json Requires you to stop the docker daemon, but I would prefer not to have to resort to that.

Variables that persist across .pro files from a subdirs pro file

早过忘川 提交于 2019-12-30 08:02:13
问题 Greetings, I've got a .pro file that looks like: TEMPLATE = subdirs SUBDIRS = foo bar I want to set a variable, or define, or something in my subdirs .pro file that can be read in both the foo and bar .pro files. I've tried to set an environment variable with: export TEST=something but that does not work, message($$(TEST)) always shows nothing (like TEST is unset). 回答1: Another option is to place the common variables in a file called ".qmake.cache" stored in the root dir of the project. This

How can my Java code read OS environment variables? [duplicate]

流过昼夜 提交于 2019-12-30 06:22:30
问题 This question already has answers here : Can we read the OS environment variables in Java? (2 answers) Closed 6 years ago . This may be a very simple problem, but I couldn't find an answer googleing and I'm in a rush - so I'd appreciate fast code examples. I have an environment variable on the OS I would like to read using Java code. I've tried System.getProperty , but that only seems to work for the -D variables supplied directly for the JVM. How can my Java code read OS variables? 回答1: Try

Expand environment variable for My Documents

无人久伴 提交于 2019-12-30 06:00:13
问题 I know I can read environment variables like this: Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments); However, it would be really helpful to me if I could do something like this: Environment.ExpandEnvironmentVariables(@"%MyDocuments%\Foo"); Is there an environement variable that equals SpecialFolder.MyDocuments? I also tried to do something like this, but this doesn't lead to the expected result: Environment.ExpandEnvironmentVariables(@"%USERPROFILE%\My Documents\Foo"); This