environment-variables

Override Windows environment variable value?

帅比萌擦擦* 提交于 2021-01-28 12:37:24
问题 I want to permanently change the value of the "Username" variable of Windows to fix a problem of my Windows 8 with the user profile folder name. I've tried to set a new environment variable using SETX tool like this: SETX /M Username "value" ...The new variable is generated, I can see it in the registry with the other variables, but is not overrided 'cause if I try to display the value of Username variable the it displays the old value. Is it possibly to do what I want? 回答1: CMD reads the

Connecting to an external database from an app deployed in Kubernetes

佐手、 提交于 2021-01-28 12:15:44
问题 I'm deploying a Spring Boot app in minikube that connects to a database running on the host. Following the 12 factor app recommendations I use environment variables for the necessary configuration: SPRING_DATASOURCE_DRIVER_CLASS_NAME=org.postgresql.Driver SPRING_DATASOURCE_PASSWORD=... SPRING_DATASOURCE_URL=jdbc:postgresql://<HOST_IP_FROM_K8S>:5432/myservice SPRING_DATASOURCE_USERNAME=... The kubernetes docs only show how to set environment variables in the service and deployment .yaml files

How to get a lengthy string environment variable in full?

自闭症网瘾萝莉.ら 提交于 2021-01-28 11:43:13
问题 The command gci env:ApiSecret | ConvertTo-Json works to return a long string, the API secret for Twitter, which is truncated without the pipe to JSON. However, the JSON is rather spammy. Is there a "goldilocks" way to get the lengthy string value without the extraneous details? (Unfortunately, gci env: truncates the key) 回答1: Get-ChildItem is for retrieving all or a subset of items from a container. Note that it outputs an object with Name and Value properties (substituting Path as another

How to change the default-search-path values for GNU GCC for regular usage?

只愿长相守 提交于 2021-01-28 11:41:41
问题 GNU GCC Compiler Environment Variables Default-Search-Path — I am trying to change default values of GCC environment variables to new custom values so that the default search path will contain any needed additional libraries or include header files that I would like to use on a regular basis. My version of GNU GCC is: gcc (MinGW.org GCC Build-2) 9.2.0 Include directories for .h header files for this <…> not "…" which would be in the same directory as .c file extension. Include Header

Dymola mos script environment variables

烂漫一生 提交于 2021-01-28 09:21:59
问题 Is there a way to use the Windows environment variables in Dymolas .mos scripts? Something like this: // Load libraries, last one determines the working directory openModel(%USERPROFILE% + "Documents/Dymola/MyTestLib/package.mo"); Alternatively, does Dymola know some other predefined pathes? I would like to make .mos script a bit more portable to a different PC. 回答1: You can use the getEnvironmentVariable function from the MSL. So this should do what you want: user_profile = Modelica

ASP.NET Core set hosting environment in build process

喜欢而已 提交于 2021-01-28 01:24:06
问题 I have an ASP.NET Core Api where I use the appsettings.{environmentname}.json configuration files. Then I also have the appropriate launchSettings.json file with the different environment options so I can run with any specific environment settings file. In the Startup.cs, we have a conditional setting where if we are in a non-prod environment, then we use a specific set of Jwt authentication (just has some validating checks turned off), then in prod, we load a different version that has all

How can I create a bash environment variable that prefixes an environment variable before a command?

白昼怎懂夜的黑 提交于 2021-01-27 21:50:37
问题 I seem to be able to create environment variables that execute commands; like this: $ cat ./src FOO="echo" $ . ./src $ echo $FOO echo $ $FOO hello hello $ Is there a way I can modify that environment variable so that it prefixes the setting of another environment variable before the command? I.e. is there a way to work around the following problem? $ cat ./src FOO="MY_DIR=/tmp echo" $ . ./src $ echo $FOO MY_DIR=/tmp echo $ $FOO hello -bash: MY_DIR=/tmp: No such file or directory $ I.e. what I

azure set environment variable programmatically to disable an azure function

社会主义新天地 提交于 2021-01-27 18:54:35
问题 I have an azure API and an Azure function. When certain logic is passed into the API, I want it to disable the Azure function. This post suggest disabling the function using environment variables. This works, but in my case, I cant disable this via manual intervention, I need the api to set this variable. Is this possible ? 回答1: Your options are somewhat limited and will entail modifying some files that will enable or disable your functions. Fortunately, you can easily to this

Cronjob: Command Not Found

北战南征 提交于 2021-01-27 17:19:00
问题 I have a cronjob that is the following: */10 * * * * root cd /some/directory && python3 FILE.py >> Output.txt 2>&1 if i run that command from a regular command line, it works fine. But when ran from cronjob, I get /bin/sh: python3: not found But when I run echo $PATH it returns /sbin:/bin:/usr/sbin:/usr/bin:/usr/syno/sbin:/usr/syno/bin:/usr/local/sbin:/usr/local/bin:/usr/local/python3/bin:/opt/bin (Note that /usr/local/python3/bin is included in this directory How do I fix this? 回答1: It seems

Cronjob: Command Not Found

流过昼夜 提交于 2021-01-27 17:07:59
问题 I have a cronjob that is the following: */10 * * * * root cd /some/directory && python3 FILE.py >> Output.txt 2>&1 if i run that command from a regular command line, it works fine. But when ran from cronjob, I get /bin/sh: python3: not found But when I run echo $PATH it returns /sbin:/bin:/usr/sbin:/usr/bin:/usr/syno/sbin:/usr/syno/bin:/usr/local/sbin:/usr/local/bin:/usr/local/python3/bin:/opt/bin (Note that /usr/local/python3/bin is included in this directory How do I fix this? 回答1: It seems